sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1803070 [20/20] - in /sis/branches/JDK9: ./ application/sis-console/src/main/java/org/apache/sis/console/ core/sis-build-helper/ core/sis-build-helper/src/main/java/org/apache/sis/internal/book/ core/sis-build-helper/src/main/java/org/apac...
Date Wed, 26 Jul 2017 16:14:14 GMT
Modified: sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java?rev=1803070&r1=1803069&r2=1803070&view=diff
==============================================================================
--- sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java
[UTF-8] (original)
+++ sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java
[UTF-8] Wed Jul 26 16:14:09 2017
@@ -20,12 +20,16 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Locale;
 import java.util.Map;
-import com.esri.core.geometry.Point;
+import java.util.HashMap;
 import org.opengis.util.ScopedName;
+import org.opengis.util.GenericName;
 import org.opengis.util.NameFactory;
 import org.opengis.util.FactoryException;
+import org.opengis.util.InternationalString;
+import org.apache.sis.setup.GeometryLibrary;
 import org.opengis.metadata.citation.OnlineResource;
 import org.opengis.metadata.content.ContentInformation;
+import org.opengis.metadata.acquisition.GeometryType;
 import org.apache.sis.storage.gps.Fix;
 import org.apache.sis.storage.FeatureNaming;
 import org.apache.sis.storage.IllegalNameException;
@@ -33,15 +37,18 @@ import org.apache.sis.referencing.Common
 import org.apache.sis.feature.AbstractIdentifiedType;
 import org.apache.sis.feature.FeatureOperations;
 import org.apache.sis.feature.builder.FeatureTypeBuilder;
+import org.apache.sis.feature.builder.PropertyTypeBuilder;
 import org.apache.sis.feature.builder.AttributeRole;
 import org.apache.sis.internal.feature.AttributeConvention;
+import org.apache.sis.internal.feature.Geometries;
 import org.apache.sis.internal.storage.FeatureCatalogBuilder;
 import org.apache.sis.internal.system.DefaultFactories;
+import org.apache.sis.util.iso.ResourceInternationalString;
 import org.apache.sis.util.iso.DefaultNameFactory;
-import org.apache.sis.util.Static;
 
 // Branch-dependent imports
 import java.time.temporal.Temporal;
+import org.opengis.feature.AttributeType;
 import org.opengis.feature.FeatureType;
 
 
@@ -55,7 +62,7 @@ import org.opengis.feature.FeatureType;
  * @since   0.8
  * @module
  */
