-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Alison Rosewarne opened SPR-5145 and commented
After upgrading to junit 4.5 my test class which uses the SpringJUnit4ClassRunner gets a NoClassDefFoundError:
org.apache.maven.surefire.booter.SurefireExecutionException: org/junit/Assume$AssumptionViolatedException; nested exception is java.lang.NoClassDefFoundError: org/junit/Assume$AssumptionViolatedException
java.lang.NoClassDefFoundError: org/junit/Assume$AssumptionViolatedException
at org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:240)
at org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333)
at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217)
at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197)
at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:142)
at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:59)
etc.
This is a Junit 4.5 issue. The static class AssumptionViolatedException within org.junit.Assume that existed in 4.4 has become org.junit.internal.AssumptionViolatedException.
The file tiger/mock/org/springframework/test/context/junit4/SpringMethodRoadie.java imports org.junit.Assume.AssumptionViolatedException which is why my test is failing.
Workaround is to stick with Junit 4.4.
(Aside: are there plans to create a "SpringTEST" component?).
Affects: 2.5.5
Attachments:
- junit4.5.patch (43.97 kB)
Issue Links:
- Incompatible with JUnit 4.5 [SPR-5171] #9844 Incompatible with JUnit 4.5 ("is duplicated by")
- Upgrade the Spring TestContext Framework to JUnit 4.6 [SPR-5887] #10557 Upgrade the Spring TestContext Framework to JUnit 4.6
Referenced from: commits d159195, c0c9501, 9daae23, e5d2570, 751e0f0, 62c991f, 6327b34
3 votes, 11 watchers