sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1732071 - in /sis/branches/JDK8/storage/sis-storage/src: main/java/org/apache/sis/internal/storage/xml/ main/resources/META-INF/services/ test/java/org/apache/sis/internal/storage/xml/ test/java/org/apache/sis/storage/ test/java/org/apache...
Date Wed, 24 Feb 2016 11:02:49 GMT
Author: desruisseaux
Date: Wed Feb 24 11:02:49 2016
New Revision: 1732071

URL: http://svn.apache.org/viewvc?rev=1732071&view=rev
Log:
Rename XMLStore as Store (an internal class anyway) since "XML" is already implied by the
package name, and for consistency with WKT store.

Added:
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
      - copied, changed from r1732070, sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStore.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java
      - copied, changed from r1732070, sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStoreProvider.java
    sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/StoreProviderTest.java
      - copied, changed from r1732070, sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/XMLStoreProviderTest.java
    sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/StoreTest.java
      - copied, changed from r1732070, sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/XMLStoreTest.java
Removed:
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStore.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStoreProvider.java
    sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/XMLStoreProviderTest.java
    sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/XMLStoreTest.java
Modified:
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/package-info.java
    sis/branches/JDK8/storage/sis-storage/src/main/resources/META-INF/services/org.apache.sis.storage.DataStoreProvider
    sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java
    sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoresTest.java
    sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java?rev=1732071&r1=1732070&r2=1732071&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java
[UTF-8] Wed Feb 24 11:02:49 2016
@@ -273,7 +273,7 @@ abstract class MimeTypeDetector {
             if (insufficientBytes) {
                 return ProbeResult.INSUFFICIENT_BYTES;
             }
-            mimeType = XMLStoreProvider.MIME_TYPE;
+            mimeType = StoreProvider.MIME_TYPE;
         }
         return new ProbeResult(true, mimeType, null);
     }

Copied: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
(from r1732070, sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStore.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java?p2=sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java&p1=sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStore.java&r1=1732070&r2=1732071&rev=1732071&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStore.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
[UTF-8] Wed Feb 24 11:02:49 2016
@@ -52,10 +52,10 @@ import static java.util.Collections.sing
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.7
  * @module
  */
-final class XMLStore extends DataStore {
+final class Store extends DataStore {
     /**
      * The file name.
      */
@@ -83,7 +83,7 @@ final class XMLStore extends DataStore {
      * @param  connector Information about the storage (URL, stream, <i>etc</i>).
      * @throws DataStoreException If an error occurred while opening the stream.
      */
-    public XMLStore(final StorageConnector connector) throws DataStoreException {
+    public Store(final StorageConnector connector) throws DataStoreException {
         name = connector.getStorageName();
         final InputStream in = connector.getStorageAs(InputStream.class);
         if (in != null) {

Copied: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java
(from r1732070, sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStoreProvider.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java?p2=sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java&p1=sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStoreProvider.java&r1=1732070&r2=1732071&rev=1732071&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java
[UTF-8] Wed Feb 24 11:02:49 2016
@@ -27,14 +27,14 @@ import org.apache.sis.storage.ProbeResul
 
 
 /**
- * The provider of {@link XMLStore} instances.
+ * The provider of {@link Store} instances.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.7
  * @module
  */
-public class XMLStoreProvider extends DataStoreProvider {
+public class StoreProvider extends DataStoreProvider {
     /**
      * The {@value} MIME type, used only of {@link #probeContent(StorageConnector)} can not
determine
      * a more accurate type.
@@ -55,11 +55,11 @@ public class XMLStoreProvider extends Da
     /**
      * Creates a new provider.
      */
-    public XMLStoreProvider() {
+    public StoreProvider() {
     }
 
     /**
-     * Returns {@link ProbeResult#SUPPORTED} if the given storage appears to be supported
by {@link XMLStore}.
+     * Returns {@link ProbeResult#SUPPORTED} if the given storage appears to be supported
by {@link Store}.
      * Returning {@code SUPPORTED} from this method does not guarantee that reading or writing
will succeed,
      * only that there appears to be a reasonable chance of success based on a brief inspection
of the storage
      * header.
@@ -127,7 +127,7 @@ public class XMLStoreProvider extends Da
     }
 
     /**
-     * Returns a {@link XMLStore} implementation associated with this provider.
+     * Returns a {@link Store} implementation associated with this provider.
      *
      * @param  storage Information about the storage (URL, stream, <i>etc</i>).
      * @return A data store implementation associated with this provider for the given storage.
@@ -135,6 +135,6 @@ public class XMLStoreProvider extends Da
      */
     @Override
     public DataStore open(final StorageConnector storage) throws DataStoreException {
-        return new XMLStore(storage);
+        return new Store(storage);
     }
 }

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/package-info.java?rev=1732071&r1=1732070&r2=1732071&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/package-info.java
[UTF-8] Wed Feb 24 11:02:49 2016
@@ -18,11 +18,11 @@
 /**
  * {@link org.apache.sis.storage.DataStore} implementation for XML files.
  * The kind of objects recognized by this package is listed in the
- * {@link org.apache.sis.internal.storage.xml.XMLStore} class.
+ * {@link org.apache.sis.internal.storage.xml.Store} class.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.7
  * @module
  */
 package org.apache.sis.internal.storage.xml;

Modified: sis/branches/JDK8/storage/sis-storage/src/main/resources/META-INF/services/org.apache.sis.storage.DataStoreProvider
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/resources/META-INF/services/org.apache.sis.storage.DataStoreProvider?rev=1732071&r1=1732070&r2=1732071&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/resources/META-INF/services/org.apache.sis.storage.DataStoreProvider
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/resources/META-INF/services/org.apache.sis.storage.DataStoreProvider
[UTF-8] Wed Feb 24 11:02:49 2016
@@ -1,2 +1,2 @@
-org.apache.sis.internal.storage.xml.XMLStoreProvider
+org.apache.sis.internal.storage.xml.StoreProvider
 org.apache.sis.internal.storage.wkt.StoreProvider

Modified: sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java?rev=1732071&r1=1732070&r2=1732071&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java
[UTF-8] Wed Feb 24 11:02:49 2016
@@ -44,7 +44,7 @@ public final strictfp class MimeTypeDete
      */
     @Test
     public void testGMDFromString() throws IOException {
-        final StringReader in = new StringReader(XMLStoreTest.XML);
+        final StringReader in = new StringReader(StoreTest.XML);
         assertEquals('<', in.read());
         assertEquals('?', in.read());
         final MimeTypeDetector detector = new MimeTypeDetector() {

Copied: sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/StoreProviderTest.java
(from r1732070, sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/XMLStoreProviderTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/StoreProviderTest.java?p2=sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/StoreProviderTest.java&p1=sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/XMLStoreProviderTest.java&r1=1732070&r2=1732071&rev=1732071&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/XMLStoreProviderTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/StoreProviderTest.java
[UTF-8] Wed Feb 24 11:02:49 2016
@@ -27,23 +27,23 @@ import static org.junit.Assert.*;
 
 
 /**
- * Tests {@link XMLStoreProvider}.
+ * Tests {@link StoreProvider}.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.7
  * @module
  */
-public final strictfp class XMLStoreProviderTest extends TestCase {
+public final strictfp class StoreProviderTest extends TestCase {
     /**
-     * Tests {@link XMLStoreProvider#probeContent(StorageConnector)} method from a {@link
Reader} object.
+     * Tests {@link StoreProvider#probeContent(StorageConnector)} method from a {@link Reader}
object.
      *
      * @throws DataStoreException Should never happen.
      */
     @Test
     public void testProbeContentFromReader() throws DataStoreException {
-        final XMLStoreProvider p = new XMLStoreProvider();
-        final StorageConnector c = new StorageConnector(new StringReader(XMLStoreTest.XML));
+        final StoreProvider    p = new StoreProvider();
+        final StorageConnector c = new StorageConnector(new StringReader(StoreTest.XML));
         final ProbeResult      r = p.probeContent(c);
         c.closeAllExcept(null);
         assertTrue  ("isSupported", r.isSupported());

Copied: sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/StoreTest.java
(from r1732070, sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/XMLStoreTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/StoreTest.java?p2=sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/StoreTest.java&p1=sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/XMLStoreTest.java&r1=1732070&r2=1732071&rev=1732071&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/XMLStoreTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/StoreTest.java
[UTF-8] Wed Feb 24 11:02:49 2016
@@ -34,14 +34,14 @@ import java.nio.charset.StandardCharsets
 
 
 /**
- * Tests {@link XMLStore}.
+ * Tests {@link Store}.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.5
+ * @version 0.7
  * @module
  */
-public final strictfp class XMLStoreTest extends TestCase {
+public final strictfp class StoreTest extends TestCase {
     /**
      * The metadata to unmarshal.
      */
@@ -84,14 +84,14 @@ public final strictfp class XMLStoreTest
             "</gmd:MD_Metadata>\n";
 
     /**
-     * Tests {@link XMLStore#getMetadata()}.
+     * Tests {@link Store#getMetadata()}.
      *
      * @throws DataStoreException If an error occurred while reading the metadata.
      */
     @Test
     public void testMetadata() throws DataStoreException {
         final Metadata metadata;
-        try (XMLStore store = new XMLStore(new StorageConnector(new StringReader(XML))))
{
+        try (Store store = new Store(new StorageConnector(new StringReader(XML)))) {
             metadata = store.getMetadata();
             assertSame("Expected cached value.", metadata, store.getMetadata());
         }

Modified: sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoresTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoresTest.java?rev=1732071&r1=1732070&r2=1732071&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoresTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoresTest.java
[UTF-8] Wed Feb 24 11:02:49 2016
@@ -17,7 +17,7 @@
 package org.apache.sis.storage;
 
 import java.io.StringReader;
-import org.apache.sis.internal.storage.xml.XMLStoreTest;
+import org.apache.sis.internal.storage.xml.StoreTest;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
@@ -30,10 +30,10 @@ import static org.junit.Assert.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.7
  * @module
  */
-@DependsOn(XMLStoreTest.class)
+@DependsOn(StoreTest.class)
 public final strictfp class DataStoresTest extends TestCase {
     /**
      * Tests {@link DataStores#probeContentType(Object)}.
@@ -42,7 +42,7 @@ public final strictfp class DataStoresTe
      */
     @Test
     public void testProbeContentType() throws DataStoreException {
-        final String type = DataStores.probeContentType(new StringReader(XMLStoreTest.XML));
+        final String type = DataStores.probeContentType(new StringReader(StoreTest.XML));
         assertEquals("application/vnd.iso.19139+xml", type);
     }
 
@@ -53,7 +53,7 @@ public final strictfp class DataStoresTe
      */
     @Test
     public void testOpen() throws DataStoreException {
-        final DataStore store = DataStores.open(new StringReader(XMLStoreTest.XML));
+        final DataStore store = DataStores.open(new StringReader(StoreTest.XML));
         assertFalse(store.getMetadata().getContacts().isEmpty());
     }
 }

Modified: sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java?rev=1732071&r1=1732070&r2=1732071&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java
[UTF-8] Wed Feb 24 11:02:49 2016
@@ -38,8 +38,8 @@ import org.junit.BeforeClass;
     org.apache.sis.storage.ProbeResultTest.class,
     org.apache.sis.storage.StorageConnectorTest.class,
     org.apache.sis.internal.storage.xml.MimeTypeDetectorTest.class,
-    org.apache.sis.internal.storage.xml.XMLStoreProviderTest.class,
-    org.apache.sis.internal.storage.xml.XMLStoreTest.class,
+    org.apache.sis.internal.storage.xml.StoreProviderTest.class,
+    org.apache.sis.internal.storage.xml.StoreTest.class,
     org.apache.sis.internal.storage.wkt.StoreProviderTest.class,
     org.apache.sis.internal.storage.wkt.StoreTest.class,
     org.apache.sis.storage.DataStoresTest.class,



Mime
View raw message