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 2014/08/07 18:56:56 UTC

svn commit: r1616536 [2/2] - in /sis/branches/JDK8: core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisit...

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java?rev=1616536&r1=1616535&r2=1616536&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultResolution.java [UTF-8] Thu Aug  7 16:56:55 2014
@@ -20,6 +20,7 @@ import javax.xml.bind.annotation.XmlType
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.opengis.util.InternationalString;
 import org.opengis.metadata.identification.RepresentativeFraction;
 import org.opengis.metadata.identification.Resolution;
 import org.apache.sis.internal.jaxb.gco.GO_Distance;
@@ -27,7 +28,6 @@ import org.apache.sis.internal.metadata.
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.measure.ValueRange;
 import org.apache.sis.util.resources.Messages;
-import org.apache.sis.util.Workaround;
 
 
 /**
@@ -55,6 +55,8 @@ import org.apache.sis.util.Workaround;
  * @since   0.3 (derived from geotk-2.1)
  * @version 0.3
  * @module
+ *
+ * @see AbstractIdentification#getSpatialResolutions()
  */
 @XmlType(name = "MD_Resolution_Type") // No need for propOrder since this structure is a union (see javadoc).
 @XmlRootElement(name = "MD_Resolution")
@@ -62,12 +64,46 @@ public class DefaultResolution extends I
     /**
      * Serial number for compatibility with different versions.
      */
-    private static final long serialVersionUID = 3856547985745400172L;
+    private static final long serialVersionUID = 4333582736458380544L;
+
+    /**
+     * Enumeration of possible values for {@link #property}.
+     */
+    private static final byte SCALE=1, DISTANCE=2, VERTICAL=3, ANGULAR=4, TEXT=5;
 
     /**
-     * Either the scale as a {@link RepresentativeFraction} instance or the distance as a {@code Double} instance.
+     * The names of the mutually exclusive properties.
+     * The index of each name shall be the value of the above {@code byte} constants minus one.
      */
-    private Object scaleOrDistance;
+    private static final String[] NAMES = {
+        "equivalentScale",
+        "distance",
+        "vertical",
+        "angularDistance",
+        "levelOfDetail"
+    };
+
+    /**
+     * The names of the setter methods, for logging purpose only.
+     */
+    private static final String[] SETTERS = {
+        "setEquivalentScale",
+        "setDistance",
+        "setVertical",
+        "setAngularDistance",
+        "setLevelOfDetail"
+    };
+
+    /**
+     * Specifies which property is set, or 0 if none.
+     */
+    private byte property;
+
+    /**
+     * Either the scale as a {@link RepresentativeFraction} instance, the distance, the angle,
+     * or the level of details as an {@link InternationalString} instance.
+     */
+    private Object value;
 
     /**
      * Constructs an initially empty resolution.
@@ -83,7 +119,7 @@ public class DefaultResolution extends I
      * @since 0.4
      */
     public DefaultResolution(final RepresentativeFraction scale) {
-        scaleOrDistance = scale;
+        value = scale;
     }
 
     // Note: there is not yet DefaultResolution(double) method because
@@ -94,8 +130,10 @@ public class DefaultResolution extends I
      * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
      * given object are not recursively copied.
      *
