Since this nights svn checkout (4-OCT-2006), junit 4-style tests fail. [junit] No runnable methods [junit] java.lang.Exception: No runnable methods Tested from fresh svn build on Windows XP and Linux, both running java 1.5.0_06
Checking when it started failing. I've got a successful run with a checkout of --revision '{2006-09-15}' Now proceeding...
ok for --revision '{2006-09-20}' ok for --revision '{2006-09-25}' ok for --revision '{2006-09-26}' ok for --revision '{2006-09-27}' ok for --revision '{2006-09-28}' (revision 450591) not ok for --revision '{2006-09-29}' (revision 451034) So, the bug must be introducedin one of these files: C:\sandbox_ant\ant>svn checkout --revision '{2006-09-29}' http://svn.apache.org/ repos/asf/ant/core/trunk/ ant-trunk U ant-trunk/src/tests/antunit/types/conditions/matches-test.xml A ant-trunk/src/tests/antunit/types/resources/tokens-test.xml A ant-trunk/src/tests/antunit/types/resources/utf-16.in U ant-trunk/src/tests/junit/org/apache/tools/ant/LocationTest.java U ant- trunk/src/tests/junit/org/apache/tools/ant/AntClassLoaderDelegationTest .java U ant-trunk/src/main/org/apache/tools/ant/AntClassLoader.java U ant-trunk/src/main/org/apache/tools/ant/UnknownElement.java U ant-trunk/src/main/org/apache/tools/ant/filters/TokenFilter.java U ant-trunk/src/main/org/apache/tools/ant/RuntimeConfigurable.java U ant- trunk/src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.ja va U ant-trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java U ant-trunk/src/main/org/apache/tools/ant/taskdefs/Concat.java U ant-trunk/src/main/org/apache/tools/ant/taskdefs/ConditionTask.java U ant-trunk/src/main/org/apache/tools/ant/types/defaults.properties A ant-trunk/src/main/org/apache/tools/ant/types/resources/Tokens.java U ant-trunk/src/main/org/apache/tools/ant/types/resources/URLResource.java A ant-trunk/src/main/org/apache/tools/ant/util/StringTokenizer.java U ant-trunk/src/main/org/apache/tools/ant/util/StringUtils.java A ant-trunk/src/main/org/apache/tools/ant/util/FileTokenizer.java U ant-trunk/src/main/org/apache/tools/ant/util/Tokenizer.java U ant- trunk/src/main/org/apache/tools/ant/util/ConcatResourceInputStream.java U ant-trunk/docs/manual/CoreTypes/resources.html U ant-trunk/CONTRIBUTORS U ant-trunk/contributors.xml U ant-trunk/WHATSNEW Checked out revision 451034.
Closing the issue, as I can't replicate it with a completely fresh checkout of the trunk. I did a complete fresh checkout today of revision 453112. Built it from scratch. Pointed my ANT_HOME and PATH to it. The issue does not re-occur.
I have more background on this. Before 2006-09-29, junit task worked with junit4 jar in ./lib or CLASSPATH Since 2006-09-29, junit task fails with junit4 jar in ./lib or CLASSPATH, and succeeds when junit 4 jar is not in ./lib or CLASSPATH.
Hello Jan, From what you wrote, it looks like this issue is a classloading issue. Peter Reilly changed AntClassLoader.java again yesterday. He had changed AntClassLoader.java on Wed Sep 27 22:46:57 2006 UTC, revision 450614. Could you update again your SVN sandbox, I suspect this usecase will work again now. Regards, Antoine
It would be nice to have a test for this. A small project with a simple test, and a small build file.
Reply to Comment #5 Clean build ANT from svn... Same behaviour as reported in Comment #4 junit task fails with junit4 jar in ./lib or CLASSPATH, with or without junit4 jar in the classpath of ant's junit task. junit task succeeds when - junit 4 jar is not in ./lib or CLASSPATH, *AND* - the classpath in the junit task includes the junit4 jar Reply to Comment #6 Working on that.
Created attachment 18965 [details] example ant project exposing the bug 1. Extract the attached zipped project. 2. edit build.properties to reflect the location of junit4 jar file. ------------------------------------------------------------------- clear junit4 from your classpath, remove junit 4 jar from ant/lib, if applicable. run the project > ant all => Success ------------------------------------------------------------------- put junit4 jar in classpath, or in ant/lib run the project > ant all => error
Thanks for the test case - it was a *big* help. I have tracked down the problem. The problem is due to http://issues.apache.org/bugzilla/show_bug.cgi?id=40682 (Order of addX and addConfiguredX), the order of setting attributes and elements was changed from addX setY addConfiguredZ execute() to setY addX, addConfiguredZ (in order of the build file) execute() However junittask depends on the first order. It is easy to fix JUnitTask for this, (I will apply patch when I reach my svn machine), however 1) I wonder if we need to rollback 40621 2) why does junit only work for fork="yes" for junit4?
I have committed a fix for this. Thanks again for the report and help in tracking the problem.
Verified from fresh checkout... It's fixed. Thank you.