Search in sources :

Example 1 with TestResult

use of junit.framework.TestResult in project android_frameworks_base by ParanoidAndroid.

the class TestSuiteBuilderTest method runSuite.

private SuiteExecutionRecorder runSuite(TestSuiteBuilder builder) {
    TestSuite suite = builder.build();
    SuiteExecutionRecorder recorder = new SuiteExecutionRecorder();
    TestResult result = new TestResult();
    result.addListener(recorder);
    suite.run(result);
    return recorder;
}
Also used : TestSuite(junit.framework.TestSuite) TestResult(junit.framework.TestResult)

Example 2 with TestResult

use of junit.framework.TestResult in project cucumber-jvm by cucumber.

the class SanityChecker method run.

public static void run(Class<?> testClass, boolean debug) {
    JUnit4TestAdapter testAdapter = new JUnit4TestAdapter(testClass);
    TestResult result = new TestResult();
    SanityChecker listener = new SanityChecker();
    result.addListener(listener);
    testAdapter.run(result);
    String output = listener.getOutput();
    if (output.contains(INSANITY)) {
        throw new RuntimeException("Something went wrong\n" + output);
    }
    if (debug) {
        System.out.println("===== " + testClass.getName());
        System.out.println(output);
        System.out.println("=====");
    }
}
Also used : TestResult(junit.framework.TestResult) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter)

Example 3 with TestResult

use of junit.framework.TestResult in project android_frameworks_base by ResurrectionRemix.

the class InstrumentationTestSuiteBuilderTest method runSuite.

private SuiteExecutionRecorder runSuite(TestSuiteBuilder builder) {
    TestSuite suite = builder.build();
    SuiteExecutionRecorder recorder = new SuiteExecutionRecorder();
    TestResult result = new TestResult();
    result.addListener(recorder);
    suite.run(result);
    return recorder;
}
Also used : TestSuite(junit.framework.TestSuite) TestResult(junit.framework.TestResult)

Example 4 with TestResult

use of junit.framework.TestResult in project android_frameworks_base by ResurrectionRemix.

the class TestSuiteBuilderTest method runSuite.

private SuiteExecutionRecorder runSuite(TestSuiteBuilder builder) {
    TestSuite suite = builder.build();
    SuiteExecutionRecorder recorder = new SuiteExecutionRecorder();
    TestResult result = new TestResult();
    result.addListener(recorder);
    suite.run(result);
    return recorder;
}
Also used : TestSuite(junit.framework.TestSuite) TestResult(junit.framework.TestResult)

Example 5 with TestResult

use of junit.framework.TestResult in project android_frameworks_base by ResurrectionRemix.

the class UnitTestSuiteBuilderTest method runSuite.

private SuiteExecutionRecorder runSuite(TestSuiteBuilder builder) {
    TestSuite suite = builder.build();
    SuiteExecutionRecorder recorder = new SuiteExecutionRecorder();
    TestResult result = new TestResult();
    result.addListener(recorder);
    suite.run(result);
    return recorder;
}
Also used : TestSuite(junit.framework.TestSuite) TestResult(junit.framework.TestResult)

Aggregations

TestResult (junit.framework.TestResult)108 TestSuite (junit.framework.TestSuite)33 Test (junit.framework.Test)19 JUnit4TestAdapter (junit.framework.JUnit4TestAdapter)17 TestCase (junit.framework.TestCase)14 TestFailure (junit.framework.TestFailure)12 Test (org.junit.Test)10 TestListener (junit.framework.TestListener)9 ArrayList (java.util.ArrayList)8 PrintStream (java.io.PrintStream)7 RepeatedTest (junit.extensions.RepeatedTest)7 Enumeration (java.util.Enumeration)6 Bundle (android.os.Bundle)5 HandlerThread (android.os.HandlerThread)5 ShellUiAutomatorBridge (com.android.uiautomator.core.ShellUiAutomatorBridge)5 Tracer (com.android.uiautomator.core.Tracer)5 UiAutomationShellWrapper (com.android.uiautomator.core.UiAutomationShellWrapper)5 AssertionFailedError (junit.framework.AssertionFailedError)5 IOException (java.io.IOException)4 Iterator (java.util.Iterator)4