Author: sebb
Date: Mon Sep 24 17:01:47 2012
New Revision: 1389484
URL: http://svn.apache.org/viewvc?rev=1389484&view=rev
Log:
Split test into 4 so each failure can be detected
Modified:
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
Modified:
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java?rev=1389484&r1=1389483&r2=1389484&view=diff
==============================================================================
---
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
(original)
+++
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
Mon Sep 24 17:01:47 2012
@@ -179,7 +179,7 @@ public class FastDateParserTest {
}
@Test
- public void testLocales() {
+ public void testLocales_Long_AD() throws Exception {
for(Locale locale : Locale.getAvailableLocales()) {
Calendar cal= Calendar.getInstance(NEW_YORK, Locale.US);
@@ -190,23 +190,77 @@ public class FastDateParserTest {
String longFormat= "GGGG/yyyy/MMMM/dddd/aaaa/EEEE/ZZZZ";
SimpleDateFormat sdf = new SimpleDateFormat(longFormat,
locale);
DateParser fdf = getInstance(longFormat, locale);
+ checkParse(cal, sdf, fdf);
+ }
+ catch(ParseException ex) {
+ // TODO: why do ja_JP_JP, hi_IN, th_TH, and th_TH_TH fail?
+ System.out.println("Long AD Locale "+locale+ " failed\n" +
ex.toString());
+ }
+ }
+ }
+
+ @Test
+ public void testLocales_Long_BC() throws Exception {
- checkParse(cal, sdf, fdf);
+ for(Locale locale : Locale.getAvailableLocales()) {
+ Calendar cal= Calendar.getInstance(NEW_YORK, Locale.US);
+ cal.clear();
+ cal.set(2003, 1, 10);
+ cal.set(Calendar.ERA, GregorianCalendar.BC);
+
+ try {
+ String longFormat= "GGGG/yyyy/MMMM/dddd/aaaa/EEEE/ZZZZ";
+ SimpleDateFormat sdf = new SimpleDateFormat(longFormat,
locale);
+ DateParser fdf = getInstance(longFormat, locale);
+ checkParse(cal, sdf, fdf);
+ }
+ catch(ParseException ex) {
+ // TODO: why do ja_JP_JP, hi_IN, th_TH, and th_TH_TH fail?
+ System.out.println("Long BC Locale "+locale+ " failed\n" +
ex.toString());
+ }
+ }
+ }
+
+ @Test
+ public void testLocales_Short_BC() throws Exception {
- cal.set(Calendar.ERA, GregorianCalendar.BC);
- checkParse(cal, sdf, fdf);
-
+ for(Locale locale : Locale.getAvailableLocales()) {
+ Calendar cal= Calendar.getInstance(NEW_YORK, Locale.US);
+ cal.clear();
+ cal.set(2003, 1, 10);
+ cal.set(Calendar.ERA, GregorianCalendar.BC);
+
+ try {
String shortFormat= "G/y/M/d/a/E/Z";
- sdf = new SimpleDateFormat(shortFormat, locale);
- fdf = getInstance(shortFormat, locale);
- checkParse(cal, sdf, fdf);
+ SimpleDateFormat sdf = new SimpleDateFormat(shortFormat,
locale);
+ DateParser fdf = getInstance(shortFormat, locale);
+ checkParse(cal, sdf, fdf);
+ }
+ catch(ParseException ex) {
+ // TODO: why do ja_JP_JP, hi_IN, th_TH, and th_TH_TH fail?
+ System.out.println("Short BC Locale "+locale+ " failed\n" +
ex.toString());
+ }
+ }
+ }
+
+ @Test
+ public void testLocales_Short_AD() throws Exception {
- cal.set(Calendar.ERA, GregorianCalendar.AD);
- checkParse(cal, sdf, fdf);
+ for(Locale locale : Locale.getAvailableLocales()) {
+ Calendar cal= Calendar.getInstance(NEW_YORK, Locale.US);
+ cal.clear();
+ cal.set(2003, 1, 10);
+ cal.set(Calendar.ERA, GregorianCalendar.AD);
+
+ try {
+ String shortFormat= "G/y/M/d/a/E/Z";
+ SimpleDateFormat sdf = new SimpleDateFormat(shortFormat,
locale);
+ DateParser fdf = getInstance(shortFormat, locale);
+ checkParse(cal, sdf, fdf);
}
catch(ParseException ex) {
// TODO: why do ja_JP_JP, hi_IN, th_TH, and th_TH_TH fail?
- System.out.println("Locale "+locale+ " failed");
+ System.out.println("Short_AD Locale "+locale+ " failed\n" +
ex.toString());
}
}
}