01: package com.clarkware.junitperf;
02:
03: import junit.framework.Test;
04:
05: /**
06: * The <code>ExampleThroughputUnderLoadTest</code> demonstrates how to
07: * decorate a <code>LoadTest</code> as a <code>TimedTest</code>
08: * to measure throughput 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 ExampleThroughputUnderLoadTest {
18:
19: public static Test suite() {
20:
21: int maxUsers = 10;
22: long maxElapsedTime = 1500;
23:
24: Test testCase = new ExampleTestCase("testOneSecondResponse");
25: Test loadTest = new LoadTest(testCase, maxUsers);
26: Test timedTest = new TimedTest(loadTest, maxElapsedTime);
27:
28: return timedTest;
29: }
30:
31: public static void main(String args[]) {
32: junit.textui.TestRunner.run(suite());
33: }
34: }
|