Examples of TestFailure


Examples of junit.framework.TestFailure

    for (int i= fSuiteCombo.getItemCount()-1; i > historyLength-1; i--)
      fSuiteCombo.removeItemAt(i);
  }

  private void appendFailure(Test test, Throwable t) {
    fFailures.addElement(new TestFailure(test, t));
    if (fFailures.size() == 1)
      revealFailure(test);
  }
View Full Code Here

Examples of junit.framework.TestFailure

  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

                System.out.println("\nFailed tests:");
                for (int i = 0; i < m_failures.size(); i++) {
                    TestResult tr = (TestResult) m_failures.get(i);
                    Enumeration e = tr.failures();
                    while (e.hasMoreElements()) {
                        TestFailure tf = (TestFailure) e.nextElement();
                        System.out.println(" " + tf.toString());
                    }
                }
            }
           
            if (m_failures.size() > 0) {
                System.out.println("\nTests in error:");
                for (int i = 0; i < m_errors.size(); i++) {
                    TestResult tr = (TestResult) m_errors.get(i);
                    Enumeration e = tr.errors();
                    while (e.hasMoreElements()) {
                        TestFailure tf = (TestFailure) e.nextElement();
                        System.out.println(" " + tf.toString());
                    }
                }
            }
           
            System.out.println("\nTests run: " + m_total + ", Failures: " + m_totalFailures + ", Errors:" + m_totalErrors + "\n");         
View Full Code Here

Examples of junit.framework.TestFailure

                System.out.println("\nFailed tests:");
                for (int i = 0; i < m_failures.size(); i++) {
                    TestResult tr = (TestResult) m_failures.get(i);
                    Enumeration e = tr.failures();
                    while (e.hasMoreElements()) {
                        TestFailure tf = (TestFailure) e.nextElement();
                        System.out.println(" " + tf.toString());
                    }
                }
            }

            if (m_failures.size() > 0) {
                System.out.println("\nTests in error:");
                for (int i = 0; i < m_errors.size(); i++) {
                    TestResult tr = (TestResult) m_errors.get(i);
                    Enumeration e = tr.errors();
                    while (e.hasMoreElements()) {
                        TestFailure tf = (TestFailure) e.nextElement();
                        System.out.println(" " + tf.toString());
                    }
                }
            }

            System.out.println("\nTests run: " + m_total + ", Failures: " + m_totalFailures + ", Errors:" + m_totalErrors + "\n");
View Full Code Here

Examples of junit.framework.TestFailure

        private void displayProblems( PrintWriter writer, String title, int count, Enumeration enumeration ) {
            if (count != 0) {
                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() ) ) );
                    }
                    writer.println( "</td></tr>" );
                }
            }
        }
View Full Code Here

Examples of junit.framework.TestFailure

        private void displayProblems( PrintWriter writer, String title, int count, Enumeration enumeration ) {
            if (count != 0) {
                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() ) ) );
                    }
                    writer.println( "</td></tr>" );
                }
            }
        }
View Full Code Here

Examples of junit.framework.TestFailure

     * @param theTest the test object that failed
     * @param theThrowable the exception that was thrown
     */
    public void addError(Test theTest, Throwable theThrowable)
    {
        TestFailure failure = new TestFailure(theTest, theThrowable);
        StringBuffer xml = new StringBuffer();

        xml.append("<" + ERROR + " " + ATTR_MESSAGE + "=\""
            + xmlEncode(failure.thrownException().getMessage()) + "\" "
            + ATTR_TYPE + "=\""
            + failure.thrownException().getClass().getName() + "\">");
        xml.append(xmlEncode(
            StringUtil.exceptionToString(failure.thrownException())));
        xml.append("</" + ERROR + ">");

        this.currentTestFailure = xml.toString();
    }
View Full Code Here

Examples of junit.framework.TestFailure

     * @param theTest the test object that failed
     * @param theError the exception that was thrown
     */
    public void addFailure(Test theTest, AssertionFailedError theError)
    {
        TestFailure failure = new TestFailure(theTest, theError);
        StringBuffer xml = new StringBuffer();

        xml.append("<" + FAILURE + " " + ATTR_MESSAGE + "=\""
            + xmlEncode(failure.thrownException().getMessage())
            + "\" " + ATTR_TYPE + "=\""
            + failure.thrownException().getClass().getName() + "\">");
        xml.append(xmlEncode(
            StringUtil.exceptionToString(failure.thrownException())));
        xml.append("</" + FAILURE + ">");

        this.currentTestFailure = xml.toString();
    }
View Full Code Here

Examples of junit.framework.TestFailure

     * @param theTest the test object that failed
     * @param theThrowable the exception that was thrown
     */
    public void addError(Test theTest, Throwable theThrowable)
    {
        TestFailure failure = new TestFailure(theTest, theThrowable);
        StringBuffer xml = new StringBuffer();

        xml.append("<" + ERROR + " " + ATTR_MESSAGE + "=\""
            + xmlEncode(failure.thrownException().getMessage()) + "\" "
            + ATTR_TYPE + "=\""
            + failure.thrownException().getClass().getName() + "\">");
        xml.append(xmlEncode(StringUtil.exceptionToString(
            failure.thrownException(), DEFAULT_STACK_FILTER_PATTERNS)));
        xml.append("</" + ERROR + ">");

        this.currentTestFailure = xml.toString();
    }
View Full Code Here

Examples of junit.framework.TestFailure

     * @param theTest the test object that failed
     * @param theError the exception that was thrown
     */
    public void addFailure(Test theTest, AssertionFailedError theError)
    {
        TestFailure failure = new TestFailure(theTest, theError);
        StringBuffer xml = new StringBuffer();

        xml.append("<" + FAILURE + " " + ATTR_MESSAGE + "=\""
            + xmlEncode(failure.thrownException().getMessage()) + "\" "
            + ATTR_TYPE + "=\""
            + failure.thrownException().getClass().getName() + "\">");
        xml.append(xmlEncode(StringUtil.exceptionToString(
            failure.thrownException(), DEFAULT_STACK_FILTER_PATTERNS)));
        xml.append("</" + FAILURE + ">");

        this.currentTestFailure = xml.toString();
    }
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.