public static void assertEquals(Adapter expected, Adapter actual) { AndroidTestCase.assertNotNull(actual); if (expected == null) { AndroidTestCase.assertEquals(0, actual.getCount()); return; } AndroidTestCase.assertEquals(expected.getCount(), actual.getCount()); final int count = expected.getCount(); for (int i = 0; i < count; i++) { AndroidTestCase.assertEquals( expected.getItem(i), actual.getItem(i)); } }
private void run() throws Exception { asyncBlockRunner.run(this); if(latch.await(timeoutMilis, TimeUnit.MILLISECONDS)){ if(failMessage==null) { if(assertions!=null){ assertions.run(); } asyncBlockRunner.onEndCalled(); } else{ AndroidTestCase.fail(failMessage); } } else { asyncBlockRunner.onTimeout(); } }
public static void assertEquals(List<?> expected, List<?> actual) { AndroidTestCase.assertNotNull(actual); if (expected == null) { AndroidTestCase.assertEquals(0, actual.size()); return; } AndroidTestCase.assertEquals(expected.size(), actual.size()); final int count = expected.size(); for (int i = 0; i < count; i++) { AndroidTestCase.assertEquals(expected.get(i), actual.get(i)); } }
public static void assertEquals(byte[] expected, byte[] actual) { AndroidTestCase.assertNotNull(actual); if (expected == null) { AndroidTestCase.assertEquals(0, actual.length); return; } AndroidTestCase.assertEquals(expected.length, actual.length); final int count = expected.length; for (int i = 0; i < count; i++) { AndroidTestCase.assertEquals(expected[i], actual[i]); } }
public static void assertEquals(long[] expected, long[] actual) { AndroidTestCase.assertNotNull(actual); if (expected == null) { AndroidTestCase.assertEquals(0, actual.length); return; } AndroidTestCase.assertEquals(expected.length, actual.length); final int count = expected.length; for (int i = 0; i < count; i++) { AndroidTestCase.assertEquals(expected[i], actual[i]); } }
public static void assertEquals(int[] expected, int[] actual) { AndroidTestCase.assertNotNull(actual); if (expected == null) { AndroidTestCase.assertEquals(0, actual.length); return; } AndroidTestCase.assertEquals(expected.length, actual.length); final int count = expected.length; for (int i = 0; i < count; i++) { AndroidTestCase.assertEquals(expected[i], actual[i]); } }
public static void assertEquals(Object[] expected, Object[] actual) { AndroidTestCase.assertNotNull(actual); if (expected == null) { AndroidTestCase.assertEquals(0, actual.length); return; } AndroidTestCase.assertEquals(expected.length, actual.length); final int count = expected.length; for (int i = 0; i < count; i++) { AndroidTestCase.assertEquals(expected[i], actual[i]); } }
/** * @return The {@link Context} of the test project. */ protected Context testContext() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { if (testContext == null) { Method getTestContext = AndroidTestCase.class.getMethod("getTestContext"); testContext = (Context) getTestContext.invoke(this); } return testContext; }
public AndroidTestCaseInitializationStrategy(AndroidTestCase testCase) { this.testCase = testCase; }
public static void runAndWaitForEnd(AndroidTestCase testCase, int timeoutMilis, AsyncBlockRunner asyncBlockRunner) throws Exception { new AsyncTimeoutHelper(timeoutMilis,asyncBlockRunner).run(); }