单元测试
package test; /** * Created by wm on 2016/12/19. */ import org.junit.runner.RunWith; import org.springframework.context.annotation.AdviceMode; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.TransactionConfiguration; import org.springframework.transaction.annotation.EnableTransactionManagement; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"classpath:spring.xml" }) @ActiveProfiles("betaC") @EnableTransactionManagement(mode = AdviceMode.PROXY) @TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = true) public abstract class BaseTest extends AbstractTransactionalJUnit4SpringContextTests { }