sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1480602 [14/15] - in /sis/branches/Android: ./ ide-project/ ide-project/NetBeans/ ide-project/NetBeans/nbproject/ ide-project/eclipse/ sis-app/src/main/java/org/apache/sis/cli/ sis-build-helper/ sis-build-helper/src/main/java/org/apache/si...
Date Thu, 09 May 2013 12:24:20 GMT
Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/measure/AngleTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/measure/FormattedCharacterIteratorTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/Assert.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/Assert.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/Assert.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/Assert.java [UTF-8] Thu May  9 12:24:13 2013
@@ -35,7 +35,7 @@ import org.apache.sis.util.CharSequences
 import org.apache.sis.util.ComparisonMode;
 
 // Related to JDK7
-import org.apache.sis.internal.util.Objects;
+import org.apache.sis.internal.jdk7.Objects;
 
 
 /**

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/Assert.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/DependsOn.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/DependsOnMethod.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestCase.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestCase.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestCase.java [UTF-8] Thu May  9 12:24:13 2013
@@ -24,10 +24,7 @@ import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.io.OutputStreamWriter;
 import java.io.UnsupportedEncodingException;
-
 import org.apache.sis.util.logging.Logging;
-
-import org.junit.After;
 import org.junit.runner.RunWith;
 
 import static org.apache.sis.test.TestConfiguration.VERBOSE_OUTPUT_KEY;
@@ -37,27 +34,20 @@ import static org.apache.sis.test.TestCo
 /**
  * Base class of Apache SIS tests (except the ones that extend GeoAPI tests).
  * This base class provides an {@link #out} field that sub-classes can use
- * <strong>if non-null</strong> for printing debugging information. This {@code out}
- * field shall be used instead of {@link System#out} for the following reasons:
+ * for printing debugging information. This {@code out} field shall be used
+ * instead of {@link System#out} for the following reasons:
  *
  * <ul>
- *   <li>It is {@code null} by default and enabled only if a system property is set as
- *     described in the {@linkplain org.apache.sis.test package javadoc}. This allows more
- *     quiet (and sometime faster) Maven executions for those who are not SIS developers.</li>
- *   <li>The outputs are collected and printed only after each test completion.
+ *   <li>By default, the contents sent to {@code out} are ignored for successful tests
+ *     and printed only when a test fail. This avoid polluting the console output during
+ *     successful Maven builds, and print only the information related to failed tests.</li>
+ *   <li>Printing information for all tests can be enabled if a system property is set as
+ *     described in the {@linkplain org.apache.sis.test package javadoc}.</li>
+ *   <li>The outputs are collected and printed only after test completion.
  *     This avoid the problem of logging messages interleaved with the output.
  *     If such interleaving is really wanted, then use the logging framework instead.</li>
  * </ul>
  *
- * Usage example:
- *
- * {@preformat java
- *     if (out != null) {
- *         // Performs here some potentially costly calculation to be printed.
- *         out.println("Write here some information of particular interest.");
- *     }
- * }
- *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.16)
  * @version 0.3
@@ -82,32 +72,34 @@ public abstract strictfp class TestCase 
     public static final boolean PENDING_NEXT_GEOAPI_RELEASE = false;
 
     /**
-     * If non-null, the output writer where to print debugging information.
-     * This field is non-null if the {@value org.apache.sis.test.TestConfiguration#VERBOSE_OUTPUT_KEY}
-     * system property is set to {@code true}. This writer will use the system default encoding, unless
-     * the {@value org.apache.sis.test.TestConfiguration#OUTPUT_ENCODING_KEY} system property has been
-     * set to a different value.
+     * The output writer where to print debugging information (never {@code null}).
+     * Texts sent to this printer will be show only if the test fails, or if the
+     * {@value org.apache.sis.test.TestConfiguration#VERBOSE_OUTPUT_KEY} system property
+     * is set to {@code true}. This writer will use the system default encoding, unless
+     * the {@value org.apache.sis.test.TestConfiguration#OUTPUT_ENCODING_KEY} system
+     * property has been set to a different value.
      *
      * @see org.apache.sis.test
-     * @see #flushVerboseOutput()
      */
     public static final PrintWriter out;
 
     /**
-     * The buffer which is backing the {@linkplain #out} stream, or {@code null} if none.
+     * The buffer which is backing the {@linkplain #out} stream.
      */
     private static final StringWriter buffer;
 
     /**
+     * {@code true} if the {@value org.apache.sis.test.TestConfiguration#VERBOSE_OUTPUT_KEY}
+     * system property is set to {@code true}.
+     */
+    public static final boolean verbose;
+
+    /**
      * Sets the {@link #out} writer and its underlying {@link #buffer}.
      */
     static {
-        if (Boolean.getBoolean(VERBOSE_OUTPUT_KEY)) {
-            out = new PrintWriter(buffer = new StringWriter());
-        } else {
-            buffer = null;
-            out = null;
-        }
+        verbose = Boolean.getBoolean(VERBOSE_OUTPUT_KEY);
+        out = new PrintWriter(buffer = new StringWriter());
     }
 
     /**
@@ -144,21 +136,29 @@ public abstract strictfp class TestCase 
     }
 
     /**
-     * If verbose output is enabled, flushes the {@link #out} stream after each test.
-     * The stream will be flushed to the {@linkplain System#console() console} if
-     * available, or to the {@linkplain System#out standard output stream} otherwise.
+     * Invoked by {@link TestRunner} in order to clear the buffer before a new test begin.
+     * This is necessary when the previous test succeeded and the {@link #verbose} flag is
+     * {@code false}, since the {@link #flushOutput()} method has not been invoked in such
+     * case.
+     */
+    static void clearBuffer() {
+        synchronized (buffer) { // This is the lock used by the 'out' PrintWriter.
+            out.flush();
+            buffer.getBuffer().setLength(0);
+        }
+    }
+
+    /**
+     * Invoked by {@link TestRunner} in order to flush the {@link #out} stream.
+     * The stream content will be flushed to the {@linkplain System#console() console}
+     * if available, or to the {@linkplain System#out standard output stream} otherwise.
+     * This method clears the stream buffer.
      *
-     * <p>This method is invoked automatically by JUnit and doesn't need to be invoked
-     * explicitely, unless the developer wants to flush the output at some specific
-     * point.</p>
+     * @param success {@code true} if this method is invoked on build success,
      */
-    @After
-    public void flushVerboseOutput() {
+    static void flushOutput() {
         System.out.flush();
         System.err.flush();
-        if (out == null) {
-            return;
-        }
         synchronized (buffer) { // This is the lock used by the 'out' PrintWriter.
             out.flush();
             /*

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestCase.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestConfiguration.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestConfiguration.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestConfiguration.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestConfiguration.java [UTF-8] Thu May  9 12:24:13 2013
@@ -31,7 +31,7 @@ public final strictfp class TestConfigur
     /**
      * The {@value} system property for enabling verbose outputs.
      * If this {@linkplain System#getProperties() system property} is set to {@code true},
-     * then the {@link TestCase#out} field will be set to a non-null value.
+     * then the content sent to the {@link TestCase#out} field will be printed after each test.
      */
     public static final String VERBOSE_OUTPUT_KEY = "org.apache.sis.test.verbose";
 

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestConfiguration.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8] Thu May  9 12:24:13 2013
@@ -37,9 +37,10 @@ import org.junit.runners.model.Initializ
 import org.junit.runners.model.Statement;
 import org.junit.runners.model.TestClass;
 
-import static org.apache.sis.util.Arrays.resize;
-import static org.apache.sis.util.collection.Collections.isNullOrEmpty;
-import static org.apache.sis.util.collection.Collections.hashMapCapacity;
+import org.apache.sis.util.ArraysExt;
+
+import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
+import static org.apache.sis.util.collection.Containers.hashMapCapacity;
 
 
 /**
@@ -92,16 +93,49 @@ public final class TestRunner extends Bl
      * The listener to use for keeping trace of methods that failed.
      */
     final RunListener listener = new RunListener() {
+        /**
+         * Clears the buffer if it was not already done by {@link #testFinished(Description)}.
+         */
+        @Override
+        public void testStarted(final Description description) {
+            if (!TestCase.verbose) {
+                TestCase.clearBuffer();
+            }
+        }
+
+        /**
+         * Prints output only in verbose mode.
+         * Otherwise silently discard the output.
+         */
+        @Override
+        public void testFinished(final Description description) {
+            if (TestCase.verbose) {
+                TestCase.flushOutput();
+            }
+        }
+
+        /**
+         * Remember that a test failed, and prints output if it was not already done
+         */
         @Override
         public void testFailure(final Failure failure) {
             addDependencyFailure(failure.getDescription().getMethodName());
+            if (!TestCase.verbose) {
+                TestCase.flushOutput();
+            }
         }
 
+        /**
+         * Silently record skipped test as if it failed, without printing the output.
+         */
         @Override
         public void testAssumptionFailure(final Failure failure) {
             addDependencyFailure(failure.getDescription().getMethodName());
         }
 
+        /**
+         * Silently record ignored test as if it failed, without printing the output.
+         */
         @Override
         public void testIgnored(final Description description) {
             addDependencyFailure(description.getMethodName());
@@ -109,13 +143,13 @@ public final class TestRunner extends Bl
     };
 
     /**
-     * Creates a {@code Corollaries} to run {@code klass}.
+     * Creates a new test runner for the given class.
      *
-     * @param  klass The class to run.
+     * @param  testClass The class to run.
      * @throws InitializationError If the test class is malformed.
      */
-    public TestRunner(final Class<?> klass) throws InitializationError {
-        super(klass);
+    public TestRunner(final Class<?> testClass) throws InitializationError {
+        super(testClass);
     }
 
     /**
@@ -247,12 +281,12 @@ public final class TestRunner extends Bl
         if (count == 0) {
             throw new NoTestsRemainException();
         }
-        filteredChildren = resize(children, count);
+        filteredChildren = ArraysExt.resize(children, count);
     }
 
     /**
      * Returns the {@link Statement} which will execute all the tests in the class given
-     * to the constructor.
+     * to the {@linkplain #TestRunner(Class) constructor}.
      *
      * @param  notifier The object to notify about test results.
      * @return The statement to execute for running the tests.

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestStep.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java [UTF-8] Thu May  9 12:24:13 2013
@@ -16,9 +16,13 @@
  */
 package org.apache.sis.test;
 
+import java.util.Map;
+import java.util.IdentityHashMap;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
+import static org.junit.Assert.*;
+
 
 /**
  * Base class of Apache SIS test suites (except the ones that extend GeoAPI suites).
@@ -35,4 +39,47 @@ public abstract strictfp class TestSuite
      */
     protected TestSuite() {
     }
+
+    /**
+     * Verifies the list of tests before the suite is run.
+     * This method verifies the following conditions:
+     *
+     * <ul>
+     *   <li>Every class shall extend either the SIS {@link TestCase} or the GeoAPI {@link org.opengis.test.TestCase}.</li>
+     *   <li>No class shall be declared twice.</li>
+     *   <li>If a test depends on another test, then the other test shall be before the dependant test.</li>
+     * </ul>
+     *
+     * Subclasses shall invoke this method as below:
+     *
+     * {@preformat java
+     *    &#64;BeforeClass
+     *    public static void verifyTestList() {
+     *        verifyTestList(MetadataTestSuite.class);
+     *    }
+     * }
+     *
+     * @param suite The suite for which to verify order.
+     */
+    protected static void verifyTestList(final Class<? extends TestSuite> suite) {
+        final Class<?>[] testCases = suite.getAnnotation(Suite.SuiteClasses.class).value();
+        final Map<Class<?>,Boolean> done = new IdentityHashMap<Class<?>,Boolean>(testCases.length);
+        for (final Class<?> testCase : testCases) {
+            if (!TestCase.class.isAssignableFrom(testCase) && !org.opengis.test.TestCase.class.isAssignableFrom(testCase)) {
+                fail("Class " + testCase.getCanonicalName() + " does not extends TestCase.");
+            }
+            final DependsOn dependencies = testCase.getAnnotation(DependsOn.class);
+            if (dependencies != null) {
+                for (final Class<?> dependency : dependencies.value()) {
+                    if (!done.containsKey(dependency)) {
+                        fail("Class " + testCase.getCanonicalName() + " depends on " + dependency.getCanonicalName()
+                                + ", but the dependency has not been found before the test.");
+                    }
+                }
+            }
+            if (done.put(testCase, Boolean.TRUE) != null) {
+                fail("Class " + testCase.getCanonicalName() + " is declared twice.");
+            }
+        }
+    }
 }

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java [UTF-8] Thu May  9 12:24:13 2013
@@ -20,6 +20,7 @@ import java.util.Date;
 import java.util.Locale;
 import java.util.TimeZone;
 import java.util.Iterator;
+import java.util.Random;
 import java.util.concurrent.Callable;
 import java.io.PrintWriter;
 import java.lang.reflect.UndeclaredThrowableException;
@@ -79,34 +80,36 @@ public final strictfp class TestUtilitie
     }
 
     /**
-     * Prints the given title to {@link TestCase#out} in a box. This method is invoked for
-     * writing a clear visual separator between the verbose output of different test cases.
+     * If verbose output are enabled, prints the given title to {@link TestCase#out} in a box.
+     * This method is invoked for writing a clear visual separator between the verbose output
+     * of different test cases. This method does nothing if verbose output is not enabled,
+     * because only the output of failed tests should be printed in such case.
      *
      * @param title The title to write.
      */
     public static void printSeparator(final String title) {
-        final PrintWriter out = TestCase.out;
-        if (out != null) {
+        if (TestCase.verbose) {
+            final PrintWriter out = TestCase.out;
             final boolean isAnsiSupported = X364.isAnsiSupported();
             if (isAnsiSupported) {
                 out.print(X364.FOREGROUND_CYAN.sequence());
             }
-            out.print('╒');
+            out.print('╒');
             for (int i=0; i<SEPARATOR_WIDTH-2; i++) {
-                out.print('═');
+                out.print('═');
             }
-            out.println('╕');
-            out.print("│ ");
+            out.println('╕');
+            out.print("│ ");
             out.print(title);
             for (int i=title.codePointCount(0, title.length()); i<SEPARATOR_WIDTH-3; i++) {
                 out.print(' ');
             }
-            out.println('│');
-            out.print('└');
+            out.println('│');
+            out.print('└');
             for (int i=0; i<SEPARATOR_WIDTH-2; i++) {
-                out.print('─');
+                out.print('─');
             }
-            out.println('┘');
+            out.println('┘');
             if (isAnsiSupported) {
                 out.print(X364.FOREGROUND_DEFAULT.sequence());
             }
@@ -114,6 +117,38 @@ public final strictfp class TestUtilitie
     }
 
     /**
+     * Returns a new random number generator with a random seed. This method logs the seed value
+     * to the {@link TestCase#out} stream, in order to allow reproducing a test in case of failure.
+     *
+     * <p>This method doesn't need to be used in every cases. For example test cases using
+     * {@link Random#nextGaussian()} should create their own random numbers generator with
+     * the {@link Random#Random(long)} constructor instead
+     * (see {@link org.apache.sis.math.StatisticsTest} for more explanation).
+     * Or test cases that are mostly insensitive to the exact sequence of numbers
+     * can use the {@link Random#Random()} constructor instead.</p>
+     *
+     * <p>This method is rather for testing relatively complex code which are likely to behave
+     * differently depending on the exact sequence of numbers. We want to use random sequence
+     * of numbers in order to test the code in a wider range of scenarios. However in case of
+     * test failure, we need to know the <cite>seed</cite> which has been used in order to allow
+     * the developer to reproduce the test with the exact same sequence of numbers.
+     * Using this method, the seed can be retrieved in the messages sent to the output stream.</p>
+     *
+     * @param  testMethod The name of the method which need a random number generator.
+     * @return A new random number generator initialized with a random seed.
+     */
+    public static Random createRandomNumberGenerator(final String testMethod) {
+        final long seed = Math.round(Math.random() * (1L << 48));
+        final PrintWriter out = TestCase.out;
+        out.print("Random number generator for ");
+        out.print(testMethod);
+        out.print(" created with seed ");
+        out.print(seed);
+        out.println('.');
+        return new Random(seed);
+    }
+
+    /**
      * Parses the date for the given string using the {@code "yyyy-MM-dd HH:mm:ss"} pattern
      * in UTC timezone.
      *
@@ -165,6 +200,20 @@ public final strictfp class TestUtilitie
     }
 
     /**
+     * Returns the single element from the given array. If the given array is null or
+     * does not contains exactly one element, then an {@link AssertionError} is thrown.
+     *
+     * @param  <E> The type of array elements.
+     * @param  array The array from which to get the singleton.
+     * @return The singleton element from the array.
+     */
+    public static <E> E getSingleton(final E[] array) {
+        assertNotNull("Null array.", array);
+        assertEquals("Not a singleton array.", 1, array.length);
+        return array[0];
+    }
+
+    /**
      * Returns the single element from the given collection. If the given collection is null
      * or does not contains exactly one element, then an {@link AssertionError} is thrown.
      *

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/TestUtilities.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java [UTF-8] Thu May  9 12:24:13 2013
@@ -50,7 +50,7 @@ import static org.apache.sis.util.Charac
 import static org.apache.sis.util.CharSequences.trimWhitespaces;
 
 // Related to JDK7
-import org.apache.sis.internal.util.JDK7;
+import org.apache.sis.internal.jdk7.JDK7;
 
 
 /**
@@ -601,14 +601,14 @@ public strictfp class XMLComparator {
             node = node.getParentNode();
         }
         if (hierarchy.equals(expected)) {
-            buffer.append("└─Same as expected").append(lineSeparator);
+            buffer.append("└─Same as expected").append(lineSeparator);
         } else {
             int indent = 2;
             for (int i=hierarchy.size(); --i>=0;) {
                 for (int j=indent; --j>=0;) {
                     buffer.append(NO_BREAK_SPACE);
                 }
-                buffer.append("└─").append(hierarchy.get(i)).append(lineSeparator);
+                buffer.append("└─").append(hierarchy.get(i)).append(lineSeparator);
                 indent += 4;
             }
         }

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/foreigner/SerializableTableColumn.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/foreigner/package-info.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/package-info.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/package-info.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/package-info.java [UTF-8] Thu May  9 12:24:13 2013
@@ -17,7 +17,7 @@
 
 /**
  * Tools for SIS tests. This package defines a base class, {@link org.apache.sis.test.TestCase},
- * which is extended directly or indirectly by many (but not all) SIS tests.
+ * which is extended directly or indirectly by most (but not all) SIS tests.
  * This package defines also an {@link org.apache.sis.test.Assert} class which extend the GeoAPI
  * {@link org.opengis.test.Assert} (which itself extends the JUnit {@link org.junit.Assert} class)
  * with the addition of assertion methods commonly used in SIS tests.

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/package-info.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] Thu May  9 12:24:13 2013
@@ -18,6 +18,7 @@ package org.apache.sis.test.suite;
 
 import org.apache.sis.test.TestSuite;
 import org.junit.runners.Suite;
+import org.junit.BeforeClass;
 
 
 /**
@@ -34,14 +35,16 @@ import org.junit.runners.Suite;
     org.apache.sis.internal.test.XMLComparatorTest.class,
 
     // Most basic functions of SIS library.
-    org.apache.sis.util.ArraysTest.class,
+    org.apache.sis.util.ArraysExtTest.class,
     org.apache.sis.util.CharactersTest.class,
     org.apache.sis.util.CharSequencesTest.class,
     org.apache.sis.util.StringBuildersTest.class,
     org.apache.sis.util.UtilitiesTest.class,
+    org.apache.sis.util.NumbersTest.class,
     org.apache.sis.util.ClassesTest.class,
     org.apache.sis.util.VersionTest.class,
     org.apache.sis.util.LocalesTest.class,
+    org.apache.sis.util.resources.LoaderTest.class,
     org.apache.sis.util.resources.IndexedResourceBundleTest.class,
     org.apache.sis.util.logging.PerformanceLevelTest.class,
     org.apache.sis.math.MathFunctionsTest.class,
@@ -58,6 +61,7 @@ import org.junit.runners.Suite;
     org.apache.sis.util.collection.TableColumnTest.class,
     org.apache.sis.util.collection.DefaultTreeTableTest.class,
     org.apache.sis.util.collection.TreeTablesTest.class,
+    org.apache.sis.util.collection.CodeListSetTest.class,
 
     // GeoAPI most basic types.
     org.apache.sis.util.iso.TypesTest.class,
@@ -69,7 +73,12 @@ import org.junit.runners.Suite;
 
     // Measurements and formatting.
     org.apache.sis.measure.UnitsTest.class,
+    org.apache.sis.measure.RangeTest.class,
+    org.apache.sis.measure.DateRangeTest.class,
+    org.apache.sis.measure.NumberRangeTest.class,
+    org.apache.sis.measure.MeasurementRangeTest.class,
     org.apache.sis.measure.FormattedCharacterIteratorTest.class,
+    org.apache.sis.measure.RangeFormatTest.class,
     org.apache.sis.measure.AngleFormatTest.class,
     org.apache.sis.measure.AngleTest.class,
     org.apache.sis.internal.util.X364Test.class,
@@ -80,12 +89,32 @@ import org.junit.runners.Suite;
     org.apache.sis.io.WordWrapWithLineSeparatorTest.class,
     org.apache.sis.io.TableAppenderTest.class,
     org.apache.sis.util.collection.TreeTableFormatTest.class,
+    org.apache.sis.util.collection.RangeSetTest.class,
+
+    // Converters
+    org.apache.sis.internal.converter.AngleConverterTest.class,
+    org.apache.sis.internal.converter.StringConverterTest.class,
+    org.apache.sis.internal.converter.PathConverterTest.class,
+    org.apache.sis.internal.converter.FallbackConverterTest.class,
+    org.apache.sis.internal.converter.ConverterRegistryTest.class,
+    org.apache.sis.internal.converter.SystemRegistryTest.class,
+    org.apache.sis.internal.converter.NumberConverterTest.class, // Shall be after SystemRegistryTest.
 
     // XML most basic types.
     org.apache.sis.xml.XLinkTest.class,
     org.apache.sis.xml.NilReasonTest.class,
+    org.apache.sis.xml.OGCNamespacePrefixMapperTest.class,
+    org.apache.sis.xml.MarshallerPoolTest.class,
     org.apache.sis.internal.jaxb.IdentifierMapAdapterTest.class,
     org.apache.sis.internal.jaxb.IdentifierMapWithSpecialCasesTest.class
 })
 public final strictfp class UtilityTestSuite extends TestSuite {
+    /**
+     * Verifies the list of tests before to run the suite.
+     * See {@link #verifyTestList(Class)} for more information.
+     */
+    @BeforeClass
+    public static void verifyTestList() {
+        verifyTestList(UtilityTestSuite.class);
+    }
 }

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/test/suite/package-info.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java [UTF-8] Thu May  9 12:24:13 2013
@@ -38,7 +38,7 @@ import static org.apache.sis.util.CharSe
  * @module
  */
 @DependsOn({
-    ArraysTest.class,
+    ArraysExtTest.class,
     CharactersTest.class
 })
 public final strictfp class CharSequencesTest extends TestCase {
@@ -76,8 +76,8 @@ public final strictfp class CharSequence
     }
 
     /**
-     * Tests the {@link CharSequences#indexOf(CharSequence, CharSequence, int)} method.
-     * We test four time with different kind of character sequences.
+     * Tests the {@link CharSequences#indexOf(CharSequence, CharSequence, int, int)} method.
+     * We test four times with different kind of character sequences.
      */
     @Test
     public void testIndexOf() {
@@ -100,9 +100,9 @@ public final strictfp class CharSequence
     }
 
     /**
-     * Tests the {@link CharSequences#indexOf(CharSequence, int, int)} and
-     * {@link CharSequences#lastIndexOf(CharSequence, int, int)} methods.
-     * We test two time with different kind of character sequences, in order
+     * Tests the {@link CharSequences#indexOf(CharSequence, int, int, int)} and
+     * {@link CharSequences#lastIndexOf(CharSequence, int, int, int)} methods.
+     * We test two times with different kind of character sequences, in order
      * to test the {@link String} optimization case.
      */
     @Test
@@ -239,7 +239,7 @@ public final strictfp class CharSequence
     public void testToASCII() {
         final String metre = "metre";
         assertSame  (metre, toASCII(metre));
-        assertEquals(metre, toASCII("mètre").toString());
+        assertEquals(metre, toASCII("mètre").toString());
     }
 
     /**
@@ -270,11 +270,20 @@ public final strictfp class CharSequence
      */
     @Test
     public void testShortSentence() {
-        assertEquals("This sentence given (…) in a short name.", String.valueOf(
+        assertEquals("This sentence given (…) in a short name.", String.valueOf(
                 shortSentence("This sentence given as an example is way too long to be included in a short name.", 40)));
     }
 
     /**
+     * Tests the {@link CharSequences#upperCaseToSentence(CharSequence)} method.
+     */
+    @Test
+    public void testUpperCaseToSentence() {
+        final CharSequence convert = upperCaseToSentence("HALF_DOWN");
+        assertEquals("Half down", convert.toString());
+    }
+
+    /**
      * Tests the {@link CharSequences#camelCaseToWords(CharSequence, boolean)} method.
      */
     @Test
@@ -359,7 +368,7 @@ public final strictfp class CharSequence
     }
 
     /**
-     * Tests the {@link CharSequences#isUpperCase(CharSequence)} method.
+     * Tests the {@link CharSequences#isUpperCase(CharSequence, int, int)} method.
      */
     @Test
     public void testIsUpperCase() {

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/CharSequencesTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/CharactersTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/CharactersTest.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/CharactersTest.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/CharactersTest.java [UTF-8] Thu May  9 12:24:13 2013
@@ -94,7 +94,7 @@ public final strictfp class CharactersTe
     }
 
     /**
-     * Tests the pre-defined {@link Characters.Filter} constants.
+     * Tests the pre-defined {@link org.apache.sis.util.Characters.Filter} constants.
      */
     @Test
     public void testPredefinedFilters() {
@@ -107,7 +107,7 @@ public final strictfp class CharactersTe
     }
 
     /**
-     * Tests the {@link Characters.Filter#forTypes(byte[])} method.
+     * Tests the {@link org.apache.sis.util.Characters.Filter#forTypes(byte[])} method.
      */
     @Test
     public void testFilterForTypes() {
@@ -118,7 +118,8 @@ public final strictfp class CharactersTe
     }
 
     /**
-     * Scans the full {@code char} range in order to check for {@link Character.Filter} consistency.
+     * Scans the full {@code char} range in order to check for
+     * {@link org.apache.sis.util.Characters.Filter} consistency.
      */
     @Test
     public void scanCharacterRange() {

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/CharactersTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java [UTF-8] Thu May  9 12:24:13 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.util;
 
+import java.lang.reflect.Field;
 import org.junit.Test;
 import org.apache.sis.test.TestCase;
 
@@ -42,6 +43,7 @@ import java.io.ObjectStreamException;
 import java.io.InvalidObjectException;
 import java.io.NotSerializableException;
 import java.io.Serializable;
+import java.awt.geom.Point2D;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.crs.SingleCRS;
 import org.opengis.referencing.crs.GeographicCRS;
@@ -87,7 +89,7 @@ public final strictfp class ClassesTest 
      */
     @Test
     public void testGetAllInterfaces() {
-        final Set<Class<?>> interfaces = getAllInterfaces(ArrayList.class);
+        final Set<Class<?>> interfaces = getInterfaceSet(ArrayList.class);
         assertTrue(interfaces.contains(List        .class));
         assertTrue(interfaces.contains(Collection  .class));
         assertTrue(interfaces.contains(Iterable    .class));
@@ -122,8 +124,8 @@ public final strictfp class ClassesTest 
     private static abstract class T3 extends T2 implements Transformation {}
 
     /**
-     * Tests {@link Classes#findCommonClass(Collection)}
-     * and {@link Classes#findSpecializedClass(Collection)}.
+     * Tests {@link Classes#findCommonClass(Iterable)}
+     * and {@link Classes#findSpecializedClass(Iterable)}.
      */
     @Test
     public void testFindCommonParent() {
@@ -184,30 +186,30 @@ public final strictfp class ClassesTest 
     }
 
     /**
-     * Tests the {@link #boundOfParameterizedAttribute} method.
+     * Tests the {@link Classes#boundOfParameterizedProperty(Field)} method.
      *
      * @throws NoSuchFieldException  Should never occur.
      * @throws NoSuchMethodException Should never occur.
      */
     @Test
-    public void testBoundOfParameterizedAttribute() throws NoSuchFieldException, NoSuchMethodException {
+    public void testBoundOfParameterizedProperty() throws NoSuchFieldException, NoSuchMethodException {
         final Class<?>[] g = null;
         final Class<?>[] s = new Class<?>[] {Set.class};
         final Class<Parameterized> c = Parameterized.class;
-        assertNull(                 boundOfParameterizedAttribute(c.getMethod("getter0", g)));
-        assertNull(                 boundOfParameterizedAttribute(c.getMethod("setter0", s)));
-        assertEquals(Long   .class, boundOfParameterizedAttribute(c.getField ("attrib2"   )));
-        assertEquals(Integer.class, boundOfParameterizedAttribute(c.getMethod("getter1", g)));
-        assertEquals(Byte   .class, boundOfParameterizedAttribute(c.getMethod("getter2", g)));
-        assertEquals(Object .class, boundOfParameterizedAttribute(c.getMethod("getter3", g)));
-        assertEquals(short[].class, boundOfParameterizedAttribute(c.getMethod("getter4", g)));
-        assertEquals(String .class, boundOfParameterizedAttribute(c.getMethod("setter1", s)));
-        assertEquals(Short  .class, boundOfParameterizedAttribute(c.getMethod("setter2", s)));
-        assertEquals(Object .class, boundOfParameterizedAttribute(c.getMethod("setter3", s)));
+        assertNull(                 boundOfParameterizedProperty(c.getMethod("getter0", g)));
+        assertNull(                 boundOfParameterizedProperty(c.getMethod("setter0", s)));
+        assertEquals(Long   .class, boundOfParameterizedProperty(c.getField ("attrib2"   )));
+        assertEquals(Integer.class, boundOfParameterizedProperty(c.getMethod("getter1", g)));
+        assertEquals(Byte   .class, boundOfParameterizedProperty(c.getMethod("getter2", g)));
+        assertEquals(Object .class, boundOfParameterizedProperty(c.getMethod("getter3", g)));
+        assertEquals(short[].class, boundOfParameterizedProperty(c.getMethod("getter4", g)));
+        assertEquals(String .class, boundOfParameterizedProperty(c.getMethod("setter1", s)));
+        assertEquals(Short  .class, boundOfParameterizedProperty(c.getMethod("setter2", s)));
+        assertEquals(Object .class, boundOfParameterizedProperty(c.getMethod("setter3", s)));
     }
 
     /**
-     * Dummy class for {@link #testBoundOfParameterizedAttribute()} usage only.
+     * Dummy class for {@link #testBoundOfParameterizedProperty()} usage only.
      */
     private static final class Parameterized {
         public Set<? extends Long> attrib2 = null;
@@ -223,4 +225,36 @@ public final strictfp class ClassesTest 
         public void setter2(Set<? extends Short> dummy) {}
         public void setter3(Set<? super  Double> dummy) {}
     }
+
+    /**
+     * Tests the {@link Classes#getShortName(Class)}, in particular the example values
+     * given in the javadoc.
+     */
+    @Test
+    public void testGetShortName() {
+        assertEquals("java.lang.String", String.class.getName());
+        assertEquals("String",           String.class.getSimpleName());
+        assertEquals("java.lang.String", String.class.getCanonicalName());
+        assertEquals("String",           getShortName(String.class));
+
+        assertEquals("[D",       double[].class.getName());
+        assertEquals("double[]", double[].class.getSimpleName());
+        assertEquals("double[]", double[].class.getCanonicalName());
+        assertEquals("double[]", getShortName(double[].class));
+
+        assertEquals("java.awt.geom.Point2D$Double", Point2D.Double.class.getName());
+        assertEquals("Double",                       Point2D.Double.class.getSimpleName());
+        assertEquals("java.awt.geom.Point2D.Double", Point2D.Double.class.getCanonicalName());
+        assertEquals("Point2D.Double",               getShortName(Point2D.Double.class));
+
+        final Class<?> anonymous = new Comparable<Object>() {
+            @Override public int compareTo(final Object o) {
+                return 0; // Not the purpose of this test.
+            }
+        }.getClass();
+        assertTrue(anonymous.getName().startsWith("org.apache.sis.util.ClassesTest$"));
+        assertEquals("",       anonymous.getSimpleName());
+        assertEquals(null,     anonymous.getCanonicalName());
+        assertEquals("Object", getShortName(anonymous));
+    }
 }

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java [UTF-8] Thu May  9 12:24:13 2013
@@ -19,6 +19,7 @@ package org.apache.sis.util;
 import java.util.Locale;
 import org.apache.sis.test.TestCase;
 import org.apache.sis.test.DependsOn;
+import org.apache.sis.test.DependsOnMethod;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
@@ -32,7 +33,7 @@ import static org.junit.Assert.*;
  * @version 0.3
  * @module
  */
-@DependsOn(Arrays.class)
+@DependsOn(ArraysExtTest.class)
 public final strictfp class LocalesTest extends TestCase {
     /**
      * Tests the {@link Locales#getAvailableLanguages()} method.
@@ -40,8 +41,8 @@ public final strictfp class LocalesTest 
     @Test
     public void testGetAvailableLanguages() {
         final Locale[] locales = Locales.ALL.getAvailableLanguages();
-        assertTrue ("Expected English locale.",         Arrays.contains(locales, Locale.ENGLISH));
-        assertFalse("US is a country, not a language.", Arrays.contains(locales, Locale.US));
+        assertTrue ("Expected English locale.",         ArraysExt.contains(locales, Locale.ENGLISH));
+        assertFalse("US is a country, not a language.", ArraysExt.contains(locales, Locale.US));
     }
 
     /**
@@ -50,18 +51,27 @@ public final strictfp class LocalesTest 
     @Test
     public void testGetAvailableLocales() {
         final Locale[] locales = Locales.SIS.getAvailableLocales();
-        assertTrue(Arrays.contains(locales, Locale.ENGLISH));
-        assertTrue(Arrays.contains(locales, Locale.US));
-        assertTrue(Arrays.contains(locales, Locale.CANADA));
-        assertTrue(Arrays.contains(locales, Locale.FRANCE));
-        assertTrue(Arrays.contains(locales, Locale.CANADA_FRENCH));
+        assertTrue(ArraysExt.contains(locales, Locale.ENGLISH));
+        assertTrue(ArraysExt.contains(locales, Locale.US));
+        assertTrue(ArraysExt.contains(locales, Locale.CANADA));
+        assertTrue(ArraysExt.contains(locales, Locale.FRANCE));
+        assertTrue(ArraysExt.contains(locales, Locale.CANADA_FRENCH));
+    }
+
+    /**
+     * Tests the {@link Locales#unique(Locale)} method.
+     */
+    @Test
+    public void testUnique() {
+        assertSame(Locale.ENGLISH, Locales.unique(new Locale("en")));
+        assertSame(Locale.FRENCH,  Locales.unique(new Locale("fr")));
     }
 
     /**
      * Tests the {@link Locales#parse(String)} method.
-     * Depends on {@link #testUnique()}.
      */
     @Test
+    @DependsOnMethod("testUnique")
     public void testParse() {
         assertSame(Locale.FRENCH,        Locales.parse("fr"));
         assertSame(Locale.FRENCH,        Locales.parse("fra"));
@@ -79,11 +89,16 @@ public final strictfp class LocalesTest 
     }
 
     /**
-     * Tests the {@link Locales#unique(Locale)} method.
+     * Tests the {@link Locales#parseSuffix(String, String)} method.
      */
     @Test
-    public void testUnique() {
-        assertSame(Locale.ENGLISH, Locales.unique(new Locale("en")));
-        assertSame(Locale.FRENCH,  Locales.unique(new Locale("fr")));
+    @DependsOnMethod("testParse")
+    public void testParseSuffix() {
+        assertSame(null,           Locales.parseSuffix("remarks", "remark"));
+        assertSame(Locale.ROOT,    Locales.parseSuffix("remarks", "remarks"));
+        assertSame(Locale.ENGLISH, Locales.parseSuffix("remarks", "remarks_en"));
+        assertSame(Locale.FRENCH,  Locales.parseSuffix("remarks", "remarks_fr"));
+        assertSame(Locale.FRENCH,  Locales.parseSuffix("remarks", "remarks_fra"));
+        assertSame(null,           Locales.parseSuffix("remarks", "remarks2_en"));
     }
 }

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/LocalesTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/StringBuildersTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/UtilitiesTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/VersionTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java [UTF-8] Thu May  9 12:24:13 2013
@@ -31,6 +31,7 @@ import org.apache.sis.test.TestUtilities
 import org.apache.sis.test.TestCase;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.DependsOnMethod;
+import org.apache.sis.test.Performance;
 import org.junit.Test;
 
 import static java.lang.StrictMath.*;
@@ -147,7 +148,7 @@ public final strictfp class CacheTest ex
                     if (failure == null) {
                         failure = e;
                     } else {
-                        // The JDK7 branch invokes Throwable.addSuppressed(…) here.
+                        // The JDK7 branch invokes Throwable.addSuppressed(…) here.
                     }
                 }
             }
@@ -191,7 +192,7 @@ public final strictfp class CacheTest ex
             final int key = entry.getKey();
             final int value = entry.getValue();
             assertEquals(key*key, value);
-            statistics.add(key);
+            statistics.accept(key);
         }
         return statistics;
     }
@@ -203,6 +204,7 @@ public final strictfp class CacheTest ex
      * @throws InterruptedException If the test has been interrupted.
      */
     @Test
+    @Performance
     @DependsOnMethod("testThreadBlocking")
     public void stress() throws InterruptedException {
         final int count = 10000;
@@ -240,7 +242,7 @@ public final strictfp class CacheTest ex
                         assertEquals(expected, value);
                     } catch (Throwable e) {
                         if (!failures.compareAndSet(null, e)) {
-                            // The JDK7 branch invokes Throwable.addSuppressed(…) here.
+                            // The JDK7 branch invokes Throwable.addSuppressed(…) here.
                         }
                         continue;
                     }
@@ -269,54 +271,53 @@ public final strictfp class CacheTest ex
          * properly tuned, most values should be non-zero.
          */
         final PrintWriter out = CacheTest.out;
-        if (out != null) {
-            TestUtilities.printSeparator("CacheTest.stress() - testing concurrent accesses");
-            out.print("There is "); out.print(threads.length); out.print(" threads, each of them"
-                    + " fetching or creating "); out.print(count); out.println(" values.");
-            out.println("Number of times a new value has been created, for each thread:");
-            for (int i=0; i<threads.length;) {
-                final String n = String.valueOf(threads[i++].addCount);
-                out.print(CharSequences.spaces(6 - n.length()));
-                out.print(n);
-                if ((i % 10) == 0) {
-                    out.println();
-                }
+        TestUtilities.printSeparator("CacheTest.stress() - testing concurrent accesses");
+        out.print("There is "); out.print(threads.length); out.print(" threads, each of them"
+                + " fetching or creating "); out.print(count); out.println(" values.");
+        out.println("Number of times a new value has been created, for each thread:");
+        for (int i=0; i<threads.length;) {
+            final String n = String.valueOf(threads[i++].addCount);
+            out.print(CharSequences.spaces(6 - n.length()));
+            out.print(n);
+            if ((i % 10) == 0) {
+                out.println();
             }
-            out.println();
-            out.println("Now observe how the background thread cleans the cache.");
-            long time = System.nanoTime();
-            for (int i=0; i<10; i++) {
-                final long t = System.nanoTime();
-                out.printf("Cache size: %4d (after %3d ms)%n", cache.size(), round((t - time) / 1E+6));
-                time = t;
-                Thread.sleep(250);
-                if (i >= 2) {
-                    System.gc();
-                }
+        }
+        out.println();
+        out.println("Now observe how the background thread cleans the cache.");
+        long time = System.nanoTime();
+        for (int i=0; i<10; i++) {
+            final long t = System.nanoTime();
+            out.printf("Cache size: %4d (after %3d ms)%n", cache.size(), round((t - time) / 1E+6));
+            time = t;
+            Thread.sleep(250);
+            if (i >= 2) {
+                System.gc();
             }
-            out.println();
-            out.flush();
         }
+        out.println();
         /*
-         * Gets the statistics of key values after garbage collection. The mean value should
+         * Gets the statistics of key values after garbage collection. Most values should
          * be higher, because oldest values (which should have been garbage collected first)
          * have lower values. If verbose output is enabled, then we will print the statistics
          * before to perform the actual check in order to allow the developer to have more
          * information in case of failure.
+         *
+         * The mean value is often greater, but not always. Since we have fewer remaining values
+         * (100 instead of 10000), the remaining low values will have a much greater impact on
+         * the mean. Only the check on the minimal value is fully reliable.
          */
-        System.gc();
         final Statistics afterGC = validateStressEntries("After GC", cache);
-        if (out != null) {
-            out.println("Statistics on the keys before and after garbage collection.");
-            out.println("The minimum and the mean values should be greater after GC.");
-            final StatisticsFormat format = StatisticsFormat.getInstance();
-            format.setBorderWidth(1);
-            try {
-                format.format(new Statistics[] {beforeGC, afterGC}, out);
-            } catch (IOException e) {
-                throw new AssertionError(e);
-            }
+        out.println("Statistics on the keys before and after garbage collection.");
+        out.println("The minimum value should be greater after GC.");
+        final StatisticsFormat format = StatisticsFormat.getInstance();
+        format.setBorderWidth(1);
+        try {
+            format.format(new Statistics[] {beforeGC, afterGC}, out);
+        } catch (IOException e) {
+            throw new AssertionError(e);
         }
-        assertTrue("Mean key value should be greater after garbage collection.", afterGC.mean() >= beforeGC.mean());
+        assertTrue("Minimum key value should be greater after garbage collection.",
+                afterGC.minimum() >= beforeGC.minimum());
     }
 }

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/CacheTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DefaultTreeTableTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DefaultTreeTableTest.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DefaultTreeTableTest.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DefaultTreeTableTest.java [UTF-8] Thu May  9 12:24:13 2013
@@ -17,6 +17,7 @@
 package org.apache.sis.util.collection;
 
 import java.util.List;
+import java.util.Collection;
 import org.junit.Test;
 import org.apache.sis.test.TestCase;
 import org.apache.sis.test.TestStep;
@@ -114,7 +115,7 @@ public final strictfp class DefaultTreeT
      */
     @TestStep
     private static void testNodeDisplacement(final TreeTable.Node root) {
-        final List<TreeTable.Node> rootChildren, nodeChildren;
+        final Collection<TreeTable.Node> rootChildren, nodeChildren;
         final TreeTable.Node node1 = getSingleton(rootChildren = root .getChildren());
         final TreeTable.Node node2 = getSingleton(nodeChildren = node1.getChildren());
         try {
@@ -149,7 +150,7 @@ public final strictfp class DefaultTreeT
         assertNotSame("clone", table, newTable);
         assertEquals("newTable.equals(table)", table, newTable);
         assertEquals("hashCode", table.hashCode(), newTable.hashCode());
-        newTable.getRoot().getChildren().get(1).setValue(NAME, "New name");
+        getChildrenList(newTable).get(1).setValue(NAME, "New name");
         assertFalse("newTable.equals(table)", newTable.equals(table));
     }
 
@@ -162,11 +163,22 @@ public final strictfp class DefaultTreeT
     @TestStep
     private void testSerialization(final TreeTable table) {
         final TreeTable newTable = assertSerializedEquals(table);
-        newTable.getRoot().getChildren().get(1).setValue(NAME, "New name");
+        getChildrenList(newTable).get(1).setValue(NAME, "New name");
         assertFalse("newTable.equals(table)", newTable.equals(table));
     }
 
     /**
+     * Returns the children of the root of the given table as a list.
+     * Instances of {@link DefaultTreeTable.Node} shall be guaranteed
+     * to store their children in a list.
+     */
+    private static List<TreeTable.Node> getChildrenList(final TreeTable table) {
+        final Collection<TreeTable.Node> children = table.getRoot().getChildren();
+        assertInstanceOf("TreeTable.Node.getChildren()", List.class, children);
+        return (List<TreeTable.Node>) children;
+    }
+
+    /**
      * Tests the creation of a tree table with a few nodes, and tests the displacement of a node
      * from one branch to another. Finally tests the serialization of that table and the comparison
      * with the original object.

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DefaultTreeTableTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedMapTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedMapTest.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedMapTest.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedMapTest.java [UTF-8] Thu May  9 12:24:13 2013
@@ -45,7 +45,7 @@ public final strictfp class DerivedMapTe
     /**
      * The value to replace by {@code null}.
      */
-    private static final int EXCLUDED = 17;
+    protected static final int EXCLUDED = 17; // non-private for javadoc purpose.
 
     /**
      * Fills test values in the given maps.
@@ -117,7 +117,7 @@ public final strictfp class DerivedMapTe
     @Override public Class<Integer> getTargetClass() {return Integer.class;}
 
     /**
-     * Multiply the given value by 10, except value {@value #EXCLUDED}.
+     * Multiplies the given value by 10, except value {@value #EXCLUDED}.
      *
      * @param  value The value to multiply.
      * @return The multiplied value, or {@code null}.

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedMapTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedSetTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedSetTest.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedSetTest.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedSetTest.java [UTF-8] Thu May  9 12:24:13 2013
@@ -43,7 +43,7 @@ public final strictfp class DerivedSetTe
     /**
      * The value to replace by {@code null}.
      */
-    private static final int EXCLUDED = 19;
+    protected static final int EXCLUDED = 19; // non-private for javadoc purpose.
 
     /**
      * Tests {@link DerivedSet} without excluded value.

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/DerivedSetTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TableColumnTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TableColumnTest.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TableColumnTest.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TableColumnTest.java [UTF-8] Thu May  9 12:24:13 2013
@@ -41,11 +41,13 @@ public final strictfp class TableColumnT
     @Test
     public void testConstantHeader() {
         InternationalString i18n = NAME.getHeader();
+        assertEquals("Name", i18n.toString(Locale.ROOT));
         assertEquals("Name", i18n.toString(Locale.ENGLISH));
         assertEquals("Nom",  i18n.toString(Locale.FRENCH));
         assertSame("Test caching", i18n, NAME.getHeader());
 
         i18n = TYPE.getHeader();
+        assertEquals("Type", i18n.toString(Locale.ROOT));
         assertEquals("Type", i18n.toString(Locale.ENGLISH));
         assertEquals("Type", i18n.toString(Locale.FRENCH));
         assertSame("Test caching", i18n, TYPE.getHeader());

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TableColumnTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTableFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTableFormatTest.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTableFormatTest.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTableFormatTest.java [UTF-8] Thu May  9 12:24:13 2013
@@ -16,11 +16,15 @@
  */
 package org.apache.sis.util.collection;
 
+import java.util.Locale;
+import java.math.RoundingMode;
 import java.text.ParseException;
-import org.junit.Test;
+import org.opengis.metadata.citation.Role;
+import org.apache.sis.util.iso.DefaultInternationalString;
 import org.apache.sis.test.TestCase;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.DependsOnMethod;
+import org.junit.Test;
 
 import static org.apache.sis.test.Assert.*;
 import static org.apache.sis.util.collection.TableColumn.*;
@@ -54,9 +58,9 @@ public final strictfp class TreeTableFor
         tf.setVerticalLinePosition(2);
         assertMultilinesEquals(
                 "Node #1\n" +
-                "  ├─Node #2\n" +
-                "  │   └─Node #4\n" +
-                "  └─Node #3\n", tf.format(new DefaultTreeTable(root)));
+                "  ├─Node #2\n" +
+                "  │   └─Node #4\n" +
+                "  └─Node #3\n", tf.format(new DefaultTreeTable(root)));
     }
 
     /**
@@ -73,9 +77,9 @@ public final strictfp class TreeTableFor
         tf.setVerticalLinePosition(0);
         final String text =
                 "Node #1\n" +
-                "├───Node #2\n" +
-                "│   └───Node #4\n" +
-                "└───Node #3\n";
+                "├───Node #2\n" +
+                "│   └───Node #4\n" +
+                "└───Node #3\n";
         final TreeTable table = tf.parseObject(text);
         assertMultilinesEquals(text, tf.format(table));
     }
@@ -111,24 +115,24 @@ public final strictfp class TreeTableFor
         final TreeTableFormat tf = new TreeTableFormat(null, null);
         tf.setVerticalLinePosition(1);
         assertMultilinesEquals(
-                "Node #1………………………… 10…… Value #1B\n" +
-                " ├──Node #2……………… 20\n" +
-                " │   └──Node #4…… 40…… val #4  with tab ¶ and a new line\n" +
-                " └──Node #3……………… ………… Value #3B\n", tf.format(table));
+                "Node #1………………………… 10…… Value #1B\n" +
+                " ├──Node #2……………… 20\n" +
+                " │   └──Node #4…… 40…… val #4  with tab ¶ and a new line\n" +
+                " └──Node #3……………… ………… Value #3B\n", tf.format(table));
 
         tf.setColumns(NAME, valueA);
         assertMultilinesEquals(
-                "Node #1………………………… 10\n" +
-                " ├──Node #2……………… 20\n" +
-                " │   └──Node #4…… 40\n" +
-                " └──Node #3\n", tf.format(table));
+                "Node #1………………………… 10\n" +
+                " ├──Node #2……………… 20\n" +
+                " │   └──Node #4…… 40\n" +
+                " └──Node #3\n", tf.format(table));
 
         tf.setColumns(NAME, valueB);
         assertMultilinesEquals(
-                "Node #1………………………… Value #1B\n" +
-                " ├──Node #2\n" +
-                " │   └──Node #4…… val #4  with tab ¶ and a new line\n" +
-                " └──Node #3……………… Value #3B\n", tf.format(table));
+                "Node #1………………………… Value #1B\n" +
+                " ├──Node #2\n" +
+                " │   └──Node #4…… val #4  with tab ¶ and a new line\n" +
+                " └──Node #3……………… Value #3B\n", tf.format(table));
     }
 
     /**
@@ -146,10 +150,10 @@ public final strictfp class TreeTableFor
         tf.setColumns(NAME, valueA, valueB);
         tf.setVerticalLinePosition(1);
         final String text =
-                "Node #1………………………… 10…… Value #1B\n" +
-                " ├──Node #2……………… 20\n" +
-                " │   └──Node #4…… 40…… Value #4B\n" +
-                " └──Node #3……………… ………… Value #3B\n";
+                "Node #1………………………… 10…… Value #1B\n" +
+                " ├──Node #2……………… 20\n" +
+                " │   └──Node #4…… 40…… Value #4B\n" +
+                " └──Node #3……………… ………… Value #3B\n";
         final TreeTable table = tf.parseObject(text);
         assertMultilinesEquals(text, tf.format(table));
     }
@@ -165,19 +169,19 @@ public final strictfp class TreeTableFor
         final TableColumn<Integer> valueA = new TableColumn<Integer>(Integer.class, "value #1");
         final TableColumn<String>  valueB = new TableColumn<String> (String .class, "value #2");
         final TreeTableFormat tf = new TreeTableFormat(null, null);
-        assertEquals("?……[…] ", tf.getColumnSeparatorPattern());
+        assertEquals("?……[…] ", tf.getColumnSeparatorPattern());
         tf.setColumns(NAME, valueA, valueB);
         tf.setVerticalLinePosition(1);
         /*
          * Test with all column separators.
          */
-        tf.setColumnSeparatorPattern(" [ ]│ ");
-        assertEquals(" [ ]│ ", tf.getColumnSeparatorPattern());
+        tf.setColumnSeparatorPattern(" [ ]│ ");
+        assertEquals(" [ ]│ ", tf.getColumnSeparatorPattern());
         final String text =
-                "Node #1         │ 10 │ Value #1B\n" +
-                " ├──Node #2     │ 20 │ \n" +
-                " │   └──Node #4 │ 40 │ Value #4B\n" +
-                " └──Node #3     │    │ Value #3B\n";
+                "Node #1         │ 10 │ Value #1B\n" +
+                " ├──Node #2     │ 20 │ \n" +
+                " │   └──Node #4 │ 40 │ Value #4B\n" +
+                " └──Node #3     │    │ Value #3B\n";
         final TreeTable table = tf.parseObject(text);
         assertMultilinesEquals(text, tf.format(table));
         /*
@@ -186,14 +190,65 @@ public final strictfp class TreeTableFor
         tf.setColumnSeparatorPattern("? [ ]; ");
         assertMultilinesEquals(
                 "Node #1         ; 10 ; Value #1B\n" +
-                " ├──Node #2     ; 20\n" + // Column separator omitted here.
-                " │   └──Node #4 ; 40 ; Value #4B\n" +
-                " └──Node #3     ;    ; Value #3B\n", tf.format(table));
+                " ├──Node #2     ; 20\n" + // Column separator omitted here.
+                " │   └──Node #4 ; 40 ; Value #4B\n" +
+                " └──Node #3     ;    ; Value #3B\n", tf.format(table));
         /*
          * Test with regular expression at parsing time.
          */
-        tf.setColumnSeparatorPattern("?……[…] /\\w*│+\\w*");
-        assertEquals("?……[…] /\\w*│+\\w*", tf.getColumnSeparatorPattern());
+        tf.setColumnSeparatorPattern("?……[…] /\\w*│+\\w*");
+        assertEquals("?……[…] /\\w*│+\\w*", tf.getColumnSeparatorPattern());
         assertEquals(table, tf.parseObject(text));
     }
+
+    /**
+     * Tests the parsing of a tree containing a code list, an enumeration and an international string.
+     * Those types shall be handled in a special way.
+     */
+    @Test
+    @DependsOnMethod("testTreeTableFormat")
+    public void testLocalizedFormat() {
+        final DefaultInternationalString i18n = new DefaultInternationalString();
+        i18n.add(Locale.ENGLISH,  "An English sentence");
+        i18n.add(Locale.FRENCH,   "Une phrase en français");
+        i18n.add(Locale.JAPANESE, "日本語の言葉");
+
+        final DefaultTreeTable table  = new DefaultTreeTable(NAME, VALUE);
+        final TreeTable.Node   root   = table.getRoot();
+        root.setValue(NAME, "Root");
+
+        TreeTable.Node child;
+        child = root.newChild();
+        child.setValue(NAME, "CodeList");
+        child.setValue(VALUE, Role.POINT_OF_CONTACT);
+
+        child = root.newChild();
+        child.setValue(NAME, "Enum");
+        child.setValue(VALUE, RoundingMode.HALF_DOWN);
+
+        child = root.newChild();
+        child.setValue(NAME, "i18n");
+        child.setValue(VALUE, i18n);
+
+        TreeTableFormat tf = new TreeTableFormat(null, null);
+        assertMultilinesEquals(
+                "Root\n" +
+                "  ├─CodeList…… Point of contact\n" +
+                "  ├─Enum……………… Half down\n" +
+                "  └─i18n……………… An English sentence\n", tf.format(table));
+
+        tf = new TreeTableFormat(Locale.FRENCH, null);
+        assertMultilinesEquals(
+                "Root\n" +
+                "  ├─CodeList…… Point of contact\n" + // Not yet localized.
+                "  ├─Enum……………… Half down\n" +        // No localization provided.
+                "  └─i18n……………… Une phrase en français\n", tf.format(table));
+
+        tf = new TreeTableFormat(Locale.JAPANESE, null);
+        assertMultilinesEquals(
+                "Root\n" +
+                "  ├─CodeList…… Point of contact\n" + // Not yet localized.
+                "  ├─Enum……………… Half down\n" +        // No localization provided.
+                "  └─i18n……………… 日本語の言葉\n", tf.format(table));
+    }
 }

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTableFormatTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java [UTF-8] Thu May  9 12:24:13 2013
@@ -42,13 +42,14 @@ import static org.apache.sis.util.collec
 })
 public final strictfp class TreeTablesTest extends TestCase {
     /**
-     * The example documented in the {@code TreeTable} javadoc.
+     * The {@code concatenateSingletons(…)} example documented in the {@link TreeTables} class javadoc.
+     * This simple code assumes that the children collection in the given node is a {@link List}.
      *
      * @param  node The root of the node to simplify.
      * @return The root of the simplified tree. May be the given {@code node} or a child.
      */
     public static TreeTable.Node concatenateSingletons(final TreeTable.Node node) {
-        final List<TreeTable.Node> children = node.getChildren();
+        final List<TreeTable.Node> children = (List<TreeTable.Node>) node.getChildren();
         final int size = children.size();
         for (int i=0; i<size; i++) {
             children.set(i, concatenateSingletons(children.get(i)));
@@ -73,19 +74,19 @@ public final strictfp class TreeTablesTe
     public void testConcatenateSingletons() throws ParseException {
         final TreeTable table = TreeTables.parse(
                 "root\n" +
-                "├───users\n" +
-                "│   └───alice\n" +
-                "│       ├───data\n" +
-                "│       │   └───mercator\n" +
-                "│       └───document\n" +
-                "└───lib\n", NAME);
+                "  ├─users\n" +
+                "  │   └─alice\n" +
+                "  │       ├─data\n" +
+                "  │       │   └─mercator\n" +
+                "  │       └─document\n" +
+                "  └─lib\n", NAME);
         ((DefaultTreeTable) table).setRoot(concatenateSingletons(table.getRoot()));
-        assertMultilinesEquals(
+        assertMultilinesEquals((
                 "root\n" +
-                "├───users/alice\n" +
-                "│   ├───data/mercator\n" +
-                "│   └───document\n" +
-                "└───lib\n".replace("/", File.separator), table.toString());
+                "  ├─users/alice\n" +
+                "  │   ├─data/mercator\n" +
+                "  │   └─document\n" +
+                "  └─lib\n").replace('/', File.separatorChar), table.toString());
     }
 
     /**
@@ -104,21 +105,21 @@ public final strictfp class TreeTablesTe
         nodeForPath(files, NAME, new File("users/Alice/data/mercator")).setValue(VALUE_AS_NUMBER, 60);
         assertMultilinesEquals(
                 "Root\n" +
-                "├───users\n" +
-                "│   ├───Alice\n" +
-                "│   │   ├───data………………………… 10\n" +
-                "│   │   │   └───mercator…… 60\n" +
-                "│   │   └───document……………… 50\n" +
-                "│   └───Bob……………………………………… 30\n" +
-                "│       └───data………………………… 20\n" +
-                "└───lib………………………………………………… 40\n", table.toString());
+                "  ├─users\n" +
+                "  │   ├─Alice\n" +
+                "  │   │   ├─data………………………… 10\n" +
+                "  │   │   │   └─mercator…… 60\n" +
+                "  │   │   └─document……………… 50\n" +
+                "  │   └─Bob……………………………………… 30\n" +
+                "  │       └─data………………………… 20\n" +
+                "  └─lib………………………………………………… 40\n", table.toString());
     }
 
     /**
-     * Tests the {@link TreeTables#valuesAsStrings(TreeTable, Locale)} method.
+     * Tests the {@link TreeTables#replaceCharSequences(TreeTable, Locale)} method.
      */
     @Test
-    public void testValuesAsStrings() {
+    public void testReplaceCharSequences() {
         final TreeTable table = new DefaultTreeTable(NAME, VALUE_AS_NUMBER);
         final TreeTable.Node root   = table .getRoot();
         final TreeTable.Node parent = root  .newChild();
@@ -132,11 +133,11 @@ public final strictfp class TreeTablesTe
         parent.setValue(VALUE_AS_NUMBER, 4);
 
         final String asString = table.toString();
-        assertEquals(3, valuesAsStrings(table, null));
-        assertInstanceOf("valuesAsStrings:", String.class, root  .getValue(NAME));
-        assertInstanceOf("valuesAsStrings:", String.class, parent.getValue(NAME));
-        assertInstanceOf("valuesAsStrings:", String.class, child1.getValue(NAME));
-        assertInstanceOf("valuesAsStrings:", String.class, child2.getValue(NAME));
+        assertEquals(3, replaceCharSequences(table, null));
+        assertInstanceOf("replaceCharSequences:", String.class, root  .getValue(NAME));
+        assertInstanceOf("replaceCharSequences:", String.class, parent.getValue(NAME));
+        assertInstanceOf("replaceCharSequences:", String.class, child1.getValue(NAME));
+        assertInstanceOf("replaceCharSequences:", String.class, child2.getValue(NAME));
         assertSame("Expected unique instance of String.", child1.getValue(NAME), child2.getValue(NAME));
         assertEquals("String representation shall be the same.", asString, table.toString());
     }

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/TreeTablesTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/WeakHashSetTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/WeakHashSetTest.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/WeakHashSetTest.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/WeakHashSetTest.java [UTF-8] Thu May  9 12:24:13 2013
@@ -38,7 +38,7 @@ import static org.apache.sis.test.TestUt
  * @version 0.3
  * @module
  */
-@DependsOn(org.apache.sis.util.ArraysTest.class)
+@DependsOn(org.apache.sis.util.ArraysExtTest.class)
 public final strictfp class WeakHashSetTest extends TestCase {
     /**
      * The size of the test sets to be created.

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/WeakHashSetTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/WeakValueHashMapTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/WeakValueHashMapTest.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/WeakValueHashMapTest.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/WeakValueHashMapTest.java [UTF-8] Thu May  9 12:24:13 2013
@@ -39,7 +39,7 @@ import static org.apache.sis.test.TestUt
  * @version 0.3
  * @module
  */
-@DependsOn(org.apache.sis.util.ArraysTest.class)
+@DependsOn(org.apache.sis.util.ArraysExtTest.class)
 public final strictfp class WeakValueHashMapTest extends TestCase {
     /**
      * The size of the test sets to be created.

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/collection/WeakValueHashMapTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/iso/AbstractNameTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/iso/AbstractNameTest.java?rev=1480602&r1=1480601&r2=1480602&view=diff
==============================================================================
--- sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/iso/AbstractNameTest.java [iso-8859-1] (original)
+++ sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/iso/AbstractNameTest.java [UTF-8] Thu May  9 12:24:13 2013
@@ -29,7 +29,7 @@ import static org.apache.sis.util.iso.De
 /**
  * Tests the {@link DefaultLocalName} and {@link DefaultScopedName} implementations.
  * This test suite instantiate the objects directly, without using {@link DefaultNameFactory}.
- * For tests using the name factory, see {@link NameFactoryTest}.
+ * For tests using the name factory, see {@link DefaultNameFactoryTest}.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from goetk-3.00)

Propchange: sis/branches/Android/sis-utility/src/test/java/org/apache/sis/util/iso/AbstractNameTest.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu May  9 12:24:13 2013
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8



Mime
View raw message