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