sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1626345 [13/14] - in /sis/trunk: ./ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/ core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gml/ core/sis-metada...
Date Fri, 19 Sep 2014 21:46:44 GMT
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] Fri Sep 19 21:46:39 2014
@@ -74,6 +74,7 @@ IncompatiblePropertyValue_1       = La v
 IncompatibleUnit_1                = L\u2019unit\u00e9 \u00ab\u202f{0}\u202f\u00bb n\u2019est pas compatible avec la valeur actuelle.
 IncompatibleUnits_2               = Les unit\u00e9s \u00ab\u202f{0}\u202f\u00bb et \u00ab\u202f{1}\u202f\u00bb ne sont pas compatibles.
 InconsistentAttribute_2           = La valeur \u00ab\u202f{1}\u202f\u00bb de l\u2019attribut \u2018{0}\u2019 n\u2019est pas coh\u00e9rente avec celles des autres attributs.
+InconsistentNamespace_2           = L\u2019espace de nom \u201c{0}\u201d \u00e9tait attendu pour \u201c{1}\u201d.
 InconsistentTableColumns          = Les colonnes des tables ne sont pas coh\u00e9rentes.
 IdentifierAlreadyBound_1          = L\u2019identifiant \u00ab\u202f{0}\u202f\u00bb est d\u00e9j\u00e0 associ\u00e9 \u00e0 un autre objet.
 IndexOutOfBounds_1                = L\u2019index {0} est en dehors des limites permises.
@@ -91,6 +92,7 @@ MismatchedParameterDescriptor_1   = Le d
 MismatchedPropertyType_1          = Le type de la propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb ne correspond pas.
 MismatchedValueClass_3            = Les valeurs de \u00ab\u202f{0}\u202f\u00bb sont de la classe \u2018{2}\u2019, alors que le type demand\u00e9 \u00e9tait \u2018{1}\u2019.
 MissingAuthority_1                = Aucune autorit\u00e9 n\u2019a \u00e9t\u00e9 sp\u00e9cifi\u00e9e pour le code \u00ab\u202f{0}\u202f\u00bb. Le format attendu est \u00ab\u202fAUTORIT\u00c9:CODE\u202f\u00bb.
+MissingNamespace_1                = \u201c{0}\u201d est d\u00e9fini sans espace de noms.
 MissingRequiredModule_1           = Cette op\u00e9ration requiert le module \u00ab\u202f{0}\u202f\u00bb.
 MissingSchemeInURI                = Il manque le sch\u00e9ma d\u2019URI.
 MissingValueForOption_1           = Aucune valeur n\u2019a \u00e9t\u00e9 d\u00e9finie pour l\u2019option \u00ab\u202f{0}\u202f\u00bb.
@@ -134,6 +136,7 @@ OddArrayLength_1                  = La l
 PropertyAlreadyExists_2           = La propri\u00e9t\u00e9 \u00ab\u202f{1}\u202f\u00bb existe d\u00e9j\u00e0 dans \u00ab\u202f{0}\u202f\u00bb.
 ParameterNotFound_2               = Aucun param\u00e8tre nomm\u00e9 \u00ab\u202f{1}\u202f\u00bb n\u2019a \u00e9t\u00e9 trouv\u00e9 dans \u00ab\u202f{0}\u202f\u00bb.
 PropertyNotFound_2                = Aucune propri\u00e9t\u00e9 nomm\u00e9e \u00ab\u202f{1}\u202f\u00bb n\u2019a \u00e9t\u00e9 trouv\u00e9e dans \u00ab\u202f{0}\u202f\u00bb.
+RecordAlreadyDefined_2            = L\u2019enregistrement \u00ab\u202f{1}\u202f\u00bb est d\u00e9j\u00e0 d\u00e9finit dans le sch\u00e9ma \u00ab\u202f{0}\u202f\u00bb.
 RecursiveCreateCallForKey_1       = Appel r\u00e9cursif lors de la cr\u00e9ation d\u2019un objet pour la cl\u00e9 \u00ab\u202f{0}\u202f\u00bb.
 RequireDecimalSeparator           = Un s\u00e9parateur d\u00e9cimal est requis.
 SingularMatrix                    = La matrice est singuli\u00e8re.

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -71,6 +71,16 @@ public final class Messages extends Inde
         public static final short DiscardedExclusiveProperty_2 = 2;
 
         /**
+         * Ignored properties after the first occurrence of ‘{0}’.
+         */
+        public static final short IgnoredPropertiesAfterFirst_1 = 6;
+
+        /**
+         * Ignored property associated to ‘{0}’.
+         */
+        public static final short IgnoredPropertyAssociatedTo_1 = 7;
+
+        /**
          * Text were discarded for some locales.
          */
         public static final short LocalesDiscarded = 3;
@@ -81,7 +91,7 @@ public final class Messages extends Inde
         public static final short PropertyHiddenBy_2 = 4;
 
         /**
-         * Can not parse “{1}” as an instance of {0}. The value is stored as plain text instead, but
+         * Can not parse “{1}” as an instance of ‘{0}’. The value is stored as plain text instead, but
          * will be ignored by some processing.
          */
         public static final short UnparsableValueStoredAsText_2 = 5;

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties [ISO-8859-1] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties [ISO-8859-1] Fri Sep 19 21:46:39 2014
@@ -17,6 +17,8 @@
 AlreadyRegistered_2             = {0} \u201c{1}\u201d is already registered. The second instance will be ignored.
 ChangedContainerCapacity_2      = Changed the container capacity from {0} to {1} elements.
 DiscardedExclusiveProperty_2    = Property \u201c{0}\u201d has been discarded in favor of \u201c{1}\u201d, because those two properties are mutually exclusive.
+IgnoredPropertiesAfterFirst_1   = Ignored properties after the first occurrence of \u2018{0}\u2019.
+IgnoredPropertyAssociatedTo_1   = Ignored property associated to \u2018{0}\u2019.
 PropertyHiddenBy_2              = Property \u201c{0}\u201d is hidden by \u201c{1}\u201d.
 LocalesDiscarded                = Text were discarded for some locales.
-UnparsableValueStoredAsText_2   = Can not parse \u201c{1}\u201d as an instance of {0}. The value is stored as plain text instead, but will be ignored by some processing.
+UnparsableValueStoredAsText_2   = Can not parse \u201c{1}\u201d as an instance of \u2018{0}\u2019. The value is stored as plain text instead, but will be ignored by some processing.

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties [ISO-8859-1] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties [ISO-8859-1] Fri Sep 19 21:46:39 2014
@@ -17,6 +17,8 @@
 AlreadyRegistered_2             = Le {0} \u00ab\u202f{1}\u202f\u00bb est d\u00e9j\u00e0 inscrit dans le registre. La seconde instance sera ignor\u00e9e.
 ChangedContainerCapacity_2      = Changement de la capacit\u00e9 du conteneur de {0} vers {1} \u00e9l\u00e9ments.
 DiscardedExclusiveProperty_2    = La propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb a \u00e9t\u00e9 \u00e9cart\u00e9e en faveur de \u00ab\u202f{1}\u202f\u00bb, parce que ces deux propri\u00e9t\u00e9s sont mutuellement exclusives.
+IgnoredPropertiesAfterFirst_1   = Des propri\u00e9t\u00e9s ont \u00e9t\u00e9 ignor\u00e9es apr\u00e8s la premi\u00e8re occurrence de \u2018{0}\u2019.
+IgnoredPropertyAssociatedTo_1   = Une propri\u00e9t\u00e9 associ\u00e9e \u00e0 \u2018{0}\u2019 a \u00e9t\u00e9 ignor\u00e9e.
 PropertyHiddenBy_2              = La propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb est masqu\u00e9e par \u00ab\u202f{1}\u202f\u00bb.
 LocalesDiscarded                = Des textes ont \u00e9t\u00e9 ignor\u00e9s pour certaines langues.
-UnparsableValueStoredAsText_2   = La valeur \u00ab\u202f{1}\u202f\u00bb ne peut pas \u00eatre interpr\u00e9t\u00e9e comme une instance de {0}. Elle est donc m\u00e9moris\u00e9e sous sa forme textuelle, mais sera ignor\u00e9e par certains traitements.
+UnparsableValueStoredAsText_2   = La valeur \u00ab\u202f{1}\u202f\u00bb ne peut pas \u00eatre interpr\u00e9t\u00e9e comme une instance de \u2018{0}\u2019. Elle est donc m\u00e9moris\u00e9e sous sa forme textuelle, mais sera ignor\u00e9e par certains traitements.

Copied: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java (from r1625241, sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java)
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java?p2=sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java&p1=sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java&r1=1625241&r2=1626345&rev=1626345&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/LegacyCodes.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -19,12 +19,8 @@ package org.apache.sis.xml;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Locale;
-import java.util.Properties;
-import java.io.InputStream;
-import java.io.IOException;
-import org.opengis.metadata.Metadata;
+import org.opengis.metadata.identification.CharacterSet;
 import org.apache.sis.util.collection.Containers;
-import org.apache.sis.util.logging.Logging;
 
 
 /**
@@ -49,20 +45,15 @@ final class LegacyCodes {
      */
     static final Map<String,String> IANA_TO_LEGACY, LEGACY_TO_IANA;
     static {
-        final Properties codes = new Properties();
-        final InputStream in = Metadata.class.getResourceAsStream("2003/charset-codes.properties");
-        try {
-            codes.load(in);
-            in.close();
-        } catch (IOException e) {
-            Logging.unexpectedException(ValueConverter.class, "toCharset[Code]", e);
-        }
-        final int capacity = Containers.hashMapCapacity(codes.size());
+        final CharacterSet[] codes = CharacterSet.values();
+        final int capacity = Containers.hashMapCapacity(codes.length);
         IANA_TO_LEGACY = new HashMap<String,String>(capacity);
         LEGACY_TO_IANA = new HashMap<String,String>(capacity);
-        for (final Map.Entry<Object,Object> entry : codes.entrySet()) {
-            final String legacy = ((String) entry.getKey()).intern();
-            final String name   = ((String) entry.getValue()).intern();
+        for (final CharacterSet code : codes) {
+            final String   legacy = code.identifier().intern();
+            final String[] names  = code.names();
+            String name = names[names.length - 1];
+            if (name.equals("ebcdic")) name = "EBCDIC"; // Missing IANA name in GeoAPI CharacterSet.
             IANA_TO_LEGACY.put(name  .toUpperCase(Locale.US), legacy); // IANA names are restricted to US-ASCII.
             LEGACY_TO_IANA.put(legacy.toLowerCase(Locale.US), name);
             IANA_TO_LEGACY.put(name, legacy);

Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/ValueConverter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/ValueConverter.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/ValueConverter.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/ValueConverter.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -23,6 +23,8 @@ import java.net.MalformedURLException;
 import java.util.MissingResourceException;
 import java.util.Locale;
 import java.util.UUID;
+import java.nio.charset.Charset;
+import java.nio.charset.IllegalCharsetNameException;
 import javax.measure.unit.Unit;
 import org.apache.sis.measure.Units;
 import org.apache.sis.util.Locales;
@@ -63,7 +65,7 @@ import static org.apache.sis.util.CharSe
  *
  * @author Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.07)
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public class ValueConverter {
@@ -179,6 +181,69 @@ public class ValueConverter {
     }
 
     /**
+     * Converts the given character set to a code.
+     *
+     * <p>The default implementation first invokes {@link Charset#name()}. Then if marshalling to ISO 19139:2007,
+     * this method converts the <a href="http://www.iana.org/assignments/character-sets">IANA</a> name to a
+     * ISO 19115:2003 {@code MD_CharacterSetCode} using the following equivalence table:</p>
+     *
+     * <table class="sis">
+     *   <caption>IANA to ISO 19115:2003 character set code</caption>
+     *   <tr>
+     *     <td><table class="compact" summary="IANA to ISO 19115:2003">
+     *       <tr><td style="width: 90px"><b>IANA</b></td><td><b>ISO 19115:2003</b></td></tr>
+     *       <tr><td>{@code ISO-8859-1}</td>  <td>{@code 8859part1}</td></tr>
+     *       <tr><td>{@code ISO-8859-2}</td>  <td>{@code 8859part2}</td></tr>
+     *       <tr><td>{@code ISO-8859-3}</td>  <td>{@code 8859part3}</td></tr>
+     *       <tr><td>{@code ISO-8859-4}</td>  <td>{@code 8859part4}</td></tr>
+     *       <tr><td>{@code ISO-8859-5}</td>  <td>{@code 8859part5}</td></tr>
+     *       <tr><td>{@code ISO-8859-6}</td>  <td>{@code 8859part6}</td></tr>
+     *       <tr><td>{@code ISO-8859-7}</td>  <td>{@code 8859part7}</td></tr>
+     *       <tr><td>{@code ISO-8859-8}</td>  <td>{@code 8859part8}</td></tr>
+     *       <tr><td>{@code ISO-8859-9}</td>  <td>{@code 8859part9}</td></tr>
+     *       <tr><td>{@code ISO-8859-10}</td> <td>{@code 8859part10}</td></tr>
+     *       <tr><td>{@code ISO-8859-11}</td> <td>{@code 8859part11}</td></tr>
+     *       <tr><td>{@code ISO-8859-12}</td> <td>{@code 8859part12}</td></tr>
+     *       <tr><td>{@code ISO-8859-13}</td> <td>{@code 8859part13}</td></tr>
+     *       <tr><td>{@code ISO-8859-14}</td> <td>{@code 8859part14}</td></tr>
+     *       <tr><td>{@code ISO-8859-15}</td> <td>{@code 8859part15}</td></tr>
+     *       <tr><td>{@code ISO-8859-16}</td> <td>{@code 8859part16}</td></tr>
+     *     </table></td>
+     *     <td class="sep"><table class="compact" summary="IANA to ISO 19115:2003">
+     *       <tr><td style="width: 90px"><b>IANA</b></td><td><b>ISO 19115:2003</b></td></tr>
+     *       <tr><td>{@code UCS-2}</td>     <td>{@code ucs2}</td></tr>
+     *       <tr><td>{@code UCS-4}</td>     <td>{@code ucs4}</td></tr>
+     *       <tr><td>{@code UTF-7}</td>     <td>{@code utf7}</td></tr>
+     *       <tr><td>{@code UTF-8}</td>     <td>{@code utf8}</td></tr>
+     *       <tr><td>{@code UTF-16}</td>    <td>{@code utf16}</td></tr>
+     *       <tr><td>{@code JIS_X0201}</td> <td>{@code jis}</td></tr>
+     *       <tr><td>{@code Shift_JIS}</td> <td>{@code shiftJIS}</td></tr>
+     *       <tr><td>{@code EUC-JP}</td>    <td>{@code eucJP}</td></tr>
+     *       <tr><td>{@code US-ASCII}</td>  <td>{@code usAscii}</td></tr>
+     *       <tr><td>{@code EBCDIC}</td>    <td>{@code ebcdic}</td></tr>
+     *       <tr><td>{@code EUC-KR}</td>    <td>{@code eucKR}</td></tr>
+     *       <tr><td>{@code Big5}</td>      <td>{@code big5}</td></tr>
+     *       <tr><td>{@code GB2312}</td>    <td>{@code GB2312}</td></tr>
+     *     </table></td>
+     *   </tr>
+     * </table>
+     *
+     * @param  context Context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.
+     * @param  value The locale to convert to a character set code, or {@code null}.
+     * @return The country code, or {@code null} if the given value was null.
+     *
+     * @see Charset#name()
+     *
+     * @since 0.5
+     */
+    public String toCharsetCode(final MarshalContext context, final Charset value) {
+        if (value != null) {
+            return LegacyCodes.fromIANA(value.name());
+        }
+        return null;
+    }
+
+    /**
      * Converts the given string to a locale. The string is the language code either as the 2
      * letters or the 3 letters ISO code. It can optionally be followed by the {@code '_'}
      * character and the country code (again either as 2 or 3 letters), optionally followed
@@ -206,6 +271,36 @@ public class ValueConverter {
     }
 
     /**
+     * Converts the given string to a character set. The string can be either a
+     * <a href="http://www.iana.org/assignments/character-sets">IANA</a> identifier,
+     * or one of the ISO 19115:2003 {@code MD_CharacterSetCode} identifier.
+     *
+     * @param  context Context (GML version, locale, <i>etc.</i>) of the (un)marshalling process.
+     * @param  value The string to convert to a character set, or {@code null}.
+     * @return The converted character set, or {@code null} if the given value was null or empty, or
+     *         if an exception was thrown and {@code exceptionOccured(…)} returned {@code true}.
+     * @throws IllegalCharsetNameException If the given string can not be converted to a character set.
+     *
+     * @see Charset#forName(String)
+     *
+     * @since 0.5
+     */
+    public Charset toCharset(final MarshalContext context, String value) throws IllegalCharsetNameException {
+        value = trimWhitespaces(value);
+        if (value != null && !value.isEmpty()) {
+            value = LegacyCodes.toIANA(value);
+            try {
+                return Charset.forName(value);
+            } catch (IllegalCharsetNameException e) {
+                if (!exceptionOccured(context, value, String.class, Charset.class, e)) {
+                    throw e;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
      * Converts the given string to a unit. The default implementation is as below, omitting
      * the check for null value and the call to {@link #exceptionOccured exceptionOccured(…)}
      * in case of error:

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/NumberConverterTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/NumberConverterTest.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/NumberConverterTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/NumberConverterTest.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -33,7 +33,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-2.4)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @DependsOn(SystemRegistryTest.class)
@@ -54,6 +54,19 @@ public final strictfp class NumberConver
     }
 
     /**
+     * Asserts that conversion of the given {@code source} value produces the given {@code target} value.
+     * The conversion is not expected to be invertible. This method is used for testing rounding behavior.
+     */
+    private static <S extends Number, T extends Number> void runConversion(
+            final ObjectConverter<S,T> c, final S source, final T target, final S inverse)
+            throws UnconvertibleObjectException
+    {
+        assertFalse(source.equals(inverse));
+        assertEquals("Forward conversion.", target,  c.apply(source));
+        assertEquals("Inverse conversion.", inverse, c.inverse().apply(target));
+    }
+
+    /**
      * Asserts that conversion of the given {@code source} value produces
      * the given {@code target} value, and tests the inverse conversion.
      */
@@ -115,7 +128,9 @@ public final strictfp class NumberConver
     @Test
     public void testInteger() {
         final ObjectConverter<Float, Integer> c = create(Float.class, Integer.class);
-        runInvertibleConversion(c, Float.valueOf(-8), Integer.valueOf(-8));
+        runInvertibleConversion(c, Float.valueOf(-8),    Integer.valueOf(-8));
+        runConversion          (c, Float.valueOf(2.25f), Integer.valueOf(2), Float.valueOf(2f));
+        runConversion          (c, Float.valueOf(2.75f), Integer.valueOf(3), Float.valueOf(3f));
         // Can not easily tests the values around Integer.MIN/MAX_VALUE because of rounding errors in float.
         assertSame("Deserialization shall resolves to the singleton instance.", c, assertSerializedEquals(c));
     }
@@ -137,6 +152,7 @@ public final strictfp class NumberConver
     public void testFloat() {
         final ObjectConverter<Double, Float> c = create(Double.class, Float.class);
         runInvertibleConversion(c, Double.valueOf(2.5), Float.valueOf(2.5f));
+        runConversion          (c, Double.valueOf(0.1), Float.valueOf(0.1f), Double.valueOf(0.1f));
         tryUnconvertibleValue  (c, Double.valueOf(1E+40));
         assertSame("Deserialization shall resolves to the singleton instance.", c, assertSerializedEquals(c));
     }
@@ -172,6 +188,23 @@ public final strictfp class NumberConver
     }
 
     /**
+     * Tests conversion of a value having more digits than what the {@code double} type can hold.
+     */
+    @Test
+    public void testLargeValue() {
+        final long longValue = 1000000000000000010L;
+        final double doubleValue = longValue;
+        assertTrue(Math.ulp(doubleValue) > 10); // Need to have more digits than 'double' capacity.
+        runConversion(create(BigDecimal.class, Double.class),
+                BigDecimal.valueOf(longValue), Double.valueOf(doubleValue), BigDecimal.valueOf(doubleValue));
+
+        final ObjectConverter<BigDecimal, Long> c = create(BigDecimal.class, Long.class);
+        final BigDecimal value = BigDecimal.valueOf(longValue);
+        runInvertibleConversion(c, value, Long.valueOf(longValue));
+        tryUnconvertibleValue(c, value.multiply(BigDecimal.valueOf(10)));
+    }
+
+    /**
      * Tests conversions to comparable objects. Should returns the object unchanged
      * since all {@link Number} subclasses are comparable.
      */

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/TimePeriodTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/TimePeriodTest.java?rev=1626345&r1=1625241&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/TimePeriodTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gml/TimePeriodTest.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -111,128 +111,4 @@ public final strictfp class TimePeriodTe
         pool.recycle(marshaller);
         pool.recycle(unmarshaller);
     }
-
-    /**
-     * Tests a time period using the GML 2 syntax.
-     * The test is executed using an arbitrary locale and timezone.
-     *
-     * @throws JAXBException If an error occurred while marshalling.
-     */
-    @Test
-    public void testPeriodGML2() throws JAXBException {
-        createContext();
-        final TimePeriodBound begin = new TimePeriodBound.GML2(new DummyInstant(date("1992-01-01 00:00:00")));
-        final TimePeriodBound end   = new TimePeriodBound.GML2(new DummyInstant(date("2007-12-31 00:00:00")));
-        testPeriod(begin, end,
-                "<gml:TimePeriod xmlns:gml=\"" + Namespaces.GML + "\">\n" +
-                "  <gml:begin>\n" +
-                "    <gml:TimeInstant>\n" +
-                "      <gml:timePosition>1992-01-01T01:00:00+01:00</gml:timePosition>\n" +
-                "    </gml:TimeInstant>\n" +
-                "  </gml:begin>\n" +
-                "  <gml:end>\n" +
-                "    <gml:TimeInstant>\n" +
-                "      <gml:timePosition>2007-12-31T01:00:00+01:00</gml:timePosition>\n" +
-                "    </gml:TimeInstant>\n" +
-                "  </gml:end>\n" +
-                "</gml:TimePeriod>\n", true);
-    }
-
-    /**
-     * Tests a time period using GML2 or GML3 syntax. This method is used for the
-     * implementation of {@link #testPeriodGML2()} and {@link #testPeriodGML3()}.
-     * The test is executed using an arbitrary locale and timezone.
-     *
-     * @param expected The expected string.
-     */
-    private void testPeriod(final TimePeriodBound begin, final TimePeriodBound end,
-            final String expected, final boolean verifyValues) throws JAXBException
-    {
-        final Marshaller   marshaller   = pool.acquireMarshaller();
-        final Unmarshaller unmarshaller = pool.acquireUnmarshaller();
-        final TimePeriod   period       = new TimePeriod();
-        period.begin = begin;
-        period.end   = end;
-        final String actual = marshal(marshaller, period);
-        assertXmlEquals(expected, actual, "xmlns:*");
-        final TimePeriod test = (TimePeriod) unmarshal(unmarshaller, actual);
-        if (verifyValues) {
-            assertEquals("1992-01-01 00:00:00", format(XmlUtilities.toDate(context, test.begin.calendar())));
-            assertEquals("2007-12-31 00:00:00", format(XmlUtilities.toDate(context, test.end  .calendar())));
-        }
-        pool.recycle(marshaller);
-        pool.recycle(unmarshaller);
-    }
-
-    /**
-     * Tests a time period using the GML 3 syntax.
-     * The test is executed using an arbitrary locale and timezone.
-     *
-     * @throws JAXBException If an error occurred while marshalling.
-     */
-    @Test
-    public void testPeriodGML3() throws JAXBException {
-        createContext();
-        final TimePeriodBound begin = new TimePeriodBound.GML3(new DummyInstant(date("1992-01-01 00:00:00")), "before");
-        final TimePeriodBound end   = new TimePeriodBound.GML3(new DummyInstant(date("2007-12-31 00:00:00")), "after");
-        testPeriod(begin, end,
-                "<gml:TimePeriod xmlns:gml=\"" + Namespaces.GML + "\">\n" +
-                "  <gml:beginPosition>1992-01-01T01:00:00+01:00</gml:beginPosition>\n" +
-                "  <gml:endPosition>2007-12-31T01:00:00+01:00</gml:endPosition>\n" +
-                "</gml:TimePeriod>\n", true);
-    }
-
-    /**
-     * Same test than {@link #testPeriodGML3()}, but with simplified date format (omit the hours and timezone)
-     * The test is executed using an arbitrary locale and timezone.
-     *
-     * @throws JAXBException If an error occurred while marshalling.
-     */
-    @Test
-    public void testSimplifiedPeriodGML3() throws JAXBException {
-        createContext();
-        final TimePeriodBound begin = new TimePeriodBound.GML3(new DummyInstant(date("1992-01-01 23:00:00")), "before");
-        final TimePeriodBound end   = new TimePeriodBound.GML3(new DummyInstant(date("2007-12-30 23:00:00")), "after");
-        testPeriod(begin, end,
-                "<gml:TimePeriod xmlns:gml=\"" + Namespaces.GML + "\">\n" +
-                "  <gml:beginPosition>1992-01-02</gml:beginPosition>\n" +
-                "  <gml:endPosition>2007-12-31</gml:endPosition>\n" +
-                "</gml:TimePeriod>\n", false);
-    }
-
-    /**
-     * Same test than {@link #testSimplifiedPeriodGML3()}, but without beginning boundary.
-     * The test is executed using an arbitrary locale and timezone.
-     *
-     * @throws JAXBException If an error occurred while marshalling.
-     */
-    @Test
-    public void testBeforePeriodGML3() throws JAXBException {
-        createContext();
-        final TimePeriodBound begin = new TimePeriodBound.GML3(null, "before");
-        final TimePeriodBound end   = new TimePeriodBound.GML3(new DummyInstant(date("2007-12-30 23:00:00")), "after");
-        testPeriod(begin, end,
-                "<gml:TimePeriod xmlns:gml=\"" + Namespaces.GML + "\">\n" +
-                "  <gml:beginPosition indeterminatePosition=\"before\"/>\n" +
-                "  <gml:endPosition>2007-12-31</gml:endPosition>\n" +
-                "</gml:TimePeriod>\n", false);
-    }
-
-    /**
-     * Same test than {@link #testSimplifiedPeriodGML3()}, but without end boundary.
-     * The test is executed using an arbitrary locale and timezone.
-     *
-     * @throws JAXBException If an error occurred while marshalling.
-     */
-    @Test
-    public void testAfterPeriodGML3() throws JAXBException {
-        createContext();
-        final TimePeriodBound begin = new TimePeriodBound.GML3(new DummyInstant(date("1992-01-01 23:00:00")), "before");
-        final TimePeriodBound end   = new TimePeriodBound.GML3(null, "after");
-        testPeriod(begin, end,
-                "<gml:TimePeriod xmlns:gml=\"" + Namespaces.GML + "\">\n" +
-                "  <gml:beginPosition>1992-01-02</gml:beginPosition>\n" +
-                "  <gml:endPosition indeterminatePosition=\"after\"/>\n" +
-                "</gml:TimePeriod>\n", false);
-    }
 }

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -26,6 +26,7 @@ import java.util.EnumSet;
 import java.util.HashSet;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Iterator;
 import java.util.Locale;
 import org.apache.sis.util.collection.CodeListSet;
 import org.apache.sis.util.ObjectConverters;
@@ -43,7 +44,7 @@ import org.apache.sis.internal.jdk8.Func
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public final strictfp class CollectionsExtTest extends TestCase {
@@ -140,4 +141,16 @@ public final strictfp class CollectionsE
             assertMapEquals(expected, CollectionsExt.toCaseInsensitiveNameMap(elements, nameFunction, Locale.ROOT));
         }
     }
+
+    /**
+     * Tests {@link CollectionsExt#identityEquals(Iterator, Iterator)}.
+     */
+    @Test
+    public void testIdentityEquals() {
+        final List<String> c1 = Arrays.asList("A", "B", "C");
+        final List<String> c2 = Arrays.asList("A", "B");
+        assertFalse(CollectionsExt.identityEquals(c1.iterator(), c2.iterator()));
+        assertFalse(CollectionsExt.identityEquals(c2.iterator(), c1.iterator()));
+        assertTrue(CollectionsExt.identityEquals(c1.iterator(), Arrays.asList("A", "B", "C").iterator()));
+    }
 }

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -45,9 +45,11 @@ import static org.apache.sis.test.TestUt
  * <ul>
  *   <li>All implementation classes have {@link XmlRootElement} and {@link XmlType} annotations.</li>
  *   <li>The name declared in the {@code XmlType} annotations matches the
- *       {@linkplain #getExpectedTypeForElement expected value}.</li>
+ *       {@link #getExpectedXmlTypeForElement expected value}.</li>
  *   <li>The name declared in the {@code XmlRootElement} (classes) or {@link XmlElement} (methods)
- *       annotations matches the identifier declared in the {@link UML} annotation of the GeoAPI interfaces.</li>
+ *       annotations matches the identifier declared in the {@link UML} annotation of the GeoAPI interfaces.
+ *       The UML - XML name mapping can be changed by overriding {@link #getExpectedXmlElementName(UML)} and
+ *       {@link #getExpectedXmlRootElementName(UML)}.</li>
  *   <li>The {@code XmlElement.required()} boolean is consistent with the UML {@linkplain Obligation obligation}.</li>
  *   <li>The namespace declared in the {@code XmlRootElement} or {@code XmlElement} annotations
  *       is not redundant with the {@link XmlSchema} annotation in the package.</li>
@@ -198,7 +200,7 @@ public abstract strictfp class Annotatio
      *
      * @see #testImplementationAnnotations()
      */
-    protected abstract String getExpectedTypeForElement(Class<?> type, Class<?> impl);
+    protected abstract String getExpectedXmlTypeForElement(Class<?> type, Class<?> impl);
 
     /**
      * Returns the expected namespace for an element defined by the given specification.
@@ -231,6 +233,26 @@ public abstract strictfp class Annotatio
     }
 
     /**
+     * Returns the name of the XML element for the given UML element.
+     *
+     * @param  uml The UML element.
+     * @return The corresponding XML element name.
+     */
+    protected String getExpectedXmlRootElementName(final UML uml) {
+        return uml.identifier();
+    }
+
+    /**
+     * Returns the name of the XML element for the given UML element.
+     *
+     * @param  uml The UML element.
+     * @return The corresponding XML element name.
+     */
+    protected String getExpectedXmlElementName(final UML uml) {
+        return uml.identifier();
+    }
+
+    /**
      * Replaces {@value #DEFAULT} value by the {@link XmlSchema} namespace if needed,
      * then performs validity check on the resulting namespace. This method checks that:
      *
@@ -276,8 +298,10 @@ public abstract strictfp class Annotatio
         } else {
             namespace = schemaNamespace;
         }
-        assertEquals("Wrong namespace for the ISO specification.",
-                getExpectedNamespace(impl, (uml != null) ? uml.specification() : null), namespace);
+        if (uml != null) {
+            assertEquals("Wrong namespace for the ISO specification.",
+                    getExpectedNamespace(impl, uml.specification()), namespace);
+        }
         return namespace;
     }
 
@@ -350,18 +374,11 @@ public abstract strictfp class Annotatio
 
     /**
      * Returns {@code true} if the given method should be ignored.
-     * This method returns {@code true} of deprecated methods and
-     * some standard methods from the JDK.
+     * This method returns {@code true} for some standard methods from the JDK.
      */
     private static boolean isIgnored(final Method method) {
-        if (method.isAnnotationPresent(Deprecated.class)) {
-            return true;
-        }
         final String name = method.getName();
-        if (name.equals("equals") || name.equals("hashCode") || name.equals("doubleValue")) {
-            return true;
-        }
-        return false;
+        return name.equals("equals") || name.equals("hashCode") || name.equals("doubleValue");
     }
 
     /**
@@ -387,7 +404,9 @@ public abstract strictfp class Annotatio
                     testingMethod = method.getName();
                     if (!isIgnored(method)) {
                         uml = method.getAnnotation(UML.class);
-                        assertNotNull("Missing @UML annotation.", uml);
+                        if (!method.isAnnotationPresent(Deprecated.class)) {
+                            assertNotNull("Missing @UML annotation.", uml);
+                        }
                     }
                 }
             }
@@ -436,7 +455,7 @@ public abstract strictfp class Annotatio
      * <ul>
      *   <li>All implementation classes have {@link XmlRootElement} and {@link XmlType} annotations.</li>
      *   <li>The name declared in the {@code XmlType} annotations matches the
-     *       {@linkplain #getExpectedTypeForElement expected value}.</li>
+     *       {@link #getExpectedXmlTypeForElement expected value}.</li>
      *   <li>The name declared in the {@code XmlRootElement} annotations matches the identifier declared
      *       in the {@link UML} annotation of the GeoAPI interfaces.</li>
      *   <li>The namespace declared in the {@code XmlRootElement} annotations is not redundant with
@@ -473,7 +492,7 @@ public abstract strictfp class Annotatio
             assertNotNull("Missing @XmlRootElement annotation.", root);
             final UML uml = type.getAnnotation(UML.class);
             if (uml != null) {
-                assertEquals("Wrong @XmlRootElement.name().", uml.identifier(), root.name());
+                assertEquals("Wrong @XmlRootElement.name().", getExpectedXmlRootElementName(uml), root.name());
             }
             /*
              * Check that the namespace is the expected one (according subclass)
@@ -485,7 +504,7 @@ public abstract strictfp class Annotatio
              */
             final XmlType xmlType = impl.getAnnotation(XmlType.class);
             assertNotNull("Missing @XmlType annotation.", xmlType);
-            String expected = getExpectedTypeForElement(type, impl);
+            String expected = getExpectedXmlTypeForElement(type, impl);
             if (expected == null) {
                 expected = DEFAULT;
             }
@@ -545,7 +564,7 @@ public abstract strictfp class Annotatio
                  * is because subclasses may choose to override the above test method.
                  */
                 if (uml != null) {
-                    assertEquals("Wrong @XmlElement.name().", uml.identifier(), element.name());
+                    assertEquals("Wrong @XmlElement.name().", getExpectedXmlElementName(uml), element.name());
                     assertEquals("Wrong @XmlElement.required().", uml.obligation() == Obligation.MANDATORY, element.required());
                 }
                 /*

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -56,11 +56,16 @@ import static org.apache.sis.util.collec
  * @author  Stephen Connolly
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from <a href="http://github.com/junit-team/junit.contrib/tree/master/assumes">junit-team</a>)
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public final class TestRunner extends BlockJUnit4ClassRunner {
     /**
+     * {@code true} if ignoring a test should cause its dependencies to be skipped as well.
+     */
+    static final boolean TRANSITIVE_IGNORE = false;
+
+    /**
      * The test methods to be executed, sorted according their dependencies.
      * This array is created by {@link #getFilteredChildren()} when first needed.
      */
@@ -152,7 +157,9 @@ public final class TestRunner extends Bl
          */
         @Override
         public void testAssumptionFailure(final Failure failure) {
-            addDependencyFailure(failure.getDescription().getMethodName());
+            if (TRANSITIVE_IGNORE) {
+                addDependencyFailure(failure.getDescription().getMethodName());
+            }
         }
 
         /**
@@ -160,7 +167,9 @@ public final class TestRunner extends Bl
          */
         @Override
         public void testIgnored(final Description description) {
-            addDependencyFailure(description.getMethodName());
+            if (TRANSITIVE_IGNORE) {
+                addDependencyFailure(description.getMethodName());
+            }
         }
     };
 

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -26,7 +26,7 @@ import org.junit.BeforeClass;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.5
  * @module
  */
 @Suite.SuiteClasses({
@@ -86,7 +86,11 @@ import org.junit.BeforeClass;
     org.apache.sis.util.iso.AbstractNameTest.class,
     org.apache.sis.util.iso.DefaultNameFactoryTest.class,
     org.apache.sis.util.iso.NamesTest.class,
+    org.apache.sis.util.iso.TypeNamesTest.class,
     org.apache.sis.internal.simple.SimpleReferenceIdentifierTest.class,
+    org.apache.sis.util.iso.DefaultRecordTypeTest.class,
+    org.apache.sis.util.iso.DefaultRecordSchemaTest.class,
+    org.apache.sis.util.iso.DefaultRecordTest.class,
 
     // Measurements and formatting.
     org.apache.sis.measure.SexagesimalConverterTest.class,
@@ -122,6 +126,7 @@ import org.junit.BeforeClass;
     // XML most basic types.
     org.apache.sis.xml.XLinkTest.class,
     org.apache.sis.xml.NilReasonTest.class,
+    org.apache.sis.xml.LegacyCodesTest.class,
     org.apache.sis.xml.ValueConverterTest.class,
     org.apache.sis.xml.OGCNamespacePrefixMapperTest.class,
     org.apache.sis.xml.MarshallerPoolTest.class,
@@ -132,6 +137,7 @@ import org.junit.BeforeClass;
     org.apache.sis.internal.jaxb.gco.MeasureTest.class,
     org.apache.sis.internal.jaxb.gco.PropertyTypeTest.class,
     org.apache.sis.internal.jaxb.gmd.LanguageCodeTest.class,
+    org.apache.sis.internal.jaxb.gml.TimePeriodTest.class,
     org.apache.sis.util.iso.NameMarshallingTest.class
 })
 public final strictfp class UtilityTestSuite extends TestSuite {

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/CharactersTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/CharactersTest.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/CharactersTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/CharactersTest.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -29,7 +29,7 @@ import static org.apache.sis.util.Charac
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.00)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 public final strictfp class CharactersTest extends TestCase {
@@ -58,6 +58,36 @@ public final strictfp class CharactersTe
     }
 
     /**
+     * Tests the {@link Characters#isHexadecimal()} method.
+     *
+     * @since 0.5
+     */
+    @Test
+    public void testIsHexadecimal() {
+        assertTrue(isHexadecimal('0'));
+        assertTrue(isHexadecimal('5'));
+        assertTrue(isHexadecimal('9'));
+        assertTrue(isHexadecimal('A'));
+        assertTrue(isHexadecimal('C'));
+        assertTrue(isHexadecimal('F'));
+        assertTrue(isHexadecimal('a'));
+        assertTrue(isHexadecimal('c'));
+        assertTrue(isHexadecimal('f'));
+
+        assertFalse(isHexadecimal(' '));
+        assertFalse(isHexadecimal('_'));
+        assertFalse(isHexadecimal(':'));
+        assertFalse(isHexadecimal('/'));
+        assertFalse(isHexadecimal('>'));
+        assertFalse(isHexadecimal('@'));
+        assertFalse(isHexadecimal('`'));
+        assertFalse(isHexadecimal('G'));
+        assertFalse(isHexadecimal('Q'));
+        assertFalse(isHexadecimal('g'));
+        assertFalse(isHexadecimal('q'));
+    }
+
+    /**
      * Tests {@link Characters#toSuperScript(char)}.
      */
     @Test

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/ClassesTest.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -57,7 +57,7 @@ import org.opengis.referencing.operation
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-2.5)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 public final strictfp class ClassesTest extends TestCase {
@@ -106,13 +106,13 @@ public final strictfp class ClassesTest 
         assertArrayEquals("TreeSet class", new Class<?>[] {NavigableSet.class},
                 getLeafInterfaces(TreeSet.class, Collection.class));
 
-        assertArrayEquals("Convolved class", new Class<?>[] {GeographicCRS.class},
+        assertArrayEquals("GeographicCRS", new Class<?>[] {GeographicCRS.class},
                 getLeafInterfaces(T1.class, IdentifiedObject.class));
 
-        assertArrayEquals("Convolved class", new Class<?>[] {GeographicCRS.class, CoordinateOperation.class},
+        assertArrayEquals("Mixed types",   new Class<?>[] {GeographicCRS.class, CoordinateOperation.class},
                 getLeafInterfaces(T2.class, IdentifiedObject.class));
 
-        assertArrayEquals("Convolved class", new Class<?>[] {Transformation.class, GeographicCRS.class},
+        assertArrayEquals("Mixed types",   new Class<?>[] {Transformation.class, GeographicCRS.class},
                 getLeafInterfaces(T3.class, IdentifiedObject.class));
     }
 
@@ -198,28 +198,30 @@ public final strictfp class ClassesTest 
         final Class<Parameterized> c = Parameterized.class;
         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)));
+        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(Comparable.class, boundOfParameterizedProperty(c.getMethod("getter5", 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 #testBoundOfParameterizedProperty()} usage only.
      */
+    @SuppressWarnings("rawtypes")
     private static final class Parameterized {
         public Set<? extends Long> attrib2 = null;
-        @SuppressWarnings("rawtypes")
         public Set                 getter0() {return null;} // Intentionnaly unparameterized.
         public Set<       Integer> getter1() {return null;}
         public Set<? extends Byte> getter2() {return null;}
         public Set<? super  Float> getter3() {return null;}
         public Set<       short[]> getter4() {return null;}
-        @SuppressWarnings("rawtypes")
+        public Set<Comparable<?>>  getter5() {return null;}
+
         public void setter0(Set                  dummy) {}  // Intentionnaly unparameterized.
         public void setter1(Set<         String> dummy) {}
         public void setter2(Set<? extends Short> dummy) {}

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/NameMarshallingTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/NameMarshallingTest.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/NameMarshallingTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/NameMarshallingTest.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -24,6 +24,7 @@ import org.opengis.util.TypeName;
 import org.opengis.util.LocalName;
 import org.opengis.util.GenericName;
 import org.opengis.util.NameFactory;
+import org.opengis.util.NameSpace;
 import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.xml.Namespaces;
 import org.apache.sis.xml.MarshallerPool;
@@ -42,7 +43,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.00)
- * @version 0.3
+ * @version 0.5
  * @module
  */
 @DependsOn(DefaultNameFactoryTest.class)
@@ -97,7 +98,7 @@ public final strictfp class NameMarshall
                 "</gml:IO_IdentifiedObject>\n";
         final String actual = marshal(name);
         assertXmlEquals(expected, actual, "xmlns:*");
-        assertEquals(name, unmarshall(actual));
+        assertEquals(name, unmarshall(expected));
     }
 
     /**
@@ -120,7 +121,31 @@ public final strictfp class NameMarshall
                 "</gml:IO_IdentifiedObject>\n";
         final String actual = marshal(name);
         assertXmlEquals(expected, actual, "xmlns:*");
-        assertEquals(name, unmarshall(actual));
+        assertEquals(name, unmarshall(expected));
+    }
+
+    /**
+     * Tests XML of a {@link LocalName} with a scope.
+     *
+     * @throws JAXBException Should not happen.
+     */
+    @Test
+    @DependsOnMethod("testLocalName")
+    public void testLocalNameWithScope() throws JAXBException {
+        final NameFactory factory = DefaultFactories.SIS_NAMES;
+        final NameSpace scope = factory.createNameSpace(factory.createLocalName(null, "A code space"), null);
+        final LocalName name = factory.createLocalName(scope, "A name in a scope");
+        assertEquals("A name in a scope", name.toString());
+        final String expected =
+                "<gml:IO_IdentifiedObject xmlns:gml=\"" + Namespaces.GML + '"' +
+                                        " xmlns:gco=\"" + Namespaces.GCO + "\">\n" +
+                "  <gml:alias>\n" +
+                "    <gco:LocalName codeSpace=\"A code space\">A name in a scope</gco:LocalName>\n" +
+                "  </gml:alias>\n" +
+                "</gml:IO_IdentifiedObject>\n";
+        final String actual = marshal(name);
+        assertXmlEquals(expected, actual, "xmlns:*");
+        assertEquals(name, unmarshall(expected));
     }
 
     /**
@@ -146,7 +171,7 @@ public final strictfp class NameMarshall
                 "</gml:IO_IdentifiedObject>\n";
         final String actual = marshal(name);
         assertXmlEquals(expected, actual, "xmlns:*");
-        assertEquals(name, unmarshall(actual));
+        assertEquals(name, unmarshall(expected));
     }
 
     /**
@@ -168,7 +193,7 @@ public final strictfp class NameMarshall
                 "</gml:IO_IdentifiedObject>\n";
         final String actual = marshal(name);
         assertXmlEquals(expected, actual, "xmlns:*");
-        assertEquals(name, unmarshall(actual));
+        assertEquals(name, unmarshall(expected));
     }
 
     /**

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/NamesTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/NamesTest.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/NamesTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/NamesTest.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -16,7 +16,16 @@
  */
 package org.apache.sis.util.iso;
 
+import java.util.List;
+import java.util.Random;
+import org.opengis.util.GenericName;
+import org.opengis.util.TypeName;
 import org.opengis.util.LocalName;
+import org.opengis.util.InternationalString;
+import org.opengis.util.NameSpace;
+import org.opengis.util.ScopedName;
+import org.apache.sis.util.UnknownNameException;
+import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
@@ -45,4 +54,81 @@ public final strictfp class NamesTest ex
         assertEquals("http://www.opengis.net/gml/srs/epsg.xml#4326",  name.toFullyQualifiedName().toString());
         assertEquals("{http://www.opengis.net/gml/srs/epsg.xml}4326", Names.toExpandedString(name));
     }
+
+    /**
+     * Tests {@link Names#toClass(TypeName)} with a name in the {@code "class"} scope.
+     * If the name is not recognized, then {@code toClass(TypeName)} is expected to throw an exception.
+     */
+    @Test
+    public void testClassFromClassname() {
+        final TypeName type = DefaultFactories.SIS_NAMES.toTypeName(Random.class);
+        assertEquals("class:java.util.Random", type.toFullyQualifiedName().toString());
+        assertValueClassEquals(Random.class, type);
+        assertValueClassEquals(DefaultNameFactoryTest.class,
+                new DefaultTypeName(type.scope(), DefaultNameFactoryTest.class.getName()));
+        assertValueClassEquals(UnknownNameException.class,
+                new DefaultTypeName(type.scope(), "org.apache.sis.Dummy"));
+    }
+
+    /**
+     * Tests {@link Names#toClass(TypeName)} with a name in the {@code "OGC"} scope.
+     * If the name is not recognized, then {@code toClass(TypeName)} is expected to throw an exception.
+     */
+    @Test
+    public void testClassFromOGC() {
+        final TypeName type = DefaultFactories.SIS_NAMES.toTypeName(String.class);
+        assertEquals("OGC:CharacterString", type.toFullyQualifiedName().toString());
+        assertValueClassEquals(String.class,               type);
+        assertValueClassEquals(Double.class,               new DefaultTypeName(type.scope(), "Real"));
+        assertValueClassEquals(InternationalString.class,  new DefaultTypeName(type.scope(), "FreeText"));
+        assertValueClassEquals(UnknownNameException.class, new DefaultTypeName(type.scope(), "Dummy"));
+    }
+
+    /**
+     * Tests {@link Names#toClass(TypeName)} with in a scope different than {@code "OGC"}.
+     * If the name is not recognized, then {@code toClass(TypeName)} is expected to return
+     * {@code null} rather than throwing an exception because the namespace is used for too
+     * many things - we can not said that the name is wrong.
+     */
+    @Test
+    public void testClassFromOtherNamespaces() {
+        assertValueClassEquals(null,         Names.createTypeName("MyOrg", ":", "CharacterString"));
+        assertValueClassEquals(String.class, Names.createTypeName(null,    ":", "CharacterString"));
+        assertValueClassEquals(null,         Names.createTypeName(null,    ":", "Dummy"));
+    }
+
+    /**
+     * Invokes {@link Names#toClass(TypeName)}, but catch {@link UnknownNameException}.
+     * If the later exception is caught, then this method returns {@code UnknownNameException.class}.
+     */
+    private static Class<?> toClass(final TypeName type) {
+        try {
+            return Names.toClass(type);
+        } catch (UnknownNameException e) {
+            final String message = e.getMessage();
+            assertTrue(message, message.contains(type.toFullyQualifiedName().toString()));
+            return UnknownNameException.class;
+        }
+    }
+
+    /**
+     * Asserts that calls to {@link Names#toClass(TypeName)} returns the expected value class.
+     */
+    private static void assertValueClassEquals(final Class<?> expected, final TypeName type) {
+        assertEquals(expected, toClass(type));
+
+        // Tests detection with an implementation which is not the SIS one.
+        assertEquals(expected, toClass(new TypeName() {
+            @Override public int                       depth()                  {return type.depth();}
+            @Override public List<? extends LocalName> getParsedNames()         {return type.getParsedNames();}
+            @Override public LocalName                 head()                   {return type.head();}
+            @Override public LocalName                 tip()                    {return type.tip();}
+            @Override public NameSpace                 scope()                  {return type.scope();}
+            @Override public GenericName               toFullyQualifiedName()   {return type.toFullyQualifiedName();}
+            @Override public ScopedName                push(GenericName scope)  {return type.push(scope);}
+            @Override public String                    toString()               {return type.toString();}
+            @Override public InternationalString       toInternationalString()  {return type.toInternationalString();}
+            @Override public int                       compareTo(GenericName o) {return type.compareTo(o);}
+        }));
+    }
 }

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -16,10 +16,8 @@
  */
 package org.apache.sis.util.iso;
 
-import java.util.Set;
 import java.util.Map;
 import java.util.Arrays;
-import java.util.HashSet;
 import java.util.HashMap;
 import java.util.TreeMap;
 import java.util.Locale;
@@ -28,7 +26,6 @@ import org.opengis.metadata.citation.Add
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.citation.OnLineFunction;
 import org.opengis.metadata.content.ImagingCondition;
-import org.opengis.metadata.identification.CharacterSet;
 import org.opengis.referencing.datum.Datum;
 import org.opengis.referencing.cs.AxisDirection;
 import org.apache.sis.test.TestCase;
@@ -42,7 +39,7 @@ import static org.opengis.test.Assert.*;
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3 (derived from geotk-2.1)
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public final strictfp class TypesTest extends TestCase {
@@ -132,12 +129,12 @@ public final strictfp class TypesTest ex
      */
     @Test
     public void testGetDescription() {
-        final InternationalString description = Types.getDescription(CharacterSet.class);
-        assertEquals("Name of the character coding standard used in the resource.",
+        final InternationalString description = Types.getDescription(OnLineFunction.class);
+        assertEquals("Function performed by the resource.",
                 description.toString(Locale.ROOT));
-        assertEquals("Name of the character coding standard used in the resource.",
+        assertEquals("Function performed by the resource.",
                 description.toString(Locale.ENGLISH));
-        assertEquals("Jeu de caractères.",
+        assertEquals("Fonctionnalité offerte par la ressource.",
                 description.toString(Locale.FRENCH));
     }
 
@@ -153,51 +150,51 @@ public final strictfp class TypesTest ex
     }
 
     /**
-     * Tests the {@link Types#getDescription(CodeList)} method.
+     * Tests the {@link Types#getDescription(Enumerated)} method.
      */
     @Test
     public void testGetCodeDescription() {
-        final InternationalString description = Types.getDescription(CharacterSet.ISO_8859_1);
-        assertEquals("ISO/IEC 8859-1, Information technology - 8-bit single byte coded graphic character sets - Part 1 : Latin alphabet No.1.",
+        final InternationalString description = Types.getDescription(OnLineFunction.DOWNLOAD);
+        assertEquals("Online instructions for transferring data from one storage device or system to another.",
                 description.toString(Locale.ROOT));
-        assertEquals("ISO/IEC 8859-1, Information technology - 8-bit single byte coded graphic character sets - Part 1 : Latin alphabet No.1.",
+        assertEquals("Online instructions for transferring data from one storage device or system to another.",
                 description.toString(Locale.ENGLISH));
-        assertEquals("ISO/IEC 8859-1, alphabet latin 1.",
+        assertEquals("Transfert de la ressource d'un système à un autre.",
                 description.toString(Locale.FRENCH));
     }
 
     /**
-     * Tests the examples given in {@link Types#getListName(CodeList)} javadoc.
+     * Tests the examples given in {@link Types#getListName(Enumerated)} javadoc.
      */
     @Test
     public void testGetListName() {
-        assertEquals("CS_AxisDirection",        Types.getListName(AxisDirection   .NORTH));
-        assertEquals("MD_CharacterSetCode",     Types.getListName(CharacterSet    .UTF_8));
-        assertEquals("MD_ImagingConditionCode", Types.getListName(ImagingCondition.BLURRED_IMAGE));
+        assertEquals("CS_AxisDirection",        Types.getListName(AxisDirection     .NORTH));
+        assertEquals("CI_OnLineFunctionCode",   Types.getListName(OnLineFunction    .DOWNLOAD));
+        assertEquals("MD_ImagingConditionCode", Types.getListName(ImagingCondition  .BLURRED_IMAGE));
     }
 
     /**
-     * Tests the examples given in {@link Types#getCodeName(CodeList)} javadoc.
+     * Tests the examples given in {@link Types#getCodeName(Enumerated)} javadoc.
      */
     @Test
     public void testGetCodeName() {
-        assertEquals("north",        Types.getCodeName(AxisDirection   .NORTH));
-        assertEquals("utf8",         Types.getCodeName(CharacterSet    .UTF_8));
-        assertEquals("blurredImage", Types.getCodeName(ImagingCondition.BLURRED_IMAGE));
+        assertEquals("north",        Types.getCodeName(AxisDirection     .NORTH));
+        assertEquals("download",     Types.getCodeName(OnLineFunction    .DOWNLOAD));
+        assertEquals("blurredImage", Types.getCodeName(ImagingCondition  .BLURRED_IMAGE));
     }
 
     /**
-     * Tests the examples given in {@link Types#getCodeLabel(CodeList)} javadoc.
+     * Tests the examples given in {@link Types#getCodeLabel(Enumerated)} javadoc.
      */
     @Test
     public void testGetCodeLabel() {
         assertEquals("North",         Types.getCodeLabel(AxisDirection   .NORTH));
-        assertEquals("UTF-8",         Types.getCodeLabel(CharacterSet    .UTF_8));
+        assertEquals("Download",      Types.getCodeLabel(OnLineFunction  .DOWNLOAD));
         assertEquals("Blurred image", Types.getCodeLabel(ImagingCondition.BLURRED_IMAGE));
     }
 
     /**
-     * Tests {@link Types#getCodeTitle(CodeList)}.
+     * Tests {@link Types#getCodeTitle(Enumerated)}.
      */
     @Test
     public void testGetCodeTitle() {
@@ -211,10 +208,9 @@ public final strictfp class TypesTest ex
      */
     @Test
     public void testGetCodeValues() {
-        final Set<OnLineFunction> expected = new HashSet<OnLineFunction>(Arrays.asList(
-                OnLineFunction.INFORMATION, OnLineFunction.SEARCH, OnLineFunction.ORDER,
-                OnLineFunction.DOWNLOAD, OnLineFunction.OFFLINE_ACCESS));
         final OnLineFunction[] actual = Types.getCodeValues(OnLineFunction.class);
-        assertTrue(expected.containsAll(Arrays.asList(actual)));
+        assertTrue(Arrays.asList(actual).containsAll(Arrays.asList(
+                OnLineFunction.INFORMATION, OnLineFunction.SEARCH, OnLineFunction.ORDER,
+                OnLineFunction.DOWNLOAD, OnLineFunction.OFFLINE_ACCESS)));
     }
 }

Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/xml/ValueConverterTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/xml/ValueConverterTest.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/xml/ValueConverterTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/xml/ValueConverterTest.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -17,10 +17,14 @@
 package org.apache.sis.xml;
 
 import java.util.Locale;
+import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static org.apache.sis.test.Assert.*;
+import static org.junit.Assert.*;
+
+// Branch-dependent imports
+import org.apache.sis.internal.jdk7.StandardCharsets;
 
 
 /**
@@ -28,9 +32,10 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.5
  * @module
  */
+@DependsOn(LegacyCodesTest.class)
 public final strictfp class ValueConverterTest extends TestCase {
     /**
      * Tests {@link ValueConverter#toLanguageCode(MarshalContext, Locale)}.
@@ -66,4 +71,26 @@ public final strictfp class ValueConvert
         assertEquals("JP", ValueConverter.DEFAULT.toCountryCode(null, Locale.JAPAN));
         assertNull  (      ValueConverter.DEFAULT.toCountryCode(null, Locale.JAPANESE));
     }
+
+    /**
+     * Tests {@link ValueConverter#toCharsetCode(MarshalContext, Charset)}.
+     */
+    @Test
+    public void testToCharsetCode() {
+        assertEquals("utf8",      ValueConverter.DEFAULT.toCharsetCode(null, StandardCharsets.UTF_8));
+        assertEquals("utf16",     ValueConverter.DEFAULT.toCharsetCode(null, StandardCharsets.UTF_16));
+        assertEquals("8859part1", ValueConverter.DEFAULT.toCharsetCode(null, StandardCharsets.ISO_8859_1));
+    }
+
+    /**
+     * Tests {@link ValueConverter#toCharset(MarshalContext, String)}.
+     */
+    @Test
+    public void testToCharset() {
+        assertEquals(StandardCharsets.UTF_8,      ValueConverter.DEFAULT.toCharset(null, "utf8"));
+        assertEquals(StandardCharsets.UTF_8,      ValueConverter.DEFAULT.toCharset(null, "UTF-8"));
+        assertEquals(StandardCharsets.UTF_16,     ValueConverter.DEFAULT.toCharset(null, "utf16"));
+        assertEquals(StandardCharsets.ISO_8859_1, ValueConverter.DEFAULT.toCharset(null, "8859part1"));
+        assertEquals(StandardCharsets.ISO_8859_1, ValueConverter.DEFAULT.toCharset(null, "ISO-8859-1"));
+    }
 }

Modified: sis/trunk/ide-project/NetBeans/nbproject/project.properties
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/nbproject/project.properties?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] (original)
+++ sis/trunk/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] Fri Sep 19 21:46:39 2014
@@ -74,7 +74,7 @@ geoapi.version       = 3.0.0
 unit-api.version     = 0.6.1
 jsr275.version       = 0.9.3
 jama.version         = 1.0.3
-geometry.version     = 1.1
+geometry.version     = 1.1.1
 georss.version       = 0.9.8
 rome.version         = 0.9
 jdom1.version        = 1.0

Modified: sis/trunk/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/pom.xml?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/pom.xml (original)
+++ sis/trunk/pom.xml Fri Sep 19 21:46:39 2014
@@ -234,6 +234,12 @@ Apache SIS is a free software, Java lang
       </roles>
     </contributor>
     <contributor>
+      <name>Christina Hough</name>
+      <roles>
+        <role>translator</role>
+      </roles>
+    </contributor>
+    <contributor>
       <name>Gregory D. Reddin</name>
       <!-- id>greddin</id -->
       <roles>
@@ -511,47 +517,6 @@ Apache SIS is a free software, Java lang
         </configuration>
       </plugin>
 
-      <!-- Build XHTML pages from the DocBook files
-           See src/main/docbook/README.txt -->
-      <plugin>
-        <groupId>com.agilejava.docbkx</groupId>
-        <artifactId>docbkx-maven-plugin</artifactId>
-        <version>2.0.14</version>
-        <inherited>false</inherited>
-        <dependencies>
-          <dependency> <!-- XHTML generation -->
-            <groupId>net.sf.docbook</groupId>
-            <artifactId>docbook-xml</artifactId>
-            <version>5.0-all</version>
-            <classifier>resources</classifier>
-            <type>zip</type>
-            <scope>runtime</scope>
-          </dependency>
-          <dependency> <!-- Syntax highlighting -->
-            <groupId>net.sf.xslthl</groupId>
-            <artifactId>xslthl</artifactId>
-            <version>2.1.0</version>
-            <scope>runtime</scope>
-          </dependency>
-        </dependencies>
-        <configuration>
-          <sourceDirectory>${basedir}/src/main/docbook</sourceDirectory>
-          <targetDirectory>${basedir}/target/site/book</targetDirectory>
-          <xhtmlCustomization>src/main/docbook/book.xsl</xhtmlCustomization>
-          <xincludeSupported>true</xincludeSupported>
-          <htmlStylesheet>book.css</htmlStylesheet>
-          <highlightSource>true</highlightSource>
-        </configuration>
-        <executions>
-          <execution>
-            <goals>
-              <goal>generate-xhtml</goal>
-            </goals>
-            <phase>pre-site</phase>
-          </execution>
-        </executions>
-      </plugin>
-
       <!-- JavaDoc configuration. -->
       <plugin>
         <artifactId>maven-javadoc-plugin</artifactId>

Modified: sis/trunk/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DirectReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/trunk/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DirectReferenceSystem.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DirectReferenceSystem.java [UTF-8] (original)
+++ sis/trunk/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DirectReferenceSystem.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -20,7 +20,8 @@ import javax.xml.bind.annotation.XmlType
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.referencing.ReferenceSystem;
 import org.opengis.referencing.ReferenceIdentifier;
-import org.apache.sis.internal.jaxb.metadata.ReferenceSystemMetadata;
+import org.apache.sis.internal.jaxb.metadata.replace.ReferenceSystemMetadata;
+import org.apache.sis.util.ComparisonMode;
 
 
 /**
@@ -73,4 +74,16 @@ public class DirectReferenceSystem exten
     public DirectReferenceSystem(final ReferenceIdentifier identifier) {
         super(identifier);
     }
+
+    /**
+     * Compares this object with the given one for equality.
+     *
+     * @param  object The object to compare with this reference system.
+     * @param  mode The strictness level of the comparison.
+     * @return {@code true} if both objects are equal.
+     */
+    @Override
+    public boolean equals(final Object object, final ComparisonMode mode) {
+        return super.equals(object, mode) && (object instanceof DirectReferenceSystem);
+    }
 }

Modified: sis/trunk/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/IndirectReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/trunk/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/IndirectReferenceSystem.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/IndirectReferenceSystem.java [UTF-8] (original)
+++ sis/trunk/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/IndirectReferenceSystem.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -20,7 +20,8 @@ import javax.xml.bind.annotation.XmlType
 import javax.xml.bind.annotation.XmlRootElement;
 import org.opengis.referencing.ReferenceSystem;
 import org.opengis.referencing.ReferenceIdentifier;
-import org.apache.sis.internal.jaxb.metadata.ReferenceSystemMetadata;
+import org.apache.sis.internal.jaxb.metadata.replace.ReferenceSystemMetadata;
+import org.apache.sis.util.ComparisonMode;
 
 
 /**
@@ -73,4 +74,16 @@ public class IndirectReferenceSystem ext
     public IndirectReferenceSystem(final ReferenceIdentifier identifier) {
         super(identifier);
     }
+
+    /**
+     * Compares this object with the given one for equality.
+     *
+     * @param  object The object to compare with this reference system.
+     * @param  mode The strictness level of the comparison.
+     * @return {@code true} if both objects are equal.
+     */
+    @Override
+    public boolean equals(final Object object, final ComparisonMode mode) {
+        return super.equals(object, mode) && (object instanceof IndirectReferenceSystem);
+    }
 }

Modified: sis/trunk/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java [UTF-8] (original)
+++ sis/trunk/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -27,7 +27,6 @@ import org.apache.sis.test.XMLTestCase;
 import org.junit.Test;
 
 import static org.apache.sis.test.Assert.*;
-import static org.apache.sis.test.TestUtilities.getSingleton;
 
 
 /**
@@ -36,7 +35,7 @@ import static org.apache.sis.test.TestUt
  * @author  Cédric Briançon (Geomatys)
  * @author  Guilhem Legal (Geomatys)
  * @version 0.4 (derived from geotk-3.00)
- * @since   0.4
+ * @since   0.5
  * @module
  */
 public final strictfp class DirectReferenceSystemTest extends XMLTestCase {
@@ -50,8 +49,9 @@ public final strictfp class DirectRefere
      */
     private static DefaultMetadata createMetadata() {
         final DefaultMetadata metadata = new DefaultMetadata();
-        final DirectReferenceSystem refSys = new DirectReferenceSystem(new ImmutableIdentifier(
-                new DefaultCitation(getSingleton(HardCodedCitations.EPSG.getCitedResponsibleParties())), null, "4326"));
+        final DefaultCitation citation = new DefaultCitation("European Petroleum Survey Group");
+        citation.setCitedResponsibleParties(HardCodedCitations.EPSG.getCitedResponsibleParties());
+        final DirectReferenceSystem refSys = new DirectReferenceSystem(new ImmutableIdentifier(citation, null, "4326"));
         metadata.setReferenceSystemInfo(Arrays.asList(refSys));
         return metadata;
     }

Modified: sis/trunk/profiles/sis-french-profile/src/test/java/org/apache/sis/profile/france/FrenchProfileTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/profiles/sis-french-profile/src/test/java/org/apache/sis/profile/france/FrenchProfileTest.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/profiles/sis-french-profile/src/test/java/org/apache/sis/profile/france/FrenchProfileTest.java [UTF-8] (original)
+++ sis/trunk/profiles/sis-french-profile/src/test/java/org/apache/sis/profile/france/FrenchProfileTest.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -23,7 +23,7 @@ import org.opengis.metadata.constraint.S
 import org.apache.sis.metadata.iso.constraint.DefaultConstraints;
 import org.apache.sis.metadata.iso.constraint.DefaultLegalConstraints;
 import org.apache.sis.metadata.iso.constraint.DefaultSecurityConstraints;
-import org.apache.sis.internal.jaxb.metadata.ReferenceSystemMetadata;
+import org.apache.sis.internal.jaxb.metadata.replace.ReferenceSystemMetadata;
 import org.apache.sis.internal.profile.fra.IndirectReferenceSystem;
 import org.apache.sis.internal.profile.fra.DirectReferenceSystem;
 import org.apache.sis.metadata.iso.ImmutableIdentifier;

Modified: sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java?rev=1626345&r1=1626344&r2=1626345&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java [UTF-8] (original)
+++ sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java [UTF-8] Fri Sep 19 21:46:39 2014
@@ -72,6 +72,7 @@ import org.apache.sis.internal.metadata.
 // Consequently the compiled class files should not have this dependency.
 import ucar.nc2.constants.CF;
 
+import static java.util.Collections.singleton;
 import static org.apache.sis.storage.netcdf.AttributeNames.*;
 
 
@@ -285,7 +286,7 @@ final class MetadataReader {
     private static Address createAddress(final String email) {
         if (email != null) {
             final DefaultAddress address = new DefaultAddress();
-            address.getElectronicMailAddresses().add(email);
+            address.setElectronicMailAddresses(singleton(email));
             return address;
         }
         return null;
@@ -297,8 +298,8 @@ final class MetadataReader {
     private static Contact createContact(final Address address, final OnlineResource url) {
         if (address != null || url != null) {
             final DefaultContact contact = new DefaultContact();
-            contact.setAddress(address);
-            contact.setOnlineResource(url);
+            if (address != null) contact.setAddresses(singleton(address));
+            if (url     != null) contact.setOnlineResources(singleton(url));
             return contact;
         }
         return null;
@@ -428,18 +429,18 @@ final class MetadataReader {
         final String references = decoder.stringValue(REFERENCES);
         final DefaultCitation citation = new DefaultCitation(title);
         if (identifier != null) {
-            citation.getIdentifiers().add(identifier);
+            citation.setIdentifiers(singleton(identifier));
         }
-        if (creation != null) citation.getDates().add(new DefaultCitationDate(creation, DateType.CREATION));
-        if (modified != null) citation.getDates().add(new DefaultCitationDate(modified, DateType.REVISION));
-        if (issued   != null) citation.getDates().add(new DefaultCitationDate(issued,   DateType.PUBLICATION));
+        if (creation != null) citation.setDates(singleton(new DefaultCitationDate(creation, DateType.CREATION)));
+        if (modified != null) citation.getDates()  .add  (new DefaultCitationDate(modified, DateType.REVISION));
+        if (issued   != null) citation.getDates()  .add  (new DefaultCitationDate(issued,   DateType.PUBLICATION));
         if (pointOfContact != null) {
             // Same responsible party than the contact, except for the role.
             final DefaultResponsibleParty np = new DefaultResponsibleParty(Role.ORIGINATOR);
             np.setIndividualName  (pointOfContact.getIndividualName());
             np.setOrganisationName(pointOfContact.getOrganisationName());
             np.setContactInfo     (pointOfContact.getContactInfo());
-            citation.getCitedResponsibleParties().add(np);
+            citation.setCitedResponsibleParties(singleton(np));
         }
         for (final String path : searchPath) {
             decoder.setSearchPath(path);
@@ -503,7 +504,7 @@ final class MetadataReader {
                     // Takes only ONE extent, because a NetCDF file may declare many time the same
                     // extent with different precision. The groups are ordered in such a way that
                     // the first extent should be the most accurate one.
-                    identification.getExtents().add(extent);
+                    identification.setExtents(singleton(extent));
                     hasExtent = true;
                 }
             }
@@ -523,7 +524,7 @@ final class MetadataReader {
         identification.setAbstract(toInternationalString(summary));
         identification.setPurpose (toInternationalString(purpose));
         if (pointOfContact != null) {
-            identification.getPointOfContacts().add(pointOfContact);
+            identification.setPointOfContacts(singleton(pointOfContact));
         }
         addKeywords(identification, project,   "project"); // Not necessarily the same string than PROJECT.
         addKeywords(identification, publisher, "dataCenter");
@@ -645,7 +646,7 @@ final class MetadataReader {
             if (extent == null) {
                 extent = new DefaultExtent();
             }
-            extent.getVerticalElements().add(new DefaultVerticalExtent(min, max, VERTICAL_CRS));
+            extent.setVerticalElements(singleton(new DefaultVerticalExtent(min, max, VERTICAL_CRS)));
         }
         /*
          * Get the start and end times as Date objects if available, or as numeric values otherwise.
@@ -676,7 +677,7 @@ final class MetadataReader {
             if (extent == null) {
                 extent = new DefaultExtent();
             }
-            extent.getTemporalElements().add(t);
+            extent.setTemporalElements(singleton(t));
         } catch (UnsupportedOperationException e) {
             decoder.listeners.warning(null, e);
         }
@@ -688,7 +689,7 @@ final class MetadataReader {
             if (extent == null) {
                 extent = new DefaultExtent();
             }
-            extent.getGeographicElements().add(new DefaultGeographicDescription(null, identifier));
+            extent.setGeographicElements(singleton(new DefaultGeographicDescription(null, identifier)));
         }
         return extent;
     }
@@ -854,7 +855,7 @@ final class MetadataReader {
             metadata.setFileIdentifier(code);
         }
         metadata.setDateStamp(decoder.dateValue(METADATA_CREATION));
-        metadata.getHierarchyLevels().add(ScopeCode.DATASET);
+        metadata.setHierarchyLevels(singleton(ScopeCode.DATASET));
         final String wms = decoder.stringValue("wms_service");
         final String wcs = decoder.stringValue("wcs_service");
         if (wms != null || wcs != null) {
@@ -910,7 +911,7 @@ final class MetadataReader {
          */
         final DataIdentification identification = createIdentificationInfo(identifier, publisher);
         if (identification != null) {
-            metadata.getIdentificationInfo().add(identification);
+            metadata.setIdentificationInfo(singleton(identification));
         }
         metadata.setContentInfo(createContentInfo());
         /*



Mime
View raw message