Eclipse で ant を使用してセレン junit テストを実行しようとしています。以下は私のbuild.xmlファイルで、Eclipseでjunitテストとして実行すると、正常に実行されます。しかし、ant を使用して実行すると、成功しません。ビルドは成功しましたが、テストは失敗しています。何か不足している場合はお知らせください。
<?xml version="1.0" encoding="UTF-8"?>
<project default="runjunit" name="firstbuild">
<target name="runjunit" depends="compile">
<junit printsummary="on">
<test name="com.test.abc"/>
<classpath>
<pathelement location="C:\eclipse\plugins\org.junit_4.10.0.v4_10_0_v20120426-0900\junit.jar"/>
<pathelement location="C:\sample\selenium-2.34.0\selenium-java-2.34.0.jar"/>
<pathelement location="classes"/>
</classpath>
</junit>
</target>
<target name="compile">
<javac includeantruntime="false" srcdir="./src" destdir="classes" classpath="C:\eclipse\plugins\org.junit_4.10.0.v4_10_0_v20120426-0900\junit.jar;C:\sample\selenium-2.34.0\selenium-java-2.34.0.jar"/>
</target>
</project>
Buildfile: C:\New folder\workspace\build.xml
compile:
runjunit:
[junit] Running com.test.abc
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit] Test com.test.abc FAILED
BUILD SUCCESSFUL
Total time: 409 milliseconds