|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| StepEvent.java | - | 90.9% | 85.7% | 88.9% |
|
||||||||||||||
| 1 |
package abbot.script;
|
|
| 2 |
|
|
| 3 |
import abbot.Log;
|
|
| 4 |
|
|
| 5 |
public class StepEvent extends java.util.EventObject implements Cloneable { |
|
| 6 |
/** The step has begun executing. */
|
|
| 7 |
public static final String STEP_START = "step-start"; |
|
| 8 |
/** The step is N% complete. */
|
|
| 9 |
public static final String STEP_PROGRESS = "step-progress"; |
|
| 10 |
/** The step has finished. */
|
|
| 11 |
public static final String STEP_END = "step-end"; |
|
| 12 |
/** The step encountered an error. */
|
|
| 13 |
public static final String STEP_ERROR = "step-error"; |
|
| 14 |
/** The step failed. This represents a test that failed to produce the
|
|
| 15 |
expected results. */
|
|
| 16 |
public static final String STEP_FAILURE = "step-failure"; |
|
| 17 |
|
|
| 18 |
/** Multi-use field. Currently only used by STEP_PROGRESS. */
|
|
| 19 |
private int id; |
|
| 20 |
/** What type of step event (start, end, etc.) */
|
|
| 21 |
private String type;
|
|
| 22 |
/** Error or failure, if any. */
|
|
| 23 |
private Throwable throwable = null; |
|
| 24 |
|
|
| 25 | 70 |
public StepEvent(Step source, String type, int id, Throwable throwable) { |
| 26 | 70 |
super(source);
|
| 27 | 70 |
Log.debug("Source is " + source);
|
| 28 | 70 |
this.type = type;
|
| 29 | 70 |
this.id = id;
|
| 30 | 70 |
this.throwable = throwable;
|
| 31 |
} |
|
| 32 |
|
|
| 33 | 0 |
public Object clone() {
|
| 34 | 0 |
return new StepEvent((Step)getSource(), type, id, throwable); |
| 35 |
} |
|
| 36 | 68 |
public Step getStep() { return (Step)getSource(); } |
| 37 | 41 |
public String getType() { return type; } |
| 38 | 8 |
public int getID() { return id; } |
| 39 | 27 |
public String toString() {
|
| 40 | 27 |
return type + ", (step " + getStep() + ")"; |
| 41 |
} |
|
| 42 | 18 |
public Throwable getError() {
|
| 43 | 18 |
return throwable;
|
| 44 |
} |
|
| 45 |
} |
|
| 46 |
|
|
||||||||||