SpringJunit測試類 BaseTest(轉)
阿新 • • 發佈:2017-12-27
需要 java代碼 ext text with manage XML test 記錄日誌 Java代碼
- /**
- *
- *
- * @author Jerval
- * @date 2011-2-17
- */
- @RunWith(SpringJUnit4ClassRunner.class)
- @ContextConfiguration(locations = { "classpath:applicationContext.xml"})
- //@ContextConfiguration(locations = { "classpath:applicationContext.xml","classpath:spring-context/StorageApplicationContext.xml"})
- //@TransactionConfiguration(transactionManager = "txManager", defaultRollback = true)
- //@Transactional
- public class BaseTest {
- //如果需要留下數據在數據庫中,請單獨註釋掉//@Transactional
- //需要記錄日誌時候直接從子類中使用
- protected Logger logger = Logger.getLogger(BaseTest.class);
- }
SpringJunit測試類 BaseTest(轉)