SpringJunit测试类 BaseTest(转)

Java代码  收藏代码
  1. /** 
  2.  *  
  3.  *  
  4.  * @author Jerval 
  5.  * @date 2011-2-17 
  6.  */  
  7. @RunWith(SpringJUnit4ClassRunner.class)  
  8. @ContextConfiguration(locations = { "classpath:applicationContext.xml"})  
  9. //@ContextConfiguration(locations = { "classpath:applicationContext.xml","classpath:spring-context/StorageApplicationContext.xml"})  
  10. //@TransactionConfiguration(transactionManager = "txManager", defaultRollback = true)  
  11. //@Transactional  
  12. public class BaseTest {  
  13.     //如果需要留下数据在数据库中,请单独注释掉//@Transactional  
  14.     //需要记录日志时候直接从子类中使用  
  15.     protected Logger logger = Logger.getLogger(BaseTest.class);  
  16. }  
 
posted @ 2017-12-27 10:00  星朝  阅读(1131)  评论(0编辑  收藏  举报