Modified: sis/branches/JDK9/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/folder/StoreTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/folder/StoreTest.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/folder/StoreTest.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/folder/StoreTest.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -24,6 +24,7 @@ import java.nio.file.Paths; import java.util.Arrays; import java.util.HashSet; import java.util.Set; +import org.opengis.parameter.ParameterValueGroup; import org.opengis.metadata.identification.Identification; import org.apache.sis.metadata.iso.citation.Citations; import org.apache.sis.storage.Aggregate; @@ -42,7 +43,7 @@ import static org.junit.Assume.assumeTru * * @author Johann Sorel (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.8 + * @version 1.0 * @since 0.8 * @module */ @@ -68,9 +69,32 @@ public final strictfp class StoreTest ex */ @Test public void testComponents() throws URISyntaxException, DataStoreException, IOException { + final Set<String> identifiers = new HashSet<>(Arrays.asList("EPSG:4326", "Sample 1", "Sample 2", "Sample 3", "data4")); + final Path path = testDirectory(); + try (Store store = new Store(null, new StorageConnector(path), path, null)) { + assertEquals("Wrong number of data stores.", 4, store.components().size()); + verifyContent(store, identifiers); + } + if (!identifiers.isEmpty()) { + fail("Missing resources: " + identifiers); + } + } + + /** + * Verifies that specifying a format effectively restricts the number of resources to be found. + * + * @throws URISyntaxException if the URL to test data can not be converted to a path of the file system. + * @throws DataStoreException if an error occurred while reading the resources. + * @throws IOException if an I/O error occurs. + */ + @Test + public void testSearchProviderParameter() throws URISyntaxException, DataStoreException, IOException { final Set<String> identifiers = new HashSet<>(Arrays.asList("Sample 1", "Sample 2", "Sample 3", "data4")); - try (Store store = new Store(null, new StorageConnector(testDirectory()))) { - assertEquals("Expected three data stores.", 3, store.components().size()); + final ParameterValueGroup params = FolderStoreProvider.PARAMETERS.createValue(); + params.parameter("location").setValue(testDirectory()); + params.parameter("format").setValue("XML"); + try (Store store = (Store) FolderStoreProvider.INSTANCE.open(params)) { + assertEquals("Expected one less data store.", 3, store.components().size()); verifyContent(store, identifiers); } if (!identifiers.isEmpty()) {
Modified: sis/branches/JDK9/storage/sis-storage/src/test/java/org/apache/sis/storage/StorageConnectorTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-storage/src/test/java/org/apache/sis/storage/StorageConnectorTest.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-storage/src/test/java/org/apache/sis/storage/StorageConnectorTest.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-storage/src/test/java/org/apache/sis/storage/StorageConnectorTest.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -191,7 +191,7 @@ public final strictfp class StorageConne final byte[] sample = new byte[32]; data.readFully(sample); /* - * Request again the InputStream and read the same amount of bytes than above. The intend of this test + * Request again the InputStream and read the same amount of bytes than above. The intent of this test * is to verify that StorageConnector has reseted the InputStream position before to return it. * Note that this test requires InputStream implementations supporting mark/reset operations * (which is the case when the resource is an ordinary file, not an entry inside a JAR file), Modified: sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/GroupAsPolylineOperation.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/GroupAsPolylineOperation.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/GroupAsPolylineOperation.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/GroupAsPolylineOperation.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -140,7 +140,7 @@ final class GroupAsPolylineOperation ext * The attribute resulting from execution if the {@link GroupAsPolylineOperation}. * The value is computed when first requested, then cached for this {@code Result} instance only. * Note that the cache is not used when {@link #apply(Feature, ParameterValueGroup)} is invoked, - * causing a new value to be computed again. The intend is to behave as if the operation has been + * causing a new value to be computed again. The intent is to behave as if the operation has been * executed at {@code apply(…)} invocation time, even if we deferred the actual execution. * * @param <G> the root geometry class (implementation-dependent). Modified: sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Link.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Link.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Link.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Link.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -101,7 +101,7 @@ public final class Link implements Onlin /** * Invoked by JAXB after unmarshalling. If the {@linkplain #uri} is not set but the {@link #text} looks - * like a URI, uses that text. The intend is to handle link that should have been defined like below: + * like a URI, uses that text. The intent is to handle link that should have been defined like below: * * {@preformat xml * <link href="http://some.site.org"> Modified: sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Reader.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Reader.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Reader.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Reader.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -19,9 +19,11 @@ package org.apache.sis.internal.storage. import java.util.List; import java.util.ArrayList; import java.util.Objects; +import java.util.function.Consumer; import java.io.IOException; import java.io.EOFException; import java.net.URISyntaxException; +import java.time.format.DateTimeParseException; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.bind.JAXBException; @@ -34,8 +36,6 @@ import org.apache.sis.util.resources.Err import org.apache.sis.util.Version; // Branch-dependent imports -import java.util.function.Consumer; -import java.time.format.DateTimeParseException; import org.opengis.feature.Feature; Modified: sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -16,6 +16,9 @@ */ package org.apache.sis.internal.storage.gpx; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; +import java.io.UncheckedIOException; import java.net.URISyntaxException; import org.opengis.util.NameFactory; import org.opengis.util.FactoryException; @@ -42,9 +45,6 @@ import org.apache.sis.metadata.iso.citat import org.apache.sis.metadata.iso.distribution.DefaultFormat; // Branch-dependent imports -import java.util.stream.Stream; -import java.util.stream.StreamSupport; -import java.io.UncheckedIOException; import org.opengis.feature.Feature; import org.opengis.feature.FeatureType; Modified: sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/StoreProvider.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/StoreProvider.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/StoreProvider.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/StoreProvider.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -22,7 +22,7 @@ import org.apache.sis.storage.DataStore; import org.apache.sis.storage.DataStoreException; import org.apache.sis.storage.StorageConnector; import org.apache.sis.internal.storage.Capability; -import org.apache.sis.internal.storage.Capabilities; +import org.apache.sis.internal.storage.StoreMetadata; import org.apache.sis.internal.storage.xml.stream.StaxDataStoreProvider; import org.apache.sis.measure.Range; import org.apache.sis.util.Version; @@ -34,11 +34,13 @@ import org.apache.sis.util.Version; * * @author Johann Sorel (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.8 + * @version 1.0 * @since 0.8 * @module */ -@Capabilities({Capability.READ, Capability.WRITE}) +@StoreMetadata(formatName = "GPX", + fileSuffixes = "xml", + capabilities = {Capability.READ, Capability.WRITE}) public final class StoreProvider extends StaxDataStoreProvider { /** * The "1.0" version. 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=1825252&r1=1825251&r2=1825252&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] Sat Feb 24 15:44:08 2018 @@ -21,6 +21,7 @@ import java.util.Collections; import java.util.Locale; import java.util.Map; import java.util.HashMap; +import java.time.temporal.Temporal; import org.opengis.util.ScopedName; import org.opengis.util.GenericName; import org.opengis.util.NameFactory; @@ -47,7 +48,6 @@ import org.apache.sis.util.iso.ResourceI import org.apache.sis.util.iso.DefaultNameFactory; // Branch-dependent imports -import java.time.temporal.Temporal; import org.opengis.feature.AttributeType; import org.opengis.feature.FeatureType; 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=1825252&r1=1825251&r2=1825252&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] Sat Feb 24 15:44:08 2018 @@ -20,7 +20,12 @@ import java.util.Date; import java.util.Map; import java.util.List; import java.util.Arrays; +import java.util.Spliterator; import java.util.NoSuchElementException; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.time.temporal.Temporal; +import java.time.format.DateTimeParseException; import java.net.URI; import java.io.IOException; import java.io.EOFException; @@ -43,11 +48,6 @@ import org.apache.sis.util.collection.Ba import org.apache.sis.util.resources.Errors; // Branch-dependent imports -import java.util.Spliterator; -import java.util.function.Consumer; -import java.util.function.Predicate; -import java.time.temporal.Temporal; -import java.time.format.DateTimeParseException; import org.opengis.feature.Feature; Modified: sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxStreamWriter.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxStreamWriter.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxStreamWriter.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxStreamWriter.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -18,7 +18,9 @@ package org.apache.sis.internal.storage. import java.util.Map; import java.util.Date; +import java.util.function.Consumer; import java.io.IOException; +import java.io.UncheckedIOException; import java.nio.charset.Charset; import javax.xml.namespace.QName; import javax.xml.bind.Marshaller; @@ -32,8 +34,6 @@ import org.apache.sis.util.collection.Ba import org.apache.sis.util.resources.Errors; // Branch-dependent imports -import java.io.UncheckedIOException; -import java.util.function.Consumer; import org.opengis.feature.Feature; 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=1825252&r1=1825251&r2=1825252&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] Sat Feb 24 15:44:08 2018 @@ -19,6 +19,8 @@ package org.apache.sis.internal.storage. import java.util.Collection; import java.util.Iterator; import java.util.List; +import java.util.stream.Stream; +import java.time.Instant; import com.esri.core.geometry.Point; import com.esri.core.geometry.Polyline; import org.opengis.geometry.Envelope; @@ -39,8 +41,6 @@ import static org.apache.sis.test.TestUt import static org.apache.sis.test.TestUtilities.getSingleton; // Branch-dependent imports -import java.time.Instant; -import java.util.stream.Stream; import org.opengis.feature.Feature; import org.opengis.metadata.content.FeatureTypeInfo; Modified: sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/WriterTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/WriterTest.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/WriterTest.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/WriterTest.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -18,6 +18,7 @@ package org.apache.sis.internal.storage. import java.util.List; import java.util.Arrays; +import java.time.Instant; import java.net.URI; import java.io.ByteArrayOutputStream; import java.io.UnsupportedEncodingException; @@ -38,7 +39,6 @@ import org.junit.Test; import static org.apache.sis.test.Assert.*; // Branch-dependent imports -import java.time.Instant; import org.opengis.feature.Feature;
