1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.betwixt.strategy;
19
20 import java.text.SimpleDateFormat;
21 import java.util.Calendar;
22 import java.util.Locale;
23
24 import junit.framework.Test;
25 import junit.framework.TestSuite;
26
27
28
29
30
31
32
33 public class Testi18nObjectStringConversion extends TestObjectStringConverters
34 {
35 static {
36 Locale.setDefault(Locale.FRENCH);
37 }
38
39 public static Test suite() {
40 return new TestSuite(Testi18nObjectStringConversion.class);
41 }
42
43 public Testi18nObjectStringConversion(String testName) {
44 super(testName);
45 }
46
47 public void testFrenchDefaultLocale() throws Exception {
48
49 SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd HH:mm:sss yyyy");
50 Calendar calendar = Calendar.getInstance();
51 calendar.set(1980, 11, 9, 5, 0, 0);
52 java.util.Date date = calendar.getTime();
53 String formatted = format.format(date);
54 assertEquals("Locale dependent conversions", "mar. d\u00E9c. 09 05:00:000 1980", formatted);
55
56 }
57 }