View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2007 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  /***
16   * Runner for loadtests
17   * 
18   * @author Ole.Matzura
19   */
20  
21  public interface LoadTestRunner
22  {
23  	/***
24  	 * Gets the number of threads currently running
25  	 */
26  	
27  	public int getRunningThreadCount();
28  
29  	public LoadTest getLoadTest();
30  
31  	/***
32  	 * Cancels the loadtest with the specified reason. This should be used for "normal" cancellations, 
33  	 * ie from a ui or some expected signal.
34  	 * 
35  	 * @param reason
36  	 */
37  	
38  	public void cancel( String reason );
39  
40  	/***
41  	 * Fails the loadtest with the specified reason. This should be used for error conditions
42  	 */
43  	
44  	public void fail( String reason );
45  
46  	/***
47  	 * Gets the current status of this runner 
48  	 */
49  	
50  	public Status getStatus();
51  
52  	public enum Status { INITIALIZED, RUNNING, CANCELED, FINISHED, FAILED }
53  
54  	/***
55  	 * Returns the progress of the loadtest as a value between 0 and 1. Progress is measured depending
56  	 * on the LoadTest limit configuration
57  	 */
58  	
59  	public float getProgress();
60  
61  	/***
62  	 * Gets the reason why a loadtest was cancelled or failed
63  	 */
64  	
65  	public String getReason();
66  
67  	/***
68  	 * Gets the time taken for this loadtest
69  	 */
70  	public long getTimeTaken();
71  }