1 37 package net.sourceforge.cruisecontrol.util; 38 39 import java.util.Locale ; 40 41 import junit.framework.TestCase; 42 43 47 public class DateHelperTest extends TestCase { 48 49 50 public void testCreateUsDateFormatter() { 51 String expectedPattern = "MM/dd/yyyy HH:mm:ss"; 52 String actualPattern = DateHelper.createDateFormat(Locale.US).toPattern(); 53 54 assertEquals(expectedPattern, actualPattern); 55 } 56 57 58 public void testCreateUkDateFormatter() { 59 String expectedPattern = "dd/MM/yyyy HH:mm:ss"; 60 String actualPattern = DateHelper.createDateFormat(Locale.UK).toPattern(); 61 62 assertEquals(expectedPattern, actualPattern); 63 } 64 65 66 public void testCreateOtherDateFormatter() { 67 String expectedPattern = "yyyy/MM/dd HH:mm:ss"; 68 String actualPattern = DateHelper.createDateFormat(Locale.CANADA_FRENCH).toPattern(); 69 70 assertEquals(expectedPattern, actualPattern); 71 } 72 } 73 | Popular Tags |