mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-06 01:58:24 +00:00
Merge branch 'parameterized-FastDateParser_TimeZoneStrategyTest'
This commit is contained in:
commit
3178494ca1
5
pom.xml
5
pom.xml
@ -527,6 +527,11 @@
|
|||||||
<artifactId>junit-jupiter-api</artifactId>
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-params</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter-engine</artifactId>
|
<artifactId>junit-jupiter-engine</artifactId>
|
||||||
|
@ -16,8 +16,9 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.commons.lang3.time;
|
package org.apache.commons.lang3.time;
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotEquals;
|
import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.Assert.fail;
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
|
import org.junit.jupiter.params.provider.MethodSource;
|
||||||
|
|
||||||
import java.text.DateFormatSymbols;
|
import java.text.DateFormatSymbols;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
@ -25,13 +26,14 @@
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import org.junit.Test;
|
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
|
||||||
public class FastDateParser_TimeZoneStrategyTest {
|
class FastDateParser_TimeZoneStrategyTest {
|
||||||
|
|
||||||
@Test
|
@ParameterizedTest
|
||||||
public void testTimeZoneStrategyPattern() {
|
@MethodSource("java.util.Locale#getAvailableLocales")
|
||||||
for(final Locale locale : Locale.getAvailableLocales()) {
|
void testTimeZoneStrategyPattern(final Locale locale) {
|
||||||
final FastDateParser parser = new FastDateParser("z", TimeZone.getDefault(), locale);
|
final FastDateParser parser = new FastDateParser("z", TimeZone.getDefault(), locale);
|
||||||
final String[][] zones = DateFormatSymbols.getInstance(locale).getZoneStrings();
|
final String[][] zones = DateFormatSymbols.getInstance(locale).getZoneStrings();
|
||||||
for (final String[] zone : zones) {
|
for (final String[] zone : zones) {
|
||||||
@ -54,10 +56,9 @@ public void testTimeZoneStrategyPattern() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLang1219() throws ParseException {
|
void testLang1219() throws ParseException {
|
||||||
final FastDateParser parser = new FastDateParser("dd.MM.yyyy HH:mm:ss z", TimeZone.getDefault(), Locale.GERMAN);
|
final FastDateParser parser = new FastDateParser("dd.MM.yyyy HH:mm:ss z", TimeZone.getDefault(), Locale.GERMAN);
|
||||||
|
|
||||||
final Date summer = parser.parse("26.10.2014 02:00:00 MESZ");
|
final Date summer = parser.parse("26.10.2014 02:00:00 MESZ");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user