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