View Javadoc
1 package remoteTester.framework; 2 3 import junit.framework.TestResult; 4 import junit.framework.Test; 5 import junit.framework.Protectable; 6 import junit.framework.AssertionFailedError; 7 8 import java.io.Serializable; 9 10 /*** 11 * This is the server side TestResult. 12 * It can be serialized to bring execution result to client side. 13 * It let exceptions come back to the client. 14 * <p/> 15 * Created by Nicolas FRANK 16 * 17 * @mail: nicolas.frank@laposte.net 18 * <p/> 19 * Date: 24 févr. 2004 20 * Time: 20:06:27 21 */ 22 public class TestResultSerializable extends TestResult implements Serializable { 23 24 /*** 25 * the testcase execution output 26 */ 27 private String output; 28 29 /*** 30 * get the testcase execution output 31 */ 32 public String getOutput() { 33 return output; 34 } 35 36 /*** 37 * the testcase execution output 38 * 39 * @param output 40 */ 41 public void setOutput(String output) { 42 this.output = output; 43 } 44 45 /*** 46 * Runs a TestCase. 47 */ 48 public void runProtected(final Test test, Protectable p) { 49 try { 50 p.protect(); 51 } catch (AssertionFailedError e) { 52 System.out.println(e); 53 addFailure(test, e); 54 throw e; 55 } catch (ThreadDeath e) { // don't catch ThreadDeath by accident 56 throw e; 57 } catch (Throwable e) { 58 System.out.println(e); 59 addError(test, e); 60 throw new RuntimeException(e); 61 } 62 } 63 }

This page was automatically generated by Maven