1 package org.apache.turbine.services.mimetype;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.Locale;
23
24 import org.apache.fulcrum.mimetype.MimeTypeService;
25 import org.apache.turbine.services.ServiceManager;
26 import org.apache.turbine.services.TurbineServices;
27 import org.apache.turbine.test.BaseTestCase;
28 import org.apache.turbine.util.TurbineConfig;
29
30
31
32
33
34
35
36
37 public class FulcrumMimetypeComponentTest extends BaseTestCase
38 {
39 private static TurbineConfig tc = null;
40 public FulcrumMimetypeComponentTest(String name) throws Exception
41 {
42 super(name);
43 }
44 public void testComponent() throws Exception
45 {
46 ServiceManager serviceManager = TurbineServices.getInstance();
47 MimeTypeService mimeTypeService = (MimeTypeService) serviceManager.getService(MimeTypeService.class.getName());
48
49 Locale locale = new Locale("en", "US");
50 String s = mimeTypeService.getCharSet(locale);
51 assertEquals("ISO-8859-1", s);
52 }
53
54 public void setUp() throws Exception
55 {
56 tc =
57 new TurbineConfig(
58 ".",
59 "/conf/test/TestFulcrumComponents.properties");
60 tc.initialize();
61 }
62 public void tearDown() throws Exception
63 {
64 if (tc != null)
65 {
66 tc.dispose();
67 }
68 }
69 }