In my JUnit 4 Tests I use Spring 3.0.x's custom Test Runner (org.springframework.test.context.junit4.SpringJUnit4ClassRunner) via @RunWith:
- Code: Select all
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:spring-test-context.xml" })
public abstract class MyTests implements ApplicationContextAware {
@Autowired
private MyDao dao;
@Test
public testSomething(){
assertEquals("expected String", dao.getExpectedString());
}
}
This automatically injects the suitable bean from the Spring context into my testcase. This works in Eclipse and when I run the tests in Maven. The CodePro Test Editor however marks all my tests as failed because of a NullPointerException when accessing "dao". I cannot find the complete stacktrace, only the tooltip which points me to a NullPointer in the line where I access "dao", but this indicates to me that the @RunWith annotation is ignored.
Is there a way to configure the Test Editor to be able to work with custom Test Runners?
Thanks,
Florian