|
From: Colin S. <col...@ex...> - 2004-07-16 15:47:06
|
Ant 1.6.2 is out, and with it support for a forkmode="once" on the junit
task, which allows ant to still fork for junit tests, but only once for
the entire task (instead of for each testcase). Alternately,
forkmode="perBatch" allows forking once per batch element.
This is pretty promising, since it could bring the time to run the test
suite from ant down to a similar value to when running in an IDE, which
is currently much faster.
I've tried to give it a go (making sure to remove the ant 1.6.1 in the
lib dir, otherwise that will interfere), by adding forkmode="once" to
the junit element in the tests target. It is currently breaking on
SqlStateExceptionTranslatorTests, due to the initial context factory
builder already being set. This should be resolvable by using a separate
batch for that test, or some other strategy. I am curious however why
this doesn't break in the IDE though.
I don't have time to play with this any longer, but will give it a go at
some later date. If anybody feels like playing around with this
themselves, please go ahead by all means.
Regards,
Colin
-----
[junit] Testsuite:
org.springframework.jdbc.support.SQLStateExceptionTransla
torTests
[junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0 sec
[junit] Testcase: testBadSqlGrammar took 0 sec
[junit] Testcase: testInvalidSqlStateCode took 0 sec
[junit] Testcase: testMalformedSqlStateCodes took 0 sec
[junit] java.lang.ExceptionInInitializerError
[junit] at java.lang.Class.forName0(Native Method)
[junit] at java.lang.Class.forName(Class.java:141)
[junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
<init>(JUnitTestRunner.java:204)
[junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
<init>(JUnitTestRunner.java:177)
[junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
launch(JUnitTestRunner.java:651)
[junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
main(JUnitTestRunner.java:537)
[junit] Caused by: java.lang.IllegalStateException:
InitialContextFactoryBui
lder already set
[junit] at
javax.naming.spi.NamingManager.setInitialContextFactoryBuilde
r(NamingManager.java:687)
[junit] at
org.springframework.jms.JmsTestCase.<clinit>(JmsTestCase.java
:93)
|