Search in sources :

Example 6 with AndroidTestRunner

use of android.test.AndroidTestRunner in project android_frameworks_base by crdroidandroid.

the class TestSuiteBuilder method addTestClassByName.

/** @hide pending API Council approval */
public TestSuiteBuilder addTestClassByName(String testClassName, String testMethodName, Context context) {
    AndroidTestRunner atr = new AndroidTestRunner();
    atr.setContext(context);
    atr.setTestClassName(testClassName, testMethodName);
    this.testCases.addAll(atr.getTestCases());
    return this;
}
Also used : AndroidTestRunner(android.test.AndroidTestRunner)

Example 7 with AndroidTestRunner

use of android.test.AndroidTestRunner in project android-junit-report by jsankey.

the class JUnitReportTestRunner method getAndroidTestRunner.

@Override
protected AndroidTestRunner getAndroidTestRunner() {
    AndroidTestRunner runner = makeAndroidTestRunner();
    mListener = new JUnitReportListener(getContext(), getTargetContext(), mReportFile, mReportDir, mFilterTraces, mMultiFile);
    runner.addTestListener(mListener);
    return runner;
}
Also used : AndroidTestRunner(android.test.AndroidTestRunner)

Example 8 with AndroidTestRunner

use of android.test.AndroidTestRunner in project android_frameworks_base by DirtyUnicorns.

the class UiAutomatorInstrumentationTestRunner method getAndroidTestRunner.

@Override
protected AndroidTestRunner getAndroidTestRunner() {
    AndroidTestRunner testRunner = super.getAndroidTestRunner();
    testRunner.addTestListener(new TestListener() {

        @Override
        public void startTest(Test test) {
            if (test instanceof UiAutomatorTestCase) {
                ((UiAutomatorTestCase) test).initialize(getArguments());
            }
        }

        @Override
        public void endTest(Test test) {
        }

        @Override
        public void addFailure(Test test, AssertionFailedError e) {
        }

        @Override
        public void addError(Test test, Throwable t) {
        }
    });
    return testRunner;
}
Also used : Test(junit.framework.Test) TestListener(junit.framework.TestListener) AssertionFailedError(junit.framework.AssertionFailedError) AndroidTestRunner(android.test.AndroidTestRunner)

Example 9 with AndroidTestRunner

use of android.test.AndroidTestRunner in project android_frameworks_base by AOSPA.

the class UiAutomatorInstrumentationTestRunner method getAndroidTestRunner.

@Override
protected AndroidTestRunner getAndroidTestRunner() {
    AndroidTestRunner testRunner = super.getAndroidTestRunner();
    testRunner.addTestListener(new TestListener() {

        @Override
        public void startTest(Test test) {
            if (test instanceof UiAutomatorTestCase) {
                ((UiAutomatorTestCase) test).initialize(getArguments());
            }
        }

        @Override
        public void endTest(Test test) {
        }

        @Override
        public void addFailure(Test test, AssertionFailedError e) {
        }

        @Override
        public void addError(Test test, Throwable t) {
        }
    });
    return testRunner;
}
Also used : Test(junit.framework.Test) TestListener(junit.framework.TestListener) AssertionFailedError(junit.framework.AssertionFailedError) AndroidTestRunner(android.test.AndroidTestRunner)

Example 10 with AndroidTestRunner

use of android.test.AndroidTestRunner in project android_frameworks_base by ResurrectionRemix.

the class TestSuiteBuilder method addTestClassByName.

/** @hide pending API Council approval */
public TestSuiteBuilder addTestClassByName(String testClassName, String testMethodName, Context context) {
    AndroidTestRunner atr = new AndroidTestRunner();
    atr.setContext(context);
    atr.setTestClassName(testClassName, testMethodName);
    this.testCases.addAll(atr.getTestCases());
    return this;
}
Also used : AndroidTestRunner(android.test.AndroidTestRunner)

Aggregations

AndroidTestRunner (android.test.AndroidTestRunner)11 AssertionFailedError (junit.framework.AssertionFailedError)5 Test (junit.framework.Test)5 TestListener (junit.framework.TestListener)5