-     * <p>If both {@linkplain #getEquivalentScale() scale} and {@linkplain #getDistance() distance}
-     * are specified, then the scale will have precedence and the distance is silently discarded.</p>
+     * <p>If more than one of the {@linkplain #getEquivalentScale() equivalent scale},
+     * {@linkplain #getDistance() distance}, {@linkplain #getVertical() vertical},
+     * {@linkplain #getAngularDistance() angular distance} and {@linkplain #getLevelOfDetail() level of detail}
+     * are specified, then the first of those values is taken and the other values are silently discarded.</p>
      *
      * @param object The metadata to copy values from, or {@code null} if none.
      *
@@ -104,9 +142,21 @@ public class DefaultResolution extends I
     public DefaultResolution(final Resolution object) {
         super(object);
         if (object != null) {
-            scaleOrDistance = object.getEquivalentScale();
-            if (scaleOrDistance == null) {
-                scaleOrDistance = object.getDistance();
+            for (byte p=SCALE; p<=TEXT; p++) {
+                final Object c;
+                switch (p) {
+                    case SCALE:    c = object.getEquivalentScale(); break;
+                    case DISTANCE: c = object.getDistance();        break;
+                    case VERTICAL: c = object.getVertical();        break;
+                    case ANGULAR:  c = object.getAngularDistance(); break;
+                    case TEXT:     c = object.getLevelOfDetail();   break;
+                    default:       throw new AssertionError(p);
+                }
+                if (c != null) {
+                    property = p;
+                    value = c;
+                    break;
+                }
             }
         }
     }
@@ -137,33 +187,34 @@ public class DefaultResolution extends I
     }
 
     /**
-     * Invoked every time the code needs to decide whether the provided information
-     * is scale or distance. Defined as a method in order to have a single word to
-     * search if we need to revisit the policy.
-     */
-    private boolean isDistance() {
-        return (scaleOrDistance instanceof Double);
-    }
-
-    /**
-     * Invoked when setting a property discards the other one.
+     * Sets the properties identified by the {@code code} argument, if non-null.
+     * This discards any other properties.
+     *
+     * @param code     The property which is going to be set.
+     * @param newValue The new value.
      */
-    private static void warning(final String method, final String oldName, final String newName) {
-        MetadataUtilities.warning(DefaultResolution.class, method,
-                Messages.Keys.DiscardedExclusiveProperty_2, oldName, newName);
+    private void setProperty(final byte code, final Object newValue) {
+        checkWritePermission();
+        if (value != null && property != code) {
+            if (newValue == null) {
+                return; // Do not erase the other property.
+            }
+            MetadataUtilities.warning(DefaultResolution.class, SETTERS[code-1],
+                    Messages.Keys.DiscardedExclusiveProperty_2, NAMES[property-1], NAMES[code-1]);
+        }
+        value = newValue;
+        property = code;
     }
 
     /**
      * Returns the level of detail expressed as the scale of a comparable hardcopy map or chart.
-     * Only one of {@linkplain #getEquivalentScale() equivalent scale} and
-     * {@linkplain #getDistance() ground sample distance} shall be provided.
      *
      * @return Level of detail expressed as the scale of a comparable hardcopy, or {@code null}.
      */
     @Override
     @XmlElement(name = "equivalentScale")
     public RepresentativeFraction getEquivalentScale()  {
-        return isDistance() ? null : (RepresentativeFraction) scaleOrDistance;
+        return (property == SCALE) ? (RepresentativeFraction) value : null;
     }
 
     /**
@@ -171,74 +222,120 @@ public class DefaultResolution extends I
      *
      * {@section Effect on other properties}
      * If and only if the {@code newValue} is non-null, then this method automatically
-     * discards the {@linkplain #setDistance distance}.
+     * discards all other properties.
      *
      * @param newValue The new equivalent scale.
      */
     public void setEquivalentScale(final RepresentativeFraction newValue) {
-        checkWritePermission();
-        if (isDistance()) {
-            if (newValue == null) {
-                return; // Do not erase the other property.
-            }
-            warning("setEquivalentScale", "distance", "equivalentScale");
-        }
-        scaleOrDistance = newValue;
+        setProperty(SCALE, newValue);
     }
 
     /**
      * Returns the ground sample distance.
-     * Only one of {@linkplain #getEquivalentScale equivalent scale} and
-     * {@linkplain #getDistance ground sample distance} shall be provided.
      *
      * @return The ground sample distance, or {@code null}.
      */
     @Override
+    @XmlElement(name = "distance")
+    @XmlJavaTypeAdapter(GO_Distance.class)
     @ValueRange(minimum=0, isMinIncluded=false)
     public Double getDistance() {
-        return isDistance() ? (Double) scaleOrDistance : null;
+        return (property == DISTANCE) ? (Double) value : null;
     }
 
     /**
      * Sets the ground sample distance.
      *
+     * {@section Effect on other properties}
+     * If and only if the {@code newValue} is non-null, then this method automatically
+     * discards all other properties.
+     *
      * @param newValue The new distance.
      */
     public void setDistance(final Double newValue) {
-        checkWritePermission();
-        if (scaleOrDistance != null && !isDistance()) {
-            if (newValue == null) {
-                return; // Do not erase the other property.
-            }
-            warning("setDistance", "equivalentScale", "distance");
-        }
-        scaleOrDistance = newValue;
+        setProperty(DISTANCE, newValue);
     }
 
     /**
-     * Workaround for a strange JAXB behavior (bug?). For an unknown reason, we are unable to annotate the
-     * {@link #getDistance()} method directly. Doing so cause JAXB to randomly ignores the {@code <gmd:distance>}
-     * property. Annotating a separated method which in turn invokes the real method seems to work.
+     * Returns the vertical sampling distance.
      *
-     * <p>In order to check if this workaround is still needed with more recent JAXB versions, move the
-     * {@link XmlElement} and {@link XmlJavaTypeAdapter} annotations to the {@link #getDistance()} method,
-     * then execute the {@link DefaultResolutionTest#testXML()} test at least 10 times (because the failure
-     * happen randomly). If the test succeeded every time, then the {@code getValue()} and {@code setValue(Double)}
-     * methods can be completely deleted.</p>
+     * @return The vertical sampling distance, or {@code null}.
      *
-     * @see DefaultResolutionTest#testXML()
+     * @since 0.5
      */
-    @XmlElement(name = "distance")
-    @XmlJavaTypeAdapter(GO_Distance.class)
-    @Workaround(library = "JAXB", version = "2.2.4-2")
-    private Double getValue() {
-        return getDistance();
+    @Override
+    @ValueRange(minimum=0, isMinIncluded=false)
+    public Double getVertical() {
+        return (property == VERTICAL) ? (Double) value : null;
     }
 
     /**
-     * The corresponding setter for the {@link #getValue()} workaround.
+     * Sets the vertical sampling distance.
+     *
+     * {@section Effect on other properties}
+     * If and only if the {@code newValue} is non-null, then this method automatically
+     * discards all other properties.
+     *
+     * @param newValue The new distance.
+     *
+     * @since 0.5
+     */
+    public void setVertical(final Double newValue) {
+        setProperty(VERTICAL, newValue);
+    }
+
+    /**
+     * Returns the angular sampling measure.
+     *
+     * @return The angular sampling measure, or {@code null}.
+     *
+     * @since 0.5
+     */
+    @Override
+    @ValueRange(minimum=0, isMinIncluded=false)
+    public Double getAngularDistance() {
+        return (property == ANGULAR) ? (Double) value : null;
+    }
+
+    /**
+     * Sets the angular sampling measure.
+     *
+     * {@section Effect on other properties}
+     * If and only if the {@code newValue} is non-null, then this method automatically
+     * discards all other properties.
+     *
+     * @param newValue The new distance.
+     *
+     * @since 0.5
+     */
+    public void setAngularDistance(final Double newValue) {
+        setProperty(ANGULAR, newValue);
+    }
+
+    /**
+     * Returns a brief textual description of the spatial resolution of the resource.
+     *
+     * @return Textual description of the spatial resolution, or {@code null}.
+     *
+     * @since 0.5
+     */
+    @Override
+    public InternationalString getLevelOfDetail() {
+        return (property == TEXT) ? (InternationalString) value : null;
+    }
+
+    /**
+     * Sets the textual description of the spatial resolution of the resource.
+     *
+     * {@section Effect on other properties}
+     * If and only if the {@code newValue} is non-null, then this method automatically
+     * discards all other properties.
+     *
+     * @param newValue The new distance.
+     *
+     * @since 0.5
      */
-    private void setValue(final Double newValue) {
-        setDistance(newValue);
+    public void setLevelOfDetail(final InternationalString newValue) {
+        setProperty(TEXT, newValue);
     }
 }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java?rev=1616536&r1=1616535&r2=1616536&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java [UTF-8] Thu Aug  7 16:56:55 2014
@@ -36,8 +36,8 @@ import org.apache.sis.metadata.iso.quali
  * the scope or lack of knowledge about lineage.
  *
  * {@section Relationship between properties}
- * Only one of {@linkplain #getStatement statement}, {@linkplain #getProcessSteps() process steps}
- * and {@link #getSources() sources} should be provided.
+ * At least one of {@linkplain #getStatement statement}, {@linkplain #getProcessSteps() process steps}
+ * and {@link #getSources() sources} shall be provided.
  *
  * {@section Limitations}
  * <ul>
@@ -80,7 +80,7 @@ public class DefaultLineage extends ISOM
     /**
      * Type of resource and / or extent to which the lineage information applies.
      */
-    private Collection<Scope> scopes;
+    private Scope scope;
 
     /**
      * A resources (for example publication) that describes the whole
@@ -117,7 +117,7 @@ public class DefaultLineage extends ISOM
         super(object);
         if (object != null) {
             statement               = object.getStatement();
-            scopes                  = copyCollection(object.getScopes(), Scope.class);
+            scope                   = object.getScope();
             additionalDocumentation = copyCollection(object.getAdditionalDocumentation(), Citation.class);
             processSteps            = copyCollection(object.getProcessSteps(), ProcessStep.class);
             sources                 = copyCollection(object.getSources(), Source.class);
@@ -173,34 +173,34 @@ public class DefaultLineage extends ISOM
     }
 
     /**
-     * Returns the types of resource and / or extents to which the lineage information applies.
+     * Returns the type of resource and / or extents to which the lineage information applies.
      *
-     * @return Types of resource and / or extents to which the lineage information applies.
+     * @return Type of resource and / or extents to which the lineage information applies.
      *
      * @since 0.5
      */
     @Override
 /// @XmlElement(name = "scope")
-    public Collection<Scope> getScopes() {
-        return scopes = nonNullCollection(scopes, Scope.class);
+    public Scope getScope() {
+        return scope;
     }
 
     /**
-     * Sets the types of resource and / or extents to which the lineage information applies.
+     * Sets the type of resource and / or extents to which the lineage information applies.
      *
-     * @param newValues The new types of resource.
+     * @param newValue The new type of resource.
      *
      * @since 0.5
      */
-    public void setScopes(final Collection<? extends Scope> newValues)  {
-        scopes = writeCollection(newValues, scopes, Scope.class);
+    public void setScope(final Scope newValue) {
+        checkWritePermission();
+        scope = newValue;
     }
 
     /**
-     * Returns information about resources (for example publication) that describes the whole
-     * process to generate this resource (for example a dataset).
+     * Returns additional documentation.
      *
-     * @return Resources that describes the whole process to generate this resource.
+     * @return Additional documentation.
      *
      * @since 0.5
      */
@@ -211,20 +211,20 @@ public class DefaultLineage extends ISOM
     }
 
     /**
-     * Sets information about resources that describes the whole process to generate this resource.
+     * Sets additional documentation.
      *
-     * @param newValues The new information about resource.
+     * @param newValues Additional documentation.
      *
      * @since 0.5
      */
     public void setAdditionalDocumentation(final Collection<? extends Citation> newValues)  {
-        additionalDocumentation = writeCollection(newValues, additionalDocumentation , Citation.class);
+        additionalDocumentation = writeCollection(newValues, additionalDocumentation, Citation.class);
     }
 
     /**
-     * Returns the information about an event in the creation process for the data specified by the scope.
+     * Returns the information about about events in the life of a resource specified by the scope.
      *
-     * @return Information about an event in the creation process.
+     * @return Information about events in the life of a resource.
      */
     @Override
     @XmlElement(name = "processStep")
@@ -233,7 +233,7 @@ public class DefaultLineage extends ISOM
     }
 
     /**
-     * Sets information about an event in the creation process for the data specified by the scope.
+     * Sets information about events in the life of a resource specified by the scope.
      *
      * @param newValues The new process steps.
      */

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java?rev=1616536&r1=1616535&r2=1616536&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java [UTF-8] Thu Aug  7 16:56:55 2014
@@ -406,9 +406,9 @@ public class DefaultSource extends ISOMe
     }
 
     /**
-     * Returns information about an event in the creation process for the source data.
+     * Returns information about process steps in which this source was used.
      *
-     * @return Information about an event in the creation process.
+     * @return Information about process steps in which this source was used.
      */
     @Override
     @XmlElement(name = "sourceStep")
@@ -417,9 +417,9 @@ public class DefaultSource extends ISOMe
     }
 
     /**
-     * Sets information about an event in the creation process for the source data.
+     * Sets information about process steps in which this source was used.
      *
-     * @param newValues The new source steps.
+     * @param newValues The new process steps.
      */
     public void setSourceSteps(final Collection<? extends ProcessStep> newValues) {
         sourceSteps = writeCollection(newValues, sourceSteps, ProcessStep.class);

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java?rev=1616536&r1=1616535&r2=1616536&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeometricObjects.java [UTF-8] Thu Aug  7 16:56:55 2014
@@ -150,7 +150,7 @@ public class DefaultGeometricObjects ext
      * @return Total number of the point or vector object type, or {@code null}.
      */
     @Override
-    @ValueRange(minimum=0)
+    @ValueRange(minimum = 1)
     @XmlElement(name = "geometricObjectCount")
     public Integer getGeometricObjectCount() {
         return geometricObjectCount;

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java?rev=1616536&r1=1616535&r2=1616536&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java [UTF-8] Thu Aug  7 16:56:55 2014
@@ -251,9 +251,7 @@ public class DefaultGeorectified extends
 
     /**
      * Returns the Earth location in the coordinate system defined by the Spatial Reference System
-     * and the grid coordinate of the cells at opposite ends of grid coverage along two
-     * diagonals in the grid spatial dimensions. There are four corner points in a
-     * georectified grid; at least two corner points along one diagonal are required.
+     * and the grid coordinate of the cells at opposite ends of grid coverage along two diagonals.
      *
      * @return The corner points.
      */
@@ -266,6 +264,12 @@ public class DefaultGeorectified extends
     /**
      * Sets the corner points.
      *
+     * The {@linkplain List#size() list size} should be 2 or 4.
+     * The list should contain at least two corner points along one diagonal.
+     * or may contains the 4 corner points of the georectified grid.
+     *
+     * <p>The first corner point shall correspond to the origin of the grid.</p>
+     *
      * @param newValues The new corner points.
      */
     public void setCornerPoints(final List<? extends Point> newValues) {
@@ -317,9 +321,9 @@ public class DefaultGeorectified extends
     }
 
     /**
-     * Returns a description of the information about which grid dimensions are the spatial dimensions.
+     * Returns a general description of the transformation.
      *
-     * @return Description of the information about grid dimensions, or {@code null}.
+     * @return General description of the transformation, or {@code null}.
      */
     @Override
     @XmlElement(name = "transformationDimensionDescription")
@@ -328,9 +332,9 @@ public class DefaultGeorectified extends
     }
 
     /**
-     * Sets the description of the information about which grid dimensions are the spatial dimensions.
+     * Sets a general description of the transformation.
      *
-     * @param newValue The new transformation dimension description.
+     * @param newValue The new general description.
      */
     public void setTransformationDimensionDescription(final InternationalString newValue) {
         checkWritePermission();
@@ -350,6 +354,7 @@ public class DefaultGeorectified extends
 
     /**
      * Sets information about which grid dimensions are the spatial dimensions.
+     * The given list should contain at most 2 elements.
      *
      * @param newValues The new transformation mapping.
      */

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java?rev=1616536&r1=1616535&r2=1616536&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java [UTF-8] Thu Aug  7 16:56:55 2014
@@ -284,13 +284,15 @@ public abstract strictfp class MetadataT
      * Reasons for skipping a test are:
      *
      * <ul>
+     *   <li>Class which is a union (those classes behave differently than non-union classes).</li>
      *   <li>Method which is the delegate of many legacy ISO 19115:2003 methods.
      *       Having a property that can be modified by many other properties confuse the tests.</li>
      * </ul>
      */
     @SuppressWarnings("deprecation")
     private static boolean skipTest(final Class<?> implementation, final String method) {
-        return implementation == org.apache.sis.metadata.iso.citation.DefaultResponsibleParty.class
-                && method.equals("getParties");
+        return implementation == org.apache.sis.metadata.iso.maintenance.DefaultScopeDescription.class ||
+              (implementation == org.apache.sis.metadata.iso.citation.DefaultResponsibleParty.class &&
+               method.equals("getParties"));
     }
 }

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java?rev=1616536&r1=1616535&r2=1616536&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java [UTF-8] Thu Aug  7 16:56:55 2014
@@ -31,6 +31,7 @@ import org.apache.sis.metadata.iso.conte
 import org.apache.sis.metadata.iso.citation.DefaultCitation;
 import org.apache.sis.metadata.iso.citation.DefaultIndividual;
 import org.apache.sis.metadata.iso.citation.DefaultResponsibility;
+import org.apache.sis.metadata.iso.content.DefaultAttributeGroup;
 import org.apache.sis.metadata.iso.identification.DefaultKeywords;
 import org.apache.sis.metadata.iso.identification.DefaultDataIdentification;
 import org.apache.sis.metadata.iso.lineage.DefaultProcessing;
@@ -158,18 +159,20 @@ public final strictfp class TreeTableFor
     @Test
     public void testImageDescription() {
         final DefaultImageDescription image = new DefaultImageDescription();
-        image.getDimensions().add(createBand(0.25, 0.26));
-        image.getDimensions().add(createBand(0.28, 0.29));
+        image.setAttributeGroups(Arrays.asList(
+            new DefaultAttributeGroup(null, createBand(0.25, 0.26)),
+            new DefaultAttributeGroup(null, createBand(0.28, 0.29))
+        ));
         final String text = format.format(image.asTreeTable());
         assertMultilinesEquals(
             "Image description\n" +
             "  ├─Attribute group (1 of 2)\n" +
-            "  │   └─Group attribute\n" +
+            "  │   └─Attribute\n" +
             "  │       ├─Max value………………… 0.26\n" +
             "  │       ├─Min value………………… 0.25\n" +
             "  │       └─Units…………………………… cm\n" +
             "  └─Attribute group (2 of 2)\n" +
-            "      └─Group attribute\n" +
+            "      └─Attribute\n" +
             "          ├─Max value………………… 0.29\n" +
             "          ├─Min value………………… 0.28\n" +
             "          └─Units…………………………… cm\n", text);

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java?rev=1616536&r1=1616535&r2=1616536&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java [UTF-8] Thu Aug  7 16:56:55 2014
@@ -62,6 +62,7 @@ public final strictfp class AllMetadataT
             org.opengis.metadata.Identifier.class,
             org.opengis.metadata.Metadata.class,
             org.opengis.metadata.MetadataExtensionInformation.class,
+            org.opengis.metadata.MetadataScope.class,
 //          org.opengis.metadata.Obligation.class, // Excluded CodeList because it doesn't use the usual kind of adapter.
             org.opengis.metadata.PortrayalCatalogueReference.class,
             org.opengis.metadata.acquisition.AcquisitionInformation.class,
@@ -156,9 +157,8 @@ public final strictfp class AllMetadataT
             org.opengis.metadata.lineage.Source.class,
             org.opengis.metadata.maintenance.MaintenanceFrequency.class,
             org.opengis.metadata.maintenance.MaintenanceInformation.class,
-            org.opengis.metadata.maintenance.MetadataScope.class,
             org.opengis.metadata.maintenance.ScopeCode.class,
-//          org.opengis.metadata.maintenance.ScopeDescription.class,  // Excluded because this is an union.
+            org.opengis.metadata.maintenance.ScopeDescription.class,
             org.opengis.metadata.quality.AbsoluteExternalPositionalAccuracy.class,
             org.opengis.metadata.quality.AccuracyOfATimeMeasurement.class,
             org.opengis.metadata.quality.Completeness.class,
@@ -217,7 +217,7 @@ public final strictfp class AllMetadataT
     @Test
     @Override
     public void testPropertyValues() {
-        listener.maximumLogCount = 3;
+        listener.maximumLogCount = 4;
         super.testPropertyValues();
     }
 
@@ -233,6 +233,9 @@ public final strictfp class AllMetadataT
         if (name.equals("distributedComputingPlatform")) {
             name = "DCP";
         }
+        if (name.equals("stepDateTime")) {
+            name = "dateTime";
+        }
         return name;
     }
 

Modified: sis/branches/JDK8/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java?rev=1616536&r1=1616535&r2=1616536&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] Thu Aug  7 16:56:55 2014
@@ -144,7 +144,7 @@ public final strictfp class MetadataRead
             "  │           └─Maximum value……………………………………………… 0.0\n" +
             "  ├─Content info\n" +
             "  │   └─Attribute group\n" +
-            "  │       └─Group attribute\n" +
+            "  │       └─Attribute\n" +
             "  │           ├─Sequence identifier……………………………… SST\n" +
             "  │           └─Description…………………………………………………… Sea temperature\n" +
             "  └─Data quality info\n" +