sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1677853 [4/4] - in /sis/branches/Android: ./ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-feature/src/test/java/org/apache/sis/feature/ core/sis-feature/src/test/java/org/apache/sis/test/suite/ core/sis-metadata/src/main...
Date Tue, 05 May 2015 16:17:28 GMT
Modified: sis/branches/Android/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java?rev=1677853&r1=1677852&r2=1677853&view=diff
==============================================================================
--- sis/branches/Android/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
[UTF-8] (original)
+++ sis/branches/Android/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
[UTF-8] Tue May  5 16:17:26 2015
@@ -101,6 +101,11 @@ public final class Vocabulary extends In
         public static final short CharacterEncoding = 6;
 
         /**
+         * Characteristics
+         */
+        public static final short Characteristics = 85;
+
+        /**
          * Classpath
          */
         public static final short Classpath = 7;

Modified: sis/branches/Android/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
URL: http://svn.apache.org/viewvc/sis/branches/Android/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties?rev=1677853&r1=1677852&r2=1677853&view=diff
==============================================================================
--- sis/branches/Android/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
[ISO-8859-1] (original)
+++ sis/branches/Android/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
[ISO-8859-1] Tue May  5 16:17:26 2015
@@ -23,6 +23,7 @@ Attributes              = Attributes
 BarometricAltitude      = Barometric altitude
 Cardinality             = Cardinality
 CharacterEncoding       = Character encoding
+Characteristics         = Characteristics
 Classpath               = Classpath
 Code_1                  = {0} code
 Commands                = Commands

Modified: sis/branches/Android/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/Android/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties?rev=1677853&r1=1677852&r2=1677853&view=diff
==============================================================================
--- sis/branches/Android/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
[ISO-8859-1] (original)
+++ sis/branches/Android/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
[ISO-8859-1] Tue May  5 16:17:26 2015
@@ -23,6 +23,7 @@ Attributes              = Attributs
 BarometricAltitude      = Altitude barom\u00e9trique
 Cardinality             = Cardinalit\u00e9
 CharacterEncoding       = Encodage des caract\u00e8res
+Characteristics         = Caract\u00e9ristiques
 Classpath               = Chemin de classes
 Code_1                  = Code {0}
 Commands                = Commandes

Modified: sis/branches/Android/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java?rev=1677853&r1=1677852&r2=1677853&view=diff
==============================================================================
--- sis/branches/Android/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java
[UTF-8] (original)
+++ sis/branches/Android/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java
[UTF-8] Tue May  5 16:17:26 2015
@@ -16,8 +16,12 @@
  */
 package org.apache.sis.internal.util;
 
+import java.util.List;
+import java.util.ArrayList;
+import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.apache.sis.internal.simple.SimpleCitation;
+import org.apache.sis.internal.simple.SimpleIdentifier;
 import org.apache.sis.xml.IdentifierSpace;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.TestCase;
@@ -37,6 +41,48 @@ import static org.junit.Assume.assumeTru
  */
 public final strictfp class CitationsTest extends TestCase {
     /**
+     * Creates an identifier with a code space.
+     */
+     @SuppressWarnings("serial")
+     private static Identifier identifier(final String codeSpace, final String code) {
+        return new SimpleIdentifier(null, code) {
+            @Override public String getCodeSpace() {
+                return codeSpace;
+            }
+        };
+    }
+
+    /**
+     * Tests {@link Citations#hasCommonIdentifier(Iterable, Iterable)}.
+     */
+    @Test
+    public void testHasCommonIdentifier() {
+        final List<Identifier> id1 = new ArrayList<Identifier>(3);
+        final List<Identifier> id2 = new ArrayList<Identifier>(2);
+        assertNull(Citations.hasCommonIdentifier(id1, id2));
+        /*
+         * Add codes for two Operation Methods which are implemented in Apache SIS by the
same class:
+         *
+         *  - EPSG:9804  —  "Mercator (variant A)" (formerly known as "Mercator (1SP)").
+         *  - EPSG:1026  —  "Mercator (Spherical)"
+         *  - GeoTIFF:7  —  "CT_Mercator"
+         */
+        id1.add(identifier("EPSG", "9804"));
+        id1.add(identifier("EPSG", "1026"));
+        id1.add(identifier("GeoTIFF", "7"));
+        assertNull(Citations.hasCommonIdentifier(id1, id2));
+        /*
+         * EPSG:9841 is a legacy (now deprecated) code for "Mercator (1SP)".
+         * We could have declared it as a deprecated code in the above list,
+         * but for the sake of this test we do not.
+         */
+        id2.add(identifier("EPSG", "9841"));
+        assertEquals(Boolean.FALSE, Citations.hasCommonIdentifier(id1, id2));
+        id2.add(identifier("EPSG", "9804"));
+        assertEquals(Boolean.TRUE, Citations.hasCommonIdentifier(id1, id2));
+    }
+
+    /**
      * Tests {@link Citations#getIdentifier(Citation, boolean)}.
      */
     @Test

Modified: sis/branches/Android/core/sis-utility/src/test/java/org/apache/sis/util/StringBuildersTest.java
URL: http://svn.apache.org/viewvc/sis/branches/Android/core/sis-utility/src/test/java/org/apache/sis/util/StringBuildersTest.java?rev=1677853&r1=1677852&r2=1677853&view=diff
==============================================================================
--- sis/branches/Android/core/sis-utility/src/test/java/org/apache/sis/util/StringBuildersTest.java
[UTF-8] (original)
+++ sis/branches/Android/core/sis-utility/src/test/java/org/apache/sis/util/StringBuildersTest.java
[UTF-8] Tue May  5 16:17:26 2015
@@ -97,8 +97,10 @@ public final strictfp class StringBuilde
      */
     @Test
     public void testToASCII() {
-        final StringBuilder metre = new StringBuilder("mètres" + Characters.PARAGRAPH_SEPARATOR);
+        final StringBuilder metre = new StringBuilder(
+                "mètres" + Characters.PARAGRAPH_SEPARATOR +
+                " ‘single’, “double”, \"ascii' 30°20′10″.");
         toASCII(metre);
-        assertEquals("metres\n", metre.toString());
+        assertEquals("metres\n 'single', \"double\", \"ascii' 30°20'10\".", metre.toString());
     }
 }



Mime
View raw message