sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1635792 - /sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java
Date Fri, 31 Oct 2014 15:19:32 GMT
Author: desruisseaux
Date: Fri Oct 31 15:19:32 2014
New Revision: 1635792

URL: http://svn.apache.org/r1635792
Log:
Added test.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java?rev=1635792&r1=1635791&r2=1635792&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java
[UTF-8] Fri Oct 31 15:19:32 2014
@@ -16,7 +16,10 @@
  */
 package org.apache.sis.metadata.iso.extent;
 
+import java.util.Map;
 import org.opengis.metadata.extent.GeographicBoundingBox;
+import org.apache.sis.measure.Latitude;
+import org.apache.sis.measure.Longitude;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
@@ -30,7 +33,7 @@ import static org.junit.Assert.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public final strictfp class DefaultGeographicBoundingBoxTest extends TestCase {
@@ -394,4 +397,29 @@ public final strictfp class DefaultGeogr
             b1.intersect(b2);
         }
     }
+
+    /**
+     * Tests {@link DefaultGeographicBoundingBox#asMap()}. The longitude and latitude values
are
+     * expected to be represented by {@link Longitude} and {@link Latitude} objects respectively.
+     *
+     * @since 0.5
+     */
+    @Test
+    public void testAsMap() {
+        final Map<String, Object> map = new DefaultGeographicBoundingBox(-40, 50, -20,
45).asMap();
+        assertArrayEquals(new String[] {
+            "westBoundLongitude",
+            "eastBoundLongitude",
+            "southBoundLatitude",
+            "northBoundLatitude",
+            "inclusion"
+        }, map.keySet().toArray());
+        assertArrayEquals(new Object[] {
+            new Longitude(-40),
+            new Longitude(+50),
+            new Latitude (-20),
+            new Latitude (+45),
+            Boolean.TRUE
+        }, map.values().toArray());
+    }
 }



Mime
View raw message