Problem running and old JUnit test

It runs OK from the command line using mvn clean test.
IntelliJ version #10666

Seems like it may be chokeing on an annotation.
I get two different setts of results based on whether or not

  /usr/share/jdk1.6.0_12/bin/java ... etc.

  Process finished with exit code 0

But no indication of success or failure. Just that the process died.

On the other hand, if after having done the above, I right click and run the same test in the panel on the lower left, I get the following:

java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.findAnnotationDeclaringClass(Ljava/lang/Class;Ljava/lang/Class;)Ljava/lang/Class;
    at org.springframework.test.context.TestContext.retrieveContextLocations(TestContext.java:144)

Annotations for the test class are:

@RunWith(SpringJUnit4ClassRunner.class)
@TestExecutionListeners({TransactionalTestExecutionListener.class,
                         DependencyInjectionTestExecutionListener.class})
@ContextConfiguration(locations = {"/applicationContext-test.xml"})
@Transactional

Also @Test on the test method itself, of course.

I've tried commenting them out one at a time but this didn't provide much insight.

2 comments
Comment actions Permalink

What's the command-line shown by IDEA when it executes the test?
Perhaps it's picking up an older version of spring.

0
Comment actions Permalink

It turned out to be a POM problem. Old spring libraries being used in sub-modules were causing trouble. Fixed by moving dependencies into parent pom.

0

Please sign in to leave a comment.