标签:next spring class extends end tor span junit4 on()
java.lang.Exception: Test class should have exactly one public constructor at org.junit.runners.BlockJUnit4ClassRunner.validateOnlyOneConstructor(BlockJUnit4ClassRunner.java:131) at org.junit.runners.BlockJUnit4ClassRunner.validateConstructor(BlockJUnit4ClassRunner.java:120) at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:101) at org.junit.runners.ParentRunner.validate(ParentRunner.java:344) at org.junit.runners.ParentRunner.<init>(ParentRunner.java:74) at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:55) at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:13)
public class TestBeanScope extends UnitTestBase { TestBeanScope(){ super("classpath*:spring-scope.xml"); } @Test public void TestSingleton(){ for (int i=0;i<3;i++){ BeanScope beanScope = (BeanScope)super.getBean("beanScope"); beanScope.say("test"); } } }
public class TestBeanScope extends UnitTestBase { public TestBeanScope(){ super("classpath*:spring-scope.xml"); } @Test public void TestSingleton(){ for (int i=0;i<3;i++){ BeanScope beanScope = (BeanScope)super.getBean("beanScope"); beanScope.say("test"); } } }
Spring错误——Spring 单元测试——Test class should have exactly one public constructor
标签:next spring class extends end tor span junit4 on()
原文地址:https://www.cnblogs.com/jixue/p/10431528.html