protected void printDefectHeader(TestFailure booBoo, int count) { // I feel like making this a println, then adding a line giving the throwable a chance to print something // before we get to the stack trace. getWriter().print(count + ") " + booBoo.failedTest()); }
protected void printDefectHeader(TestFailure booBoo, int count) { // I feel like making this a println, then adding a line giving the throwable a chance to print something // before we get to the stack trace. getWriter().print(count + ") " + booBoo.failedTest()); }
protected void printDefectHeader(TestFailure booBoo, int count) { // I feel like making this a println, then adding a line giving the throwable a chance to print something // before we get to the stack trace. getWriter().print(count + ") " + booBoo.failedTest()); }
public Test getSelectedTest() { int index= fFailureList.getSelectedIndex(); if (index == -1) return null; ListModel model= fFailureList.getModel(); TestFailure failure= (TestFailure)model.getElementAt(index); return failure.failedTest(); }
protected void printDefectHeader(TestFailure booBoo, int count) { // I feel like making this a println, then adding a line giving the throwable a chance to print something // before we get to the stack trace. getWriter().print(count + ") " + booBoo.failedTest()); }
protected void printDefectHeader(TestFailure booBoo, int count) { // I feel like making this a println, then adding a line giving the throwable a chance to print something // before we get to the stack trace. getWriter().print(count + ") " + booBoo.failedTest()); }
protected void printDefectHeader(TestFailure booBoo, int count) { // I feel like making this a println, then adding a line giving the throwable a chance to print something // before we get to the stack trace. getWriter().print(count + ") " + booBoo.failedTest()); }
protected void printDefectHeader(TestFailure booBoo, int count) { // I feel like making this a println, then adding a line giving the throwable a chance to print something // before we get to the stack trace. getWriter().print(count + ") " + booBoo.failedTest()); }
protected void printDefectHeader(TestFailure booBoo, int count) { // I feel like making this a println, then adding a line giving the throwable a chance to print something // before we get to the stack trace. getWriter().print(count + ") " + booBoo.failedTest()); }
protected void printDefectHeader(TestFailure booBoo, int count) { // I feel like making this a println, then adding a line giving the throwable a chance to print something // before we get to the stack trace. getWriter().print(count + ") " + booBoo.failedTest()); }
protected void printDefectHeader(TestFailure booBoo, int count) { // I feel like making this a println, then adding a line giving the throwable a chance to print something // before we get to the stack trace. getWriter().print(count + ") " + booBoo.failedTest()); }
protected void printDefectHeader(TestFailure booBoo, int count) { // I feel like making this a println, then adding a line giving the throwable a chance to print something // before we get to the stack trace. getWriter().print(count + ") " + booBoo.failedTest()); }
/** * @see junit.textui.ResultPrinter#printDefectHeader(junit.framework.TestFailure, int) */ protected void printDefectHeader(TestFailure booBoo, int count) { // I feel like making this a println, then adding a line giving the throwable a chance to print // something // before we get to the stack trace. getWriter().print(count + ") " + booBoo.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; } } } fFailureView.clear(); }
private void displayResults( PrintWriter writer, String failureNodeName, Enumeration resultsEnumeration ) { for (Enumeration e = resultsEnumeration; e.hasMoreElements();) { TestFailure failure = (TestFailure) e.nextElement(); writer.println( " <testcase name=" + asAttribute( failure.failedTest().toString() ) + ">" ); writer.print( " <" + failureNodeName + " type=" + asAttribute( failure.thrownException().getClass().getName() ) + " message=" + asAttribute( failure.exceptionMessage() ) ); if (!displayException( failure )) { writer.println( "/>" ); } else { writer.println( ">" ); writer.print( sgmlEscape( BaseTestRunner.getFilteredTrace( failure.thrownException() ) ) ); writer.println( " </" + failureNodeName + ">" ); } writer.println( " </testcase>" ); } }
private void displayResults( PrintWriter writer, String failureNodeName, Enumeration resultsEnumeration ) { for (Enumeration e = resultsEnumeration; e.hasMoreElements();) { TestFailure failure = (TestFailure) e.nextElement(); writer.println( " <testcase name=" + asAttribute( failure.failedTest().toString() ) + ">" ); writer.print( " <" + failureNodeName + " type=" + asAttribute( failure.thrownException().getClass().getName() ) + " message=" + asAttribute( failure.exceptionMessage() ) ); if (!displayException( failure )) { writer.println( "/>" ); } else { writer.println( ">" ); writer.print( sgmlEscape( BaseTestRunner.getFilteredTrace( failure.thrownException() ) ) ); writer.println( " </" + failureNodeName + ">" ); } writer.println( " </testcase>" ); } }
YourTestClass testClass = new YourTestClass(); TestResult result = testClass.run(); Enumeration<TestFailure> failures = result.failures(); if (result.failureCount() != 0) { TestFailure fail = failes.nextElement(); junit.framework.Test test = fail.failedTest(); test.run( result ); }
private void displayProblems( PrintWriter writer, String kind, int count, Enumeration enumeration ) { if (count != 0) { displayProblemTitle( writer, getFormatted( count, kind ) ); Enumeration e = enumeration; for (int i = 1; e.hasMoreElements(); i++) { TestFailure failure = (TestFailure) e.nextElement(); displayProblemDetailHeader( writer, i, failure.failedTest().toString() ); if (failure.thrownException() instanceof AssertionFailedError) { displayProblemDetail( writer, failure.thrownException().getMessage() ); } else { displayProblemDetail( writer, BaseTestRunner.getFilteredTrace( failure.thrownException() ) ); } displayProblemDetailFooter( writer ); } } }
private void displayProblems( PrintWriter writer, String kind, int count, Enumeration enumeration ) { if (count != 0) { displayProblemTitle( writer, getFormatted( count, kind ) ); Enumeration e = enumeration; for (int i = 1; e.hasMoreElements(); i++) { TestFailure failure = (TestFailure) e.nextElement(); displayProblemDetailHeader( writer, i, failure.failedTest().toString() ); if (failure.thrownException() instanceof AssertionFailedError) { displayProblemDetail( writer, failure.thrownException().getMessage() ); } else { displayProblemDetail( writer, BaseTestRunner.getFilteredTrace( failure.thrownException() ) ); } displayProblemDetailFooter( writer ); } } }
private void displayProblems( PrintWriter writer, String kind, int count, Enumeration enumeration ) { if (count != 0) { displayProblemTitle( writer, getFormatted( count, kind ) ); Enumeration e = enumeration; for (int i = 1; e.hasMoreElements(); i++) { TestFailure failure = (TestFailure) e.nextElement(); displayProblemDetailHeader( writer, i, failure.failedTest().toString() ); if (failure.thrownException() instanceof AssertionFailedError) { displayProblemDetail( writer, failure.thrownException().getMessage() ); } else { displayProblemDetail( writer, BaseTestRunner.getFilteredTrace( failure.thrownException() ) ); } displayProblemDetailFooter( writer ); } } }