标签:
使用注解简化了可以和Junit文章相比较看出。import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.TransactionConfiguration; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath*:applicationContext-test.xml" }) @TransactionConfiguration(defaultRollback = true) public class SpringandJunit4Test { //spring-test.jar spring-beans.jar //junit4.jar @Autowired private DubboService dubboService; @Test public void myTest(){ } }
标签:
原文地址:http://blog.csdn.net/u010081710/article/details/43763883