junit 테스트를 실행할 수있는 build.xml이 있습니다.Ant 클래스 경로 및 junit.jar
<pathelement location="${eclipse.home}/plugins/org.junit4_4.5.0.v20090824/junit.jar"/>
변화가 클래스 경로를 나누기로
<pathelement location="../../../../../eclipse/plugins/org.junit4_4.5.0.v20090824/junit.jar"/>
: 나는 라인을 교체 할 경우
<path id="JUnit 4.libraryclasspath">
<pathelement location="../../../../../eclipse/plugins/org.junit4_4.5.0.v20090824/junit.jar"/>
<pathelement location="../../../../../eclipse/plugins/org.hamcrest.core_1.1.0.v20090501071000.jar"/>
</path>
<path id="MyProject.classpath">
<pathelement location="bin"/>
<path refid="JUnit 4.libraryclasspath"/>
</path>
<target name="run_unit_tests" depends="build">
<mkdir dir="${junit.output.dir}"/>
<junit printsummary="yes" haltonfailure="no">
<classpath refid="MyProject.classpath" />
<formatter type="xml"/>
<batchtest todir="${junit.output.dir}">
<fileset dir="${src}">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
다음은 관련 부분이다. 다음과 같은 오류가 발생합니다 :
The
<classpath>
for<junit>
must include junit.jar if not in Ant's own classpath
내가 이해하는 한, 위치 속성은 두 경우 모두 동일한 값을 유지해야합니다. 그렇다면 그 이유는 무엇일까요?
이 빌드 파일은 다른 junit 버전 (경로가 끊어짐)이있는 환경에서는 작동하지 않습니다. junit.jar에 "일반"경로를 추가 할 수 있습니까?
eclipse.home은 제대로 확장 되었습니까? –