How to expect an exception in Robotium?
问题 Here is my test case: public void testStartActivityWithoutExtraData() { try { getActivity(); Assert.fail("Should have thrown IllegalStateException"); } catch (IllegalStateException ex) { assertTrue(true); } } The Activity under a test throws an Exception if it is started without extras . So in this test I expect for an IllegalStateException , but test always fails because of the issue: Test failed to run to completion. Reason: 'Instrumentation run failed due to 'java.lang