junit4同一时候測试多个測试类
两个分别须要的測试类
TestSuit001
package com.test.junit; import org.junit.Test; public class TestSuit001 { @Test public void test() { System.out.println("test001"); } }
TestSuit002
package com.test.junit; import org.junit.Test; public class TestSuit002 { @Test public void test() { System.out.println("test002"); } }
一个測试套件类
TestSuit
package com.test.junit; import org.junit.runner.RunWith; import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({TestSuit001.class, TestSuit002.class}) public class TestSuit { }
输出结果