1 package org.apache.turbine.services.rundata;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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 }