sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1626813 - in /sis/branches/JDK7: ./ core/sis-feature/src/test/java/org/apache/sis/feature/ core/sis-metadata/src/test/java/org/apache/sis/metadata/ core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ core/sis-metadata/src/test/jav...
Date Mon, 22 Sep 2014 15:48:17 GMT
Author: desruisseaux
Date: Mon Sep 22 15:48:17 2014
New Revision: 1626813

URL: http://svn.apache.org/r1626813
Log:
Merge from the JDK8 branch (WKT formatting of TemporalCRS).

Added:
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultTemporalCRSTest.java
      - copied unchanged from r1626812, sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultTemporalCRSTest.java
Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/CustomAttribute.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PrunerTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentificationTest.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
    sis/branches/JDK7/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java
    sis/branches/JDK7/profiles/sis-french-profile/src/test/resources/org/apache/sis/internal/profile/fra/DirectReferenceSystem.xml
    sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStore.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK8:r1626641-1626812

Modified: sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/CustomAttribute.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/CustomAttribute.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/CustomAttribute.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/CustomAttribute.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -23,7 +23,7 @@ import org.apache.sis.metadata.iso.quali
 import org.apache.sis.util.iso.SimpleInternationalString;
 import org.apache.sis.referencing.NamedIdentifier;
 
-import static org.junit.Assert.*;
+import static java.util.Collections.singleton;
 
 // Branch-dependent imports
 import org.opengis.feature.AttributeType;
@@ -84,8 +84,8 @@ final strictfp class CustomAttribute<V> 
         final DefaultQuantitativeResult result  = new DefaultQuantitativeResult();
         result.setErrorStatistic(new SimpleInternationalString(ADDITIONAL_QUALITY_INFO));
         report.setMeasureIdentification(new NamedIdentifier(getName()));
-        assertTrue(report .getResults().add(result));
-        assertTrue(quality.getReports().add(report));
+        report .setResults(singleton(result));
+        quality.setReports(singleton(report));
         return quality;
     }
 }

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -36,6 +36,7 @@ import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
+import static java.util.Collections.singleton;
 import static org.apache.sis.test.Assert.*;
 import static org.apache.sis.test.TestUtilities.getSingleton;
 
@@ -123,7 +124,7 @@ public final strictfp class MetadataStan
         final DefaultPlatform platform = new DefaultPlatform();
         platform.setDescription(new SimpleInternationalString("A platform."));
         instrument.setMountedOn(platform);
-        platform.getInstruments().add(instrument);
+        platform.setInstruments(singleton(instrument));
         return platform;
     }
 

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PrunerTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PrunerTest.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PrunerTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/PrunerTest.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -28,6 +28,7 @@ import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
+import static java.util.Collections.singleton;
 import static org.apache.sis.metadata.ValueExistencePolicy.isNullOrEmpty;
 
 
@@ -69,9 +70,9 @@ public final strictfp class PrunerTest e
         identification = new DefaultDataIdentification();
         extent         = new DefaultExtent();
         bbox           = new DefaultGeographicBoundingBox();
