Skip to content

Instantly share code, notes, and snippets.

@eliasnogueira
Last active August 29, 2015 14:03
Show Gist options
  • Save eliasnogueira/fa27f336d9142cec1ecf to your computer and use it in GitHub Desktop.
Save eliasnogueira/fa27f336d9142cec1ecf to your computer and use it in GitHub Desktop.
<project name="Execucao JUnit" default="test2" basedir=".">
<property name="src" value="src" />
<property name="lib" value="lib" />
<property name="bin" value="bin" />
<property name="test" value="test" />
<property name="test.reports" value="reports" />
<path id="test.classpath">
<pathelement location="${bin}" />
<pathelement location="lib/junit-4.11.jar" />
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="compile-test">
<javac srcdir="${test}" destdir="${bin}" verbose="true" includeantruntime="true">
<classpath refid="test.classpath" />
</javac>
</target>
<target name="create-remove-test-report-dir">
<delete dir="${test.reports}"/>
<mkdir dir="${test.reports}"/>
</target>
<target name="test2" depends="create-remove-test-report-dir">
<junit fork="yes" printsummary="yes" haltonfailure="no" showoutput="yes" >
<classpath refid="test.classpath" />
<test todir="${test.reports}" name="br.com.qualister.webdriver.actions.TesteJavascript" />
<formatter type="xml" />
</junit>
</target>
<target name="test" depends="compile-test, create-remove-test-report-dir">
<junit fork="yes" printsummary="yes" haltonfailure="no" showoutput="yes">
<batchtest fork="yes" todir="${test.reports}" >
<fileset dir="${test}">
<include name="*.java" />
</fileset>
</batchtest>
<formatter type="xml" />
<classpath refid="test.classpath" />
</junit>
</target>
<target name="junitreport">
<junitreport todir="${test.reports}">
<fileset dir="${test.reports}">
<include name="TEST-*.xml" />
</fileset>
<report todir="${test.reports}" />
</junitreport>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment