sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1467483 [2/2] - in /sis/branches/JDK6: ./ sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/ sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/ sis-metadata/src/main/java/org/apache/sis/metadata/ sis-metadata/src/m...
Date Fri, 12 Apr 2013 21:45:43 GMT
Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java?rev=1467483&r1=1467482&r2=1467483&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java [UTF-8]
(original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/measure/RangeTest.java [UTF-8]
Fri Apr 12 21:45:42 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.measure;
 
+import java.util.Locale;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
@@ -306,6 +307,19 @@ public final strictfp class RangeTest ex
     }
 
     /**
+     * Tests the {@link Range#formatTo(Formatter, int, int, int)} method.
+     */
+    @Test
+    public void testFormatTo() {
+        final Range<Integer> range = new Range<Integer>(Integer.class, 10, true,
 20, false);
+        assertEquals("[10 … 20)",    String.format(Locale.CANADA, "%s", range));
+        assertEquals("[10 … 20)",    String.format(Locale.CANADA, "%4s", range));
+        assertEquals("[10 … 20)   ", String.format(Locale.CANADA, "%-12s", range));
+        assertEquals("   [10 … 20)", String.format(Locale.CANADA, "%12s", range));
+        assertEquals("[10 … 20[   ", String.format(Locale.CANADA, "%#-12s", range));
+    }
+
+    /**
      * Tests the {@link Range#equals(Object)} method.
      */
     @Test

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java?rev=1467483&r1=1467482&r2=1467483&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8]
(original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8]
Fri Apr 12 21:45:42 2013
@@ -39,8 +39,8 @@ import org.junit.runners.model.TestClass
 
 import org.apache.sis.util.ArraysExt;
 
-import static org.apache.sis.util.collection.CollectionsExt.isNullOrEmpty;
-import static org.apache.sis.util.collection.CollectionsExt.hashMapCapacity;
+import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
+import static org.apache.sis.util.collection.Containers.hashMapCapacity;
 
 
 /**

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultInternationalStringTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultInternationalStringTest.java?rev=1467483&r1=1467482&r2=1467483&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultInternationalStringTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/DefaultInternationalStringTest.java
[UTF-8] Fri Apr 12 21:45:42 2013
@@ -108,11 +108,11 @@ public final strictfp class DefaultInter
         assertEquals("English message:",     MESSAGE_en, String.format(Locale.ENGLISH, "%s",
toTest));
         assertEquals("French message:",      MESSAGE_fr, String.format(Locale.FRENCH,  "%s",
toTest));
 
-        assertEquals("  This", String.format(Locale.ROOT,    "%6.4s",  toTest));
-        assertEquals("  This", String.format(Locale.ENGLISH, "%6.4s",  toTest));
-        assertEquals(" Voici", String.format(Locale.FRENCH,  "%6.5s",  toTest));
-        assertEquals("THIS  ", String.format(Locale.ROOT,    "%-6.5S", toTest));
-        assertEquals("THIS  ", String.format(Locale.ENGLISH, "%-6.5S", toTest));
-        assertEquals("VOICI ", String.format(Locale.FRENCH,  "%-6.5S", toTest));
+        assertEquals("  Thi…", String.format(Locale.ROOT,    "%6.4s",  toTest));
+        assertEquals("  Thi…", String.format(Locale.ENGLISH, "%6.4s",  toTest));
+        assertEquals(" Voic…", String.format(Locale.FRENCH,  "%6.5s",  toTest));
+        assertEquals("THIS… ", String.format(Locale.ROOT,    "%-6.5S", toTest));
+        assertEquals("THIS… ", String.format(Locale.ENGLISH, "%-6.5S", toTest));
+        assertEquals("VOIC… ", String.format(Locale.FRENCH,  "%-6.5S", toTest));
     }
 }

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/SimpleInternationalStringTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/SimpleInternationalStringTest.java?rev=1467483&r1=1467482&r2=1467483&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/SimpleInternationalStringTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/iso/SimpleInternationalStringTest.java
[UTF-8] Fri Apr 12 21:45:42 2013
@@ -60,4 +60,17 @@ public final strictfp class SimpleIntern
         assertEquals(MESSAGE, after.toString(Locale.JAPANESE));
         validate(after);
     }
+
+    /**
+     * Tests the formatting in a {@code printf} statement.
+     */
+    @Test
+    public void testPrintf() {
+        final SimpleInternationalString toTest = new SimpleInternationalString(MESSAGE);
+        assertEquals(MESSAGE,                               String.format("%s", toTest));
+        assertEquals("    This is an unlocalized message.", String.format("%35s", toTest));
+        assertEquals("This is an unlocalized message.    ", String.format("%-35s", toTest));
+        assertEquals("This is a…",                          String.format("%1.10s", toTest));
+        assertEquals("This is a…  ",                        String.format("%-12.10s", toTest));
+    }
 }

Modified: sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/xml/MarshallerPoolTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/xml/MarshallerPoolTest.java?rev=1467483&r1=1467482&r2=1467483&view=diff
==============================================================================
--- sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/xml/MarshallerPoolTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/xml/MarshallerPoolTest.java
[UTF-8] Fri Apr 12 21:45:42 2013
@@ -57,13 +57,13 @@ public final strictfp class MarshallerPo
         /*
          * MarshallerPool should reset the properties to their initial state.
          */
-        pool.release(marshaller);
+        pool.recycle(marshaller);
         assertSame(marshaller, pool.acquireMarshaller());
         /*
          * Following should be null, but has been replaced by "" under the hood
          * for avoiding a NullPointerException in current JAXB implementation.
          */
         assertEquals("", marshaller.getProperty("com.sun.xml.bind.xmlHeaders"));
-        pool.release(marshaller);
+        pool.recycle(marshaller);
     }
 }



Mime
View raw message