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 2017/05/03 17:41:31 UTC
svn commit: r1793684 - in /sis/branches/JDK8:
core/sis-metadata/src/main/java/org/apache/sis/metadata/
core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/
core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/
core/sis-metadata/...
Author: desruisseaux
Date: Wed May 3 17:41:30 2017
New Revision: 1793684
URL: http://svn.apache.org/viewvc?rev=1793684&view=rev
Log:
First draft of tree view simplification.
https://issues.apache.org/jira/browse/SIS-298
Modified:
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitationDate.java
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentificationTest.java
sis/branches/JDK8/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java
sis/branches/JDK8/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java?rev=1793684&r1=1793683&r2=1793684&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java [UTF-8] Wed May 3 17:41:30 2017
@@ -178,12 +178,20 @@ class TreeNode implements Node {
this.parent = parent;
this.metadata = metadata;
this.baseType = baseType;
- if (!table.standard.isMetadata(baseType)) {
+ if (!isMetadata(baseType)) {
children = LEAF;
}
}
/**
+ * Returns {@code true} if nodes for values of the given type can be expanded with more children.
+ * A return value of {@code false} means that values of the given type are leaves.
+ */
+ final boolean isMetadata(final Class<?> type) {
+ return table.standard.isMetadata(type);
+ }
+
+ /**
* Returns the key to use for calls to {@link MetadataStandard} methods.
* This key is used only for some default method implementations in the root node;
* children will use the class of their node value instead.
@@ -390,7 +398,7 @@ class TreeNode implements Node {
Class<?> type = null;
for (Class<?> c : subtypes) {
if (baseType.isAssignableFrom(c)) {
- if (!table.standard.isMetadata(c)) {
+ if (!isMetadata(c)) {
c = standardSubType(c.getInterfaces());
}
if (type == null) {
@@ -645,19 +653,14 @@ class TreeNode implements Node {
cachedValue = null; // Use the cached value only once after iteration.
/*
* If there is a value, check if the cached collection is still applicable.
+ * We verify that the collection is a wrapper for the same metadata object.
+ * If we need to create a new collection, we know that the property accessor
+ * exists otherwise the call to 'isLeaf()' above would have returned 'true'.
*/
- if (children instanceof TreeNodeChildren) {
- final TreeNodeChildren candidate = (TreeNodeChildren) children;
- if (candidate.metadata == value) {
- return candidate;
- }
+ if (children == null || ((TreeNodeChildren) children).metadata != value) {
+ children = new TreeNodeChildren(this, value,
+ table.standard.getAccessor(new CacheKey(value.getClass(), baseType), true));
}
- /*
- * At this point, we need to create a new collection. The property accessor shall
- * exist, otherwise the call to 'isLeaf()' above would have returned 'true'.
- */
- children = new TreeNodeChildren(this, value,
- table.standard.getAccessor(new CacheKey(value.getClass(), baseType), true));
}
return children;
}
@@ -765,8 +768,10 @@ class TreeNode implements Node {
throw new IllegalArgumentException(Errors.format(Errors.Keys.ElementAlreadyPresent_1, value));
}
delegate = siblings.childAt(indexInData, indexInList);
- // Do not set 'delegate.cachedValue = value', since 'value' may
- // have been converted by the setter method to an other value.
+ /*
+ * Do not set 'delegate.cachedValue = value', since 'value' may
+ * have been converted by the setter method to another value.
+ */
return;
}
}
@@ -795,30 +800,35 @@ class TreeNode implements Node {
*/
@Override
public final <V> V getValue(final TableColumn<V> column) {
+ Object value;
ArgumentChecks.ensureNonNull("column", column);
- Object value = null;
-
- // Check the columns in what we think may be the most frequently
- // asked columns first, and less frequently asked columns last.
- if (column == TableColumn.VALUE) {
- if (isLeaf()) {
- value = cachedValue;
- cachedValue = null; // Use the cached value only once after iteration.
- if (value == null) {
- value = getUserObject();
- }
- }
+ if (column == TableColumn.IDENTIFIER) {
+ value = getIdentifier();
+ } else if (column == TableColumn.INDEX) {
+ value = getIndex();
} else if (column == TableColumn.NAME) {
if (name == null) {
name = getName();
}
value = name;
- } else if (column == TableColumn.IDENTIFIER) {
- value = getIdentifier();
- } else if (column == TableColumn.INDEX) {
- value = getIndex();
} else if (column == TableColumn.TYPE) {
- value = baseType;
+ final Collection<Node> children = getChildren();
+ if (children == LEAF || (value = ((TreeNodeChildren) children).getParentType()) == null) {
+ value = baseType;
+ }
+ } else if (column == TableColumn.VALUE) {
+ final Collection<Node> children = getChildren();
+ if (children == LEAF) {
+ value = cachedValue;
+ cachedValue = null; // Use the cached value only once after iteration.
+ if (value == null) {
+ value = getUserObject();
+ }
+ } else {
+ value = ((TreeNodeChildren) children).getParentTitle();
+ }
+ } else {
+ return null;
}
return column.getElementType().cast(value);
}
@@ -836,9 +846,12 @@ class TreeNode implements Node {
public final <V> void setValue(final TableColumn<V> column, final V value) throws UnsupportedOperationException {
ArgumentChecks.ensureNonNull("column", column);
if (column == TableColumn.VALUE) {
- ArgumentChecks.ensureNonNull("value", value);
+ ArgumentChecks.ensureNonNull("value", value); // See javadoc.
cachedValue = null;
- setUserObject(value);
+ final Collection<Node> children = getChildren();
+ if (children == LEAF || !(((TreeNodeChildren) children).setParentTitle(value))) {
+ setUserObject(value);
+ }
} else if (TreeTableView.COLUMNS.contains(column)) {
throw new UnsupportedOperationException(unmodifiableCellValue(column));
} else {
Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java?rev=1793684&r1=1793683&r2=1793684&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java [UTF-8] Wed May 3 17:41:30 2017
@@ -98,6 +98,30 @@ final class TreeNodeChildren extends Abs
private final TreeNode[] children;
/**
+ * Index of the property to write in the parent node instead than as a child.
+ * If a property has the same name than the parent property that contains it,
+ * we write its value in that parent property. For example instead of:
+ *
+ * {@preformat text
+ * Citation
+ * └─Date
+ * ├─Date………………… 2012/01/01
+ * └─Date type…… Creation
+ * }
+ *
+ * We simplify as:
+ *
+ * {@preformat text
+ * Citation
+ * └─Date………………………… 2012/01/01
+ * └─Date type…… Creation
+ * }
+ *
+ * @see <a href="https://issues.apache.org/jira/browse/SIS-298">SIS-298</a>
+ */
+ final int titleProperty;
+
+ /**
* Modification count, incremented when the content of this collection is modified. This check
* is done on a <cite>best effort basis</cite> only, since we can't not track the changes which
* are done independently in the {@linkplain #metadata} object.
@@ -116,6 +140,51 @@ final class TreeNodeChildren extends Abs
this.metadata = metadata;
this.accessor = accessor;
this.children = new TreeNode[accessor.count()];
+ /*
+ * Search for something that looks like the main property, to be associated with the parent node
+ * instead than provided as a child. The intend is to have more compact and easy to read trees.
+ * That property shall be a singleton for a simple value (not another metadata object).
+ */
+ if (parent.getParent() != null) {
+ final TitleProperty an = accessor.implementation.getAnnotation(TitleProperty.class);
+ if (an != null) {
+ final int index = accessor.indexOf(an.name(), false);
+ final Class<?> type = accessor.type(index, TypeValuePolicy.ELEMENT_TYPE);
+ if (type != null && !parent.isMetadata(type) && type == accessor.type(index, TypeValuePolicy.PROPERTY_TYPE)) {
+ titleProperty = index;
+ return;
+ }
+ }
+ }
+ titleProperty = -1;
+ }
+
+ /**
+ * If a simple value should be associated to the parent node, returns the type of that value.
+ * Otherwise returns {@code null}.
+ */
+ final Class<?> getParentType() {
+ return (titleProperty >= 0) ? accessor.type(titleProperty, TypeValuePolicy.ELEMENT_TYPE) : null;
+ }
+
+ /**
+ * If a simple value should be associated to the parent node, returns that value.
+ * Otherwise returns {@code null}.
+ */
+ final Object getParentTitle() {
+ return (titleProperty >= 0) ? valueAt(titleProperty) : null;
+ }
+
+ /**
+ * Sets the value associated to the parent node, if possible.
+ * This returned boolean tells whether the value has been written.
+ */
+ final boolean setParentTitle(final Object value) {
+ if (titleProperty < 0) {
+ return false;
+ }
+ accessor.set(titleProperty, metadata, value, PropertyAccessor.RETURN_NULL);
+ return true;
}
/**
@@ -229,7 +298,9 @@ final class TreeNodeChildren extends Abs
*/
@Override
public int size() {
- return accessor.count(metadata, parent.table.valuePolicy, PropertyAccessor.COUNT_DEEP);
+ int count = accessor.count(metadata, parent.table.valuePolicy, PropertyAccessor.COUNT_DEEP);
+ if (titleProperty >= 0 && !isSkipped(valueAt(titleProperty))) count--;
+ return count;
}
/**
@@ -310,11 +381,9 @@ final class TreeNodeChildren extends Abs
private Object nextValue;
/**
- * If the call to {@link #next()} found a collection, the iterator over the elements
- * in that collection. Otherwise {@code null}.
- *
- * <p>A non-null value (even if that sub-iterator has no next elements)
- * means that {@link #nextValue} is an element of that sub-iteration.</p>
+ * If the call to {@link #next()} found a collection, the iterator over the elements in that collection.
+ * Otherwise {@code null}. A non-null value (even if that sub-iterator has no next elements) means that
+ * {@link #nextValue} is an element of that sub-iteration.
*/
private Iterator<?> subIterator;
@@ -385,38 +454,40 @@ final class TreeNodeChildren extends Abs
*/
final int count = childCount();
while (nextInAccessor < count) {
- nextValue = valueAt(nextInAccessor);
- if (!isSkipped(nextValue)) {
- if (isCollection(nextInAccessor)) {
- /*
- * If the property is a collection, unconditionally get the first element
- * even if absent (null) in order to comply with the ValueExistencePolicy.
- * if we were expected to ignore empty collections, 'isSkipped(nextValue)'
- * would have returned 'true'.
- */
- if (nextValue != null) {
- subIterator = ((Iterable<?>) nextValue).iterator();
- } else {
- subIterator = Collections.emptyIterator();
- /*
- * Null collections are illegal (it shall be empty collections instead),
- * but we try to keep the iterator robut to ill-formed metadata, because
- * we want AbstractMetadata.toString() to work so we can spot problems.
- */
- }
- subIndex = 0;
- if (subIterator.hasNext()) {
- nextValue = subIterator.next();
- } else {
- nextValue = null;
+ if (nextInAccessor != titleProperty) {
+ nextValue = valueAt(nextInAccessor);
+ if (!isSkipped(nextValue)) {
+ if (isCollection(nextInAccessor)) {
/*
- * Do not set 'childIterator' to null, since the above 'nextValue'
- * is considered as part of the child iteration.
+ * If the property is a collection, unconditionally get the first element
+ * even if absent (null) in order to comply with the ValueExistencePolicy.
+ * if we were expected to ignore empty collections, 'isSkipped(nextValue)'
+ * would have returned 'true'.
*/
+ if (nextValue != null) {
+ subIterator = ((Iterable<?>) nextValue).iterator();
+ } else {
+ subIterator = Collections.emptyIterator();
+ /*
+ * Null collections are illegal (it shall be empty collections instead),
+ * but we try to keep the iterator robut to ill-formed metadata, because
+ * we want AbstractMetadata.toString() to work so we can spot problems.
+ */
+ }
+ subIndex = 0;
+ if (subIterator.hasNext()) {
+ nextValue = subIterator.next();
+ } else {
+ nextValue = null;
+ /*
+ * Do not set 'childIterator' to null, since the above 'nextValue'
+ * is considered as part of the child iteration.
+ */
+ }
}
+ isNextVerified = true;
+ return true;
}
- isNextVerified = true;
- return true;
}
nextInAccessor++;
}
Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java?rev=1793684&r1=1793683&r2=1793684&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java [UTF-8] Wed May 3 17:41:30 2017
@@ -22,6 +22,7 @@ import javax.xml.bind.annotation.XmlRoot
import org.opengis.metadata.Identifier;
import org.opengis.metadata.citation.Citation;
import org.opengis.util.InternationalString;
+import org.apache.sis.metadata.TitleProperty;
import org.apache.sis.internal.util.Citations;
@@ -85,6 +86,7 @@ import org.apache.sis.internal.util.Cita
* @module
*/
@SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones.
+@TitleProperty(name = "code")
@XmlType(name = "MD_Identifier_Type", propOrder = {
"authority",
"code"
Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1793684&r1=1793683&r2=1793684&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] Wed May 3 17:41:30 2017
@@ -29,6 +29,7 @@ import org.opengis.parameter.ParameterVa
import org.opengis.util.InternationalString;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.iso.Types;
+import org.apache.sis.metadata.TitleProperty;
import org.apache.sis.metadata.iso.citation.Citations;
import org.apache.sis.internal.metadata.NameMeaning;
import org.apache.sis.internal.metadata.WKTKeywords;
@@ -127,6 +128,7 @@ import static org.apache.sis.util.collec
* @since 0.3
* @module
*/
+@TitleProperty(name = "code")
@XmlType(name = "RS_Identifier_Type", propOrder = {
"authority",
"code",
Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java?rev=1793684&r1=1793683&r2=1793684&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java [UTF-8] Wed May 3 17:41:30 2017
@@ -32,6 +32,7 @@ import org.opengis.metadata.identificati
import org.opengis.util.InternationalString;
import org.apache.sis.util.iso.Types;
import org.apache.sis.internal.jaxb.NonMarshalledAuthority;
+import org.apache.sis.metadata.TitleProperty;
import org.apache.sis.metadata.iso.ISOMetadata;
import org.apache.sis.xml.IdentifierSpace;
import org.apache.sis.xml.IdentifierMap;
@@ -67,6 +68,7 @@ import static org.apache.sis.internal.me
* @module
*/
@SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones.
+@TitleProperty(name = "title")
@XmlType(name = "CI_Citation_Type", propOrder = {
"title",
"alternateTitles",
Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitationDate.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitationDate.java?rev=1793684&r1=1793683&r2=1793684&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitationDate.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitationDate.java [UTF-8] Wed May 3 17:41:30 2017
@@ -23,6 +23,7 @@ import javax.xml.bind.annotation.XmlRoot
import org.opengis.metadata.citation.CitationDate;
import org.opengis.metadata.citation.DateType;
import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.metadata.TitleProperty;
import static org.apache.sis.internal.metadata.MetadataUtilities.toDate;
import static org.apache.sis.internal.metadata.MetadataUtilities.toMilliseconds;
@@ -47,6 +48,7 @@ import static org.apache.sis.internal.me
* @module
*/
@SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones.
+@TitleProperty(name = "date")
@XmlType(name = "CI_Date_Type", propOrder = {
"date",
"dateType"
Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java?rev=1793684&r1=1793683&r2=1793684&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java [UTF-8] Wed May 3 17:41:30 2017
@@ -30,6 +30,7 @@ import org.opengis.referencing.operation
import org.opengis.util.InternationalString;
import org.apache.sis.util.iso.Types;
import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.metadata.TitleProperty;
import org.apache.sis.internal.metadata.ReferencingServices;
@@ -70,6 +71,7 @@ import org.apache.sis.internal.metadata.
* @module
*/
@SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones.
+@TitleProperty(name = "description")
@XmlType(name = "EX_Extent_Type", propOrder = {
"description",
"geographicElements",
Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java?rev=1793684&r1=1793683&r2=1793684&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java [UTF-8] Wed May 3 17:41:30 2017
@@ -16,25 +16,28 @@
*/
package org.apache.sis.metadata;
+import java.util.Date;
import java.util.Random;
import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;
-import org.opengis.metadata.Metadata;
+import java.util.Collections;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.metadata.citation.DateType;
import org.opengis.metadata.citation.PresentationForm;
import org.apache.sis.metadata.iso.citation.DefaultCitation;
+import org.apache.sis.metadata.iso.citation.DefaultCitationDate;
import org.apache.sis.util.iso.SimpleInternationalString;
import org.apache.sis.util.collection.DefaultTreeTable;
import org.apache.sis.util.collection.TableColumn;
import org.apache.sis.util.collection.TreeTable;
import org.apache.sis.test.DependsOnMethod;
import org.apache.sis.test.DependsOn;
+import org.apache.sis.test.TestUtilities;
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.test.TestUtilities.createRandomNumberGenerator;
/**
@@ -67,7 +70,7 @@ public final strictfp class TreeNodeChil
static DefaultCitation metadataWithoutCollections() {
final DefaultCitation citation = new DefaultCitation("Some title");
citation.setEdition(new SimpleInternationalString("Some edition"));
- citation.setOtherCitationDetails(singleton(new SimpleInternationalString("Some other details")));
+ citation.setOtherCitationDetails(Collections.singleton(new SimpleInternationalString("Some other details")));
return citation;
}
@@ -114,14 +117,42 @@ public final strictfp class TreeNodeChil
}
/**
+ * Creates a metadata object with a property than can be simplified.
+ * Strictly speaking, the metadata is:
+ *
+ * {@preformat text
+ * DefaultCitation
+ * └─Date
+ * ├─Date………………… 2012-01-01
+ * └─Date type…… Creation
+ * }
+ *
+ * However the tree view should simplify as:
+ *
+ * {@preformat text
+ * DefaultCitation
+ * └─Date………………………… 2012-01-01
+ * └─Date type…… Creation
+ * }
+ *
+ * @see <a href="https://issues.apache.org/jira/browse/SIS-298">SIS-298</a>
+ */
+ static DefaultCitation metadataSimplifiable() {
+ final DefaultCitation citation = new DefaultCitation();
+ final DefaultCitationDate date = new DefaultCitationDate(TestUtilities.date("2012-01-01 00:00:00"), DateType.CREATION);
+ assertTrue(citation.getDates().add(date));
+ return citation;
+ }
+
+ /**
* Creates a collection to be tested for the given metadata object and value policy.
*/
- private static TreeNodeChildren create(final AbstractMetadata metadata, final ValueExistencePolicy valuePolicy) {
+ private static TreeNodeChildren create(final DefaultCitation citation, final ValueExistencePolicy valuePolicy) {
final MetadataStandard standard = MetadataStandard.ISO_19115;
- final TreeTableView table = new TreeTableView(standard, metadata, Metadata.class, valuePolicy);
+ final TreeTableView table = new TreeTableView(standard, citation, Citation.class, valuePolicy);
final TreeNode node = (TreeNode) table.getRoot();
- final PropertyAccessor accessor = standard.getAccessor(new CacheKey(metadata.getClass()), true);
- return new TreeNodeChildren(node, metadata, accessor);
+ final PropertyAccessor accessor = standard.getAccessor(new CacheKey(citation.getClass()), true);
+ return new TreeNodeChildren(node, citation, accessor);
}
/**
@@ -136,6 +167,7 @@ public final strictfp class TreeNodeChil
"Some edition",
"Some other details"
};
+ assertEquals("titleProperty", -1, children.titleProperty);
assertFalse ("isEmpty()", children.isEmpty());
assertEquals("size()", expected.length, children.size());
assertAllNextEqual(expected, children.iterator());
@@ -157,6 +189,7 @@ public final strictfp class TreeNodeChil
"PresentationForm[MAP_DIGITAL]",
"Some other details"
};
+ assertEquals("titleProperty", -1, children.titleProperty);
assertFalse ("isEmpty()", children.isEmpty());
assertEquals("size()", expected.length, children.size());
assertAllNextEqual(expected, children.iterator());
@@ -180,6 +213,35 @@ public final strictfp class TreeNodeChil
"PresentationForm[MAP_HARDCOPY]",
"Some other details"
};
+ assertEquals("titleProperty", -1, children.titleProperty);
+ assertFalse ("isEmpty()", children.isEmpty());
+ assertEquals("size()", expected.length, children.size());
+ assertAllNextEqual(expected, children.iterator());
+ }
+
+ /**
+ * Tests a metadata than can be simplified by displaying a child property value directly as the parent value.
+ */
+ @Test
+ @DependsOnMethod("testReadOnlyWithoutCollections")
+ public void testSimplifiable() {
+ final DefaultCitation citation = metadataSimplifiable();
+ /*
+ * DefaultCitation
+ * └─Date
+ * ├─Date………………… 2012-01-01
+ * └─Date type…… Creation
+ *
+ * We need to perform the tests on the "Date" node, not on the "DefaultCitation" node.
+ */
+ final TreeTable.Node node = TestUtilities.getSingleton(create(citation, ValueExistencePolicy.NON_EMPTY));
+ assertEquals("value", 1325376000000L, ((Date) node.getValue(TableColumn.VALUE)).getTime());
+ final TreeNodeChildren children = (TreeNodeChildren) node.getChildren();
+ final String[] expected = {
+ // The "Date" node should be omitted because merged with the parent "Date" node.
+ "DateType[CREATION]"
+ };
+ assertEquals("titleProperty", 0, children.titleProperty);
assertFalse ("isEmpty()", children.isEmpty());
assertEquals("size()", expected.length, children.size());
assertAllNextEqual(expected, children.iterator());
@@ -193,6 +255,8 @@ public final strictfp class TreeNodeChil
public void testAdd() {
final DefaultCitation citation = metadataWithMultiOccurrences();
final TreeNodeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
+ assertEquals("titleProperty", -1, children.titleProperty);
+
final DefaultTreeTable.Node toAdd = new DefaultTreeTable.Node(new DefaultTreeTable(
TableColumn.IDENTIFIER,
TableColumn.VALUE));
@@ -242,7 +306,8 @@ public final strictfp class TreeNodeChil
public void testRemoveWithoutCollections() {
final DefaultCitation citation = metadataWithoutCollections();
final TreeNodeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
- testRemove(createRandomNumberGenerator(), children);
+ assertEquals("titleProperty", -1, children.titleProperty);
+ testRemove(TestUtilities.createRandomNumberGenerator(), children);
}
/**
@@ -257,7 +322,8 @@ public final strictfp class TreeNodeChil
public void testRemoveWithSingletonInCollections() {
final DefaultCitation citation = metadataWithSingletonInCollections();
final TreeNodeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
- testRemove(createRandomNumberGenerator(), children);
+ assertEquals("titleProperty", -1, children.titleProperty);
+ testRemove(TestUtilities.createRandomNumberGenerator(), children);
}
/**
@@ -272,7 +338,8 @@ public final strictfp class TreeNodeChil
public void testRemoveWithMultiOccurrences() {
final DefaultCitation citation = metadataWithSingletonInCollections();
final TreeNodeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
- testRemove(createRandomNumberGenerator(), children);
+ assertEquals("titleProperty", -1, children.titleProperty);
+ testRemove(TestUtilities.createRandomNumberGenerator(), children);
}
/**
@@ -282,9 +349,10 @@ public final strictfp class TreeNodeChil
public void testClear() {
final DefaultCitation citation = metadataWithSingletonInCollections();
final TreeNodeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
- assertFalse(children.isEmpty());
+ assertEquals("titleProperty", -1, children.titleProperty);
+ assertFalse("isEmpty()", children.isEmpty());
children.clear();
- assertTrue(children.isEmpty());
+ assertTrue("isEmpty()", children.isEmpty());
assertNull(citation.getTitle());
assertTrue(citation.getAlternateTitles().isEmpty());
}
@@ -316,6 +384,7 @@ public final strictfp class TreeNodeChil
null, // onlineResources (collection)
null // graphics (collection)
};
+ assertEquals("titleProperty", -1, children.titleProperty);
assertFalse ("isEmpty()", children.isEmpty());
assertEquals("size()", expected.length, children.size());
assertAllNextEqual(expected, children.iterator());
Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java?rev=1793684&r1=1793683&r2=1793684&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java [UTF-8] Wed May 3 17:41:30 2017
@@ -124,9 +124,10 @@ public final strictfp class TreeNodeTest
assertFalse ("isLeaf()", node.isLeaf());
final TreeNodeChildren children = (TreeNodeChildren) node.getChildren();
- assertSame ("children.metadata", citation, children.metadata);
- assertFalse("children.isEmpty()", node.getChildren().isEmpty());
- assertSame ("children.parent", node, children.iterator().next().getParent());
+ assertEquals("children.titleProperty", -1, children.titleProperty);
+ assertSame ("children.metadata", citation, children.metadata);
+ assertFalse ("children.isEmpty()", node.getChildren().isEmpty());
+ assertSame ("children.parent", node, children.iterator().next().getParent());
}
/**
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=1793684&r1=1793683&r2=1793684&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] Wed May 3 17:41:30 2017
@@ -101,8 +101,7 @@ public final strictfp class TreeTableFor
" │ ├─Organisation\n" +
" │ │ └─Name………………………………………………………… Kōdansha\n" +
" │ ├─Role…………………………………………………………………… Editor\n" +
- " │ └─Extent\n" +
- " │ ├─Description……………………………………… World\n" +
+ " │ └─Extent……………………………………………………………… World\n" +
" │ └─Geographic element\n" +
" │ ├─West bound longitude…… 180°W\n" +
" │ ├─East bound longitude…… 180°E\n" +
@@ -130,8 +129,7 @@ public final strictfp class TreeTableFor
final String text = format.format(processing.asTreeTable());
assertMultilinesEquals(
"Processing\n" +
- " ├─Documentation (1 of 3)\n" +
- " │ ├─Title……………………………………………… Some specification\n" +
+ " ├─Documentation (1 of 3)…………… Some specification\n" +
" │ └─Presentation form……………… Document hardcopy\n" +
" ├─Documentation (2 of 3)\n" +
" │ └─Presentation form……………… Image hardcopy\n" +
Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java?rev=1793684&r1=1793683&r2=1793684&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java [UTF-8] Wed May 3 17:41:30 2017
@@ -82,8 +82,8 @@ public final strictfp class TreeTableVie
@Test
public void testToString() {
final TreeTableView metadata = create(ValueExistencePolicy.NON_EMPTY);
- assertMultilinesEquals(EXPECTED, formatNameAndValue(metadata)); // Locale-independent
- assertArrayEquals(toTreeStructure(EXPECTED), toTreeStructure(metadata.toString())); // Locale-dependent.
+ assertMultilinesEquals(EXPECTED, formatNameAndValue(metadata)); // Locale-independent
+ assertArrayEquals(toTreeStructure(EXPECTED), toTreeStructure(metadata.toString())); // Locale-dependent.
}
/**
Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentificationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentificationTest.java?rev=1793684&r1=1793683&r2=1793684&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentificationTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentificationTest.java [UTF-8] Wed May 3 17:41:30 2017
@@ -135,27 +135,22 @@ public final strictfp class DefaultDataI
public void testToString() {
assertMultilinesEquals(
"Data identification\n" +
- " ├─Citation\n" +
- " │ ├─Title……………………………………………………… Sea Surface Temperature Analysis Model\n" +
- " │ ├─Date\n" +
- " │ │ ├─Date……………………………………………… 2005-09-22 00:00:00\n" +
+ " ├─Citation………………………………………………………… Sea Surface Temperature Analysis Model\n" +
+ " │ ├─Date………………………………………………………… 2005-09-22 00:00:00\n" +
" │ │ └─Date type………………………………… Creation\n" +
- " │ └─Identifier\n" +
- " │ └─Code……………………………………………… SST_Global.nc\n" +
+ " │ └─Identifier………………………………………… SST_Global.nc\n" +
" ├─Abstract………………………………………………………… NCEP SST Global 5.0 x 2.5 degree model data\n" +
" ├─Descriptive keywords\n" +
" │ ├─Keyword………………………………………………… EARTH SCIENCE > Oceans > Ocean Temperature > Sea Surface Temperature\n" +
" │ ├─Type………………………………………………………… Theme\n" +
- " │ └─Thesaurus name\n" +
- " │ └─Title…………………………………………… GCMD Science Keywords\n" +
+ " │ └─Thesaurus name……………………………… GCMD Science Keywords\n" +
" ├─Resource constraints\n" +
" │ └─Use limitation……………………………… Freely available\n" +
" ├─Spatial representation type……… Grid\n" +
" ├─Language (1 of 2)………………………………… en_US\n" +
" ├─Language (2 of 2)………………………………… en\n" +
" ├─Character set…………………………………………… US-ASCII\n" +
- " └─Extent\n" +
- " ├─Description……………………………………… World\n" +
+ " └─Extent……………………………………………………………… World\n" +
" └─Geographic element\n" +
" ├─West bound longitude…… 180°W\n" +
" ├─East bound longitude…… 180°E\n" +
Modified: sis/branches/JDK8/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java?rev=1793684&r1=1793683&r2=1793684&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java [UTF-8] Wed May 3 17:41:30 2017
@@ -118,11 +118,9 @@ public class LandsatReaderTest extends T
+ " ├─Reference system info………………………………………………………… EPSG:WGS 84 / UTM zone 49N\n"
+ " ├─Identification info\n"
+ " │ ├─Citation\n"
- + " │ │ ├─Date\n"
- + " │ │ │ ├─Date……………………………………………………………………… 2016-06-27 16:48:12\n"
+ + " │ │ ├─Date………………………………………………………………………………… 2016-06-27 16:48:12\n"
+ " │ │ │ └─Date type………………………………………………………… Creation\n"
- + " │ │ └─Identifier\n"
- + " │ │ └─Code……………………………………………………………………… LandsatTest\n"
+ + " │ │ └─Identifier………………………………………………………………… LandsatTest\n"
+ " │ ├─Credit……………………………………………………………………………………… Derived from U.S. Geological Survey data\n"
+ " │ ├─Resource format\n"
+ " │ │ └─Format specification citation\n"
@@ -154,8 +152,7 @@ public class LandsatReaderTest extends T
+ " │ │ │ ├─Transfer function type……………………… Linear\n"
+ " │ │ │ ├─Bound units…………………………………………………… nm\n"
+ " │ │ │ ├─Description…………………………………………………… Coastal Aerosol\n"
- + " │ │ │ └─Name\n"
- + " │ │ │ └─Code…………………………………………………………… TestImage_B1.TIF\n"
+ + " │ │ │ └─Name……………………………………………………………………… TestImage_B1.TIF\n"
+ " │ │ ├─Attribute (2 of 8)\n"
+ " │ │ │ ├─Max value………………………………………………………… 65535.0\n"
+ " │ │ │ ├─Min value………………………………………………………… 1.0\n"
@@ -165,8 +162,7 @@ public class LandsatReaderTest extends T
+ " │ │ │ ├─Transfer function type……………………… Linear\n"
+ " │ │ │ ├─Bound units…………………………………………………… nm\n"
+ " │ │ │ ├─Description…………………………………………………… Blue\n"
- + " │ │ │ └─Name\n"
- + " │ │ │ └─Code…………………………………………………………… TestImage_B2.TIF\n"
+ + " │ │ │ └─Name……………………………………………………………………… TestImage_B2.TIF\n"
+ " │ │ ├─Attribute (3 of 8)\n"
+ " │ │ │ ├─Max value………………………………………………………… 65535.0\n"
+ " │ │ │ ├─Min value………………………………………………………… 1.0\n"
@@ -176,8 +172,7 @@ public class LandsatReaderTest extends T
+ " │ │ │ ├─Transfer function type……………………… Linear\n"
+ " │ │ │ ├─Bound units…………………………………………………… nm\n"
+ " │ │ │ ├─Description…………………………………………………… Green\n"
- + " │ │ │ └─Name\n"
- + " │ │ │ └─Code…………………………………………………………… TestImage_B3.TIF\n"
+ + " │ │ │ └─Name……………………………………………………………………… TestImage_B3.TIF\n"
+ " │ │ ├─Attribute (4 of 8)\n"
+ " │ │ │ ├─Max value………………………………………………………… 65535.0\n"
+ " │ │ │ ├─Min value………………………………………………………… 1.0\n"
@@ -187,8 +182,7 @@ public class LandsatReaderTest extends T
+ " │ │ │ ├─Transfer function type……………………… Linear\n"
+ " │ │ │ ├─Bound units…………………………………………………… nm\n"
+ " │ │ │ ├─Description…………………………………………………… Red\n"
- + " │ │ │ └─Name\n"
- + " │ │ │ └─Code…………………………………………………………… TestImage_B4.TIF\n"
+ + " │ │ │ └─Name……………………………………………………………………… TestImage_B4.TIF\n"
+ " │ │ ├─Attribute (5 of 8)\n"
+ " │ │ │ ├─Max value………………………………………………………… 65535.0\n"
+ " │ │ │ ├─Min value………………………………………………………… 1.0\n"
@@ -198,8 +192,7 @@ public class LandsatReaderTest extends T
+ " │ │ │ ├─Transfer function type……………………… Linear\n"
+ " │ │ │ ├─Bound units…………………………………………………… nm\n"
+ " │ │ │ ├─Description…………………………………………………… Near-Infrared\n"
- + " │ │ │ └─Name\n"
- + " │ │ │ └─Code…………………………………………………………… TestImage_B5.TIF\n"
+ + " │ │ │ └─Name……………………………………………………………………… TestImage_B5.TIF\n"
+ " │ │ ├─Attribute (6 of 8)\n"
+ " │ │ │ ├─Max value………………………………………………………… 65535.0\n"
+ " │ │ │ ├─Min value………………………………………………………… 1.0\n"
@@ -209,8 +202,7 @@ public class LandsatReaderTest extends T
+ " │ │ │ ├─Transfer function type……………………… Linear\n"
+ " │ │ │ ├─Bound units…………………………………………………… nm\n"
+ " │ │ │ ├─Description…………………………………………………… Short Wavelength Infrared (SWIR) 1\n"
- + " │ │ │ └─Name\n"
- + " │ │ │ └─Code…………………………………………………………… TestImage_B6.TIF\n"
+ + " │ │ │ └─Name……………………………………………………………………… TestImage_B6.TIF\n"
+ " │ │ ├─Attribute (7 of 8)\n"
+ " │ │ │ ├─Max value………………………………………………………… 65535.0\n"
+ " │ │ │ ├─Min value………………………………………………………… 1.0\n"
@@ -220,8 +212,7 @@ public class LandsatReaderTest extends T
+ " │ │ │ ├─Transfer function type……………………… Linear\n"
+ " │ │ │ ├─Bound units…………………………………………………… nm\n"
+ " │ │ │ ├─Description…………………………………………………… Short Wavelength Infrared (SWIR) 2\n"
- + " │ │ │ └─Name\n"
- + " │ │ │ └─Code…………………………………………………………… TestImage_B7.TIF\n"
+ + " │ │ │ └─Name……………………………………………………………………… TestImage_B7.TIF\n"
+ " │ │ └─Attribute (8 of 8)\n"
+ " │ │ ├─Max value………………………………………………………… 65535.0\n"
+ " │ │ ├─Min value………………………………………………………… 1.0\n"
@@ -231,8 +222,7 @@ public class LandsatReaderTest extends T
+ " │ │ ├─Transfer function type……………………… Linear\n"
+ " │ │ ├─Bound units…………………………………………………… nm\n"
+ " │ │ ├─Description…………………………………………………… Cirrus\n"
- + " │ │ └─Name\n"
- + " │ │ └─Code…………………………………………………………… TestImage_B9.TIF\n"
+ + " │ │ └─Name……………………………………………………………………… TestImage_B9.TIF\n"
+ " │ ├─Attribute group (2 of 3)\n"
+ " │ │ ├─Content type…………………………………………………………… Physical measurement\n"
+ " │ │ └─Attribute\n"
@@ -244,8 +234,7 @@ public class LandsatReaderTest extends T
+ " │ │ ├─Transfer function type……………………… Linear\n"
+ " │ │ ├─Bound units…………………………………………………… nm\n"
+ " │ │ ├─Description…………………………………………………… Panchromatic\n"
- + " │ │ └─Name\n"
- + " │ │ └─Code…………………………………………………………… TestImage_B8.TIF\n"
+ + " │ │ └─Name……………………………………………………………………… TestImage_B8.TIF\n"
+ " │ └─Attribute group (3 of 3)\n"
+ " │ ├─Content type…………………………………………………………… Physical measurement\n"
+ " │ ├─Attribute (1 of 2)\n"
@@ -257,8 +246,7 @@ public class LandsatReaderTest extends T
+ " │ │ ├─Transfer function type……………………… Linear\n"
+ " │ │ ├─Bound units…………………………………………………… nm\n"
+ " │ │ ├─Description…………………………………………………… Thermal Infrared Sensor (TIRS) 1\n"
- + " │ │ └─Name\n"
- + " │ │ └─Code…………………………………………………………… TestImage_B10.TIF\n"
+ + " │ │ └─Name……………………………………………………………………… TestImage_B10.TIF\n"
+ " │ └─Attribute (2 of 2)\n"
+ " │ ├─Max value………………………………………………………… 65535.0\n"
+ " │ ├─Min value………………………………………………………… 1.0\n"
@@ -268,12 +256,10 @@ public class LandsatReaderTest extends T
+ " │ ├─Transfer function type……………………… Linear\n"
+ " │ ├─Bound units…………………………………………………… nm\n"
+ " │ ├─Description…………………………………………………… Thermal Infrared Sensor (TIRS) 2\n"
- + " │ └─Name\n"
- + " │ └─Code…………………………………………………………… TestImage_B11.TIF\n"
+ + " │ └─Name……………………………………………………………………… TestImage_B11.TIF\n"
+ " ├─Acquisition information\n"
+ " │ ├─Acquisition requirement\n"
- + " │ │ └─Identifier\n"
- + " │ │ └─Code……………………………………………………………………… Software unit tests\n"
+ + " │ │ └─Identifier………………………………………………………………… Software unit tests\n"
+ " │ ├─Operation\n"
+ " │ │ ├─Status…………………………………………………………………………… Completed\n"
+ " │ │ ├─Type………………………………………………………………………………… Real\n"
@@ -281,23 +267,18 @@ public class LandsatReaderTest extends T
+ " │ │ ├─Context……………………………………………………………… Acquisition\n"
+ " │ │ └─Time……………………………………………………………………… 2016-06-26 03:02:01\n"
+ " │ └─Platform\n"
- + " │ ├─Identifier\n"
- + " │ │ └─Code……………………………………………………………………… Pseudo LANDSAT\n"
+ + " │ ├─Identifier………………………………………………………………… Pseudo LANDSAT\n"
+ " │ └─Instrument\n"
- + " │ └─Identifier\n"
- + " │ └─Code…………………………………………………………… Pseudo TIRS\n"
- + " ├─Date info\n"
- + " │ ├─Date…………………………………………………………………………………………… 2016-06-27 16:48:12\n"
+ + " │ └─Identifier……………………………………………………… Pseudo TIRS\n"
+ + " ├─Date info………………………………………………………………………………………… 2016-06-27 16:48:12\n"
+ " │ └─Date type……………………………………………………………………………… Creation\n"
+ " ├─Metadata scope\n"
+ " │ └─Resource scope………………………………………………………………… Coverage\n"
- + " ├─Metadata identifier\n"
- + " │ └─Code…………………………………………………………………………………………… LandsatTest\n"
+ + " ├─Metadata identifier……………………………………………………………… LandsatTest\n"
+ " ├─Metadata standard (1 of 2)\n"
+ " │ ├─Title………………………………………………………………………………………… Geographic Information — Metadata Part 1: Fundamentals\n"
+ " │ ├─Edition…………………………………………………………………………………… ISO 19115-1:2014(E)\n"
- + " │ ├─Identifier\n"
- + " │ │ ├─Code………………………………………………………………………………… 19115-1\n"
+ + " │ ├─Identifier…………………………………………………………………………… 19115-1\n"
+ " │ │ ├─Code space………………………………………………………………… ISO\n"
+ " │ │ └─Version………………………………………………………………………… 2014(E)\n"
+ " │ ├─Cited responsible party\n"
@@ -308,8 +289,7 @@ public class LandsatReaderTest extends T
+ " └─Metadata standard (2 of 2)\n"
+ " ├─Title………………………………………………………………………………………… Geographic Information — Metadata Part 2: Extensions for imagery and gridded data\n"
+ " ├─Edition…………………………………………………………………………………… ISO 19115-2:2009(E)\n"
- + " ├─Identifier\n"
- + " │ ├─Code………………………………………………………………………………… 19115-2\n"
+ + " ├─Identifier…………………………………………………………………………… 19115-2\n"
+ " │ ├─Code space………………………………………………………………… ISO\n"
+ " │ └─Version………………………………………………………………………… 2009(E)\n"
+ " ├─Cited responsible party\n"
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=1793684&r1=1793683&r2=1793684&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] Wed May 3 17:41:30 2017
@@ -104,15 +104,11 @@ public final strictfp class MetadataRead
" │ ├─Cell geometry…………………………………………………………………… Area\n" +
" │ └─Transformation parameter availability…… false\n" +
" ├─Identification info\n" +
- " │ ├─Citation\n" +
- " │ │ ├─Title……………………………………………………………………………… Sea Surface Temperature Analysis Model\n" +
- " │ │ ├─Date\n" +
- " │ │ │ ├─Date……………………………………………………………………… 2005-09-22 00:00:00\n" +
+ " │ ├─Citation………………………………………………………………………………… Sea Surface Temperature Analysis Model\n" +
+ " │ │ ├─Date………………………………………………………………………………… 2005-09-22 00:00:00\n" +
" │ │ │ └─Date type………………………………………………………… Creation\n" +
- " │ │ ├─Identifier\n" +
- " │ │ │ ├─Authority\n" +
- " │ │ │ │ └─Title………………………………………………………… edu.ucar.unidata\n" +
- " │ │ │ └─Code……………………………………………………………………… NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc\n" +
+ " │ │ ├─Identifier………………………………………………………………… NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc\n" +
+ " │ │ │ └─Authority………………………………………………………… edu.ucar.unidata\n" +
" │ │ └─Cited responsible party\n" +
" │ │ ├─Individual\n" + // TODO: actually we can not distinguish individual from organization.
" │ │ │ └─Name…………………………………………………………… NOAA/NWS/NCEP\n" +
@@ -125,8 +121,7 @@ public final strictfp class MetadataRead
" │ ├─Descriptive keywords\n" +
" │ │ ├─Keyword………………………………………………………………………… EARTH SCIENCE > Oceans > Ocean Temperature > Sea Surface Temperature\n" +
" │ │ ├─Type………………………………………………………………………………… Theme\n" +
- " │ │ └─Thesaurus name\n" +
- " │ │ └─Title…………………………………………………………………… GCMD Science Keywords\n" +
+ " │ │ └─Thesaurus name……………………………………………………… GCMD Science Keywords\n" +
" │ ├─Resource constraints\n" +
" │ │ └─Use limitation……………………………………………………… Freely available\n" +
" │ ├─Spatial representation type……………………………… Grid\n" +
@@ -152,15 +147,12 @@ public final strictfp class MetadataRead
" 2005-09-26T21:50:00 - edavis - add attributes for dataset discovery\n" +
" ├─Metadata scope\n" +
" │ └─Resource scope………………………………………………………………… Dataset\n" +
- " ├─Metadata identifier\n" +
- " │ ├─Authority\n" +
- " │ │ └─Title……………………………………………………………………………… edu.ucar.unidata\n" +
- " │ └─Code…………………………………………………………………………………………… NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc\n" +
+ " ├─Metadata identifier……………………………………………………………… NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc\n" +
+ " │ └─Authority……………………………………………………………………………… edu.ucar.unidata\n" +
" ├─Metadata standard (1 of 2)\n" +
" │ ├─Title………………………………………………………………………………………… Geographic Information — Metadata Part 1: Fundamentals\n" +
" │ ├─Edition…………………………………………………………………………………… ISO 19115-1:2014(E)\n" +
- " │ ├─Identifier\n" +
- " │ │ ├─Code………………………………………………………………………………… 19115-1\n" +
+ " │ ├─Identifier…………………………………………………………………………… 19115-1\n" +
" │ │ ├─Code space………………………………………………………………… ISO\n" +
" │ │ └─Version………………………………………………………………………… 2014(E)\n" +
" │ ├─Cited responsible party\n" +
@@ -171,8 +163,7 @@ public final strictfp class MetadataRead
" └─Metadata standard (2 of 2)\n" +
" ├─Title………………………………………………………………………………………… Geographic Information — Metadata Part 2: Extensions for imagery and gridded data\n" +
" ├─Edition…………………………………………………………………………………… ISO 19115-2:2009(E)\n" +
- " ├─Identifier\n" +
- " │ ├─Code………………………………………………………………………………… 19115-2\n" +
+ " ├─Identifier…………………………………………………………………………… 19115-2\n" +
" │ ├─Code space………………………………………………………………… ISO\n" +
" │ └─Version………………………………………………………………………… 2009(E)\n" +
" ├─Cited responsible party\n" +