List of usage examples for junit.framework TestFailure toString
@Override
public String toString()
From source file:org.fhcrc.cpl.toolbox.filehandler.TabLoader.java
public static void main(String[] args) throws Exception { try {//from w w w . j a v a 2s . c o m Class c = Class.forName("org.fhcrc.cpas.data.ConvertHelper"); c.getMethod("registerHelpers").invoke(null); Test test = TabLoaderTestCase.suite(); TestResult result = new TestResult(); test.run(result); System.out.println(result.wasSuccessful() ? "success" : "fail"); Enumeration failures = result.failures(); Throwable first = null; while (failures.hasMoreElements()) { TestFailure failure = (TestFailure) failures.nextElement(); System.err.println(failure.toString()); if (first == null) first = failure.thrownException(); } Enumeration errors = result.errors(); while (errors.hasMoreElements()) { TestFailure error = (TestFailure) errors.nextElement(); System.err.println(error.toString()); if (first == null) first = error.thrownException(); } if (first != null) { System.err.println("first exception"); first.printStackTrace(System.err); } } catch (Throwable t) { t.printStackTrace(System.err); } }