    001package 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
    023import static org.junit.Assert.assertEquals;
    024
    025import org.apache.turbine.Turbine;
    026import org.apache.turbine.TurbineConstants;
    027import org.apache.turbine.test.BaseTestCase;
    028import org.apache.turbine.util.TurbineConfig;
    029import org.junit.AfterClass;
    030import org.junit.BeforeClass;
    031import org.junit.Test;
    032
    033public class DefaultTurbineRunDataTest extends BaseTestCase
    034{
    035    private static TurbineConfig tc = null;
    036
    037
    038    @Test public void testGetDefaultCharSetWithMimeType()
    039    {
    040        Turbine.getConfiguration().setProperty(
    041            TurbineConstants.LOCALE_DEFAULT_CHARSET_KEY,
    042            "");
    043                Turbine.getConfiguration().setProperty(
    044                          TurbineConstants.LOCALE_DEFAULT_COUNTRY_KEY,
    045                          "UK");
    046         DefaultTurbineRunData runData =
    047            new DefaultTurbineRunData();
    048        assertEquals("ISO-8859-1", runData.getDefaultCharSet());
    049
    050    }
    051
    052    @BeforeClass
    053    public static void setUp() throws Exception
    054    {
    055        tc =
    056            new TurbineConfig(
    057                ".",
    058                "/conf/test/TestFulcrumComponents.properties");
    059        tc.initialize();
    060    }
    061    @AfterClass
    062    public static void tearDown() throws Exception
    063    {
    064        if (tc != null)
    065        {
    066            tc.dispose();
    067        }
    068    }
    069
    070}