You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by dj...@apache.org on 2015/04/12 21:59:04 UTC
svn commit: r1673049 - in
/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time:
FastDateParserTest.java FastDateParser_TimeZoneStrategyTest.java
Author: djones
Date: Sun Apr 12 19:59:04 2015
New Revision: 1673049
URL: http://svn.apache.org/r1673049
Log:
Refactored test into separate class, to avoid needless repeated execution by subclasses of the original test.
Added:
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java (with props)
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=1673049&r1=1673048&r2=1673049&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 Sun Apr 12 19:59:04 2015
@@ -21,7 +21,6 @@ import static org.junit.Assert.assertFal
import static org.junit.Assert.assertTrue;
import java.io.Serializable;
-import java.text.DateFormatSymbols;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@@ -31,7 +30,6 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
-import java.util.regex.Pattern;
import org.apache.commons.lang3.SerializationUtils;
import org.junit.Assert;
@@ -641,20 +639,4 @@ public class FastDateParserTest {
assertEquals(message+trial.three, cal.getTime(), parser.parse(dateStub+trial.three));
}
}
-
- @Test
- public void testTimeZoneStrategyPattern() {
- Pattern tz = Pattern.compile(FastDateParser.TimeZoneStrategy.TZ_DATABASE);
- Assert.assertFalse(tz.matcher("GMT-1234").matches());
-
- for (Locale locale : Locale.getAvailableLocales()) {
- final String[][] zones = DateFormatSymbols.getInstance(locale).getZoneStrings();
- for (final String[] zone : zones) {
- for (String zoneExpr : zone) {
- Assert.assertTrue(locale.getDisplayName() + ":" + zoneExpr, tz.matcher(zoneExpr).matches());
- }
- }
- }
- }
-
}
Added: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java?rev=1673049&view=auto
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java (added)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java Sun Apr 12 19:59:04 2015
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.lang3.time;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.text.DateFormatSymbols;
+import java.util.Locale;
+import java.util.regex.Pattern;
+
+import org.junit.Test;
+
+public class FastDateParser_TimeZoneStrategyTest {
+
+ @Test
+ public void testTimeZoneStrategyPattern() {
+ Pattern tz = Pattern.compile(FastDateParser.TimeZoneStrategy.TZ_DATABASE);
+ assertFalse(tz.matcher("GMT-1234").matches());
+
+ for (Locale locale : Locale.getAvailableLocales()) {
+ final String[][] zones = DateFormatSymbols.getInstance(locale).getZoneStrings();
+ for (final String[] zone : zones) {
+ for (String zoneExpr : zone) {
+ assertTrue(locale.getDisplayName() + ":" + zoneExpr, tz.matcher(zoneExpr).matches());
+ }
+ }
+ }
+ }
+}
Propchange: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParser_TimeZoneStrategyTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain