0
При запуске тестовых модулей junit-4.12 с помощью ant -d с предоставлением отчетов XML мой testuite не выполняется.Почему «ant junit» не находит testuite
Это часть build.xml:
<target name="compile" depends="prepare">
<!-- kompilieren der Quelldateien -->
<javac includeantruntime="false" srcdir="${source.dir}" destdir="${build.dir}">
<classpath>
<path refid="classPath"/>
<pathelement location="${lib.dir}/junit-4.12.jar" />
<pathelement location="${lib.dir}/hamcrest-all-1.3.jar" />
<pathelement location="test" />
<pathelement location="." />
</classpath>
</javac>
<javac includeantruntime="false" srcdir="${tests.dir}" destdir="${build.dir}">
<classpath>
<path refid="classPath"/>
<pathelement location="${lib.dir}/junit-4.12.jar" />
<pathelement location="${lib.dir}/hamcrest-all-1.3.jar" />
<pathelement location="test" />
<pathelement location="." />
</classpath>
</javac>
<!-- kopieren der Dateien, die in den
resources-Verzeichnissen liegen -->
<copy todir="${build.dir}" overwrite="y">
<fileset dir="${source.dir}">
<!-- beruecksichtigt alle Verzeichnisse mit
Namen resources und alle .properties Dateien -->
<include name="**/resources/" />
<include name="**/*.properties" />
</fileset>
</copy>
</target>
<target name="junit" depends="compile">
<junit printsummary="yes" fork="false" haltonfailure="false"
failureproperty="tests.failed" showoutput="true" dir="${build.dir}">
<classpath>
<path refid="classPath" />
<pathelement location="${lib.dir}/junit-4.12.jar" />
<pathelement location="${lib.dir}/hamcrest-all-1.3.jar" />
<pathelement location="test" />
<pathelement location="." />
<!-- <path location="${source.dir}" /> -->
</classpath>
<formatter type="xml" />
<batchtest todir="${report.dir}">
<fileset dir="test">
<exclude name="**/GMRTest*.class" />
<include name="**/AllTests.class" />
</fileset>
</batchtest>
</junit>
</target>
Заранее спасибо!
Геррит
PS Это мой тест JUnit Тестов/AllTests.java:
package test;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
import projekt.GMR;
@RunWith(Suite.class)
@SuiteClasses({ GMRTest.class,
GMRTest2.class,
GMRTest3.class})
public class AllTests {
@BeforeClass
public static void setUpClass() {
System.out.println("Master setup");
}
@AfterClass public static void tearDownClass() {
System.out.println("Master tearDown");
}
}
Это выход HTML муравьиной цели junitReport: – Leder
'предупреждение \t \t Failure тестов не найден в tests.AllTests junit.framework.AssertionFailedError: тесты не найдено в tests.AllTests' – Leder
или 'Alltests (неправильное название: тест/Alltests) java.lang.NoClassDefFoundError: Alltests (неправильное название: тест/Alltests) \t на java.lang.ClassLoader.defineClass1 (Native Method) \t на Java .lang.ClassLoader.defineClass (ClassLoader.java:763) \t в java.lang.ClassLoader.loadClass (ClassLoader.java:357) \t at java.lang.Class.forName0 (собственный метод) \t at java.lang.Class.forName (Class.java:348) ' – Leder