1
package com.clarkware.junitperf;
3
import junit.framework.Test;
4
import junit.framework.TestSuite;
7
* The <code>ExampleTimedTest</code> demonstrates how to decorate a
8
* <code>Test</code> as a <code>TimedTest</code>.
10
* @author <a href="mailto:mike@clarkware.com">Mike Clark</a>
11
* @author <a href="http://www.clarkware.com">Clarkware Consulting, Inc.</a>
13
* @see com.clarkware.junitperf.TimedTest
16
public class ExampleTimedTest {
18
public static final long toleranceInMillis = 100;
20
public static Test suite() {
22
long maxElapsedTimeInMillis = 1000 + toleranceInMillis;
24
Test testCase = new ExampleTestCase("testOneSecondResponse");
25
Test timedTest = new TimedTest(testCase, maxElapsedTimeInMillis);
27
TestSuite suite = new TestSuite();
28
suite.addTest(timedTest);
33
public static void main(String args[]) {
34
junit.textui.TestRunner.run(suite());