001 package org.apache.turbine.services.rundata; 002 003 004 /* 005 * Licensed to the Apache Software Foundation (ASF) under one 006 * or more contributor license agreements. See the NOTICE file 007 * distributed with this work for additional information 008 * regarding copyright ownership. The ASF licenses this file 009 * to you under the Apache License, Version 2.0 (the 010 * "License"); you may not use this file except in compliance 011 * with the License. You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, 016 * software distributed under the License is distributed on an 017 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 018 * KIND, either express or implied. See the License for the 019 * specific language governing permissions and limitations 020 * under the License. 021 */ 022 023 024 import org.apache.turbine.Turbine; 025 import org.apache.turbine.TurbineConstants; 026 import org.apache.turbine.test.BaseTestCase; 027 import org.apache.turbine.util.TurbineConfig; 028 029 public class DefaultTurbineRunDataTest extends BaseTestCase 030 { 031 private static TurbineConfig tc = null; 032 public DefaultTurbineRunDataTest(String name) throws Exception 033 { 034 super(name); 035 } 036 037 public void testGetDefaultCharSetWithMimeType() 038 { 039 Turbine.getConfiguration().setProperty( 040 TurbineConstants.LOCALE_DEFAULT_CHARSET_KEY, 041 ""); 042 Turbine.getConfiguration().setProperty( 043 TurbineConstants.LOCALE_DEFAULT_COUNTRY_KEY, 044 "UK"); 045 DefaultTurbineRunData runData = 046 new DefaultTurbineRunData(); 047 assertEquals("ISO-8859-1", runData.getDefaultCharSet()); 048 049 } 050 051 public void setUp() throws Exception 052 { 053 tc = 054 new TurbineConfig( 055 ".", 056 "/conf/test/TestFulcrumComponents.properties"); 057 tc.initialize(); 058 } 059 public void tearDown() throws Exception 060 { 061 if (tc != null) 062 { 063 tc.dispose(); 064 } 065 } 066 067 }