The base class for TestCase

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
“classpath:spring-jndi.xml”
})
@TestExecutionListeners({
Log4JSetupListener.class,
JndiSetupListener.class,
DependencyInjectionTestExecutionListener.class,
DirtiesContextTestExecutionListener.class,
TransactionalTestExecutionListener.class
})
public class SpringAppTestCase extends Assert implements ApplicationContextAware {

protected JndiTemplate jndiTemplate = new JndiTemplate();

@Autowired
protected JdbcTemplate jdbcTemplate;

protected ApplicationContext applicationContext;

public void setApplicationContext(ApplicationContext ac) {
this.applicationContext = ac;
}

@Test
public void doit(){

}

protected Logger log = Logger.getLogger(getClass().getName());

}

Advertisements