01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.test;
05:
06: import java.io.PrintWriter;
07: import java.io.StringWriter;
08:
09: import junit.framework.Test;
10:
11: public class TestException {
12: private final Test theTest;
13: private final Throwable exception;
14:
15: public TestException(Test theTest, Throwable exception) {
16: this .theTest = theTest;
17: this .exception = exception;
18: }
19:
20: public String toString() {
21: StringWriter sw = new StringWriter();
22: PrintWriter pw = new PrintWriter(sw);
23:
24: pw.println(this .theTest + " FAILED:");
25: this.exception.printStackTrace(pw);
26:
27: pw.flush();
28: return sw.toString();
29: }
30: }
|