Examples of failedTest()


Examples of junit.framework.TestFailure.failedTest()

           
            Enumeration errorEnum = result.errors();
            TestFailure failure = null;
            while (errorEnum.hasMoreElements()) {
                failure = (TestFailure) errorEnum.nextElement();
                logger.severe("Test " + failure.failedTest().toString() + " failed --------");
                Throwable th = failure.thrownException();
                th.printStackTrace(System.err);
            }
            errorEnum = result.failures();
            failure = null;
View Full Code Here

Examples of junit.framework.TestFailure.failedTest()

            }
            errorEnum = result.failures();
            failure = null;
            while (errorEnum.hasMoreElements()) {
                failure = (TestFailure) errorEnum.nextElement();
                logger.severe("Test " + failure.failedTest().toString() + " failed --------");
                Throwable th = failure.thrownException();
                th.printStackTrace(System.err);
            }
            System.exit(1);
        }
View Full Code Here

Examples of junit.framework.TestFailure.failedTest()

  private void showFailureDetail(Test test) {
    if (test != null) {
      ListModel failures= getFailures();
      for (int i= 0; i < failures.getSize(); i++) {
        TestFailure failure= (TestFailure)failures.getElementAt(i);
        if (failure.failedTest() == test) {
          fFailureView.showFailure(failure);
          return;
        }
      }
    }
View Full Code Here

Examples of junit.framework.TestFailure.failedTest()

                writer.println( "<tr><td colspan=3>" + getFormatted( count, title ) + "</td></tr>" );
                Enumeration e = enumeration;
                for (int i = 1; e.hasMoreElements(); i++) {
                    TestFailure failure = (TestFailure) e.nextElement();
                    writer.println( "<tr><td class='detail' align='right'>" + i + "</td>" );
                    writer.println( "<td class='detail'>" + failure.failedTest() + "</td><td class='detail'>" );
                    if (failure.thrownException() instanceof AssertionFailedError) {
                        writer.println( htmlEscape( failure.thrownException().getMessage() ) );
                    } else {
                        writer.println( htmlEscape( getFilteredTrace( failure.thrownException() ) ) );
                    }
View Full Code Here

Examples of junit.framework.TestFailure.failedTest()

                writer.println( "<tr><td colspan=3>" + getFormatted( count, title ) + "</td></tr>" );
                Enumeration e = enumeration;
                for (int i = 1; e.hasMoreElements(); i++) {
                    TestFailure failure = (TestFailure) e.nextElement();
                    writer.println( "<tr><td class='detail' align='right'>" + i + "</td>" );
                    writer.println( "<td class='detail'>" + failure.failedTest() + "</td><td class='detail'>" );
                    if (failure.thrownException() instanceof AssertionFailedError) {
                        writer.println( htmlEscape( failure.thrownException().getMessage() ) );
                    } else {
                        writer.println( htmlEscape( getFilteredTrace( failure.thrownException() ) ) );
                    }
View Full Code Here

Examples of junit.framework.TestFailure.failedTest()

           
            int i = 1;
            writer().println("\nFailure Summary:");
            for (final Enumeration e= result.failures(); e.hasMoreElements(); i++) {
                final TestFailure failure= (TestFailure) e.nextElement();
                writer().println(i + ") " + failure.failedTest());
            }
            i = 1;
            writer().println("\nFailure Details:");
            for (final Enumeration e= result.failures(); e.hasMoreElements(); i++) {
                final TestFailure failure= (TestFailure) e.nextElement();
View Full Code Here

Examples of junit.framework.TestFailure.failedTest()

            }
            i = 1;
            writer().println("\nFailure Details:");
            for (final Enumeration e= result.failures(); e.hasMoreElements(); i++) {
                final TestFailure failure= (TestFailure) e.nextElement();
                writer().println("\n"+ i + ") " + failure.failedTest());
                final Throwable t= failure.thrownException();
                if (t.getMessage() != null)
                    writer().println("\t\"" + t.getMessage() + "\"");
                else {
                    writer().println();
View Full Code Here

Examples of junit.framework.TestFailure.failedTest()

   
            writer().println("\nError Summary:");
            int i = 1;
            for (final Enumeration e= result.errors(); e.hasMoreElements(); i++) {
                final TestFailure failure= (TestFailure) e.nextElement();
                writer().println(i + ") " + failure.failedTest());
            }
            writer().println("\nError Details:");
            i = 1;
            for (final Enumeration e= result.errors(); e.hasMoreElements(); i++) {
                final TestFailure failure= (TestFailure)e.nextElement();
View Full Code Here

Examples of junit.framework.TestFailure.failedTest()

            }
            writer().println("\nError Details:");
            i = 1;
            for (final Enumeration e= result.errors(); e.hasMoreElements(); i++) {
                final TestFailure failure= (TestFailure)e.nextElement();
                writer().println(i+") "+failure.failedTest());
                final String trace = getRelevantStackTrace(failure.thrownException());
                writer().println(trace);
            }
        }
    }
View Full Code Here

Examples of junit.framework.TestFailure.failedTest()

        AntUnitTestCase antUnitTestCase = new AntUnitTestCase(unknownName);
        antUnitTestCase.run(testResult);

        assertEquals(1 , testResult.errorCount());
        TestFailure error = (TestFailure) testResult.errors().nextElement();
        assertSame(antUnitTestCase, error.failedTest());
        assertTrue("Unexpected error : " + error.exceptionMessage(),
                error.exceptionMessage().contains("unknown"));
    }

    public void testInvalidFile() {
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.