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