View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2010 eviware.com 
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the 
5    *  terms of version 2.1 of the GNU Lesser General Public License as published by 
6    *  the Free Software Foundation.
7    *
8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
9    *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
10   *  See the GNU Lesser General Public License for more details at gnu.org.
11   */
12  
13  package com.eviware.soapui.model.testsuite;
14  
15  public interface TestRunner
16  {
17  
18  	/***
19  	 * Gets the current status of this TestRunner
20  	 */
21  
22  	public Status getStatus();
23  
24  	public enum Status
25  	{
26  		INITIALIZED, RUNNING, CANCELED, FINISHED, FAILED
27  	};
28  
29  	/***
30  	 * Starts running this TestRunners TestCase. If the async flag is set to
31  	 * true, this method will return directly, otherwise it will block until the
32  	 * TestCase is finished
33  	 * 
34  	 * @param async
35  	 *           flag controlling if TestCase should be run in seperate or
36  	 *           callers thread.
37  	 */
38  
39  	public void start( boolean async );
40  
41  	/***
42  	 * Returns the time taken by this runner since its last start
43  	 */
44  
45  	public long getTimeTaken();
46  
47  	/***
48  	 * Returns the time this runner was last started
49  	 */
50  
51  	public long getStartTime();
52  
53  	/***
54  	 * Blocks until this runner is finished, (returns directly if it already has
55  	 * finished)
56  	 */
57  
58  	public Status waitUntilFinished();
59  
60  	/***
61  	 * Cancels an ongoing test run with the specified reason
62  	 */
63  
64  	public void cancel( String reason );
65  
66  	/***
67  	 * Fails an ongoing test run with the specified reason
68  	 */
69  
70  	public void fail( String reason );
71  
72  	/***
73  	 * Gets the reason why a running test was canceled or failed.
74  	 */
75  
76  	public String getReason();
77  
78  	public TestRunContext getRunContext();
79  
80  	public TestRunnable getTestRunnable();
81  
82  }