1   package org.apache.turbine;
2   
3   /*
4    * Copyright 2001-2005 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License")
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
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  import junit.framework.Test;
20  import junit.framework.TestSuite;
21  
22  import org.apache.turbine.Turbine;
23  import org.apache.turbine.test.BaseTestCase;
24  import org.apache.turbine.util.TurbineConfig;
25  
26  /***
27   * Can we call "destroy" unconditionally on our Turbine Servlet, even if
28   * it hasn't configured?
29   *
30   * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
31   * @version $Id: DestroyTest.java 264148 2005-08-29 14:21:04Z henning $
32   */
33  public class DestroyTest
34      extends BaseTestCase
35  {
36      private static TurbineConfig tc = null;
37  
38      public DestroyTest(String name)
39              throws Exception
40      {
41          super(name);
42          tc = new TurbineConfig(".", "/conf/test/TemplateService.properties");
43      }
44  
45      public static Test suite()
46      {
47          return new TestSuite(DestroyTest.class);
48      }
49  
50      public void testDestroy()
51          throws Exception
52      {
53          Turbine t = new Turbine();
54          t.destroy();
55      }
56  
57      public void testInitAndDestroy()
58          throws Exception
59      {
60          tc.initialize();
61          tc.dispose();
62      }
63  }