i have working ant-task runs me batch of junit-tests, in following fashion:
<junit printsummary="yes" showoutput="yes" haltonfailure="no"> <formatter type="plain" /> <classpath> <path refid="app.compile.classpath" /> <path id="classes" location="${app.classes.home}" /> <path id="test-classes" location="${app.build.home}/test-classes" /> </classpath> <batchtest fork="no" todir="${app.tests.reports}"> <fileset dir="${app.tests.home}"> <include name="**/*test*.java" /> </fileset> </batchtest> </junit>
now works fine right now, except names of test-reports generated. these names overly long , follow pattern:
test-com.company.package.class.txt
is there way specify file-naming pattern report files batchtest, preferrably ant 1.6.5?
i know single test, can specify filename using outfile
attribute. in junit-task reference, it's stated that:
it generates test class name each resource ends in
.java
or.class
.
no, it's not possible.
according source code
protected void execute(junittest arg, int thread) throws buildexception { validatetestname(arg.getname()); junittest test = (junittest) arg.clone(); test.setthread(thread); // set default values if not specified //@todo should moved test class instead. if (test.gettodir() == null) { test.settodir(getproject().resolvefile(".")); } if (test.getoutfile() == null) { test.setoutfile("test-" + test.getname()); } // execute test , return code testresultholder result = null; if (!test.getfork()) { result = executeinvm(test); } else { executewatchdog watchdog = createwatchdog(); result = executeasforked(test, watchdog, null); // null watchdog means no timeout, you'd better not check null } actontestresult(result, test, "test " + test.getname()); }
it create out file "test-" + test.getname()
if don't specify explicitly in test
element. it's not possible specify in batchtest
element.
Comments
Post a Comment