01: package com.clarkware.junitperf;
02:
03: import junit.framework.Test;
04:
05: /**
06: * The <code>ExampleResponseTimeUnderLoadTest</code> demonstrates
07: * how to decorate a <code>TimedTest</code> as a <code>LoadTest</code>
08: * to measure response time under load.
09: *
10: * @author <b>Mike Clark</b>
11: * @author Clarkware Consulting, Inc.
12: *
13: * @see com.clarkware.junitperf.LoadTest
14: * @see com.clarkware.junitperf.TimedTest
15: */
16:
17: public class ExampleResponseTimeUnderLoadTest {
18:
19: public static Test suite() {
20:
21: int maxUsers = 10;
22: long maxElapsedTime = 1050;
23:
24: Test testCase = new ExampleTestCase("testOneSecondResponse");
25: Test timedTest = new TimedTest(testCase, maxElapsedTime);
26: Test loadTest = new LoadTest(timedTest, maxUsers);
27:
28: return loadTest;
29: }
30:
31: public static void main(String args[]) {
32: junit.textui.TestRunner.run(suite());
33: }
34: }
|