01: /*
02: * ========================================================================
03: *
04: * Copyright 2001-2003 The Apache Software Foundation.
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: *
18: * ========================================================================
19: */
20: package org.apache.cactus.sample.servlet.unit;
21:
22: import org.apache.cactus.ServletTestSuite;
23:
24: import junit.framework.Test;
25: import junit.framework.TestCase;
26:
27: /**
28: * Pure JUnit Test Case that we run on the server side using Cactus, by
29: * using a {@link ServletTestSuite}.
30: *
31: * @version $Id: TestJUnitTestCaseWrapper.java 238816 2004-02-29 16:36:46Z vmassol $
32: */
33: public class TestJUnitTestCaseWrapper extends TestCase {
34: /**
35: * Used to verify that the setUp method does get called.
36: */
37: private boolean isSetUpCalled;
38:
39: /**
40: * Used to verify that the testXXX method does get called.
41: */
42: private boolean isTestXXXCalled;
43:
44: /**
45: * Runs this pure JUnit Test Case with Cactus, wrapping it in
46: * a Servlet Test Case.
47: *
48: * @return the test suite containing all tests to run
49: */
50: public static Test suite() {
51: ServletTestSuite suite = new ServletTestSuite();
52: suite.addTestSuite(TestJUnitTestCaseWrapper.class);
53: return suite;
54: }
55:
56: //-------------------------------------------------------------------------
57:
58: /**
59: * No-op test just to verify that pure JUnit tests can be executed on the
60: * server side using Cactus.
61: */
62: public void setUp() {
63: this .isSetUpCalled = true;
64: }
65:
66: /**
67: * No-op test just to verify that pure JUnit tests can be executed on the
68: * server side using Cactus.
69: */
70: public void testXXX() {
71: assertTrue("setUp() should have been called",
72: this .isSetUpCalled);
73: this .isTestXXXCalled = true;
74: }
75:
76: /**
77: * No-op test just to verify that pure JUnit tests can be executed on the
78: * server side using Cactus.
79: */
80: public void tearDown() {
81: assertTrue("testXXX() should have been called",
82: this.isTestXXXCalled);
83: }
84:
85: }
|