I've searched high and low all over the Internet trying to find a solution to this problem. I found a few different solutions that worked for some people, but none of them have worked for me. I've installed the JUnit extension for JDeveloper 11.1, so that I can now run a test class as such. I verified that this functionality works without Spring. I have a very simple test class with Spring where I am simply trying to kick off an app context and inject an object:
When attempting to run this test class in JDeveloper, I get the following error:Code:@ContextConfiguration(locations = {"applicationContext-test.xml"}) public class ConfidentialAccessTypeCodeEntityTest extends AbstractJUnit4SpringContextTests { @Autowired @Qualifier("basicDataSource") private DriverManagerDataSource ds; @Test public void junkTest() throws Exception { assertNotNull(ds.getConnection()); } }
I've tried several things, including messing around with my dependencies. I have a feeling it may be the way that JDeveloper is executing the test class, but I'm not sure. I'm using Spring 2.5.6 with JUnit 4.4 I'm at a complete loss as to what I should try next.Code:java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.findAnnotationDeclaringClass(Ljava/lang/Class;Ljava/lang/Class;)Ljava/lang/Class; org.springframework.test.context.TestContext.retrieveContextLocations(TestContext.java:144) org.springframework.test.context.TestContext.<init>(TestContext.java:110) org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:103) org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTestContextManager(SpringJUnit4ClassRunner.java:120) org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:80) sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) java.lang.reflect.Constructor.newInstance(Constructor.java:513) org.junit.internal.requests.ClassRequest.buildRunner(ClassRequest.java:33) org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
Any ideas?
Thanks


Reply With Quote
