Java Code Examples for vogar.target.junit3.LongTest

Following code examples demonstrate how to use vogar.target.junit3.LongTestfrom android. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use vogar.target.junit3.LongTestand various code implementation of this class.

    public void test_init_and_run_for_LongTest_with_time_limit_should_report_time_out() {
        Class<?> target = LongTest.class;
        String actionName = "actionName";

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        System.setOut(new PrintStream(baos));

        runner.init(monitor, actionName, null, target, skipPastReference, testEnvironment, 0, false);
        runner.run("", null, null);

        verify(monitor).outcomeStarted(runner, target.getName() + "#test",
                actionName);
        verify(monitor).outcomeFinished(Result.EXEC_FAILED);

        String outStr = baos.toString();
        assertTrue(outStr.contains("java.util.concurrent.TimeoutException"));
    } 


Advertisement
Javadoc
A test case that is used to verify behavior of timeout.
Advertisement