실제로 build.xml이 필요없이 어떻게 ant 태스크를 실행할 수 있는지 알아 내려고합니다. 특히 포맷터로 JUnit
작업을 실행하고 싶습니다. XML 형식이 다음과 같습니다 개미 스크립트를 실행 할 때 작동build.xml없이 junit ant-task를 실행하십시오.
<junit printsummary="true" errorProperty="test.failed" failureProperty="test.failed">
<classpath refid="run.class.path" />
<!-- console log -->
<formatter type="xml" classname="be.x.SFFormatter" />
<test name="be.x.SF" outfile="result" todir="${build.output.dir}" />
</junit>
,하지만 난 내 응용 프로그램이 실행 가능한 단지로 실행 좀하고 싶습니다. 자바에서 실행 테스트는 쉬웠다 :
JUnitCore junit = new JUnitCore();
testResult = junit.run(SeleniumFramework.class);
그러나, 실제로 포맷터가 작동하는 방법을 알아 일을 투쟁. 포맷터는 org.apache.tools.ant.taskdefs.optional.junit.JUnitResultFormatter
유형이므로 ant를 실행하지 않고 어딘가에 연결할 수 있습니다.
이전에 비슷한 것을 한 사람이 있습니까? 감사합니다.
빌드 파일을 내 jar 파일로 묶어 내부적으로 실행하기로 결정했습니다. 조금 슬프지만 제 최종 제품이 개미에 달려 있지만 지금은 그 제품과 함께 살 수 있습니다. –