JUnit 3有类似于@BeforeClass的东西吗?
我被迫将JUnit 3用于特定的测试套件。 我理解setUp()
和tearDown()
服务于@Before
和@After
的function,但是@BeforeClass
和@AfterClass
的类似物是否应该在测试开始之前发生一次,并且在所有测试运行之后?
好的,我应该更好地搜索。
在junit 3中拆分?
public static Test suite() { return new TestSetup(new TestSuite(YourTestClass.class)) { protected void setUp() throws Exception { System.out.println(" Global setUp "); } protected void tearDown() throws Exception { System.out.println(" Global tearDown "); } }; }
不,这是JUnit4中的新function。