1 4 package com.tc.test; 5 6 import org.apache.commons.lang.exception.ExceptionUtils; 7 8 import java.util.Date ; 9 10 11 public class TestFailure { 12 private final long timestamp; 13 private final String message; 14 private final Thread thread; 15 private final Throwable throwable; 16 17 public TestFailure(String message, Thread thread, 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) + " " + thread + message ); 26 if (this.throwable != null) { 27 buf.append(": " + ExceptionUtils.getFullStackTrace(this.throwable)); 28 } 29 return buf.toString(); 30 } 31 } | Popular Tags |