Package junit.framework

Examples of junit.framework.TestResult


            public void setUp() {
                fail();
            }
        };

        TestResult result = new TestResult();
        wrapper.run(result);

        assertTrue(!test.fWasRun);
        assertTrue(!result.wasSuccessful());
    }
View Full Code Here


            @Override
            public void tearDown() {
                throw new Error("tearingDown");
            }
        };
        TestResult result = new TestResult();
        t.run(result);
        TestFailure failure = result.errors().nextElement();
        assertEquals("running", failure.thrownException().getMessage());
    }
View Full Code Here

        }
    }

    public void testNoArgTestCasePasses() {
        Test t = new TestSuite(NoArgTestCaseTest.class);
        TestResult result = new TestResult();
        t.run(result);
        assertTrue(result.runCount() == 1);
        assertTrue(result.failureCount() == 0);
        assertTrue(result.errorCount() == 0);
    }
View Full Code Here

    }

    public void testNamelessTestCase() {
        TestCase t = new TestCase() {
        };
        TestResult result = t.run();
        assertEquals(1, result.failureCount());
    }
View Full Code Here

        TestResult result = t.run();
        assertEquals(1, result.failureCount());
    }

    void verifyError(TestCase test) {
        TestResult result = test.run();
        assertTrue(result.runCount() == 1);
        assertTrue(result.failureCount() == 0);
        assertTrue(result.errorCount() == 1);
    }
View Full Code Here

        assertTrue(result.failureCount() == 0);
        assertTrue(result.errorCount() == 1);
    }

    void verifyFailure(TestCase test) {
        TestResult result = test.run();
        assertTrue(result.runCount() == 1);
        assertTrue(result.failureCount() == 1);
        assertTrue(result.errorCount() == 0);
    }
View Full Code Here

        assertTrue(result.failureCount() == 1);
        assertTrue(result.errorCount() == 0);
    }

    void verifySuccess(TestCase test) {
        TestResult result = test.run();
        assertTrue(result.runCount() == 1);
        assertTrue(result.failureCount() == 0);
        assertTrue(result.errorCount() == 0);
    }
View Full Code Here

        assertEquals(1, result.getRunCount());
    }

    @Test
    public void compatibility() {
        TestResult result = new TestResult();
        new JUnit4TestAdapter(IgnoredTest.class).run(result);
        assertEquals(1, result.runCount());
    }
View Full Code Here

    }

    @Test
    public void ensureSuitesWorkWithForwardCompatibility() {
        junit.framework.Test test = new JUnit4TestAdapter(All.class);
        TestResult result = new TestResult();
        test.run(result);
        assertEquals(2, result.runCount());
    }
View Full Code Here

        assertEquals(1, fAdapter.getTests().size());
    }

    @Test
    public void initializationErrorsAreThrownAtRuntime() {
        TestResult result = new TestResult();
        fAdapter.run(result);
        assertEquals(1, result.errorCount());
        assertEquals(CantInitialize.UNIQUE_ERROR_MESSAGE, result.errors()
                .nextElement().exceptionMessage());
    }
View Full Code Here

TOP

Related Classes of junit.framework.TestResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.