KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derbyTesting > unitTests > harness > UnitTestManager


1 /*
2
3    Derby - Class org.apache.derbyTesting.unitTests.harness.UnitTestManager
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to You under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derbyTesting.unitTests.harness;
23
24 /**
25  *
26  * The UnitTestManager provides a mechanism for
27  * registering subsystem tests and then invoking
28  * them. It can produce an output report specifying
29  * the results, the timing, and any output produced
30  * by the tests. If the run fails, the invoker of
31  * the tests should shut down the system.
32  */

33 public interface UnitTestManager
34 {
35     public static final String JavaDoc MODULE = "org.apache.derbyTesting.unitTests.harness.UnitTestManager";
36     
37     /**
38      * Debug flag to allow the cloudscape system running the tests
39      * to run forever. By default test systems are killed
40      * after an interval of T_Bomb.DEFAULT_BOMB_DELAY to avoid tests
41      * hanging.
42      */

43     public static final String JavaDoc RUN_FOREVER = "RunForever";
44
45     /**
46      * Debug flag to skip unit tests.
47      */

48     public static final String JavaDoc SKIP_UNIT_TESTS = "SkipUnitTests";
49
50     /**
51      * register an object that has the UnitTest interface,
52      * marking what type it has and its duration.
53      * Tests are run in the order they were registered.
54      * <p>
55      *
56      */

57     public void registerTest(UnitTest objectToTest, String JavaDoc testName);
58     
59
60     /**
61      * run the tests. Tests are run
62      * in the order they were registered, filtered by type
63      * and duration set for the unit test manager.
64      */

65     public boolean runTests();
66     
67
68     /**
69      * Convenience function to set the test type and duration
70      * for the UnitTestManager and then run the tests.
71      * <p>
72      * @see UnitTestConstants
73      */

74     public boolean runTests(int testType, int testDuration);
75     
76
77     /**
78      * the test duration is set. This will be used when the
79      * tests are run; no tests with duration more than
80       * specified will be run.
81      */

82     public void setTestDuration(int testDuration);
83     
84
85     /**
86      * the test duration is set. This will be used when the
87      * tests are run; no tests with duration more than
88       * specified will be run.
89      */

90     public void setTestType(int testType);
91     
92     /**
93      * specify whether performance statistics should be
94      * gathered when tests are run. The manager will collect
95      * the duration of each test, and will compare it to
96      * any previous runs it may have done of that test.
97      */

98     public void setPerformanceReportOn(boolean performanceReportOn);
99     
100 }
101
102
Popular Tags