-final class Types extends Static {
+final class Types {
     /**
      * Way point GPX feature type.
      */
@@ -88,13 +95,18 @@ final class Types extends Static {
     final FeatureNaming<FeatureType> names;
 
     /**
+     * Accessor to the geometry implementation in use (Java2D, ESRI or JTS).
+     */
+    final Geometries<?> geometries;
+
+    /**
      * A system-wide instance for {@code FeatureType} instances created using the {@link
DefaultNameFactory}.
      * This is normally the only instance used in an application.
      */
     static final Types DEFAULT;
     static {
         try {
-            DEFAULT = new Types(DefaultFactories.forBuildin(NameFactory.class, DefaultNameFactory.class),
null);
+            DEFAULT = new Types(DefaultFactories.forBuildin(NameFactory.class, DefaultNameFactory.class),
null, null);
         } catch (FactoryException | IllegalNameException e) {
             throw new AssertionError(e);        // Should never happen with DefaultNameFactory
implementation.
         }
@@ -105,9 +117,14 @@ final class Types extends Static {
      *
      * @param  factory   the factory to use for creating names, or {@code null} for the default
factory.
      * @param  locale    the locale to use for formatting error messages, or {@code null}
for the default locale.
+     * @param  library   the required geometry library, or {@code null} for the default.
      * @throws FactoryException if an error occurred while creating an "envelope bounds"
operation.
      */
-    Types(final NameFactory factory, final Locale locale) throws FactoryException, IllegalNameException
{
+    Types(final NameFactory factory, final Locale locale, final GeometryLibrary library)
+            throws FactoryException, IllegalNameException
+    {
+        geometries = Geometries.implementation(library);
+        final Map<String,InternationalString[]> resources = new HashMap<>();
         final ScopedName    geomName = AttributeConvention.GEOMETRY_PROPERTY;
         final Map<String,?> geomInfo = Collections.singletonMap(AbstractIdentifiedType.NAME_KEY,
geomName);
         final Map<String,?> envpInfo = Collections.singletonMap(AbstractIdentifiedType.NAME_KEY,
AttributeConvention.ENVELOPE_PROPERTY);
@@ -116,19 +133,19 @@ final class Types extends Static {
          * This parent has a single property, "sis:identifier" of type Integer,
          * which is not part of GPX specification.
          *
-         * http://www.topografix.com/GPX/GPXEntity
+         * GPXEntity
          * ┌────────────────┬─────────┬─────────────┐
          * │ Name           │ Type    │ Cardinality │
          * ├────────────────┼─────────┼─────────────┤
          * │ sis:identifier │ Integer │   [1 … 1]   │      SIS-specific property
          * └────────────────┴─────────┴─────────────┘
          */
-        FeatureTypeBuilder builder = new FeatureTypeBuilder(null, factory, locale);
-        builder.setDefaultScope(Tags.NAMESPACE).setName("GPXEntity").setAbstract(true);
+        final FeatureTypeBuilder builder = new FeatureTypeBuilder(factory, library, locale);
+        builder.setNameSpace(Tags.PREFIX).setName("GPXEntity").setAbstract(true);
         builder.addAttribute(Integer.class).setName(AttributeConvention.IDENTIFIER_PROPERTY);
         final FeatureType parent = builder.build();
         /*
-         * http://www.topografix.com/GPX/WayPoint ⇾ GPXEntity
+         * WayPoint ⇾ GPXEntity
          * ┌──────────────────┬────────────────┬────────────────────────┬─────────────┐
          * │ Name             │ Type           │ XML type               │ Cardinality
│
          * ├──────────────────┼────────────────┼────────────────────────┼─────────────┤
@@ -155,9 +172,8 @@ final class Types extends Static {
          * │ dgpsid           │ Integer        │ gpx:dgpsStationType    │   [0 …
1]   │
          * └──────────────────┴────────────────┴────────────────────────┴─────────────┘
          */
-        builder = new FeatureTypeBuilder(null, factory, locale).setSuperTypes(parent);
-        builder.setDefaultScope(Tags.NAMESPACE).setName("WayPoint");
-        builder.addAttribute(Point.class).setName(geomName)
+        builder.clear().setSuperTypes(parent).setNameSpace(Tags.PREFIX).setName("WayPoint");
+        builder.addAttribute(GeometryType.POINT).setName(geomName)
                 .setCRS(CommonCRS.WGS84.normalizedGeographic())
                 .addRole(AttributeRole.DEFAULT_GEOMETRY);
         builder.setDefaultCardinality(0, 1);
@@ -179,9 +195,9 @@ final class Types extends Static {
         builder.addAttribute(Double        .class).setName(Tags.PDOP);
         builder.addAttribute(Double        .class).setName(Tags.AGE_OF_GPS_DATA);
         builder.addAttribute(Integer       .class).setName(Tags.DGPS_ID);
-        wayPoint = builder.build();
+        wayPoint = create(builder, resources);
         /*
-         * http://www.topografix.com/GPX/Route ⇾ GPXEntity
+         * Route ⇾ GPXEntity
          * ┌────────────────┬────────────────┬────────────────────────┬─────────────┐
          * │ Name           │ Type           │ XML type               │ Cardinality
│
          * ├────────────────┼────────────────┼────────────────────────┼─────────────┤
@@ -198,9 +214,9 @@ final class Types extends Static {
          * │ rtept          │ WayPoint       │ gpx:wptType            │   [0 …
∞]   │
          * └────────────────┴────────────────┴────────────────────────┴─────────────┘
          */
-        GroupAsPolylineOperation groupOp = new GroupPointsAsPolylineOperation(geomInfo, Tags.ROUTE_POINTS);
-        builder = new FeatureTypeBuilder(null, factory, locale).setSuperTypes(parent);
-        builder.setDefaultScope(Tags.NAMESPACE).setName("Route");
+        final AttributeType<?> groupResult = GroupAsPolylineOperation.getResult(geometries);
+        GroupAsPolylineOperation groupOp = new GroupAsPolylineOperation(geomInfo, Tags.ROUTE_POINTS,
groupResult);
+        builder.clear().setSuperTypes(parent).setNameSpace(Tags.PREFIX).setName("Route");
         builder.addProperty(groupOp);
         builder.addProperty(FeatureOperations.envelope(envpInfo, null, groupOp));
         builder.setDefaultCardinality(0, 1);
@@ -212,9 +228,9 @@ final class Types extends Static {
         builder.addAttribute(Integer.class).setName(Tags.NUMBER);
         builder.addProperty(wayPoint.getProperty(Tags.TYPE));
         builder.addAssociation(wayPoint).setName(Tags.ROUTE_POINTS).setMaximumOccurs(Integer.MAX_VALUE);
-        route = builder.build();
+        route = create(builder, resources);
         /*
-         * http://www.topografix.com/GPX/TrackSegment ⇾ GPXEntity
+         * TrackSegment ⇾ GPXEntity
          * ┌────────────────┬──────────┬─────────────┬─────────────┐
          * │ Name           │ Type     │ XML type    │ Cardinality │
          * ├────────────────┼──────────┼─────────────┼─────────────┤
@@ -224,16 +240,15 @@ final class Types extends Static {
          * │ trkpt          │ WayPoint │ gpx:wptType │   [0 … ∞]   │
          * └────────────────┴──────────┴─────────────┴─────────────┘
          */
-        groupOp = new GroupPointsAsPolylineOperation(geomInfo, Tags.TRACK_POINTS);
-        builder = new FeatureTypeBuilder(null, factory, locale).setSuperTypes(parent);
-        builder.setDefaultScope(Tags.NAMESPACE).setName("TrackSegment");
+        groupOp = new GroupAsPolylineOperation(geomInfo, Tags.TRACK_POINTS, groupResult);
+        builder.clear().setSuperTypes(parent).setNameSpace(Tags.PREFIX).setName("TrackSegment");
         builder.addProperty(groupOp);
         builder.addProperty(FeatureOperations.envelope(envpInfo, null, groupOp));
         builder.setDefaultCardinality(0, 1);
         builder.addAssociation(wayPoint).setName(Tags.TRACK_POINTS).setMaximumOccurs(Integer.MAX_VALUE);
-        trackSegment = builder.build();
+        trackSegment = create(builder, resources);
         /*
-         * http://www.topografix.com/GPX/Track ⇾ GPXEntity
+         * Track ⇾ GPXEntity
          * ┌────────────────┬────────────────┬────────────────────────┬─────────────┐
          * │ Name           │ Type           │ XML type               │ Cardinality
│
          * ├────────────────┼────────────────┼────────────────────────┼─────────────┤
@@ -250,9 +265,8 @@ final class Types extends Static {
          * │ trkseg         │ TrackSegment   │ gpx:trksegType         │   [0 …
∞]   │
          * └────────────────┴────────────────┴────────────────────────┴─────────────┘
          */
-        groupOp = new GroupAsPolylineOperation(geomInfo, Tags.TRACK_SEGMENTS);
-        builder = new FeatureTypeBuilder(null, factory, locale).setSuperTypes(parent);
-        builder.setDefaultScope(Tags.NAMESPACE).setName("Track");
+        groupOp = new GroupAsPolylineOperation(geomInfo, Tags.TRACK_SEGMENTS, groupResult);
+        builder.clear().setSuperTypes(parent).setNameSpace(Tags.PREFIX).setName("Track");
         builder.addProperty(groupOp);
         builder.addProperty(FeatureOperations.envelope(envpInfo, null, groupOp));
         builder.setDefaultCardinality(0, 1);
@@ -264,7 +278,7 @@ final class Types extends Static {
         builder.addProperty(route.getProperty(Tags.NUMBER));
         builder.addProperty(route.getProperty(Tags.TYPE));
         builder.addAssociation(trackSegment).setName(Tags.TRACK_SEGMENTS).setMaximumOccurs(Integer.MAX_VALUE);
-        track = builder.build();
+        track = create(builder, resources);
 
         final FeatureCatalogBuilder fc = new FeatureCatalogBuilder(null);
         fc.define(route);
@@ -273,4 +287,27 @@ final class Types extends Static {
         metadata = fc.build(true).getContentInfo();
         names = fc.features;
     }
+
+    /**
+     * Adds internationalized designation and definition information for all properties in
the given type.
+     * Then, returns the result of {@link FeatureTypeBuilder#build()}.
+     *
+     * @param  builder   the feature type builder for which to add designations and definitions.
+     * @param  previous  previously created international strings as array of length 2.
+     *                   The first element is the designation and the second element is the
definition.
+     */
+    private static FeatureType create(final FeatureTypeBuilder builder, final Map<String,InternationalString[]>
previous) {
+        for (final PropertyTypeBuilder p : builder.properties()) {
+            final GenericName name = p.getName();
+            if (!AttributeConvention.contains(name)) {
+                final InternationalString[] resources = previous.computeIfAbsent(name.toString(),
(key) -> new InternationalString[] {
+                    new ResourceInternationalString("org.apache.sis.internal.storage.gpx.Designations",
key),
+                    new ResourceInternationalString("org.apache.sis.internal.storage.gpx.Definitions",
 key)
+                });
+                p.setDefinition (resources[1]);
+                p.setDesignation(resources[0]);
+            }
+        }
+        return builder.build();
+    }
 }

Modified: sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Writer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Writer.java?rev=1803070&r1=1803069&r2=1803070&view=diff
==============================================================================
--- sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Writer.java
[UTF-8] (original)
+++ sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Writer.java
[UTF-8] Wed Jul 26 16:14:09 2017
@@ -20,11 +20,11 @@ import java.io.IOException;
 import java.util.Collection;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.bind.JAXBException;
-import com.esri.core.geometry.Point;
 import org.apache.sis.storage.gps.Fix;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.IllegalFeatureTypeException;
 import org.apache.sis.internal.storage.xml.stream.StaxStreamWriter;
+import org.apache.sis.internal.feature.Geometries;
 import org.apache.sis.util.Version;
 
 // Branch-dependent imports
@@ -191,31 +191,33 @@ final class Writer extends StaxStreamWri
      */
     private void writeWayPoint(final Feature feature, final String tagName) throws XMLStreamException,
JAXBException {
         if (feature != null) {
-            final Point pt = (Point) feature.getPropertyValue("sis:geometry");
-            writer.writeStartElement(tagName);
-            writer.writeAttribute(Attributes.LATITUDE, Double.toString(pt.getY()));
-            writer.writeAttribute(Attributes.LONGITUDE, Double.toString(pt.getX()));
-
-            writeSingleValue(Tags.ELEVATION,       feature.getPropertyValue(Tags.ELEVATION));
-            writeSingleValue(Tags.TIME,            feature.getPropertyValue(Tags.TIME));
-            writeSingleValue(Tags.MAGNETIC_VAR,    feature.getPropertyValue(Tags.MAGNETIC_VAR));
-            writeSingleValue(Tags.GEOID_HEIGHT,    feature.getPropertyValue(Tags.GEOID_HEIGHT));
-            writeSingleValue(Tags.NAME,            feature.getPropertyValue(Tags.NAME));
-            writeSingleValue(Tags.COMMENT,         feature.getPropertyValue(Tags.COMMENT));
-            writeSingleValue(Tags.DESCRIPTION,     feature.getPropertyValue(Tags.DESCRIPTION));
-            writeSingleValue(Tags.SOURCE,          feature.getPropertyValue(Tags.SOURCE));
-            writeLinks((Collection<?>)             feature.getPropertyValue(Tags.LINK));
-            writeSingleValue(Tags.SYMBOL,          feature.getPropertyValue(Tags.SYMBOL));
-            writeSingleValue(Tags.TYPE,            feature.getPropertyValue(Tags.TYPE));
-            writeSingle((Fix)                      feature.getPropertyValue(Tags.FIX));
-            writeSingleValue(Tags.SATELITTES,      feature.getPropertyValue(Tags.SATELITTES));
-            writeSingleValue(Tags.HDOP,            feature.getPropertyValue(Tags.HDOP));
-            writeSingleValue(Tags.VDOP,            feature.getPropertyValue(Tags.VDOP));
-            writeSingleValue(Tags.PDOP,            feature.getPropertyValue(Tags.PDOP));
-            writeSingleValue(Tags.AGE_OF_GPS_DATA, feature.getPropertyValue(Tags.AGE_OF_GPS_DATA));
-            writeSingleValue(Tags.DGPS_ID,         feature.getPropertyValue(Tags.DGPS_ID));
+            final double[] pt = Geometries.getCoordinate(feature.getPropertyValue("sis:geometry"));
+            if (pt != null && pt.length >= 2) {
+                writer.writeStartElement(tagName);
+                writer.writeAttribute(Attributes.LATITUDE,  Double.toString(pt[1]));
+                writer.writeAttribute(Attributes.LONGITUDE, Double.toString(pt[0]));
+
+                writeSingleValue(Tags.ELEVATION,       feature.getPropertyValue(Tags.ELEVATION));
+                writeSingleValue(Tags.TIME,            feature.getPropertyValue(Tags.TIME));
+                writeSingleValue(Tags.MAGNETIC_VAR,    feature.getPropertyValue(Tags.MAGNETIC_VAR));
+                writeSingleValue(Tags.GEOID_HEIGHT,    feature.getPropertyValue(Tags.GEOID_HEIGHT));
+                writeSingleValue(Tags.NAME,            feature.getPropertyValue(Tags.NAME));
+                writeSingleValue(Tags.COMMENT,         feature.getPropertyValue(Tags.COMMENT));
+                writeSingleValue(Tags.DESCRIPTION,     feature.getPropertyValue(Tags.DESCRIPTION));
+                writeSingleValue(Tags.SOURCE,          feature.getPropertyValue(Tags.SOURCE));
+                writeLinks((Collection<?>)             feature.getPropertyValue(Tags.LINK));
+                writeSingleValue(Tags.SYMBOL,          feature.getPropertyValue(Tags.SYMBOL));
+                writeSingleValue(Tags.TYPE,            feature.getPropertyValue(Tags.TYPE));
+                writeSingle((Fix)                      feature.getPropertyValue(Tags.FIX));
+                writeSingleValue(Tags.SATELITTES,      feature.getPropertyValue(Tags.SATELITTES));
+                writeSingleValue(Tags.HDOP,            feature.getPropertyValue(Tags.HDOP));
+                writeSingleValue(Tags.VDOP,            feature.getPropertyValue(Tags.VDOP));
+                writeSingleValue(Tags.PDOP,            feature.getPropertyValue(Tags.PDOP));
+                writeSingleValue(Tags.AGE_OF_GPS_DATA, feature.getPropertyValue(Tags.AGE_OF_GPS_DATA));
+                writeSingleValue(Tags.DGPS_ID,         feature.getPropertyValue(Tags.DGPS_ID));
 
-            writer.writeEndElement();
+                writer.writeEndElement();
+            }
         }
     }
 

Modified: sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java?rev=1803070&r1=1803069&r2=1803070&view=diff
==============================================================================
--- sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java
[UTF-8] (original)
+++ sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java
[UTF-8] Wed Jul 26 16:14:09 2017
@@ -46,6 +46,7 @@ import org.apache.sis.internal.util.Abst
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.internal.util.Utilities;
 import org.apache.sis.io.wkt.WKTFormat;
+import org.apache.sis.io.InvalidSeekException;
 import org.apache.sis.storage.ConcurrentReadException;
 import org.apache.sis.storage.ConcurrentWriteException;
 import org.apache.sis.storage.DataStoreClosedException;
@@ -266,7 +267,7 @@ public abstract class StaxDataStore exte
      * @throws IOException if an error occurred while reseting the stream.
      */
     private boolean reset() throws IOException {
-        if (streamPosition >= 0) {
+        if (streamPosition >= 0) try {
             final Markable m = (Markable) stream;
             long p;
             do {
@@ -278,6 +279,8 @@ public abstract class StaxDataStore exte
                 state = START;
                 return true;
             }
+        } catch (InvalidSeekException e) {
+            listeners.warning(null, e);
         }
         return false;
     }
@@ -332,7 +335,8 @@ public abstract class StaxDataStore exte
         @Override
         public void report(String message, String errorType, Object info, Location location)
{
             final LogRecord record = new LogRecord(Level.WARNING, message);
-            record.setSourceClassName(getClass().getCanonicalName());
+            record.setSourceClassName(StaxDataStore.this.getClass().getCanonicalName());
+            // record.setLoggerName(…) will be invoked by 'listeners' with inferred name.
             listeners.warning(record);
         }
 
@@ -344,6 +348,7 @@ public abstract class StaxDataStore exte
          */
         @Override
         public void warningOccured(final Object source, final LogRecord warning) {
+            warning.setLoggerName(null);        // For allowing 'listeners' to select a logger
name.
             listeners.warning(warning);
         }
 

Modified: sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxStreamReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxStreamReader.java?rev=1803070&r1=1803069&r2=1803070&view=diff
==============================================================================
--- sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxStreamReader.java
[UTF-8] (original)
+++ sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxStreamReader.java
[UTF-8] Wed Jul 26 16:14:09 2017
@@ -556,8 +556,7 @@ parse:  switch (value.length()) {
      * @return a localized error message for a file that can not be parsed.
      */
     protected final String canNotParseFile() {
-        final Object[] parameters = IOUtilities.errorMessageParameters(owner.getFormatName(),
owner.getDisplayName(), reader);
-        return errors().getString(IOUtilities.errorMessageKey(parameters), parameters);
+        return IOUtilities.canNotReadFile(owner.getLocale(), owner.getFormatName(), owner.getDisplayName(),
reader);
     }
 
     /**

Modified: sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/MetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/MetadataTest.java?rev=1803070&r1=1803069&r2=1803070&view=diff
==============================================================================
--- sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/MetadataTest.java
[UTF-8] (original)
+++ sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/MetadataTest.java
[UTF-8] Wed Jul 26 16:14:09 2017
@@ -19,6 +19,7 @@ package org.apache.sis.internal.storage.
 import java.util.Arrays;
 import java.net.URI;
 import java.net.URISyntaxException;
+import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
@@ -36,6 +37,7 @@ import static org.apache.sis.test.TestUt
  * @since   0.8
  * @module
  */
+@DependsOn(TypesTest.class)
 public final strictfp class MetadataTest extends TestCase {
     /**
      * Tests the {@link Metadata#equals(Object)} and {@link Metadata#hashCode()}.

Modified: sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/ReaderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/ReaderTest.java?rev=1803070&r1=1803069&r2=1803070&view=diff
==============================================================================
--- sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/ReaderTest.java
[UTF-8] (original)
+++ sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/ReaderTest.java
[UTF-8] Wed Jul 26 16:14:09 2017
@@ -224,7 +224,7 @@ public final strictfp class ReaderTest e
         try (Store reader = create("1.0/waypoint.xml")) {
             verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
             assertEquals("version", StoreProvider.V1_0, reader.getVersion());
-            try (Stream<Feature> features = reader.features()) {
+            try (Stream<Feature> features = reader.features(false)) {
                 final Iterator<Feature> it = features.iterator();
                 verifyPoint(it.next(), 0, false);
                 verifyPoint(it.next(), 1, false);
@@ -245,7 +245,7 @@ public final strictfp class ReaderTest e
         try (Store reader = create("1.1/waypoint.xml")) {
             verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
             assertEquals("version", StoreProvider.V1_1, reader.getVersion());
-            try (Stream<Feature> features = reader.features()) {
+            try (Stream<Feature> features = reader.features(false)) {
                 final Iterator<Feature> it = features.iterator();
                 verifyPoint(it.next(), 0, true);
                 verifyPoint(it.next(), 1, true);
@@ -266,7 +266,7 @@ public final strictfp class ReaderTest e
         try (Store reader = create("1.0/route.xml")) {
             verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
             assertEquals("version", StoreProvider.V1_0, reader.getVersion());
-            try (Stream<Feature> features = reader.features()) {
+            try (Stream<Feature> features = reader.features(false)) {
                 final Iterator<Feature> it = features.iterator();
                 verifyRoute(it.next(), false, 1);
                 verifyEmpty(it.next(), "rtept");
@@ -295,7 +295,7 @@ 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 (Stream<Feature> features = reader.features()) {
+        try (Stream<Feature> features = reader.features(false)) {
             final Iterator<Feature> it = features.iterator();
             verifyRoute(it.next(), true, 3);
             verifyEmpty(it.next(), "rtept");
@@ -373,7 +373,7 @@ public final strictfp class ReaderTest e
         try (Store reader = create("1.0/track.xml")) {
             verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
             assertEquals("version", StoreProvider.V1_0, reader.getVersion());
-            try (Stream<Feature> features = reader.features()) {
+            try (Stream<Feature> features = reader.features(false)) {
                 final Iterator<Feature> it = features.iterator();
                 verifyTrack(it.next(), false, 1);
                 verifyEmpty(it.next(), "trkseg");
@@ -393,7 +393,7 @@ public final strictfp class ReaderTest e
         try (Store reader = create("1.1/track.xml")) {
             verifyAlmostEmptyMetadata((Metadata) reader.getMetadata());
             assertEquals("version", StoreProvider.V1_1, reader.getVersion());
-            try (Stream<Feature> features = reader.features()) {
+            try (Stream<Feature> features = reader.features(false)) {
                 final Iterator<Feature> it = features.iterator();
                 verifyTrack(it.next(), true, 3);
                 verifyEmpty(it.next(), "trkseg");
@@ -610,13 +610,13 @@ public final strictfp class ReaderTest e
     @DependsOnMethod("testSequentialReads")
     public void testConcurrentReads() throws DataStoreException {
         try (Store reader = createFromURL()) {
-            final Stream<Feature>   f1 = reader.features();
+            final Stream<Feature>   f1 = reader.features(false);
             final Iterator<Feature> i1 = f1.iterator();
             verifyRoute(i1.next(), true, 3);
-            final Stream<Feature>   f2 = reader.features();
+            final Stream<Feature>   f2 = reader.features(false);
             final Iterator<Feature> i2 = f2.iterator();
             verifyEmpty(i1.next(), "rtept");
-            final Stream<Feature>   f3 = reader.features();
+            final Stream<Feature>   f3 = reader.features(false);
             final Iterator<Feature> i3 = f3.iterator();
             verifyRoute(i2.next(), true, 3);
             verifyRoute(i3.next(), true, 3);

Modified: sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/test/suite/GPXTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/test/suite/GPXTestSuite.java?rev=1803070&r1=1803069&r2=1803070&view=diff
==============================================================================
--- sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/test/suite/GPXTestSuite.java
[UTF-8] (original)
+++ sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/test/suite/GPXTestSuite.java
[UTF-8] Wed Jul 26 16:14:09 2017
@@ -25,6 +25,7 @@ import org.junit.BeforeClass;
  * All tests from the {@code sis-xmlstore} module, in approximative dependency order.
  */
 @Suite.SuiteClasses({
+    org.apache.sis.internal.storage.gpx.TypesTest.class,
     org.apache.sis.internal.storage.gpx.MetadataTest.class,
     org.apache.sis.internal.storage.gpx.ReaderTest.class,
     org.apache.sis.internal.storage.gpx.WriterTest.class



Mime
View raw message