Simplify
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1663410 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3ec99c1f0b
commit
e124486951
|
@ -107,6 +107,7 @@ public class FastDateParserSDFTest {
|
||||||
private final String input;
|
private final String input;
|
||||||
private final Locale locale;
|
private final Locale locale;
|
||||||
private final boolean valid;
|
private final boolean valid;
|
||||||
|
private final TimeZone timeZone = TimeZone.getDefault();
|
||||||
|
|
||||||
public FastDateParserSDFTest(String format, String input, Locale locale, boolean valid) {
|
public FastDateParserSDFTest(String format, String input, Locale locale, boolean valid) {
|
||||||
this.format = format;
|
this.format = format;
|
||||||
|
@ -117,30 +118,24 @@ public class FastDateParserSDFTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOriginal() throws Exception {
|
public void testOriginal() throws Exception {
|
||||||
final SimpleDateFormat sdf = new SimpleDateFormat(format, locale);
|
checkParse(input);
|
||||||
final TimeZone timeZone = TimeZone.getDefault();
|
|
||||||
final DateParser fdf = new FastDateParser(format, timeZone, locale);
|
|
||||||
checkParse(locale, sdf, fdf, input);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpperCase() throws Exception {
|
public void testUpperCase() throws Exception {
|
||||||
final SimpleDateFormat sdf = new SimpleDateFormat(format, locale);
|
checkParse(input.toUpperCase(locale));
|
||||||
final TimeZone timeZone = TimeZone.getDefault();
|
|
||||||
final DateParser fdf = new FastDateParser(format, timeZone , locale);
|
|
||||||
checkParse(locale, sdf, fdf, input.toUpperCase(locale));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore // not currently supported
|
@Ignore // not currently supported
|
||||||
public void testLowerCase() throws Exception {
|
public void testLowerCase() throws Exception {
|
||||||
final SimpleDateFormat sdf = new SimpleDateFormat(format, locale);
|
checkParse(input.toLowerCase(locale));
|
||||||
final TimeZone timeZone = TimeZone.getDefault();
|
|
||||||
final DateParser fdf = new FastDateParser(format, timeZone , locale);
|
|
||||||
checkParse(locale, sdf, fdf, input.toLowerCase(locale));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkParse(final Locale locale, final SimpleDateFormat sdf, final DateParser fdf, final String formattedDate) throws ParseException {
|
private void checkParse(final String formattedDate) throws ParseException {
|
||||||
|
final SimpleDateFormat sdf = new SimpleDateFormat(format, locale);
|
||||||
|
sdf.setTimeZone(timeZone);
|
||||||
|
final DateParser fdf = new FastDateParser(format, timeZone, locale);
|
||||||
Date expectedTime=null;
|
Date expectedTime=null;
|
||||||
Class<?> sdfE = null;
|
Class<?> sdfE = null;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue