Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java?rev=1630661&r1=1630660&r2=1630661&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java [UTF-8] Fri Oct 10 06:53:25 2014 @@ -20,6 +20,7 @@ import java.lang.reflect.Modifier; import org.opengis.util.CodeList; import org.opengis.annotation.UML; import org.opengis.annotation.Specification; +import org.opengis.metadata.content.FeatureCatalogueDescription; import org.apache.sis.metadata.MetadataStandard; import org.apache.sis.metadata.MetadataTestCase; import org.apache.sis.metadata.iso.identification.DefaultCoupledResource; @@ -40,7 +41,7 @@ import static org.junit.Assert.*; * * @author Martin Desruisseaux (Geomatys) * @since 0.3 (derived from geotk-2.4) - * @version 0.3 + * @version 0.5 * @module */ @DependsOn(org.apache.sis.metadata.PropertyAccessorTest.class) @@ -231,13 +232,16 @@ public final strictfp class AllMetadataT * @return {@inheritDoc} */ @Override - protected String getExpectedXmlElementName(final UML uml) { + protected String getExpectedXmlElementName(final Class<?> type, final UML uml) { String name = uml.identifier(); if (name.equals("distributedComputingPlatform")) { name = "DCP"; - } - if (name.equals("stepDateTime")) { + } else if (name.equals("stepDateTime")) { name = "dateTime"; + } else if (name.equals("defaultLocale+otherLocale") || + type == FeatureCatalogueDescription.class && name.equals("locale")) + { + name = "language"; } return name; }
Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java?rev=1630661&r1=1630660&r2=1630661&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java [UTF-8] Fri Oct 10 06:53:25 2014 @@ -25,7 +25,6 @@ import java.lang.reflect.Method; import java.lang.reflect.InvocationHandler; import java.nio.charset.Charset; import javax.xml.bind.JAXBException; -import org.opengis.metadata.Metadata; import org.opengis.metadata.Identifier; import org.opengis.metadata.identification.*; import org.opengis.metadata.citation.Citation; @@ -37,6 +36,8 @@ import org.opengis.metadata.maintenance. import org.opengis.metadata.spatial.SpatialRepresentationType; import org.opengis.util.InternationalString; import org.opengis.temporal.Duration; +import org.apache.sis.util.iso.SimpleInternationalString; +import org.apache.sis.metadata.iso.citation.DefaultCitation; import org.apache.sis.internal.system.DefaultFactories; import org.apache.sis.test.XMLTestCase; import org.apache.sis.xml.XML; @@ -67,29 +68,29 @@ public final strictfp class CustomMetada public void testProxy() throws JAXBException { /* * A trivial metadata implementation which return the method name - * for every attribute of type String. + * for every attribute of type InternationalString. */ final InvocationHandler handler = new InvocationHandler() { @Override public Object invoke(Object proxy, Method method, Object[] args) { - if (method.getReturnType() == String.class) { - return method.getName(); + if (method.getReturnType() == InternationalString.class) { + return new SimpleInternationalString(method.getName()); } return null; } }; - Metadata data = (Metadata) Proxy.newProxyInstance(getClass().getClassLoader(), - new Class<?>[] { Metadata.class }, handler); + Citation data = (Citation) Proxy.newProxyInstance(getClass().getClassLoader(), + new Class<?>[] { Citation.class }, handler); /* * Wrap the metadata in a DefaultMetadata, and ensure * we can marshall it without an exception being throw. */ - data = new DefaultMetadata(data); + data = new DefaultCitation(data); final String xml = XML.marshal(data); /* * A few simple checks. */ - assertTrue(xml.contains("getMetadataStandardName")); - assertTrue(xml.contains("getMetadataStandardVersion")); + assertTrue(xml.contains("title")); + assertTrue(xml.contains("edition")); } /** Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java?rev=1630661&r1=1630660&r2=1630661&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java [UTF-8] Fri Oct 10 06:53:25 2014 @@ -120,6 +120,6 @@ public final strictfp class DefaultMetad * Verify warning message emitted during unmarshalling. */ assertEquals("warning", "NullCollectionElement_1", resourceKey); - assertArrayEquals("warning", new String[] {"CheckedArrayList<ResponsibleParty>"}, parameters); + assertArrayEquals("warning", new String[] {"CheckedArrayList<Responsibility>"}, parameters); } } Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java?rev=1630661&r1=1630660&r2=1630661&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java [UTF-8] Fri Oct 10 06:53:25 2014 @@ -120,7 +120,7 @@ public strictfp class DefaultMetadataTes new DefaultTelephone("+33 (0)2 xx.xx.xx.x4", TelephoneType.FACSIMILE) )); final DefaultAddress address = new DefaultAddress(); - address.setDeliveryPoints(singleton("Brest institute")); + address.setDeliveryPoints(singleton(new SimpleInternationalString("Brest institute"))); address.setCity(new SimpleInternationalString("Plouzane")); address.setPostalCode("29280"); address.setCountry(country); @@ -150,7 +150,7 @@ public strictfp class DefaultMetadataTes new DefaultTelephone("+33 (0)4 xx.xx.xx.x8", TelephoneType.FACSIMILE) )); final DefaultAddress address = new DefaultAddress(); - address.setDeliveryPoints(singleton("Oceanology institute")); + address.setDeliveryPoints(singleton(new SimpleInternationalString("Oceanology institute"))); address.setCity(new SimpleInternationalString("Marseille")); address.setPostalCode("13288"); address.setCountry(country); @@ -306,7 +306,7 @@ public strictfp class DefaultMetadataTes onlines.setProtocol("http"); transfer.setOnLines(singleton(onlines)); distributionInfo.setTransferOptions(singleton(transfer)); - metadata.setDistributionInfo(distributionInfo); + metadata.setDistributionInfo(singleton(distributionInfo)); } return metadata; } Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java?rev=1630661&r1=1630660&r2=1630661&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java [UTF-8] Fri Oct 10 06:53:25 2014 @@ -94,7 +94,7 @@ public final strictfp class ReferencingI * </gmd:CI_ResponsibleParty> * </gmd:contact> */ - final ResponsibleParty contact = getSingleton(metadata.getContacts()); + final ResponsibleParty contact = (ResponsibleParty) getSingleton(metadata.getContacts()); final OnlineResource onlineResource = contact.getContactInfo().getOnlineResource(); assertNotNull("onlineResource", onlineResource); assertEquals("organisationName", "Apache SIS", contact.getOrganisationName().toString()); Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java?rev=1630661&r1=1630660&r2=1630661&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java [UTF-8] Fri Oct 10 06:53:25 2014 @@ -61,7 +61,7 @@ import static org.apache.sis.test.TestUt * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) * @since 0.3 (derived from geotk-3.05) - * @version 0.3 + * @version 0.5 * @module */ public abstract strictfp class AnnotationsTestCase extends TestCase { @@ -245,10 +245,11 @@ public abstract strictfp class Annotatio /** * Returns the name of the XML element for the given UML element. * - * @param uml The UML element. + * @param type The GeoAPI interface which contains the property. + * @param uml The UML element of a property in the {@code type} interface. * @return The corresponding XML element name. */ - protected String getExpectedXmlElementName(final UML uml) { + protected String getExpectedXmlElementName(final Class<?> type, final UML uml) { return uml.identifier(); } @@ -564,7 +565,7 @@ public abstract strictfp class Annotatio * is because subclasses may choose to override the above test method. */ if (uml != null) { - assertEquals("Wrong @XmlElement.name().", getExpectedXmlElementName(uml), element.name()); + assertEquals("Wrong @XmlElement.name().", getExpectedXmlElementName(type, uml), element.name()); assertEquals("Wrong @XmlElement.required().", uml.obligation() == Obligation.MANDATORY, element.required()); } /* Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/MetadataMock.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/MetadataMock.java?rev=1630661&r1=1630660&r2=1630661&view=diff ============================================================================== --- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/MetadataMock.java [UTF-8] (original) +++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/MetadataMock.java [UTF-8] Fri Oct 10 06:53:25 2014 @@ -23,12 +23,17 @@ import java.nio.charset.Charset; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.opengis.metadata.Identifier; import org.opengis.metadata.Metadata; +import org.opengis.metadata.MetadataScope; import org.opengis.metadata.MetadataExtensionInformation; import org.opengis.metadata.ApplicationSchemaInformation; import org.opengis.metadata.PortrayalCatalogueReference; import org.opengis.metadata.acquisition.AcquisitionInformation; -import org.opengis.metadata.citation.ResponsibleParty; +import org.opengis.metadata.citation.Citation; +import org.opengis.metadata.citation.CitationDate; +import org.opengis.metadata.citation.OnlineResource; +import org.opengis.metadata.citation.Responsibility; import org.opengis.metadata.constraint.Constraints; import org.opengis.metadata.content.ContentInformation; import org.opengis.metadata.distribution.Distribution; @@ -36,6 +41,7 @@ import org.opengis.metadata.identificati import org.opengis.metadata.maintenance.MaintenanceInformation; import org.opengis.metadata.maintenance.ScopeCode; import org.opengis.metadata.quality.DataQuality; +import org.opengis.metadata.lineage.Lineage; import org.opengis.metadata.spatial.SpatialRepresentation; import org.opengis.referencing.ReferenceSystem; import org.apache.sis.internal.jaxb.gmd.LocaleAdapter; @@ -47,7 +53,7 @@ import org.apache.sis.xml.Namespaces; * * @author Martin Desruisseaux (Geomatys) * @since 0.4 - * @version 0.4 + * @version 0.5 * @module */ @XmlRootElement(name = "MD_Metadata", namespace = Namespaces.GMD) @@ -81,16 +87,36 @@ public final strictfp class MetadataMock * @return {@code null}. */ @Override + public Identifier getMetadataIdentifier() { + return null; + } + + /** + * Undefined property. + * @return {@code null}. + */ + @Override + @Deprecated public String getFileIdentifier() { return null; } /** + * Undefined property. + * @return {@code null}. + */ + @Override + public Collection<Locale> getLanguages() { + return null; + } + + /** * Returns {@link #language}. * * @return {@link #language} */ @Override + @Deprecated public Locale getLanguage() { return language; } @@ -100,6 +126,26 @@ public final strictfp class MetadataMock * @return {@code null}. */ @Override + @Deprecated + public Collection<Locale> getLocales() { + return null; + } + + /** + * Undefined property. + * @return {@code null}. + */ + @Override + public Collection<Charset> getCharacterSets() { + return null; + } + + /** + * Undefined property. + * @return {@code null}. + */ + @Override + @Deprecated public Charset getCharacterSet() { return null; } @@ -109,6 +155,16 @@ public final strictfp class MetadataMock * @return {@code null}. */ @Override + public Citation getParentMetadata() { + return null; + } + + /** + * Undefined property. + * @return {@code null}. + */ + @Override + @Deprecated public String getParentIdentifier() { return null; } @@ -118,6 +174,16 @@ public final strictfp class MetadataMock * @return {@code null}. */ @Override + public Collection<? extends MetadataScope> getMetadataScopes() { + return null; + } + + /** + * Undefined property. + * @return {@code null}. + */ + @Override + @Deprecated public Collection<ScopeCode> getHierarchyLevels() { return null; } @@ -127,6 +193,7 @@ public final strictfp class MetadataMock * @return {@code null}. */ @Override + @Deprecated public Collection<String> getHierarchyLevelNames() { return null; } @@ -136,7 +203,16 @@ public final strictfp class MetadataMock * @return {@code null}. */ @Override - public Collection<? extends ResponsibleParty> getContacts() { + public Collection<? extends Responsibility> getContacts() { + return null; + } + + /** + * Undefined property. + * @return {@code null}. + */ + @Override + public Collection<? extends CitationDate> getDates() { return null; } @@ -145,6 +221,7 @@ public final strictfp class MetadataMock * @return {@code null}. */ @Override + @Deprecated public Date getDateStamp() { return null; } @@ -154,6 +231,16 @@ public final strictfp class MetadataMock * @return {@code null}. */ @Override + public Collection<? extends Citation> getMetadataStandards() { + return null; + } + + /** + * Undefined property. + * @return {@code null}. + */ + @Override + @Deprecated public String getMetadataStandardName() { return null; } @@ -163,6 +250,7 @@ public final strictfp class MetadataMock * @return {@code null}. */ @Override + @Deprecated public String getMetadataStandardVersion() { return null; } @@ -172,7 +260,7 @@ public final strictfp class MetadataMock * @return {@code null}. */ @Override - public String getDataSetUri() { + public Collection<? extends Citation> getMetadataProfiles() { return null; } @@ -181,7 +269,26 @@ public final strictfp class MetadataMock * @return {@code null}. */ @Override - public Collection<Locale> getLocales() { + public Collection<? extends Citation> getAlternativeMetadataReferences() { + return null; + } + + /** + * Undefined property. + * @return {@code null}. + */ + @Override + public Collection<? extends OnlineResource> getMetadataLinkages() { + return null; + } + + /** + * Undefined property. + * @return {@code null}. + */ + @Override + @Deprecated + public String getDataSetUri() { return null; } @@ -235,7 +342,7 @@ public final strictfp class MetadataMock * @return {@code null}. */ @Override - public Distribution getDistributionInfo() { + public Collection<? extends Distribution> getDistributionInfo() { return null; } @@ -292,4 +399,13 @@ public final strictfp class MetadataMock public Collection<? extends AcquisitionInformation> getAcquisitionInformation() { return null; } + + /** + * Undefined property. + * @return {@code null}. + */ + @Override + public Collection<? extends Lineage> getResourceLineages() { + return null; + } } Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java?rev=1630661&r1=1630660&r2=1630661&view=diff ============================================================================== --- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java [UTF-8] (original) +++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java [UTF-8] Fri Oct 10 06:53:25 2014 @@ -884,7 +884,7 @@ final class MetadataReader { if (party != null) { if (distribution == null) { distribution = new DefaultDistribution(); - metadata.setDistributionInfo(distribution); + metadata.setDistributionInfo(singleton(distribution)); } final DefaultDistributor distributor = new DefaultDistributor(party); // TODO: There is some transfert option, etc. that we could set there. Modified: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/ConformanceTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/ConformanceTest.java?rev=1630661&r1=1630660&r2=1630661&view=diff ============================================================================== --- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/ConformanceTest.java [UTF-8] (original) +++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/ConformanceTest.java [UTF-8] Fri Oct 10 06:53:25 2014 @@ -112,7 +112,7 @@ public final strictfp class ConformanceT assertNull(expected.put("contentInfo.dimension.sequenceIdentifier", "z")); super.testTHREDDS(); assertEquals("hierarchyLevel", new HashSet<>(Arrays.asList(ScopeCode.DATASET, ScopeCode.SERVICE)), - metadata.getHierarchyLevels()); + new HashSet<>(metadata.getHierarchyLevels())); /* * In the SIS case, the Metadata/Contact and Metadata/Identification/PointOfContact * proprties are not just equals - they are expected to be the exact same instance. Modified: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java?rev=1630661&r1=1630660&r2=1630661&view=diff ============================================================================== --- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] (original) +++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] Fri Oct 10 06:53:25 2014 @@ -84,14 +84,10 @@ public final strictfp class MetadataRead final String text = formatNameAndValue(DefaultMetadata.castOrCopy(actual).asTreeTable()); assertMultilinesEquals( "Metadata\n" + - " ├─File identifier………………………………………………………………………… edu.ucar.unidata:NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc\n" + - " ├─Hierarchy level………………………………………………………………………… Dataset\n" + " ├─Contact\n" + " │ ├─Role…………………………………………………………………………………………… Point of contact\n" + " │ └─Party\n" + " │ └─Name………………………………………………………………………………… NOAA/NWS/NCEP\n" + - " ├─Metadata standard name……………………………………………………… ISO 19115-2 Geographic Information - Metadata Part 2 Extensions for imagery and gridded data\n" + - " ├─Metadata standard version……………………………………………… ISO 19115-2:2009(E)\n" + " ├─Spatial representation info\n" + " │ ├─Number of dimensions………………………………………………… 3\n" + " │ ├─Axis dimension properties (1 of 3)\n" + @@ -147,9 +143,16 @@ public final strictfp class MetadataRead " │ └─Attribute\n" + " │ ├─Sequence identifier……………………………… SST\n" + " │ └─Description…………………………………………………… Sea temperature\n" + - " └─Data quality info\n" + - " └─Lineage\n" + - " └─Statement…………………………………………………………………… 2003-04-07 12:12:50 - created by gribtocdl" + - " 2005-09-26T21:50:00 - edavis - add attributes for dataset discovery\n", text); + " ├─Data quality info\n" + + " │ └─Lineage\n" + + " │ └─Statement…………………………………………………………………… 2003-04-07 12:12:50 - created by gribtocdl" + + " 2005-09-26T21:50:00 - edavis - add attributes for dataset discovery\n" + + " ├─Metadata scope\n" + + " │ └─Resource scope………………………………………………………………… Dataset\n" + + " ├─Metadata identifier\n" + + " │ └─Code…………………………………………………………………………………………… edu.ucar.unidata:NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc\n" + + " └─Metadata standard\n" + + " ├─Title………………………………………………………………………………………… ISO 19115-2 Geographic Information - Metadata Part 2 Extensions for imagery and gridded data\n" + + " └─Edition…………………………………………………………………………………… ISO 19115-2:2009(E)\n", text); } } Modified: sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/XMLStoreTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/XMLStoreTest.java?rev=1630661&r1=1630660&r2=1630661&view=diff ============================================================================== --- sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/XMLStoreTest.java [UTF-8] (original) +++ sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/XMLStoreTest.java [UTF-8] Fri Oct 10 06:53:25 2014 @@ -98,7 +98,7 @@ public final strictfp class XMLStoreTest metadata = store.getMetadata(); assertSame("Expected cached value.", metadata, store.getMetadata()); } - final ResponsibleParty party = getSingleton(metadata.getContacts()); + final ResponsibleParty party = (ResponsibleParty) getSingleton(metadata.getContacts()); final OnlineResource resource = party.getContactInfo().getOnlineResource(); assertEquals(Locale.ENGLISH, metadata.getLanguage());
