sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1778374 [2/2] - in /sis/trunk: ./ core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/ ide-project/NetBeans/ ide-project/NetBeans/nbproject/ storage/ storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/ storage/si...
Date Thu, 12 Jan 2017 06:01:13 GMT
Modified: sis/trunk/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/ReaderTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/ReaderTest.java?rev=1778374&r1=1778364&r2=1778374&view=diff
==============================================================================
--- sis/trunk/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/ReaderTest.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/ReaderTest.java
[UTF-8] Thu Jan 12 06:01:13 2017
@@ -40,8 +40,8 @@ import static org.apache.sis.test.TestUt
 // Branch-dependent imports
 import org.apache.sis.internal.jdk8.Stream;
 import org.apache.sis.internal.jdk8.Instant;
-import org.opengis.feature.Feature;
-import org.opengis.metadata.content.FeatureTypeInfo;
+import org.apache.sis.feature.AbstractFeature;
+import org.opengis.util.GenericName;
 
 
 /**
@@ -205,10 +205,10 @@ public final strictfp class ReaderTest e
          */
         final FeatureCatalogueDescription content = (FeatureCatalogueDescription) getSingleton(md.getContentInfo());
         assertTrue("isIncludedWithDataset", content.isIncludedWithDataset());
-        final Iterator<? extends FeatureTypeInfo> it = content.getFeatureTypeInfo().iterator();
-        assertStringEquals("Route",    it.next().getFeatureTypeName().tip());
-        assertStringEquals("Track",    it.next().getFeatureTypeName().tip());
-        assertStringEquals("WayPoint", it.next().getFeatureTypeName().tip());
+        final Iterator<? extends GenericName> it = content.getFeatureTypes().iterator();
+        assertStringEquals("Route",    it.next().tip());
+        assertStringEquals("Track",    it.next().tip());
+        assertStringEquals("WayPoint", it.next().tip());
         assertFalse("hasNext", it.hasNext());
     }
 