-        extent.getGeographicElements().add(bbox);
-        identification.getExtents().add(extent);
-        metadata.getIdentificationInfo().add(identification);
+        extent.setGeographicElements(singleton(bbox));
+        identification.setExtents(singleton(extent));
+        metadata.setIdentificationInfo(singleton(identification));
     }
 
     /**
@@ -123,8 +124,8 @@ public final strictfp class PrunerTest e
      */
     private void createCyclicMetadata() {
         final DefaultAcquisitionInformation acquisition = new DefaultAcquisitionInformation();
-        acquisition.getPlatforms().add(MetadataStandardTest.createCyclicMetadata());
-        metadata.getAcquisitionInformation().add(acquisition);
+        acquisition.setPlatforms(singleton(MetadataStandardTest.createCyclicMetadata()));
+        metadata.setAcquisitionInformation(singleton(acquisition));
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -40,6 +40,7 @@ import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
+import static java.util.Collections.singleton;
 
 
 /**
@@ -83,16 +84,16 @@ public final strictfp class TreeNodeTest
         final DefaultCitation citation = TreeNodeChildrenTest.metadataWithMultiOccurrences();
         AbstractParty party = new DefaultOrganisation("Some organisation", null, null, null);
         DefaultResponsibility responsibility = new DefaultResponsibility(Role.DISTRIBUTOR,
null, party);
-        citation.getCitedResponsibleParties().add(responsibility);
+        assertTrue(citation.getCitedResponsibleParties().add(responsibility));
 
         // Add a second responsible party with deeper hierarchy.
         final DefaultContact contact = new DefaultContact();
         final DefaultAddress address = new DefaultAddress();
-        address.getElectronicMailAddresses().add("Some email");
-        contact.getAddresses().add(address);
+        address.setElectronicMailAddresses(singleton("Some email"));
+        contact.setAddresses(singleton(address));
         party = new DefaultIndividual("Some person of contact", null, contact);
         responsibility = new DefaultResponsibility(Role.POINT_OF_CONTACT, null, party);
-        citation.getCitedResponsibleParties().add(responsibility);
+        assertTrue(citation.getCitedResponsibleParties().add(responsibility));
         return citation;
     }
 

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -39,6 +39,8 @@ import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
+import static java.util.Arrays.asList;
+import static java.util.Collections.singleton;
 import static org.apache.sis.test.Assert.*;
 
 
@@ -84,16 +86,15 @@ public final strictfp class TreeTableFor
         final InternationalString title = new SimpleInternationalString("Undercurrent");
         citation.setTitle(title);
         citation.setISBN("9782505004509");
-        citation.getPresentationForms().add(PresentationForm.DOCUMENT_HARDCOPY);
-        citation.getPresentationForms().add(PresentationForm.IMAGE_HARDCOPY);
-        citation.getAlternateTitles().add(new SimpleInternationalString("Alt A"));
-        citation.getAlternateTitles().add(new SimpleInternationalString("Alt B"));
-
-        citation.getCitedResponsibleParties().add(new DefaultResponsibility(Role.AUTHOR,
null,
-                new DefaultIndividual("Testsuya Toyoda", null, null)));
-        citation.getCitedResponsibleParties().add(new DefaultResponsibility(null, null,
-                new DefaultIndividual("A japanese author", null, null)));
-
+        citation.setPresentationForms(asList(
+                PresentationForm.DOCUMENT_HARDCOPY,
+                PresentationForm.IMAGE_HARDCOPY));
+        citation.setAlternateTitles(asList(
+                new SimpleInternationalString("Alt A"),
+                new SimpleInternationalString("Alt B")));
+        citation.setCitedResponsibleParties(asList(
+                new DefaultResponsibility(Role.AUTHOR, null, new DefaultIndividual("Testsuya
Toyoda", null, null)),
+                new DefaultResponsibility(null, null, new DefaultIndividual("A japanese author",
null, null))));
         return citation;
     }
 
@@ -133,13 +134,11 @@ public final strictfp class TreeTableFor
         final DefaultCitation   titled = new DefaultCitation("Some specification");
         final DefaultCitation    coded = new DefaultCitation();
         final DefaultCitation untitled = new DefaultCitation();
-        titled  .getPresentationForms().add(PresentationForm.DOCUMENT_HARDCOPY);
-        coded   .getPresentationForms().add(PresentationForm.IMAGE_HARDCOPY);
-        untitled.getCitedResponsibleParties().add(new DefaultResponsibility(Role.AUTHOR,
null, null));
+        titled  .setPresentationForms(singleton(PresentationForm.DOCUMENT_HARDCOPY));
+        coded   .setPresentationForms(singleton(PresentationForm.IMAGE_HARDCOPY));
+        untitled.setCitedResponsibleParties(singleton(new DefaultResponsibility(Role.AUTHOR,
null, null)));
         final DefaultProcessing processing = new DefaultProcessing();
-        processing.getDocumentations().add(titled);
-        processing.getDocumentations().add(coded);
-        processing.getDocumentations().add(untitled);
+        processing.setDocumentations(asList(titled, coded, untitled));
         final String text = format.format(processing.asTreeTable());
         assertMultilinesEquals(
             "Processing\n" +

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -93,7 +93,7 @@ public final strictfp class ValueMapTest
         author   = new DefaultResponsibility();
         citation = new DefaultCitation(title);
         author.setParties(singleton(new DefaultIndividual("Testsuya Toyoda", null, null)));
-        citation.getCitedResponsibleParties().add(author);
+        citation.setCitedResponsibleParties(singleton(author));
         citation.setISBN("9782505004509");
         citation.setEdition(NilReason.UNKNOWN.createNilObject(InternationalString.class));
         return MetadataStandard.ISO_19115.asValueMap(citation, KeyNamePolicy.JAVABEANS_PROPERTY,
ValueExistencePolicy.NON_EMPTY);

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=1626813&r1=1626812&r2=1626813&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] Mon Sep 22 15:48:17 2014
@@ -42,6 +42,7 @@ import org.apache.sis.test.XMLTestCase;
 import org.apache.sis.xml.XML;
 import org.junit.Test;
 
+import static java.util.Collections.singleton;
 import static org.junit.Assert.*;
 
 
@@ -138,7 +139,7 @@ public final strictfp class CustomMetada
             @Override public Collection<Citation>                  getAdditionalDocumentations()
  {return null;}
         };
         final DefaultMetadata data = new DefaultMetadata();
-        assertTrue(data.getIdentificationInfo().add(identification));
+        data.setIdentificationInfo(singleton(identification));
         final String xml = XML.marshal(data);
         /*
          * A few simple checks.

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -55,7 +55,7 @@ public final strictfp class HardCodedCit
         final DefaultCitation c = new DefaultCitation("Open Geospatial consortium");
         c.setAlternateTitles(singleton(new SimpleInternationalString("OGC")));
         c.setPresentationForms(singleton(PresentationForm.DOCUMENT_DIGITAL));
-        c.getIdentifiers().add(new DefaultIdentifier("OGC"));
+        c.setIdentifiers(singleton(new DefaultIdentifier("OGC")));
         c.freeze();
         OGC = c;
     }
@@ -70,7 +70,7 @@ public final strictfp class HardCodedCit
         final DefaultCitation c = new DefaultCitation("International Organization for Standardization");
         c.setAlternateTitles(singleton(new SimpleInternationalString("ISO")));
         c.setPresentationForms(singleton(PresentationForm.DOCUMENT_DIGITAL));
-        c.getIdentifiers().add(new DefaultIdentifier("ISO"));
+        c.setIdentifiers(singleton(new DefaultIdentifier("ISO")));
         c.freeze();
         ISO = c;
     }
@@ -96,32 +96,49 @@ public final strictfp class HardCodedCit
     static {
         final DefaultCitation c = new DefaultCitation("International Association of Oil &
Gas Producers");
         c.setAlternateTitles(singleton(new SimpleInternationalString("OGP")));
-        c.getIdentifiers().add(new DefaultIdentifier("OGP"));
+        c.setIdentifiers(singleton(new DefaultIdentifier("OGP")));
         c.freeze();
         OGP = c;
     }
 
     /**
      * The <a href="http://www.epsg.org">European Petroleum Survey Group</a>
authority.
-     * An {@linkplain Citation#getAlternateTitles() alternate title} for this citation is
-     * "EPSG" (according ISO 19115, alternate titles often contain abbreviations). In
-     * addition, this citation contains the "EPSG" {@linkplain Citation#getIdentifiers identifier}.
+     * An {@linkplain Citation#getAlternateTitles() alternate title} for this citation is
"EPSG"
+     * (according ISO 19115, alternate titles often contain abbreviations). In addition,
+     * this citation contains the "EPSG" {@linkplain Citation#getIdentifiers() identifier}.
+     *
+     * <p>String representation:</p>
+     *
+     * {@preformat text
+     *   Citation
+     *     ├─Title…………………………………………………………
European Petroleum Survey Group
+     *     ├─Alternate title……………………………… EPSG
+     *     ├─Identifier
+     *     │   └─Code…………………………………………………
EPSG
+     *     ├─Cited responsible party
+     *     │   ├─Party
+     *     │   │   ├─Name……………………………………… International
Association of Oil & Gas Producers
+     *     │   │   └─Contact info
+     *     │   │       └─Online resource
+     *     │   │           ├─Linkage………… http://www.epsg.org
+     *     │   │           └─Function……… Information
+     *     │   └─Role…………………………………………………
Principal investigator
+     *     └─Presentation form………………………… Table digital
+     * }
      */
     public static final DefaultCitation EPSG;
     static {
-        final SimpleInternationalString title = new SimpleInternationalString("European Petroleum
Survey Group");
         final DefaultOnlineResource r = new DefaultOnlineResource(URI.create("http://www.epsg.org"));
         r.setFunction(OnLineFunction.INFORMATION);
 
-        final DefaultResponsibleParty p = new DefaultResponsibleParty(Role.PRINCIPAL_INVESTIGATOR);
-        p.setOrganisationName(title);
-        p.setContactInfo(new DefaultContact(r));
+        final DefaultResponsibility p = new DefaultResponsibility(Role.PRINCIPAL_INVESTIGATOR,
null,
+                new DefaultOrganisation(OGP.getTitle(), null, null, new DefaultContact(r)));
 
-        final DefaultCitation c = new DefaultCitation(title);
+        final DefaultCitation c = new DefaultCitation("European Petroleum Survey Group");
         c.setAlternateTitles(singleton(new SimpleInternationalString("EPSG")));
         c.setPresentationForms(singleton(PresentationForm.TABLE_DIGITAL));
-        c.getIdentifiers().add(new DefaultIdentifier("EPSG"));
-        c.getCitedResponsibleParties().add(p);
+        c.setIdentifiers(singleton(new DefaultIdentifier("EPSG")));
+        c.setCitedResponsibleParties(singleton(p));
         c.freeze();
         EPSG = c;
     }

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -27,6 +27,7 @@ import org.apache.sis.util.logging.Warni
 import org.apache.sis.test.XMLTestCase;
 import org.junit.Test;
 
+import static java.util.Collections.singleton;
 import static org.apache.sis.test.Assert.*;
 import static org.apache.sis.test.TestUtilities.getSingleton;
 
@@ -140,7 +141,7 @@ public final strictfp class DefaultLegal
                 "</gmd:MD_LegalConstraints>\n";
 
         final DefaultLegalConstraints c = new DefaultLegalConstraints();
-        c.getUseConstraints().add(Restriction.LICENCE);
+        c.setUseConstraints(singleton(Restriction.LICENCE));
         assertXmlEquals(xml, marshal(c), "xmlns:*");
         /*
          * Unmarshall and ensure that we got back the original LICENCE code, not a new "LICENSE"
code.

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentificationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentificationTest.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentificationTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentificationTest.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -29,6 +29,7 @@ import org.apache.sis.test.TestCase;
 import org.apache.sis.test.TestUtilities;
 import org.junit.Test;
 
+import static java.util.Collections.singleton;
 import static org.apache.sis.test.Assert.*;
 
 
@@ -62,8 +63,8 @@ public final strictfp class DefaultDataI
          *       └─Code………………………………………………………………………
NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc
          */
         final DefaultCitation citation = new DefaultCitation("Sea Surface Temperature Analysis
Model");
-        citation.getDates().add(new DefaultCitationDate(TestUtilities.date("2005-09-22 00:00:00"),
DateType.CREATION));
-        citation.getIdentifiers().add(new DefaultIdentifier("SST_Global.nc"));
+        citation.setDates(singleton(new DefaultCitationDate(TestUtilities.date("2005-09-22
00:00:00"), DateType.CREATION)));
+        citation.setIdentifiers(singleton(new DefaultIdentifier("SST_Global.nc")));
         /*
          * Descriptive keywords
          *   ├─Keyword…………………………………………………………………………
EARTH SCIENCE > Oceans > Ocean Temperature > Sea Surface Temperature
@@ -97,10 +98,10 @@ public final strictfp class DefaultDataI
          */
         final DefaultDataIdentification info = new DefaultDataIdentification(citation,
                 "NCEP SST Global 5.0 x 2.5 degree model data", null, null);
-        info.getSpatialRepresentationTypes().add(SpatialRepresentationType.GRID);
-        info.getDescriptiveKeywords().add(keywords);
-        info.getResourceConstraints().add(new DefaultConstraints("Freely available"));
-        info.getExtents().add(Extents.WORLD);
+        info.setSpatialRepresentationTypes(singleton(SpatialRepresentationType.GRID));
+        info.setDescriptiveKeywords(singleton(keywords));
+        info.setResourceConstraints(singleton(new DefaultConstraints("Freely available")));
+        info.setExtents(singleton(Extents.WORLD));
         return info;
     }
 

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
(original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
Mon Sep 22 15:48:17 2014
@@ -29,7 +29,6 @@ import org.opengis.referencing.datum.Tem
 import org.apache.sis.internal.jaxb.gml.UniversalTimeAdapter;
 import org.apache.sis.internal.metadata.MetadataUtilities;
 import org.apache.sis.util.ComparisonMode;
-import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.io.wkt.FormattableObject;
 
@@ -288,9 +287,8 @@ public class DefaultTemporalDatum extend
     @Override
     protected String formatTo(final Formatter formatter) {
         super.formatTo(formatter);
-        final Convention convention = formatter.getConvention();
         formatter.append(new Origin(MetadataUtilities.toDate(origin)));
-        if (convention.majorVersion() == 1) {
+        if (formatter.getConvention().majorVersion() == 1) {
             formatter.setInvalidWKT(this, null);
         }
         return "TimeDatum";

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -162,7 +162,7 @@ public final strictfp class DefaultCompo
                 "    UNIT[“metre”, 1],\n" +
                 "    AXIS[“Gravity-related height”, UP]],\n" +
                 "  TIMECRS[“Time”,\n" +
-                "    TIMEDATUM[“UNIX”, TIMEORIGIN[1970-01-01T00:00:00.0Z]],\n" +
+                "    TIMEDATUM[“Modified Julian”, TIMEORIGIN[1858-11-17T00:00:00.0Z]],\n"
+
                 "    UNIT[“day”, 86400],\n" +
                 "    AXIS[“Time”, FUTURE]]]",
                 HardCodedCRS.GEOID_4D);
@@ -190,7 +190,7 @@ public final strictfp class DefaultCompo
                 "      Axis[“Gravity-related height (H)”, up],\n" +
                 "      LengthUnit[“metre”, 1]],\n" +
                 "  TimeCRS[“Time”,\n" +
-                "    TimeDatum[“UNIX”, TimeOrigin[1970-01-01T00:00:00.0Z]],\n" +
+                "    TimeDatum[“Modified Julian”, TimeOrigin[1858-11-17T00:00:00.0Z]],\n"
+
                 "    CS[“temporal”, 1],\n" +
                 "      Axis[“Time (t)”, future],\n" +
                 "      TimeUnit[“day”, 86400]],\n" +

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -137,10 +137,10 @@ public final strictfp class HardCodedCRS
             getProperties(HardCodedCS.DEPTH), HardCodedDatum.MEAN_SEA_LEVEL, HardCodedCS.DEPTH);
 
     /**
-     * A temporal coordinate reference system for time in days elapsed since the Unix epoch.
+     * A temporal coordinate reference system for time in days elapsed since November 17,
1858 at 00:00 UTC.
      */
     public static final DefaultTemporalCRS TIME = new DefaultTemporalCRS(
-            getProperties(HardCodedCS.DAYS), HardCodedDatum.UNIX, HardCodedCS.DAYS);
+            getProperties(HardCodedCS.DAYS), HardCodedDatum.MODIFIED_JULIAN, HardCodedCS.DAYS);
 
     /**
      * A (λ,φ,h,t) CRS where <var>h</var> is the {@link #GRAVITY_RELATED_HEIGHT}.

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultTemporalDatumTest.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -64,6 +64,16 @@ public final strictfp class DefaultTempo
     }
 
     /**
+     * Tests the consistency of our test with {@link HardCodedDatum#MODIFIED_JULIAN}.
+     *
+     * @since 0.5
+     */
+    @Test
+    public void testConsistency() {
+        assertEquals(HardCodedDatum.MODIFIED_JULIAN.getOrigin(), new Date(ORIGIN));
+    }
+
+    /**
      * Tests {@link DefaultTemporalDatum#toWKT()}.
      *
      * @since 0.5
@@ -71,6 +81,7 @@ public final strictfp class DefaultTempo
     @Test
     public void testToWKT() {
         final DefaultTemporalDatum datum = create();
+        assertWktEquals(Convention.WKT1, "TIMEDATUM[“Modified Julian”, TIMEORIGIN[1858-11-17T00:00:00.0Z],
AUTHORITY[“SIS”, “MJ”]]", datum);
         assertWktEquals(Convention.WKT2, "TimeDatum[“Modified Julian”, TimeOrigin[1858-11-17T00:00:00.0Z],
Id[“SIS”, “MJ”]]", datum);
     }
 

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -90,6 +90,12 @@ public final strictfp class HardCodedDat
             properties("UNIX", null), new Date(0));
 
     /**
+     * Default datum for time measured since November 17, 1858 at 00:00 UTC.
+     */
+    public static final DefaultTemporalDatum MODIFIED_JULIAN = new DefaultTemporalDatum(
+            properties("Modified Julian", null), new Date(-40587 * (24*60*60*1000L)));
+
+    /**
      * Image with {@link PixelInCell#CELL_CENTER}.
      */
     public static final DefaultImageDatum IMAGE = new DefaultImageDatum(

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -93,6 +93,7 @@ import org.junit.BeforeClass;
     org.apache.sis.referencing.crs.DefaultGeocentricCRSTest.class,
     org.apache.sis.referencing.crs.DefaultGeographicCRSTest.class,
     org.apache.sis.referencing.crs.DefaultVerticalCRSTest.class,
+    org.apache.sis.referencing.crs.DefaultTemporalCRSTest.class,
     org.apache.sis.referencing.crs.SubTypesTest.class,
     org.apache.sis.referencing.crs.DefaultCompoundCRSTest.class,
     org.apache.sis.referencing.crs.HardCodedCRSTest.class,

Modified: sis/branches/JDK7/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -16,16 +16,21 @@
  */
 package org.apache.sis.internal.profile.fra;
 
-import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
 import javax.xml.bind.JAXBException;
+import org.opengis.metadata.citation.Responsibility;
 import org.apache.sis.metadata.iso.DefaultMetadata;
 import org.apache.sis.metadata.iso.ImmutableIdentifier;
 import org.apache.sis.metadata.iso.citation.DefaultCitation;
+import org.apache.sis.metadata.iso.citation.DefaultResponsibleParty;
 import org.apache.sis.metadata.iso.citation.HardCodedCitations;
 import org.apache.sis.util.ComparisonMode;
+import org.apache.sis.test.TestUtilities;
 import org.apache.sis.test.XMLTestCase;
 import org.junit.Test;
 
+import static java.util.Collections.singleton;
 import static org.apache.sis.test.Assert.*;
 
 
@@ -46,13 +51,21 @@ public final strictfp class DirectRefere
 
     /**
      * Creates the metadata object to be tested.
+     *
+     * @param legacy {@code true} for using the legacy {@code ResponsibleParty} instead of
{@code Responsibility}.
+     *        This is sometime needed for comparison purpose with unmarshalled metadata.
      */
-    private static DefaultMetadata createMetadata() {
+    @SuppressWarnings("deprecation")
+    private static DefaultMetadata createMetadata(final boolean legacy) {
         final DefaultMetadata metadata = new DefaultMetadata();
         final DefaultCitation citation = new DefaultCitation("European Petroleum Survey Group");
-        citation.setCitedResponsibleParties(HardCodedCitations.EPSG.getCitedResponsibleParties());
+        Collection<Responsibility> r = HardCodedCitations.EPSG.getCitedResponsibleParties();
+        if (legacy) {
+            r = Collections.<Responsibility>singleton(new DefaultResponsibleParty(TestUtilities.getSingleton(r)));
+        }
+        citation.setCitedResponsibleParties(r);
         final DirectReferenceSystem refSys = new DirectReferenceSystem(new ImmutableIdentifier(citation,
null, "4326"));
-        metadata.setReferenceSystemInfo(Arrays.asList(refSys));
+        metadata.setReferenceSystemInfo(singleton(refSys));
         return metadata;
     }
 
@@ -64,7 +77,7 @@ public final strictfp class DirectRefere
      */
     @Test
     public void marshallingTest() throws JAXBException {
-        assertMarshalEqualsFile(XML_FILE, createMetadata(), "xmlns:*", "xsi:schemaLocation");
+        assertMarshalEqualsFile(XML_FILE, createMetadata(false), "xmlns:*", "xsi:schemaLocation");
     }
 
     /**
@@ -75,7 +88,7 @@ public final strictfp class DirectRefere
      */
     @Test
     public void unmarshallingTest() throws JAXBException {
-        final DefaultMetadata expected = createMetadata();
+        final DefaultMetadata expected = createMetadata(true);
         final DefaultMetadata result = unmarshalFile(DefaultMetadata.class, XML_FILE);
         /*
          * Compare in debug mode before to perform the real comparison,

Modified: sis/branches/JDK7/profiles/sis-french-profile/src/test/resources/org/apache/sis/internal/profile/fra/DirectReferenceSystem.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/profiles/sis-french-profile/src/test/resources/org/apache/sis/internal/profile/fra/DirectReferenceSystem.xml?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/profiles/sis-french-profile/src/test/resources/org/apache/sis/internal/profile/fra/DirectReferenceSystem.xml
(original)
+++ sis/branches/JDK7/profiles/sis-french-profile/src/test/resources/org/apache/sis/internal/profile/fra/DirectReferenceSystem.xml
Mon Sep 22 15:48:17 2014
@@ -44,7 +44,7 @@
               <gmd:citedResponsibleParty>
                 <gmd:CI_ResponsibleParty>
                   <gmd:organisationName>
-                    <gco:CharacterString>European Petroleum Survey Group</gco:CharacterString>
+                    <gco:CharacterString>International Association of Oil &amp;
Gas Producers</gco:CharacterString>
                   </gmd:organisationName>
                   <gmd:contactInfo>
                     <gmd:CI_Contact>

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStore.java?rev=1626813&r1=1626812&r2=1626813&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStore.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStore.java
[UTF-8] Mon Sep 22 15:48:17 2014
@@ -35,6 +35,8 @@ import org.apache.sis.metadata.iso.Defau
 import org.apache.sis.util.logging.WarningListener;
 import org.apache.sis.util.resources.Errors;
 
+import static java.util.Collections.singleton;
+
 
 /**
  * A data store which creates data objects from a XML file.
@@ -175,7 +177,7 @@ public class XMLStore extends DataStore 
                 metadata = (Metadata) object;
             } else if (object instanceof ReferenceSystem) {
                 final DefaultMetadata d = new DefaultMetadata();
-                d.getReferenceSystemInfo().add((ReferenceSystem) object);
+                d.setReferenceSystemInfo(singleton((ReferenceSystem) object));
                 metadata = d;
             }
         }



Mime
View raw message