1 20 package org.apache.cactus.internal.client; 21 22 import java.io.PrintStream ; 23 import java.io.PrintWriter ; 24 25 import junit.framework.AssertionFailedError; 26 27 34 public class AssertionFailedErrorWrapper extends AssertionFailedError 35 { 36 40 private String stackTrace; 41 42 45 private String className; 46 47 52 public AssertionFailedErrorWrapper(String theMessage) 53 { 54 super(theMessage); 55 } 56 57 60 public AssertionFailedErrorWrapper() 61 { 62 super(); 63 } 64 65 72 public AssertionFailedErrorWrapper(String theMessage, String theClassName, 73 String theStackTrace) 74 { 75 super(theMessage); 76 this.className = theClassName; 77 this.stackTrace = theStackTrace; 78 } 79 80 85 public void printStackTrace(PrintStream thePs) 86 { 87 if (this.stackTrace == null) 88 { 89 thePs.print(getMessage()); 90 } 91 else 92 { 93 thePs.print(this.stackTrace); 94 } 95 } 96 97 102 public void printStackTrace(PrintWriter thePw) 103 { 104 if (this.stackTrace == null) 105 { 106 thePw.print(getMessage()); 107 } 108 else 109 { 110 thePw.print(this.stackTrace); 111 } 112 } 113 114 117 public String getWrappedClassName() 118 { 119 return this.className; 120 } 121 } 122 | Popular Tags |