1 13 14 package org.eclipse.jdt.internal.junit.runner; 15 16 import java.io.PrintWriter ; 17 import java.io.StringWriter ; 18 19 20 public class DefaultClassifier implements IClassifiesThrowables { 21 22 private String fVersion; 23 24 public DefaultClassifier(String version) { 25 fVersion= version; 26 } 27 28 33 public String getTrace(Throwable t) { 34 StringWriter stringWriter= new StringWriter (); 35 PrintWriter writer= new PrintWriter (stringWriter); 36 t.printStackTrace(writer); 37 StringBuffer buffer= stringWriter.getBuffer(); 38 return buffer.toString(); 39 } 40 41 46 public boolean isComparisonFailure(Throwable throwable) { 47 if (! fVersion.equals("3")) return false; 49 return throwable.getClass().getName().equals("junit.framework.ComparisonFailure"); } 52 } 53 | Popular Tags |