As promised I checked out JUnit 4 from CVS. It compiled just fine without any additional dependency. Only
<property name="build.compiler" value="classic" />looks a little strange in a "Java 5 or higher" project's build file. Luckily Ant is smart enough to upgrade to modern automatically.
Then I went ahead, checked out a fresh copy of Ant and compiled it against JUnit 4. No problems. To be sure that no problems are hidden anywhere, I ran Ant's test. I even tried some cross-checks.
- Ant compiled against JUnit 3.8.1, tests compiled against 3.8.1, tests run against 4.0rc1 (took 10 minutes 31 seconds).
- Ant compiled against JUnit 3.8.1, tests compiled against 4.0rc1, tests run against 3.8.1 (took 10 minutes 10 seconds).
- Ant compiled against JUnit 4.0rc1, tests compiled against 3.8.1, tests run against 3.8.1 (took 10 minutes 18 seconds).
- Ant compiled against JUnit 3.8.1, tests compiled against 4.0rc1, tests run against 4.0rc1 (took 11 minutes 24 seconds).
- Ant compiled against JUnit 4.0rc1, tests compiled against 3.8.1, tests run against 4.0rc1 (took 10 minutes 57 seconds).
- Ant compiled against JUnit 4.0rc1, tests compiled against 4.0rc1, tests run against 3.8.1 (took 10 minutes 19 seconds).
- Ant compiled against JUnit 4.0rc1, tests compiled against 4.0rc1, tests run against 4.0rc1 (took 11 minutes 14 seconds).
As for the timing information, I'm not sure how significant they are. My machine may have been swapping or running under load of other processes during the tests. All tests were run in the same VM as Ant using Sun's JDK 1.5.0_003 for Linux. Yes, it looks as if using JUnit 4 was a bit slower, but I couldn't explain why since most of the time is taken up by running Ant (inside of the tests) or for Ant's own test-runner.
path: /en/Apache/Ant | #