Search in sources :

Example 6 with TestDescriptor

use of android.test.suitebuilder.ListTestCaseNames.TestDescriptor in project android_frameworks_base by crdroidandroid.

the class InstrumentationTestRunnerTest method assertContentsInOrder.

private void assertContentsInOrder(List<TestDescriptor> actual, TestDescriptor... source) {
    TestDescriptor[] clonedSource = source.clone();
    assertEquals("Unexpected number of items.", clonedSource.length, actual.size());
    for (int i = 0; i < actual.size(); i++) {
        TestDescriptor actualItem = actual.get(i);
        TestDescriptor sourceItem = clonedSource[i];
        assertEquals("Unexpected item. Index: " + i, sourceItem, actualItem);
    }
}
Also used : TestDescriptor(android.test.suitebuilder.ListTestCaseNames.TestDescriptor)

Example 7 with TestDescriptor

use of android.test.suitebuilder.ListTestCaseNames.TestDescriptor in project platform_frameworks_base by android.

the class InstrumentationTestRunnerTest method assertTestRunnerCalledWithExpectedParameters.

private void assertTestRunnerCalledWithExpectedParameters(String expectedTestClassName, String expectedTestMethodName) {
    Test test = mStubAndroidTestRunner.getTest();
    assertContentsInOrder(ListTestCaseNames.getTestNames((TestSuite) test), new TestDescriptor(expectedTestClassName, expectedTestMethodName));
    assertTrue(mInstrumentationTestRunner.isStarted());
    assertFalse(mInstrumentationTestRunner.isFinished());
}
Also used : TestSuite(junit.framework.TestSuite) Test(junit.framework.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest) TestDescriptor(android.test.suitebuilder.ListTestCaseNames.TestDescriptor)

Example 8 with TestDescriptor

use of android.test.suitebuilder.ListTestCaseNames.TestDescriptor in project android_frameworks_base by ParanoidAndroid.

the class InstrumentationTestRunnerTest method assertContentsInOrder.

private void assertContentsInOrder(List<TestDescriptor> actual, TestDescriptor... source) {
    TestDescriptor[] clonedSource = source.clone();
    assertEquals("Unexpected number of items.", clonedSource.length, actual.size());
    for (int i = 0; i < actual.size(); i++) {
        TestDescriptor actualItem = actual.get(i);
        TestDescriptor sourceItem = clonedSource[i];
        assertEquals("Unexpected item. Index: " + i, sourceItem, actualItem);
    }
}
Also used : TestDescriptor(android.test.suitebuilder.ListTestCaseNames.TestDescriptor)

Example 9 with TestDescriptor

use of android.test.suitebuilder.ListTestCaseNames.TestDescriptor in project android_frameworks_base by ParanoidAndroid.

the class InstrumentationTestRunnerTest method assertTestRunnerCalledWithExpectedParameters.

private void assertTestRunnerCalledWithExpectedParameters(String expectedTestClassName, String expectedTestMethodName) {
    Test test = mStubAndroidTestRunner.getTest();
    assertContentsInOrder(ListTestCaseNames.getTestNames((TestSuite) test), new TestDescriptor(expectedTestClassName, expectedTestMethodName));
    assertTrue(mInstrumentationTestRunner.isStarted());
    assertFalse(mInstrumentationTestRunner.isFinished());
}
Also used : TestSuite(junit.framework.TestSuite) Test(junit.framework.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest) TestDescriptor(android.test.suitebuilder.ListTestCaseNames.TestDescriptor)

Example 10 with TestDescriptor

use of android.test.suitebuilder.ListTestCaseNames.TestDescriptor in project android_frameworks_base by DirtyUnicorns.

the class InstrumentationTestRunnerTest method assertTestRunnerCalledWithExpectedParameters.

private void assertTestRunnerCalledWithExpectedParameters(String expectedTestClassName, String expectedTestMethodName) {
    Test test = mStubAndroidTestRunner.getTest();
    assertContentsInOrder(ListTestCaseNames.getTestNames((TestSuite) test), new TestDescriptor(expectedTestClassName, expectedTestMethodName));
    assertTrue(mInstrumentationTestRunner.isStarted());
    assertFalse(mInstrumentationTestRunner.isFinished());
}
Also used : TestSuite(junit.framework.TestSuite) Test(junit.framework.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest) TestDescriptor(android.test.suitebuilder.ListTestCaseNames.TestDescriptor)

Aggregations

TestDescriptor (android.test.suitebuilder.ListTestCaseNames.TestDescriptor)15 SmallTest (android.test.suitebuilder.annotation.SmallTest)10 Test (junit.framework.Test)10 TestSuite (junit.framework.TestSuite)10