我使用的是IntelliJ IDEA CE 2018.3和JUnit 4.12。我有一个测试类,看起来像这样: @RunWith(HierarchicalContextRunner.class) @BeforeClass //hit the service and assert something about the result }} 当我告诉Intelli
在使用JUnit进行单元测试时,有两种类似的方法:setUp()和setUpBeforeClass()。这些方法之间的区别是什么?另外,tearDown()和tearDownAfterClass()之间的区别是什么@BeforeClass
public static void setUpBeforeClass()
,这是行不通的- TestNG不认为testSimple方法是一个测试,因此不会运行它。因此,我尝试注释testSimple方法(或DAOTestBase类):
不带任何组的A @Test注释将导致相同的效果--测试不会对fast组或slow组运行。中添加的TestMockDAO注释也不能工作,除非在组中包含common以运行,这再次导致了上面的案例2( Test