I'm trying to convert an ant based project to Maven, I've moved all
the source and tests into the standard Maven structure, and the whole
project compiles fine, however when it comes to run the tests, I get
1
-------------------------------------------------------------------------------
2 Test set: net.plus.adaptors.valueobject.TestProblemState
3
-------------------------------------------------------------------------------
4 Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:
0.009 sec <<< FAILURE!
5 testProblemState(net.plus.adaptors.valueobject.TestProblemState)
Time elapsed: 0.002 sec <<< ERROR!
6 java.lang.NoClassDefFoundError: Could not initialize class
net.plus.adaptors.valueobject.ProblemState
7 at
net.plus.adaptors.valueobject.TestProblemState.setUp(TestProblemState.java:
17)
8 at junit.framework.TestCase.runBare(TestCase.java:132)
9 at junit.framework.TestResult$1.protect(TestResult.java:110)
10 at junit.framework.TestResult.runProtected(TestResult.java:
128)
11 at junit.framework.TestResult.run(TestResult.java:113)
12 at junit.framework.TestCase.run(TestCase.java:124)
13 at junit.framework.TestSuite.runTest(TestSuite.java:232)
14 at junit.framework.TestSuite.run(TestSuite.java:227)
15 at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:
83)
16 at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:
62)
17 at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:
140)
18 at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:
127)
19 at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
20 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
21 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
22 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
23 at java.lang.reflect.Method.invoke(Method.java:597)
24 at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:
345)
25 at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:
1009)
net.plus.adaptors.valueobject.ProblemState is a class defined in this
project, so it's not like I've missed a dependancy, debug with -X
shows that both the normal & test classes are on the class path.
The pom file looks like this:
http://pastie.org/927728
and the test class looks like this:
http://pastie.org/private/klacp1kav5zphcv8ked9a
Any ideas?
--
Subscription settings:
http://groups.google.com/group/java-sheffield/subscribe?hl=en