1   package org.apache.turbine.services.rundata;
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.Turbine;
25  import org.apache.turbine.TurbineConstants;
26  import org.apache.turbine.test.BaseTestCase;
27  import org.apache.turbine.util.TurbineConfig;
28  
29  public class DefaultTurbineRunDataTest extends BaseTestCase
30  {
31      private static TurbineConfig tc = null;
32      public DefaultTurbineRunDataTest(String name) throws Exception
33      {
34          super(name);
35      }
36  
37      public void testGetDefaultCharSetWithMimeType()
38      {
39          Turbine.getConfiguration().setProperty(
40              TurbineConstants.LOCALE_DEFAULT_CHARSET_KEY,
41              "");
42  		Turbine.getConfiguration().setProperty(
43  			  TurbineConstants.LOCALE_DEFAULT_COUNTRY_KEY,
44  			  "UK");
45           DefaultTurbineRunData runData =
46              new DefaultTurbineRunData();
47          assertEquals("ISO-8859-1", runData.getDefaultCharSet());
48  
49      }
50  
51      public void setUp() throws Exception
52      {
53          tc =
54              new TurbineConfig(
55                  ".",
56                  "/conf/test/TestFulcrumComponents.properties");
57          tc.initialize();
58      }
59      public void tearDown() throws Exception
60      {
61          if (tc != null)
62          {
63              tc.dispose();
64          }
65      }
66  
67  }