Created
March 7, 2013 08:12
Revisions
-
jgraglia created this gist
Mar 7, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import org.junit.Assert; import org.junit.Test; import com.cloudseal.client.saml2.CloudsealPrincipal; /** @see CloudsealPrincipal#setDateOfBirth(String)*/ public class DateOfBirthTest { private final String DATE_OF_BIRTH = "Sat Oct 12 00:00:00 UTC 1978"; @Test public void date_of_birth_cannot_be_parsed_with_my_default_french_locale() throws ParseException { Assert.assertEquals(Locale.FRANCE, Locale.getDefault()); SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "EEE MMM dd HH:mm:ss z yyyy"); Date dob = simpleDateFormat.parse(DATE_OF_BIRTH); } @Test public void date_of_birth_must_be_parsed_as_with_en_locale() throws ParseException { SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH); Date dob = simpleDateFormat.parse(DATE_OF_BIRTH); } }