Package net.jsunit

Examples of net.jsunit.TestCaseResult.hadError()


    public void testBuildSuccessfulResultFromString() {
        TestCaseResult result = TestCaseResult.fromString("file:///dummy/path/dummyPage.html:testFoo|1.3|S||");
        assertEquals("file:///dummy/path/dummyPage.html:testFoo", result.getName());
        assertEquals(1.3d, result.getTime(), .001d);
        assertFalse(result.hadError());
        assertFalse(result.hadFailure());
        assertTrue(result.hadSuccess());
        assertNull(result.getError());
        assertNull(result.getFailure());
        assertEquals("<testcase name=\"file:///dummy/path/dummyPage.html:testFoo\" time=\"1.3\" />", result.writeXmlFragment());
View Full Code Here


    public void testBuildErrorResultFromString() {
        TestCaseResult result = TestCaseResult.fromString("file:///dummy/path/dummyPage.html:testFoo|1.3|E|Test Error Message|");
        assertEquals("file:///dummy/path/dummyPage.html:testFoo", result.getName());
        assertEquals(1.3d, result.getTime(), .001d);
        assertTrue(result.hadError());
        assertFalse(result.hadFailure());
        assertFalse(result.hadSuccess());
        assertEquals("Test Error Message", result.getError());
        assertNull(result.getFailure());
        assertEquals("<testcase name=\"file:///dummy/path/dummyPage.html:testFoo\" time=\"1.3\"><error message=\"Test Error Message\" /></testcase>", result.writeXmlFragment());
View Full Code Here

    public void testBuildFailureResultFromString() {
        TestCaseResult result = TestCaseResult.fromString("file:///dummy/path/dummyPage.html:testFoo|1.3|F|Test Failure Message|");
        assertEquals("file:///dummy/path/dummyPage.html:testFoo", result.getName());
        assertEquals(1.3d, result.getTime(), .001d);
        assertFalse(result.hadError());
        assertTrue(result.hadFailure());
        assertFalse(result.hadSuccess());
        assertNull(result.getError());
        assertEquals("Test Failure Message", result.getFailure());
        assertEquals("<testcase name=\"file:///dummy/path/dummyPage.html:testFoo\" time=\"1.3\"><failure message=\"Test Failure Message\" /></testcase>", result.writeXmlFragment());
View Full Code Here

        TestCaseResult result = TestCaseResult.fromString("file:///dummy/path/dummyPage.html:testFoo|1.3|F|Test Failure Message|");
        Element element = new TestCaseResultWriter(result).createTestCaseElement();
        TestCaseResult reconstitutedResult = TestCaseResult.fromXmlElement(element);
        assertEquals("file:///dummy/path/dummyPage.html:testFoo", reconstitutedResult.getName());
        assertEquals(1.3d, reconstitutedResult.getTime(), .001d);
        assertFalse(reconstitutedResult.hadError());
        assertTrue(reconstitutedResult.hadFailure());
        assertFalse(reconstitutedResult.hadSuccess());
        assertNull(reconstitutedResult.getError());
        assertEquals("Test Failure Message", reconstitutedResult.getFailure());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.