Search in sources :

Example 11 with TestDescriptor

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

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 12 with TestDescriptor

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

the class InstrumentationTestRunnerTest method testMultipleTestClass.

public void testMultipleTestClass() throws Exception {
    String classArg = PlaceHolderTest.class.getName() + "," + PlaceHolderTest2.class.getName();
    mInstrumentationTestRunner.onCreate(createBundle(InstrumentationTestRunner.ARGUMENT_TEST_CLASS, classArg));
    Test test = mStubAndroidTestRunner.getTest();
    assertContentsInOrder(ListTestCaseNames.getTestNames((TestSuite) test), new TestDescriptor(PlaceHolderTest.class.getName(), "testPlaceHolder"), new TestDescriptor(PlaceHolderTest2.class.getName(), "testPlaceHolder2"));
}
Also used : TestSuite(junit.framework.TestSuite) Test(junit.framework.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest) TestDescriptor(android.test.suitebuilder.ListTestCaseNames.TestDescriptor)

Example 13 with TestDescriptor

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

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 14 with TestDescriptor

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

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 15 with TestDescriptor

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

the class InstrumentationTestRunnerTest method testMultipleTestClass.

public void testMultipleTestClass() throws Exception {
    String classArg = PlaceHolderTest.class.getName() + "," + PlaceHolderTest2.class.getName();
    mInstrumentationTestRunner.onCreate(createBundle(InstrumentationTestRunner.ARGUMENT_TEST_CLASS, classArg));
    Test test = mStubAndroidTestRunner.getTest();
    assertContentsInOrder(ListTestCaseNames.getTestNames((TestSuite) test), new TestDescriptor(PlaceHolderTest.class.getName(), "testPlaceHolder"), new TestDescriptor(PlaceHolderTest2.class.getName(), "testPlaceHolder2"));
}
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