01: package org.testng;
02:
03: import java.io.Serializable;
04:
05: /**
06: * This class describes the result of a test.
07: *
08: * @author Cedric Beust, May 2, 2004
09: * @since May 2, 2004
10: * @version $Revision: 149 $, $Date: 2006-09-22 16:20:00 -0700 (Fri, 22 Sep 2006) $
11: *
12: */
13: public interface ITestResult extends Serializable {
14:
15: //
16: // Test status
17: //
18: public static final int SUCCESS = 1;
19: public static final int FAILURE = 2;
20: public static final int SKIP = 3;
21: public static final int SUCCESS_PERCENTAGE_FAILURE = 4;
22: public static final int STARTED = 16;
23:
24: /**
25: * @return The status of this result, using one of the constants
26: * above.
27: */
28: public int getStatus();
29:
30: public void setStatus(int status);
31:
32: /**
33: * @return The test method this result represents.
34: */
35: public ITestNGMethod getMethod();
36:
37: /**
38: * @return The parameters this method was invoked with.
39: */
40: public Object[] getParameters();
41:
42: public void setParameters(Object[] parameters);
43:
44: /**
45: * @return The test class used this object is a result for.
46: */
47: public IClass getTestClass();
48:
49: /**
50: * @return The throwable that was thrown while running the
51: * method, or null if no exception was thrown.
52: */
53: public Throwable getThrowable();
54:
55: public void setThrowable(Throwable throwable);
56:
57: /**
58: * @return the start date for this test, in milliseconds.
59: */
60: public long getStartMillis();
61:
62: /**
63: * @return the end date for this test, in milliseconds.
64: */
65: public long getEndMillis();
66:
67: public void setEndMillis(long millis);
68:
69: /**
70: * @return The name of this TestResult, typically identical to the name
71: * of the method.
72: */
73: public String getName();
74:
75: /**
76: * @return true if if this test run is a SUCCESS
77: */
78: public boolean isSuccess();
79:
80: /**
81: * @return The host where this suite was run, or null if it was run locally. The
82: * returned string has the form: host:port
83: */
84: public String getHost();
85:
86: }
|