Hi Mujahid,
The Spring TestContext Framework provides a custom runner for JUnit 4.4 called SpringJUnit4ClassRunner. You annotate your classes as follows to get it working:
As an alternative, we also provide abstract base test classes which you can directly extend. Once the Spring 2.1 M4 release is officially out, take a look at the following classes:Code:@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration public class SimpleTest { @Test public void testMethod() { // execute test logic... } }
- AbstractJUnit4SpringContextTests
- AbstractTransactionalJUnit4SpringContextTests
For JUnit 3.8 support with the new Spring TestContext Framework, we provide the following analogous classes:
- AbstractJUnit38SpringContextTests
- AbstractTransactionalJUnit38SpringContextTests
cheers,
Sam



Reply With Quote
