Java教程

非springboot java单元测试基类

本文主要是介绍非springboot java单元测试基类,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration("src/main/webapp")
@ContextConfiguration(locations = {"/spring/spring-context.xml", "/spring/spring-datasource.xml"})
@TestExecutionListeners({DependencyInjectionTestExecutionListener.class, DirtiesContextTestExecutionListener.class})
@Transactional
@TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = true)
public class BaseServiceTest   {

    private static final Logger logger = LoggerFactory.getLogger(BaseServiceTest.class);

    @BeforeClass
    public static void start() {
        logger.debug("=====================  start  =======================");
    }

    @AfterClass
    public static void end() {
        logger.debug("=====================  end  =======================");
    }

}
这篇关于非springboot java单元测试基类的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!