@@ -223,8 +223,8 @@ public final strictfp class ReaderTest e
         try (final Store reader = create("1.0/waypoint.xml")) {
             verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
             assertEquals("version", Store.V1_0, reader.getVersion());
-            try (final Stream<Feature> features = reader.getFeatures()) {
-                final Iterator<Feature> it = features.iterator();
+            try (final Stream<AbstractFeature> features = reader.getFeatures()) {
+                final Iterator<AbstractFeature> it = features.iterator();
                 verifyPoint(it.next(), 0, false);
                 verifyPoint(it.next(), 1, false);
                 verifyPoint(it.next(), 2, false);
@@ -244,8 +244,8 @@ public final strictfp class ReaderTest e
         try (final Store reader = create("1.1/waypoint.xml")) {
             verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
             assertEquals("version", Store.V1_1, reader.getVersion());
-            try (final Stream<Feature> features = reader.getFeatures()) {
-                final Iterator<Feature> it = features.iterator();
+            try (final Stream<AbstractFeature> features = reader.getFeatures()) {
+                final Iterator<AbstractFeature> it = features.iterator();
                 verifyPoint(it.next(), 0, true);
                 verifyPoint(it.next(), 1, true);
                 verifyPoint(it.next(), 2, true);
@@ -265,8 +265,8 @@ public final strictfp class ReaderTest e
         try (final Store reader = create("1.0/route.xml")) {
             verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
             assertEquals("version", Store.V1_0, reader.getVersion());
-            try (final Stream<Feature> features = reader.getFeatures()) {
-                final Iterator<Feature> it = features.iterator();
+            try (final Stream<AbstractFeature> features = reader.getFeatures()) {
+                final Iterator<AbstractFeature> it = features.iterator();
                 verifyRoute(it.next(), false, 1);
                 verifyEmpty(it.next(), "rtept");
                 assertFalse("hasNext", it.hasNext());
@@ -294,8 +294,8 @@ public final strictfp class ReaderTest e
      * This verification is shared by {@link #testRoute110()} and {@link #testSequentialReads()}.
      */
     static void verifyRoute110(final Store reader) throws DataStoreException {
-        try (final Stream<Feature> features = reader.getFeatures()) {
-            final Iterator<Feature> it = features.iterator();
+        try (final Stream<AbstractFeature> features = reader.getFeatures()) {
+            final Iterator<AbstractFeature> it = features.iterator();
             verifyRoute(it.next(), true, 3);
             verifyEmpty(it.next(), "rtept");
             assertFalse("hasNext", it.hasNext());
@@ -310,7 +310,7 @@ public final strictfp class ReaderTest e
      * @param  numLinks  expected number of links.
      */
     @SuppressWarnings("fallthrough")
-    private static void verifyRoute(final Feature f, final boolean v11, final int numLinks)
{
+    private static void verifyRoute(final AbstractFeature f, final boolean v11, final int
numLinks) {
         assertEquals("name",       "Route name",          f.getPropertyValue("name"));
         assertEquals("cmt",        "Route comment",       f.getPropertyValue("cmt"));
         assertEquals("desc",       "Route description",   f.getPropertyValue("desc"));
@@ -330,9 +330,9 @@ public final strictfp class ReaderTest e
 
         final List<?> points = (List<?>) f.getPropertyValue("rtept");
         assertEquals("points.size()", 3, points.size());
-        verifyPoint((Feature) points.get(0), 0, v11);
-        verifyPoint((Feature) points.get(1), 1, v11);
-        verifyPoint((Feature) points.get(2), 2, v11);
+        verifyPoint((AbstractFeature) points.get(0), 0, v11);
+        verifyPoint((AbstractFeature) points.get(1), 1, v11);
+        verifyPoint((AbstractFeature) points.get(2), 2, v11);
 
         final Polyline p = (Polyline) f.getPropertyValue("@geometry");
         assertEquals("pointCount", 3, p.getPointCount());
@@ -348,7 +348,7 @@ public final strictfp class ReaderTest e
      * @param  f    the route or track to verify.
      * @param  dep  {@code "rtept"} if verifying a route, or {@code "trkseg"} if verifying
a track.
      */
-    private static void verifyEmpty(final Feature f, final String dep) {
+    private static void verifyEmpty(final AbstractFeature f, final String dep) {
         assertNull("name",   f.getPropertyValue("name"));
         assertNull("cmt",    f.getPropertyValue("cmt"));
         assertNull("desc",   f.getPropertyValue("desc"));
@@ -372,8 +372,8 @@ public final strictfp class ReaderTest e
         try (final Store reader = create("1.0/track.xml")) {
             verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
             assertEquals("version", Store.V1_0, reader.getVersion());
-            try (final Stream<Feature> features = reader.getFeatures()) {
-                final Iterator<Feature> it = features.iterator();
+            try (final Stream<AbstractFeature> features = reader.getFeatures()) {
+                final Iterator<AbstractFeature> it = features.iterator();
                 verifyTrack(it.next(), false, 1);
                 verifyEmpty(it.next(), "trkseg");
                 assertFalse("hasNext", it.hasNext());
@@ -392,8 +392,8 @@ public final strictfp class ReaderTest e
         try (final Store reader = create("1.1/track.xml")) {
             verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
             assertEquals("version", Store.V1_1, reader.getVersion());
-            try (final Stream<Feature> features = reader.getFeatures()) {
-                final Iterator<Feature> it = features.iterator();
+            try (final Stream<AbstractFeature> features = reader.getFeatures()) {
+                final Iterator<AbstractFeature> it = features.iterator();
                 verifyTrack(it.next(), true, 3);
                 verifyEmpty(it.next(), "trkseg");
                 assertFalse("hasNext", it.hasNext());
@@ -409,7 +409,7 @@ public final strictfp class ReaderTest e
      * @param  numLinks  expected number of links.
      */
     @SuppressWarnings("fallthrough")
-    private static void verifyTrack(final Feature f, final boolean v11, final int numLinks)
{
+    private static void verifyTrack(final AbstractFeature f, final boolean v11, final int
numLinks) {
         assertEquals("name",       "Track name",          f.getPropertyValue("name"));
         assertEquals("cmt",        "Track comment",       f.getPropertyValue("cmt"));
         assertEquals("desc",       "Track description",   f.getPropertyValue("desc"));
@@ -429,13 +429,13 @@ public final strictfp class ReaderTest e
 
         final List<?> segments = (List<?>) f.getPropertyValue("trkseg");
         assertEquals("segments.size()", 2, segments.size());
-        final Feature seg1 = (Feature) segments.get(0);
-        final Feature seg2 = (Feature) segments.get(1);
+        final AbstractFeature seg1 = (AbstractFeature) segments.get(0);
+        final AbstractFeature seg2 = (AbstractFeature) segments.get(1);
         final List<?> points = (List<?>) seg1.getPropertyValue("trkpt");
         assertEquals("points.size()", 3, points.size());
-        verifyPoint((Feature) points.get(0), 0, v11);
-        verifyPoint((Feature) points.get(1), 1, v11);
-        verifyPoint((Feature) points.get(2), 2, v11);
+        verifyPoint((AbstractFeature) points.get(0), 0, v11);
+        verifyPoint((AbstractFeature) points.get(1), 1, v11);
+        verifyPoint((AbstractFeature) points.get(2), 2, v11);
         assertTrue(((Collection<?>) seg2.getPropertyValue("trkpt")).isEmpty());
 
         final Polyline p = (Polyline) f.getPropertyValue("@geometry");
@@ -453,7 +453,7 @@ public final strictfp class ReaderTest e
      * @param  index  index of the point being verified: 0, 1 or 2.
      * @param  v11    {@code true} for GPX 1.1, or {@code false} for GPX 1.0.
      */
-    private static void verifyPoint(final Feature f, final int index, final boolean v11)
{
+    private static void verifyPoint(final AbstractFeature f, final int index, final boolean
v11) {
         assertEquals("@identifier", index + 1, f.getPropertyValue("@identifier"));
         switch (index) {
             case 0: {
@@ -607,14 +607,14 @@ public final strictfp class ReaderTest e
     @DependsOnMethod("testSequentialReads")
     public void testConcurrentReads() throws DataStoreException {
         try (final Store reader = createFromURL()) {
-            final Stream<Feature>   f1 = reader.getFeatures();
-            final Iterator<Feature> i1 = f1.iterator();
+            final Stream<AbstractFeature>   f1 = reader.getFeatures();
+            final Iterator<AbstractFeature> i1 = f1.iterator();
             verifyRoute(i1.next(), true, 3);
-            final Stream<Feature>   f2 = reader.getFeatures();
-            final Iterator<Feature> i2 = f2.iterator();
+            final Stream<AbstractFeature>   f2 = reader.getFeatures();
+            final Iterator<AbstractFeature> i2 = f2.iterator();
             verifyEmpty(i1.next(), "rtept");
-            final Stream<Feature>   f3 = reader.getFeatures();
-            final Iterator<Feature> i3 = f3.iterator();
+            final Stream<AbstractFeature>   f3 = reader.getFeatures();
+            final Iterator<AbstractFeature> i3 = f3.iterator();
             verifyRoute(i2.next(), true, 3);
             verifyRoute(i3.next(), true, 3);
             verifyEmpty(i3.next(), "rtept");

Modified: sis/trunk/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/WriterTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/WriterTest.java?rev=1778374&r1=1778364&r2=1778374&view=diff
==============================================================================
--- sis/trunk/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/WriterTest.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/WriterTest.java
[UTF-8] Thu Jan 12 06:01:13 2017
@@ -40,7 +40,7 @@ import static org.apache.sis.test.Assert
 // Branch-dependent imports
 import org.apache.sis.internal.jdk8.Instant;
 import org.apache.sis.internal.jdk8.Stream;
-import org.opengis.feature.Feature;
+import org.apache.sis.feature.AbstractFeature;
 
 
 /**
@@ -251,7 +251,7 @@ public final strictfp class WriterTest e
          * Way Points as defined in "waypoint.xml" test file.
          * Appear also in "route.xml" and "track.xml" files.
          */
-        final Feature point1 = types.wayPoint.newInstance();
+        final AbstractFeature point1 = types.wayPoint.newInstance();
         point1.setPropertyValue("@geometry",     new Point(15, 10));
         point1.setPropertyValue("time",          Instant.parse("2010-01-10T00:00:00Z"));
         point1.setPropertyValue("name",          "first point");
@@ -273,7 +273,7 @@ public final strictfp class WriterTest e
         point1.setPropertyValue("link",          Arrays.asList(new Link(new URI("http://first-address1.org")),
                                                                new Link(new URI("http://first-address2.org")),
                                                                new Link(new URI("http://first-address3.org"))));
-        final Feature point3 = types.wayPoint.newInstance();
+        final AbstractFeature point3 = types.wayPoint.newInstance();
         point3.setPropertyValue("@geometry",     new Point(35, 30));
         point3.setPropertyValue("time",          Instant.parse("2010-01-30T00:00:00Z"));
         point3.setPropertyValue("name",          "third point");
@@ -294,17 +294,17 @@ public final strictfp class WriterTest e
         point3.setPropertyValue("fix",           Fix.THREE_DIMENSIONAL);
         point3.setPropertyValue("link",          Arrays.asList(new Link(new URI("http://third-address1.org")),
                                                                new Link(new URI("http://third-address2.org"))));
-        final Feature point2 = types.wayPoint.newInstance();
+        final AbstractFeature point2 = types.wayPoint.newInstance();
         point2.setPropertyValue("@geometry", new Point(25, 20));
-        final List<Feature> wayPoints = Arrays.asList(point1, point2, point3);
-        final List<Feature> features;
+        final List<AbstractFeature> wayPoints = Arrays.asList(point1, point2, point3);
+        final List<AbstractFeature> features;
         switch (type) {
             case WAY_POINT: {
                 features = wayPoints;
                 break;
             }
             case ROUTE: {
-                final Feature route1 = types.route.newInstance();
+                final AbstractFeature route1 = types.route.newInstance();
                 route1.setPropertyValue("name",   "Route name");
                 route1.setPropertyValue("cmt",    "Route comment");
                 route1.setPropertyValue("desc",   "Route description");
@@ -315,16 +315,16 @@ public final strictfp class WriterTest e
                 route1.setPropertyValue("link",   Arrays.asList(new Link(new URI("http://route-address1.org")),
                                                                 new Link(new URI("http://route-address2.org")),
                                                                 new Link(new URI("http://route-address3.org"))));
-                final Feature route2 = types.route.newInstance();
+                final AbstractFeature route2 = types.route.newInstance();
                 features = Arrays.asList(route1, route2);
                 break;
             }
             case TRACK: {
-                final Feature seg1 = types.trackSegment.newInstance();
-                final Feature seg2 = types.trackSegment.newInstance();
+                final AbstractFeature seg1 = types.trackSegment.newInstance();
+                final AbstractFeature seg2 = types.trackSegment.newInstance();
                 seg1.setPropertyValue("trkpt", wayPoints);
 
-                final Feature track1 = types.track.newInstance();
+                final AbstractFeature track1 = types.track.newInstance();
                 track1.setPropertyValue("name",   "Track name");
                 track1.setPropertyValue("cmt",    "Track comment");
                 track1.setPropertyValue("desc",   "Track description");
@@ -335,7 +335,7 @@ public final strictfp class WriterTest e
                 track1.setPropertyValue("link",   Arrays.asList(new Link(new URI("http://track-address1.org")),
                                                                 new Link(new URI("http://track-address2.org")),
                                                                 new Link(new URI("http://track-address3.org"))));
-                final Feature track2 = types.track.newInstance();
+                final AbstractFeature track2 = types.track.newInstance();
                 features = Arrays.asList(track1, track2);
                 break;
             }



Mime
View raw message