I am currently writing Fest Junit test cases that will be later ran on a Hudson test server. I would like to have them take desktop screen shots if any test case fails. I found this url that has a tutorial on how to set this up: http://fest.codehaus.org/Taking+Screenshots+of+JUnit+Test+Failures but the tests don't even run locally.
Here is a skimmed down copy of the java code that I am attempting to run:
@RunWith(GUITestRunner.class)
public class AddingNewUserTest extends FestTest {
@Before
public void setup(){
super.setup(constants.users.name);
}
@After
public void cleanup(){super.shutDown();
}
@GUITest
public void testAddingNewUser() throws InterruptedException{
//java code
}
And my JUnit Ant task that I am attempting to run:
<target name="run.tests" description="Runs all the junit tests.">
<echo message="Run the tests"/>
<taskdef resource="festjunittasks" classpathref="classpath" />
<junit printsummary="true" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="yes">
<classpath refid="classpath" />
<formatter classname="org.fest.swing.junit.ant.ScreenshotOnFailureResultFormatter" extension=".xml" />
<batchtest todir="${test.output.reports.test.dir}" unless="testcase" fork="true">
<fileset dir="${output.mainclasses.dir}" includes="**/AddingNewUserTest.class" excludes="**/FestTest.class,**/DefaultsTest.class"/>
</batchtest>
</junit>
<festreport todir="${test.output.reports.dir}">
<classpath refid="classpath" />
<fileset dir="${test.output.reports.test.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${test.output.reports.dir}/html" />
</festreport>
<antcall target="kill.server"/>
</target>
Any help would be great.
A screen shot of the error thrown by Junit in the report