commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject [lang] ExtendedMessageFormatTest: remove code for java versions below 1.4
Date Sun, 18 Dec 2016 16:49:45 GMT
Repository: commons-lang
Updated Branches:
  refs/heads/master cc2d70e2e -> c63653983


ExtendedMessageFormatTest: remove code for java versions below 1.4


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/c6365398
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/c6365398
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/c6365398

Branch: refs/heads/master
Commit: c636539836ecb541d9ef71f2d347772cf9f6bc52
Parents: cc2d70e
Author: pascalschumacher <pascalschumacher@gmx.net>
Authored: Sun Dec 18 17:49:27 2016 +0100
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Sun Dec 18 17:49:27 2016 +0100

----------------------------------------------------------------------
 .../lang3/text/ExtendedMessageFormatTest.java       | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/c6365398/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java b/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
index 13a7e79..6a717a3 100644
--- a/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
+++ b/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
@@ -19,7 +19,6 @@ package org.apache.commons.lang3.text;
 import org.junit.Test;
 import org.junit.Before;
 import static org.junit.Assert.*;
-import static org.apache.commons.lang3.JavaVersion.JAVA_1_4;
 
 import java.text.DateFormat;
 import java.text.FieldPosition;
@@ -35,8 +34,6 @@ import java.util.HashSet;
 import java.util.Locale;
 import java.util.Map;
 
-import org.apache.commons.lang3.SystemUtils;
-
 /**
  * Test case for {@link ExtendedMessageFormat}.
  *
@@ -59,7 +56,7 @@ public class ExtendedMessageFormatTest {
     public void testExtendedFormats() {
         final String pattern = "Lower: {0,lower} Upper: {1,upper}";
         final ExtendedMessageFormat emf = new ExtendedMessageFormat(pattern, registry);
-        assertPatternsEqual("TOPATTERN", pattern, emf.toPattern());
+        assertEquals("TOPATTERN", pattern, emf.toPattern());
         assertEquals("Lower: foo Upper: BAR", emf.format(new Object[] {"foo", "bar"}));
         assertEquals("Lower: foo Upper: BAR", emf.format(new Object[] {"Foo", "Bar"}));
         assertEquals("Lower: foo Upper: BAR", emf.format(new Object[] {"FOO", "BAR"}));
@@ -142,7 +139,7 @@ public class ExtendedMessageFormatTest {
             expected.append(df.format(args[1]));
             expected.append(" Salary: ");
             expected.append(nf.format(args[2]));
-            assertPatternsEqual("pattern comparison for locale " + locale, expectedPattern,
emf.toPattern());
+            assertEquals("pattern comparison for locale " + locale, expectedPattern, emf.toPattern());
             assertEquals(String.valueOf(locale), expected.toString(), emf.format(args));
         }
     }
@@ -377,14 +374,7 @@ public class ExtendedMessageFormatTest {
             emf = new ExtendedMessageFormat(pattern, locale);
         }
         assertEquals("format "    + buffer.toString(), mf.format(args), emf.format(args));
-        assertPatternsEqual("toPattern " + buffer.toString(), mf.toPattern(),  emf.toPattern());
-    }
-
-    //can't trust what MessageFormat does with toPattern() pre 1.4:
-    private void assertPatternsEqual(final String message, final String expected, final String
actual) {
-        if (SystemUtils.isJavaVersionAtLeast(JAVA_1_4)) {
-            assertEquals(message, expected, actual);
-        }
+        assertEquals("toPattern " + buffer.toString(), mf.toPattern(), emf.toPattern());
     }
 
     /**


Mime
View raw message