01: /*
02: * Copyright 2006-2007, Unitils.org
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.unitils;
17:
18: import org.unitils.core.TestListener;
19: import org.unitils.core.Unitils;
20:
21: /**
22: * Empty TestNG test class. This test test-class is used in the {@link UnitilsInvocationTest} tests.
23: *
24: * @author Tim Ducheyne
25: */
26: public class UnitilsTestNGTest_EmptyTestClass extends UnitilsTestNG {
27:
28: /* Test listener that will record all invocations */
29: private static TracingTestListener tracingTestListener;
30:
31: /**
32: * Sets the tracing test listener that will record all invocations .
33: *
34: * @param testListener the listener
35: */
36: public static void setTracingTestListener(
37: TracingTestListener testListener) {
38: tracingTestListener = testListener;
39: }
40:
41: /**
42: * Overridden to install the tracing test listener.
43: *
44: * @return the unitils instance, not null
45: */
46: @Override
47: protected Unitils getUnitils() {
48: if (tracingTestListener != null) {
49: return new Unitils() {
50:
51: @Override
52: public TestListener createTestListener() {
53: return tracingTestListener;
54: }
55: };
56: }
57: return super.getUnitils();
58: }
59:
60: }
|