1 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 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 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 } | Popular Tags |