Java ';断言';在使用InstrumentationTestCase的Junit测试中被忽略
我从中设置JUnit测试,并从以下测试类中获得“失败”结果Java ';断言';在使用InstrumentationTestCase的Junit测试中被忽略,java,android,unit-testing,testing,junit,Java,Android,Unit Testing,Testing,Junit,我从中设置JUnit测试,并从以下测试类中获得“失败”结果 public class FooTest extends AndroidTestCase { @Before public void setUp() throws Exception { super.setUp(); } @After public void tearDown() throws Exception { super.tearDown(); } @Test public voi
public class FooTest extends AndroidTestCase {
@Before
public void setUp() throws Exception { super.setUp(); }
@After
public void tearDown() throws Exception { super.tearDown(); }
@Test
public void testCase1() { assertTrue(false); }
}
然而,在将“AndroidTestCase”替换为“InstrumentationTestCase”之后,我得到了“SUCCESS”结果,尽管其中包含明显返回“FAIL”的断言
我想知道为什么我会得到这样一个结果,这与超类不同,以及如何在JUnit框架测试中使用上下文