01: /*
02: * All content copyright (c) 2003-2006 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 org.apache.commons.lang.exception.ExceptionUtils;
07:
08: import java.util.Date;
09:
10: public class TestFailure {
11: private final long timestamp;
12: private final String message;
13: private final Thread thread;
14: private final Throwable throwable;
15:
16: public TestFailure(String message, Thread thread,
17: Throwable throwable) {
18: this .timestamp = System.currentTimeMillis();
19: this .message = message;
20: this .thread = thread;
21: this .throwable = throwable;
22: }
23:
24: public String toString() {
25: StringBuffer buf = new StringBuffer(new Date(timestamp) + " "
26: + thread + message);
27: if (this .throwable != null) {
28: buf.append(": "
29: + ExceptionUtils.getFullStackTrace(this.throwable));
30: }
31: return buf.toString();
32: }
33: }
|