This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git
commit 07c828dc9786c8b0125f81b21902496093a05cae Author: Martin Desruisseaux <[email protected]> AuthorDate: Thu Apr 21 11:07:36 2022 +0200 Rename classes with more explicit names. This is in anticipation for addition of classes other than World File data store in the future. For example a future version may provide Image I/O implementation as wrapper around `DataStore`. --- .../sis/internal/storage/image/FormatFilter.java | 2 +- .../image/{Image.java => WorldFileResource.java} | 24 +++++----- .../image/{Store.java => WorldFileStore.java} | 52 +++++++++++----------- ...reProvider.java => WorldFileStoreProvider.java} | 12 ++--- .../{WritableImage.java => WritableResource.java} | 8 ++-- .../sis/internal/storage/image/WritableStore.java | 26 ++++++----- .../storage/image/SelfConsistencyTest.java | 8 ++-- .../{StoreTest.java => WorldFileStoreTest.java} | 12 ++--- .../apache/sis/test/suite/StorageTestSuite.java | 2 +- 9 files changed, 76 insertions(+), 70 deletions(-) diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/FormatFilter.java b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/FormatFilter.java index 97d8a7e50c..ceda08a109 100644 --- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/FormatFilter.java +++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/FormatFilter.java @@ -124,7 +124,7 @@ enum FormatFilter { /** * Finds a provider for the given input, or returns {@code null} if none. - * This is used by {@link StoreProvider#probeContent(StorageConnector)}. + * This is used by {@link WorldFileStoreProvider#probeContent(StorageConnector)}. * * @param identifier the property value to use as a filtering criterion, or {@code null} if none. * @param connector provider of the input to be given to the {@code canDecodeInput(…)} method. diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/Image.java b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WorldFileResource.java similarity index 94% rename from storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/Image.java rename to storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WorldFileResource.java index 268f8619d1..c292bc5089 100644 --- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/Image.java +++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WorldFileResource.java @@ -52,14 +52,14 @@ import static java.lang.Math.toIntExact; /** - * A single image in a {@link Store}. + * A single image in a {@link WorldFileStore}. * * @author Martin Desruisseaux (Geomatys) * @version 1.2 * @since 1.2 * @module */ -class Image extends AbstractGridCoverageResource implements StoreResource { +class WorldFileResource extends AbstractGridCoverageResource implements StoreResource { /** * The dimensions of <var>x</var> and <var>y</var> axes. * Static constants for now, may become configurable fields in the future. @@ -69,7 +69,7 @@ class Image extends AbstractGridCoverageResource implements StoreResource { /** * The parent data store, or {@code null} if this resource is not valid anymore. */ - private volatile Store store; + private volatile WorldFileStore store; /** * Index of the image to read or write in the image file. This is usually 0. @@ -77,7 +77,7 @@ class Image extends AbstractGridCoverageResource implements StoreResource { int imageIndex; /** - * The identifier as a sequence number in the namespace of the {@link Store}. + * The identifier as a sequence number in the namespace of the {@link WorldFileStore}. * The first image has the sequence number "1". This is computed when first needed. * * @see #getIdentifier() @@ -102,7 +102,9 @@ class Image extends AbstractGridCoverageResource implements StoreResource { * Creates a new resource. This resource will have its own set of listeners, * but the listeners of the data store that created this resource will be notified as well. */ - Image(final Store store, final StoreListeners parent, final int imageIndex, final GridGeometry gridGeometry) { + WorldFileResource(final WorldFileStore store, final StoreListeners parent, + final int imageIndex, final GridGeometry gridGeometry) + { super(parent); this.store = store; this.imageIndex = imageIndex; @@ -122,8 +124,8 @@ class Image extends AbstractGridCoverageResource implements StoreResource { * * @throws DataStoreException if this resource is not valid anymore. */ - final Store store() throws DataStoreException { - final Store store = this.store; + final WorldFileStore store() throws DataStoreException { + final WorldFileStore store = this.store; if (store != null) { return store; } @@ -136,7 +138,7 @@ class Image extends AbstractGridCoverageResource implements StoreResource { */ @Override public final Optional<GenericName> getIdentifier() throws DataStoreException { - final Store store = store(); + final WorldFileStore store = store(); synchronized (store) { if (identifier == null) { identifier = Names.createLocalName(store.getDisplayName(), null, String.valueOf(imageIndex + 1)); @@ -148,7 +150,7 @@ class Image extends AbstractGridCoverageResource implements StoreResource { /** * Returns the valid extent of grid coordinates together with the conversion from those grid coordinates * to real world coordinates. The CRS and "pixels to CRS" conversion may be unknown if this image is not - * the {@linkplain Store#MAIN_IMAGE main image}, or if the {@code *.prj} and/or world auxiliary file has + * the {@link WorldFileStore#MAIN_IMAGE main image}, or if the {@code *.prj} and/or world auxiliary file has * not been found. */ @Override @@ -162,7 +164,7 @@ class Image extends AbstractGridCoverageResource implements StoreResource { @Override @SuppressWarnings("ReturnOfCollectionOrArrayField") public final List<SampleDimension> getSampleDimensions() throws DataStoreException { - final Store store = store(); + final WorldFileStore store = store(); synchronized (store) { if (sampleDimensions == null) try { final ImageReader reader = store.reader(); @@ -206,7 +208,7 @@ class Image extends AbstractGridCoverageResource implements StoreResource { public final GridCoverage read(GridGeometry domain, int... range) throws DataStoreException { RenderedImage image; List<SampleDimension> bands; - final Store store = store(); + final WorldFileStore store = store(); try { synchronized (store) { final ImageReader reader = store.reader(); diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/Store.java b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WorldFileStore.java similarity index 94% rename from storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/Store.java rename to storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WorldFileStore.java index d129a7513b..2188e244fe 100644 --- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/Store.java +++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WorldFileStore.java @@ -100,7 +100,9 @@ import org.apache.sis.setup.OptionKey; * * <p>The storage input object may also be an {@link ImageReader} instance ready for use * (i.e. with its {@linkplain ImageReader#setInput(Object) input set} to a non-null value). - * In that case, this data store will use the given image reader as-is.</p> + * In that case, this data store will use the given image reader as-is. + * The image reader will be {@linkplain ImageReader#dispose() disposed} + * and its input closed (if {@link AutoCloseable}) when this data store is {@linkplain #close() closed}.</p> * * <h2>Handling of multi-image files</h2> * Because some image formats can store an arbitrary amount of images, @@ -112,7 +114,7 @@ import org.apache.sis.setup.OptionKey; * @since 1.2 * @module */ -class Store extends PRJDataStore implements Aggregate { +class WorldFileStore extends PRJDataStore implements Aggregate { /** * Image I/O format names (ignoring case) for which we have an entry in the {@code SpatialMetadata} database. */ @@ -208,7 +210,7 @@ class Store extends PRJDataStore implements Aggregate { * @throws DataStoreException if an error occurred while opening the stream. * @throws IOException if an error occurred while creating the image reader instance. */ - Store(final StoreProvider provider, final StorageConnector connector, final boolean readOnly) + WorldFileStore(final WorldFileStoreProvider provider, final StorageConnector connector, final boolean readOnly) throws DataStoreException, IOException { super(provider, connector); @@ -271,7 +273,7 @@ fallback: if (reader == null) { } } } - throw new UnsupportedStorageException(super.getLocale(), StoreProvider.NAME, + throw new UnsupportedStorageException(super.getLocale(), WorldFileStoreProvider.NAME, storage, connector.getOption(OptionKey.OPEN_OPTIONS)); } } @@ -500,8 +502,8 @@ loop: for (int convention=0;; convention++) { return null; } final GridExtent extent = gg.getExtent(); - final int w = Math.toIntExact(extent.getSize(Image.X_DIMENSION)); - final int h = Math.toIntExact(extent.getSize(Image.Y_DIMENSION)); + final int w = Math.toIntExact(extent.getSize(WorldFileResource.X_DIMENSION)); + final int h = Math.toIntExact(extent.getSize(WorldFileResource.Y_DIMENSION)); final String s = (suffixWLD != null) ? suffixWLD : getWorldFileSuffix(); crs = gg.isDefined(GridGeometry.CRS) ? gg.getCoordinateReferenceSystem() : null; gridGeometry = gg; // Set only after success of all the above. @@ -578,10 +580,10 @@ loop: for (int convention=0;; convention++) { } /** - * A list of images where each {@link Image} instance is initialized when first needed. + * A list of images where each {@link WorldFileResource} instance is initialized when first needed. * Fetching the list size may be a costly operation and will be done only if requested. */ - final class Components extends ListOfUnknownSize<Image> { + final class Components extends ListOfUnknownSize<WorldFileResource> { /** * Size of this list, or any negative value if unknown. */ @@ -591,7 +593,7 @@ loop: for (int convention=0;; convention++) { * All elements in this list. Some array elements may be {@code null} if the image * has never been requested. */ - private Image[] images; + private WorldFileResource[] images; /** * Creates a new list of images. @@ -600,7 +602,7 @@ loop: for (int convention=0;; convention++) { */ private Components(final int numImages) { size = numImages; - images = new Image[Math.max(numImages, 1)]; + images = new WorldFileResource[Math.max(numImages, 1)]; } /** @@ -609,7 +611,7 @@ loop: for (int convention=0;; convention++) { */ @Override public int size() { - synchronized (Store.this) { + synchronized (WorldFileStore.this) { if (size < 0) try { size = reader().getNumImages(true); images = ArraysExt.resize(images, size); @@ -628,7 +630,7 @@ loop: for (int convention=0;; convention++) { */ @Override protected int sizeIfKnown() { - synchronized (Store.this) { + synchronized (WorldFileStore.this) { return size; } } @@ -639,7 +641,7 @@ loop: for (int convention=0;; convention++) { */ @Override protected boolean exists(final int index) { - synchronized (Store.this) { + synchronized (WorldFileStore.this) { if (size >= 0) { return index >= 0 && index < size; } @@ -659,9 +661,9 @@ loop: for (int convention=0;; convention++) { * @throws IndexOutOfBoundsException if the image index is out of bounds. */ @Override - public Image get(final int index) { - synchronized (Store.this) { - Image image = null; + public WorldFileResource get(final int index) { + synchronized (WorldFileStore.this) { + WorldFileResource image = null; if (index < images.length) { image = images[index]; } @@ -686,7 +688,7 @@ loop: for (int convention=0;; convention++) { * * @param image the image to add to this list. */ - final void added(final Image image) { + final void added(final WorldFileResource image) { size = image.imageIndex; if (size >= images.length) { images = Arrays.copyOf(images, size * 2); @@ -706,7 +708,7 @@ loop: for (int convention=0;; convention++) { images[last] = null; size--; while (index < last) { - final Image image = images[index++]; + final WorldFileResource image = images[index++]; if (image != null) image.imageIndex--; } } @@ -715,10 +717,10 @@ loop: for (int convention=0;; convention++) { * Removes the element at the specified position in this list. */ @Override - public Image remove(final int index) { - final Image image = get(index); + public WorldFileResource remove(final int index) { + final WorldFileResource image = get(index); try { - Store.this.remove(image); + WorldFileStore.this.remove(image); } catch (DataStoreException e) { throw new UnsupportedOperationException(e); } @@ -743,14 +745,14 @@ loop: for (int convention=0;; convention++) { * @return resource for the image identified by the given index. * @throws IndexOutOfBoundsException if the image index is out of bounds. */ - Image createImageResource(final int index) throws DataStoreException, IOException { - return new Image(this, listeners, index, getGridGeometry(index)); + WorldFileResource createImageResource(final int index) throws DataStoreException, IOException { + return new WorldFileResource(this, listeners, index, getGridGeometry(index)); } /** * Prepares an image reader compatible with the writer and sets its input. * This method is invoked for switching from write mode to read mode. - * Its actual implementation is provided by {@link WritableImage}. + * Its actual implementation is provided by {@link WritableResource}. * * @param current the current image reader, or {@code null} if none. * @return the image reader to use, or {@code null} if none. @@ -781,7 +783,7 @@ loop: for (int convention=0;; convention++) { if (current == null || current.getInput() == null) { reader = current = prepareReader(current); if (current == null) { - throw new DataStoreClosedException(getLocale(), StoreProvider.NAME, StandardOpenOption.READ); + throw new DataStoreClosedException(getLocale(), WorldFileStoreProvider.NAME, StandardOpenOption.READ); } configureReader(); } diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/StoreProvider.java b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WorldFileStoreProvider.java similarity index 93% rename from storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/StoreProvider.java rename to storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WorldFileStoreProvider.java index 563dafcd46..3e06c04f40 100644 --- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/StoreProvider.java +++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WorldFileStoreProvider.java @@ -35,18 +35,18 @@ import org.apache.sis.storage.ProbeResult; /** - * The provider of {@link Store} instances. + * The provider of {@link WorldFileStore} instances. * * @author Martin Desruisseaux (Geomatys) * @version 1.2 * @since 1.2 * @module */ -@StoreMetadata(formatName = StoreProvider.NAME, +@StoreMetadata(formatName = WorldFileStoreProvider.NAME, fileSuffixes = {"jpeg", "jpg", "png", "gif", "bmp"}, // Non-exhaustive list. capabilities = {Capability.READ, Capability.WRITE, Capability.CREATE}, resourceTypes = GridCoverageResource.class) -public final class StoreProvider extends PRJDataStore.Provider { +public final class WorldFileStoreProvider extends PRJDataStore.Provider { /** * The format name. */ @@ -55,7 +55,7 @@ public final class StoreProvider extends PRJDataStore.Provider { /** * Creates a new provider. */ - public StoreProvider() { + public WorldFileStoreProvider() { } /** @@ -69,7 +69,7 @@ public final class StoreProvider extends PRJDataStore.Provider { } /** - * Returns a {@link Store} implementation associated with this provider. + * Returns a {@link WorldFileStore} implementation associated with this provider. * The data store will be writable if {@link java.nio.file.StandardOpenOption#WRITE} is provided, * or if the storage is a writable object such as {@link javax.imageio.stream.ImageOutputStream}. * @@ -93,7 +93,7 @@ public final class StoreProvider extends PRJDataStore.Provider { if (isWritable) { return new WritableStore(this, connector); } else { - return new Store(this, connector, true); + return new WorldFileStore(this, connector, true); } } catch (IOException e) { throw new DataStoreException(e); diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WritableImage.java b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WritableResource.java similarity index 89% rename from storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WritableImage.java rename to storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WritableResource.java index fcc92c97da..5b6405d892 100644 --- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WritableImage.java +++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WritableResource.java @@ -36,12 +36,12 @@ import org.apache.sis.storage.event.StoreListeners; * @since 1.2 * @module */ -final class WritableImage extends Image implements WritableGridCoverageResource { +final class WritableResource extends WorldFileResource implements WritableGridCoverageResource { /** * Creates a new resource. */ - WritableImage(final WritableStore store, final StoreListeners parent, final int imageIndex, - final GridGeometry gridGeometry) throws DataStoreException + WritableResource(final WritableStore store, final StoreListeners parent, final int imageIndex, + final GridGeometry gridGeometry) throws DataStoreException { super(store, parent, imageIndex, gridGeometry); } @@ -60,7 +60,7 @@ final class WritableImage extends Image implements WritableGridCoverageResource final WritableStore store = (WritableStore) store(); try { synchronized (store) { - if (imageIndex != Store.MAIN_IMAGE || (store.isMultiImages() != 0 && !h.replace(null))) { + if (imageIndex != WorldFileStore.MAIN_IMAGE || (store.isMultiImages() != 0 && !h.replace(null))) { // TODO: we should use `ImageWriter.replacePixels(…)` methods instead. coverage = h.update(coverage); } diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WritableStore.java b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WritableStore.java index e20c3c7263..c427c2ec93 100644 --- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WritableStore.java +++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/image/WritableStore.java @@ -53,7 +53,7 @@ import org.apache.sis.setup.OptionKey; /** * A data store which writes grid coverages using Image I/O writers completed by the <cite>World File</cite> convention. - * Georeferencing is defined by two auxiliary files described in the {@link Store} parent class. + * Georeferencing is defined by two auxiliary files described in the {@link WorldFileStore} parent class. * * <h2>Type of output objects</h2> * The {@link StorageConnector} output should be an instance of the following types: @@ -63,16 +63,18 @@ import org.apache.sis.setup.OptionKey; * If none is found, this data store tries to {@linkplain ImageIO#createImageOutputStream(Object) create an output stream} * from the output object. * - * <p>The storage input object may also be an {@link ImageWriter} instance ready for use + * <p>The storage output object may also be an {@link ImageWriter} instance ready for use * (i.e. with its {@linkplain ImageWriter#setOutput(Object) output set} to a non-null value). - * In that case, this data store will use the given image writer as-is.</p> + * In that case, this data store will use the given image writer as-is. + * The image writer will be {@linkplain ImageWriter#dispose() disposed} + * and its output closed (if {@link AutoCloseable}) when this data store is {@linkplain #close() closed}.</p> * * @author Martin Desruisseaux (Geomatys) * @version 1.2 * @since 1.2 * @module */ -final class WritableStore extends Store implements WritableAggregate { +final class WritableStore extends WorldFileStore implements WritableAggregate { /** * Position of the input/output stream beginning. This is usually 0. */ @@ -104,7 +106,7 @@ final class WritableStore extends Store implements WritableAggregate { * @throws DataStoreException if an error occurred while opening the stream. * @throws IOException if an error occurred while creating the image reader instance. */ - WritableStore(final StoreProvider provider, final StorageConnector connector) + WritableStore(final WorldFileStoreProvider provider, final StorageConnector connector) throws DataStoreException, IOException { super(provider, connector, false); @@ -152,7 +154,7 @@ fallback: if (writer == null) { break fallback; } } - throw new UnsupportedStorageException(super.getLocale(), StoreProvider.NAME, + throw new UnsupportedStorageException(super.getLocale(), WorldFileStoreProvider.NAME, storage, connector.getOption(OptionKey.OPEN_OPTIONS)); } } @@ -289,8 +291,8 @@ writeCoeffs: for (int i=0;; i++) { * @throws IndexOutOfBoundsException if the image index is out of bounds. */ @Override - Image createImageResource(final int index) throws DataStoreException, IOException { - return new WritableImage(this, listeners, index, getGridGeometry(index)); + WorldFileResource createImageResource(final int index) throws DataStoreException, IOException { + return new WritableResource(this, listeners, index, getGridGeometry(index)); } /** @@ -322,7 +324,7 @@ writeCoeffs: for (int i=0;; i++) { if (domain == null) { domain = coverage.getGridGeometry(); // We are adding the first image. } - final WritableImage image = new WritableImage(this, listeners, numImages, domain); + final WritableResource image = new WritableResource(this, listeners, numImages, domain); image.write(coverage); components.added(image); // Must be invoked only after above succeeded. numImages++; @@ -343,8 +345,8 @@ writeCoeffs: for (int i=0;; i++) { @Override public synchronized void remove(final Resource resource) throws DataStoreException { Exception cause = null; - if (resource instanceof WritableImage) { - final WritableImage image = (WritableImage) resource; + if (resource instanceof WritableResource) { + final WritableResource image = (WritableResource) resource; if (image.store() == this) try { final int imageIndex = image.imageIndex; writer().removeImage(imageIndex); @@ -436,7 +438,7 @@ writeCoeffs: for (int i=0;; i++) { } } } - throw new DataStoreClosedException(getLocale(), StoreProvider.NAME, StandardOpenOption.WRITE); + throw new DataStoreClosedException(getLocale(), WorldFileStoreProvider.NAME, StandardOpenOption.WRITE); } /** diff --git a/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/image/SelfConsistencyTest.java b/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/image/SelfConsistencyTest.java index ea99ffe540..a2858cfadc 100644 --- a/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/image/SelfConsistencyTest.java +++ b/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/image/SelfConsistencyTest.java @@ -43,7 +43,7 @@ public final strictfp class SelfConsistencyTest extends CoverageReadConsistency /** * The store used for the test, opened only once. */ - private static Store store; + private static WorldFileStore store; /** * Opens the test file to be used for all tests. @@ -53,9 +53,9 @@ public final strictfp class SelfConsistencyTest extends CoverageReadConsistency */ @BeforeClass public static void openFile() throws IOException, DataStoreException { - final URL url = StoreTest.class.getResource("gradient.png"); + final URL url = WorldFileStoreTest.class.getResource("gradient.png"); assumeNotNull(url); - store = new Store(null, new StorageConnector(url), true); + store = new WorldFileStore(null, new StorageConnector(url), true); } /** @@ -65,7 +65,7 @@ public final strictfp class SelfConsistencyTest extends CoverageReadConsistency */ @AfterClass public static void closeFile() throws DataStoreException { - final Store s = store; + final WorldFileStore s = store; if (s != null) { store = null; // Clear first in case of failure. s.close(); diff --git a/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/image/StoreTest.java b/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/image/WorldFileStoreTest.java similarity index 87% rename from storage/sis-storage/src/test/java/org/apache/sis/internal/storage/image/StoreTest.java rename to storage/sis-storage/src/test/java/org/apache/sis/internal/storage/image/WorldFileStoreTest.java index d3f6c02ddb..46b90eb276 100644 --- a/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/image/StoreTest.java +++ b/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/image/WorldFileStoreTest.java @@ -31,29 +31,29 @@ import static org.apache.sis.test.TestUtilities.getSingleton; /** - * Tests {@link Store} and {@link StoreProvider}. + * Tests {@link WorldFileStore} and {@link WorldFileStoreProvider}. * * @author Martin Desruisseaux (Geomatys) * @version 1.2 * @since 1.2 * @module */ -public final strictfp class StoreTest extends TestCase { +public final strictfp class WorldFileStoreTest extends TestCase { /** * Returns a storage connector with the URL to the test data. */ private static StorageConnector testData() { - return new StorageConnector(StoreTest.class.getResource("gradient.png")); + return new StorageConnector(WorldFileStoreTest.class.getResource("gradient.png")); } /** - * Tests {@link StoreProvider#probeContent(StorageConnector)} method. + * Tests {@link WorldFileStoreProvider#probeContent(StorageConnector)} method. * * @throws DataStoreException if en error occurred while reading the CSV file. */ @Test public void testProbeContent() throws DataStoreException { - final StoreProvider p = new StoreProvider(); + final WorldFileStoreProvider p = new WorldFileStoreProvider(); final ProbeResult r = p.probeContent(testData()); assertTrue(r.isSupported()); assertEquals("image/png", r.getMimeType()); @@ -67,7 +67,7 @@ public final strictfp class StoreTest extends TestCase { */ @Test public void testMetadata() throws DataStoreException, IOException { - try (Store store = new Store(null, testData(), true)) { + try (WorldFileStore store = new WorldFileStore(null, testData(), true)) { assertEquals("gradient", store.getIdentifier().get().toString()); final Metadata metadata = store.getMetadata(); final Identification id = getSingleton(metadata.getIdentificationInfo()); diff --git a/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java b/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java index 073c8ed5f1..1bdf997a3f 100644 --- a/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java +++ b/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java @@ -57,7 +57,7 @@ import org.junit.BeforeClass; org.apache.sis.internal.storage.wkt.StoreTest.class, org.apache.sis.internal.storage.csv.StoreProviderTest.class, org.apache.sis.internal.storage.csv.StoreTest.class, - org.apache.sis.internal.storage.image.StoreTest.class, + org.apache.sis.internal.storage.image.WorldFileStoreTest.class, org.apache.sis.internal.storage.image.SelfConsistencyTest.class, org.apache.sis.internal.storage.ascii.StoreTest.class, org.apache.sis.internal.storage.ascii.WritableStoreTest.class,
