View Javadoc

    1   package org.apache.turbine;
    2
    3
    4   /*
    5    * Licensed to the Apache Software Foundation (ASF) under one
    6    * or more contributor license agreements.  See the NOTICE file
    7    * distributed with this work for additional information
    8    * regarding copyright ownership.  The ASF licenses this file
    9    * to you under the Apache License, Version 2.0 (the
    10   * "License"); you may not use this file except in compliance
    11   * with the License.  You may obtain a copy of the License at
    12   *
    13   *   http://www.apache.org/licenses/LICENSE-2.0
    14   *
    15   * Unless required by applicable law or agreed to in writing,
    16   * software distributed under the License is distributed on an
    17   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    18   * KIND, either express or implied.  See the License for the
    19   * specific language governing permissions and limitations
    20   * under the License.
    21   */
    22
    23
    24  import org.apache.turbine.test.BaseTestCase;
    25  import org.apache.turbine.util.TurbineConfig;
    26  import org.junit.AfterClass;
    27  import org.junit.BeforeClass;
    28  import org.junit.Test;
    29
    30  /**
    31   * Can we call "destroy" unconditionally on our Turbine Servlet, even if
    32   * it hasn't configured?
    33   *
    34   * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
    35   * @version $Id: DestroyTest.java 1812628 2017-10-19 12:34:25Z gk $
    36   */
    37  public class DestroyTest
    38      extends BaseTestCase
    39  {
    40      private static TurbineConfig tc = null;
    41
    42
    43      @BeforeClass
    44      public static void init() throws Exception {
    45          tc = new TurbineConfig(".", "/conf/test/TemplateService.properties");
    46      }
    47      @Test
    48      public void testDestroy()
    49          throws Exception
    50      {
    51          Turbine t = new Turbine();
    52          t.destroy();
    53      }
    54      @Test
    55      public void testInitAndDestroy()
    56          throws Exception
    57      {
    58          tc.initialize();
    59          tc.dispose();
    60      }
    61
    62      @AfterClass
    63      public static void destroy()
    64          throws Exception
    65      {
    66          // should be already dispoesd
    67          //tc.dispose();
    68      }
    69  }