1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.model.testsuite;
14
15 import java.util.List;
16
17 /***
18 * Runs a TestCase
19 *
20 * @author Ole.Matzura
21 */
22
23 public interface TestRunner
24 {
25 /***
26 * Gets the TestCase being run
27 *
28 * @return the TestCase being run
29 */
30
31 public TestCase getTestCase();
32
33 /***
34 * Gets the accumulated results so far; each TestStep returns a TestStepResult when running.
35 *
36 * @return the accumulated results so far
37 */
38
39 public List<TestStepResult> getResults();
40
41 /***
42 * Gets the current status of this TestRunner
43 */
44
45 public Status getStatus();
46
47 public enum Status { INITIALIZED, RUNNING, CANCELED, FINISHED, FAILED };
48
49 /***
50 * Starts running this TestRunners TestCase. If the async flag is set to true, this method will return
51 * directly, otherwise it will block until the TestCase is finished
52 *
53 * @param async flag controlling if TestCase should be run in seperate or callers thread.
54 */
55
56 public void start( boolean async );
57
58 /***
59 * Returns the time taken by this runner since its last start
60 */
61
62 public long getTimeTaken();
63
64 /***
65 * Returns the time this runner was last started
66 */
67
68 public long getStartTime();
69
70 /***
71 * Blocks until this runner is finished, (returns directly if it already has finished)
72 */
73
74 public Status waitUntilFinished();
75
76 /***
77 * Cancels an ongoing test run with the specified reason
78 */
79
80 public void cancel( String reason );
81
82 /***
83 * Fails an ongoing test run with the specified reason
84 */
85
86 public void fail( String reason );
87
88 /***
89 * Gets the reason why a running test was canceled or failed.
90 */
91
92 public String getReason();
93
94 /***
95 * Transfers execution of this TestRunner to the TestStep with the specified index in the TestCase
96 */
97
98 public void gotoStep( int index );
99
100 /***
101 * Transfers execution of this TestRunner to the TestStep with the specified name in the TestCase
102 */
103
104 public void gotoStepByName( String stepName );
105
106 /***
107 * Runs the specified TestStep and returns the result
108 */
109
110 public TestStepResult runTestStepByName( String name );
111 }