01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * 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: * Gets the number of threads currently running
24: */
25:
26: public int getRunningThreadCount();
27:
28: public LoadTest getLoadTest();
29:
30: /**
31: * Cancels the loadtest with the specified reason. This should be used for "normal" cancellations,
32: * ie from a ui or some expected signal.
33: *
34: * @param reason
35: */
36:
37: public void cancel(String reason);
38:
39: /**
40: * Fails the loadtest with the specified reason. This should be used for error conditions
41: */
42:
43: public void fail(String reason);
44:
45: /**
46: * Gets the current status of this runner
47: */
48:
49: public Status getStatus();
50:
51: public enum Status {
52: INITIALIZED, RUNNING, CANCELED, FINISHED, FAILED
53: }
54:
55: /**
56: * Returns the progress of the loadtest as a value between 0 and 1. Progress is measured depending
57: * on the LoadTest limit configuration
58: */
59:
60: public float getProgress();
61:
62: /**
63: * Gets the reason why a loadtest was cancelled or failed
64: */
65:
66: public String getReason();
67:
68: /**
69: * Gets the time taken for this loadtest
70: */
71: public long getTimeTaken();
72: }
|