TestCase run - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TestCase run method.

This code example shows how to use the following methods:getClass, run
 
        while (fTests.size() != 0 && !result.shouldStop()) {
            TestCase test = (TestCase)fTests.elementAt(i);
             
            Thread.currentThread().setContextClassLoader(
                    test.getClass().getClassLoader());
 
            test.run(result);
 
            /* 
            if (fVictim != null) { 
                TestResult dummy = fVictim.run(); 
 
                if (dummy.failureCount() != 0) { 
                    result.addError(fTests.elementAt(i), new RuntimeException( 
                            "Probable side effect", 
                            ((TestFailure)dummy.failures().nextElement()). 
                            thrownException())); 
                } else if (dummy.errorCount() != 0) { 
                    result.addError(fTests.elementAt(i), new RuntimeException( 
5
CodeRank
This code example shows how to use the following methods:run, setName
            if (mTestCase instanceof DeviceTest) {
                DeviceTest deviceTest = (DeviceTest) mTestCase;
                deviceTest.setDevice(mTest.mDevice.getDevice());
                deviceTest.setTestAppPath(HostConfig.getInstance().getCaseRepository().getRoot());
            } 
            mTestCase.run(result);
        } 
        return result;
    } 
 
    /** 
     * Load test case via test class name and test method. 
     * 
     * @param testClassName The class name. 
     * @param testMethodName The method name. 
     */ 
    @SuppressWarnings("unchecked") 
    public TestCase loadTestCase(final String jarPath,
            final String testPkgName, final String testClassName,
            final String testMethodName) throws ClassNotFoundException, IOException {

5
CodeRank
This code example shows how to use the following methods:run, setName
		assertEquals("tests are being not being ran by JUnit", 3, result.runCount());
		assertEquals("skipped tests not properly recorded", 2, ConditionalTestCase.getDisabledTestCount());
	} 
 
	private void executeTest(String testMethod) {
		test.setName(testMethod);
		test.run(result);
	} 
} 
5
CodeRank
This code example shows how to use the following methods:run
     
    /** Bootstrap for the self-test code. 
     */ 
    public static void main( String[] argc ) throws Exception {
        TestCase test = new JspTaglibsTest( "test-jsptaglibs.txt" );
        test.run();
    } 
} 
5
CodeRank
This code example shows how to use the following methods:getClass, run
         
        while (fTests.size() != 0 && !result.shouldStop()) {
            TestCase test = (TestCase)fTests.elementAt(i);
             
            Thread.currentThread().setContextClassLoader(
                    test.getClass().getClassLoader());
             
            test.run(result);
 
            /* 
            if (fVictim != null) { 
                TestResult dummy = fVictim.run(); 
                 
                if (dummy.failureCount() != 0) { 
                    result.addError(fTests.elementAt(i), new RuntimeException( 
                            "Probable side effect",   
                            ((TestFailure)dummy.failures().nextElement()). 
                            thrownException())); 
                } else if (dummy.errorCount() != 0) { 
                    result.addError(fTests.elementAt(i), new RuntimeException( 
5
CodeRank
run Method Overview
A convenience method to run this test, collecting the results with a default TestResult object.
See Code Examples for other Android TestCase Methods: