You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2013/12/13 23:12:48 UTC
svn commit: r1550842 [4/4] - in /sis/branches/JDK6: ./
application/sis-console/src/test/java/org/apache/sis/console/
core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/
core/sis-build-helper/src/site/apt/ core/sis-metadata/src/main/java...
Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/URIParserTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/URIParserTest.java?rev=1550842&r1=1550841&r2=1550842&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/URIParserTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/URIParserTest.java [UTF-8] Fri Dec 13 22:12:45 2013
@@ -16,6 +16,7 @@
*/
package org.apache.sis.internal.util;
+import org.apache.sis.test.DependsOnMethod;
import org.apache.sis.test.TestCase;
import org.junit.Test;
@@ -32,6 +33,71 @@ import static org.junit.Assert.*;
*/
public final strictfp class URIParserTest extends TestCase {
/**
+ * Tests {@link URIParser#parse(String)} on {@code "urn:ogc:def:crs:EPSG:8.2:4326"}.
+ * This is a URN without parameters defined by EPSG.
+ */
+ @Test
+ public void testParse() {
+ assertNull(URIParser.parse("EPSG:4326"));
+
+ URIParser parsed = URIParser.parse(" urn:ogc:def: crs : EPSG: 8.2 :4326 ");
+ assertNotNull("URIParser", parsed);
+ assertEquals ("isHTTP", false, parsed.isHTTP);
+ assertEquals ("type", "crs", parsed.type);
+ assertEquals ("authority", "EPSG", parsed.authority);
+ assertEquals ("version", "8.2", parsed.version);
+ assertEquals ("code", "4326", parsed.code);
+ assertNull ("parameters", parsed.parameters);
+ assertEquals ("toString()", "urn:ogc:def:crs:EPSG:8.2:4326", parsed.toString());
+
+ parsed = URIParser.parse("URN :X-OGC: Def:crs:EPSG::4326");
+ assertNotNull("URIParser", parsed);
+ assertEquals ("isHTTP", false, parsed.isHTTP);
+ assertEquals ("type", "crs", parsed.type);
+ assertEquals ("authority", "EPSG", parsed.authority);
+ assertNull ("version", parsed.version);
+ assertEquals ("code", "4326", parsed.code);
+ assertNull ("parameters", parsed.parameters);
+ assertEquals ("toString()", "urn:ogc:def:crs:EPSG::4326", parsed.toString());
+ }
+
+ /**
+ * Tests {@link URIParser#parse(String)} on {@code "urn:ogc:def:crs:OGC:1.3:AUTO42003:1:-100:45"}.
+ * This is a URN with parameters defined in WMS specification.
+ */
+ @Test
+ @DependsOnMethod("testParse")
+ public void testParseWithParameters() {
+ final URIParser parsed = URIParser.parse("urn:ogc:def:crs:OGC:1.3:AUTO42003:1:-100:45");
+ assertNotNull("URIParser", parsed);
+ assertEquals ("isHTTP", false, parsed.isHTTP);
+ assertEquals ("type", "crs", parsed.type);
+ assertEquals ("authority", "OGC", parsed.authority);
+ assertEquals ("version", "1.3", parsed.version);
+ assertEquals ("code", "AUTO42003", parsed.code);
+ assertNotNull("parameters", parsed.parameters);
+ assertArrayEquals("parameters", new String[] {"1", "-100", "45"}, parsed.parameters);
+ assertEquals("toString()", "urn:ogc:def:crs:OGC:1.3:AUTO42003:1:-100:45", parsed.toString());
+ }
+
+ /**
+ * Tests {@link URIParser#parse(String)} on {@code "http://www.opengis.net/gml/srs/epsg.xml#4326"}.
+ */
+ @Test
+ @DependsOnMethod("testParse")
+ public void testParseHTTP() {
+ final URIParser parsed = URIParser.parse("http://www.opengis.net/gml/srs/epsg.xml#4326");
+ assertNotNull("URIParser", parsed);
+ assertEquals ("isHTTP", true, parsed.isHTTP);
+ assertEquals ("type", "crs", parsed.type);
+ assertEquals ("authority", "epsg", parsed.authority);
+ assertNull ("version", parsed.version);
+ assertEquals ("code", "4326", parsed.code);
+ assertNull ("parameters", parsed.parameters);
+ assertEquals ("toString()", "http://www.opengis.net/gml/srs/epsg.xml#4326", parsed.toString());
+ }
+
+ /**
* Tests {@link URIParser#codeOf(String, String, String)} with URI like {@code "EPSG:4326"}.
*/
@Test
Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/mock/ReferenceResolverMock.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/mock/ReferenceResolverMock.java?rev=1550842&r1=1550841&r2=1550842&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/mock/ReferenceResolverMock.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/mock/ReferenceResolverMock.java [UTF-8] Fri Dec 13 22:12:45 2013
@@ -53,8 +53,8 @@ public final strictfp class ReferenceRes
* }
* }
*
- * Alternatively, the {@code finally} block can be replaced by a call to {@code context.finish()}
- * in a method annotated by {@link org.junit.After}.
+ * Alternatively, the {@code finally} block can be replaced by a call to {@code context.finish()} in a method
+ * annotated by {@link org.junit.After}. This is done automatically by {@link org.apache.sis.test.XMLTestCase}.
*
* @param marshalling {@code true} for marshalling, or {@code false} for unmarshalling.
* @return The (un)marshalling context.
@@ -66,6 +66,8 @@ public final strictfp class ReferenceRes
/**
* Unconditionally returns {@code true}.
+ *
+ * @return {@code true}.
*/
@Override
public <T> boolean canSubstituteByReference(final MarshalContext context, final Class<T> type, final T object, final UUID uuid) {
@@ -74,6 +76,8 @@ public final strictfp class ReferenceRes
/**
* Unconditionally returns {@code true}.
+ *
+ * @return {@code true}.
*/
@Override
public <T> boolean canSubstituteByReference(final MarshalContext context, final Class<T> type, final T object, final XLink link) {
Modified: sis/branches/JDK6/ide-project/NetBeans/nbproject/project.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/ide-project/NetBeans/nbproject/project.xml?rev=1550842&r1=1550841&r2=1550842&view=diff
==============================================================================
--- sis/branches/JDK6/ide-project/NetBeans/nbproject/project.xml (original)
+++ sis/branches/JDK6/ide-project/NetBeans/nbproject/project.xml Fri Dec 13 22:12:45 2013
@@ -59,6 +59,7 @@
<word>initially</word>
<word>javadoc</word>
<word>loggings</word>
+ <word>maintainance</word>
<word>marshallable</word>
<word>marshalled</word>
<word>marshaller</word>
Modified: sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java?rev=1550842&r1=1550841&r2=1550842&view=diff
==============================================================================
--- sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java [UTF-8] (original)
+++ sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java [UTF-8] Fri Dec 13 22:12:45 2013
@@ -19,7 +19,7 @@ package org.apache.sis.internal.storage.
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
-import org.apache.sis.xml.MetadataMarshallingTest;
+import org.apache.sis.metadata.iso.extent.DefaultExtentTest;
import org.apache.sis.test.DependsOnMethod;
import org.apache.sis.test.TestCase;
import org.junit.Test;
@@ -65,8 +65,7 @@ public final strictfp class MimeTypeDete
@Test
@DependsOnMethod("testGMDFromString")
public void testGMDFromInputStream() throws IOException {
- final InputStream in = MetadataMarshallingTest.class.getResourceAsStream("Extent.xml");
- assertNotNull("Can not read Extent.xml", in);
+ final InputStream in = DefaultExtentTest.getResource("Extent.xml").openStream();
assertEquals('<', in.read());
assertEquals('?', in.read());
final MimeTypeDetector detector = new MimeTypeDetector() {