You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2013/05/03 22:30:30 UTC
svn commit: r1478961 - in /sis/branches/JDK7/sis-metadata/src:
main/java/org/apache/sis/metadata/ test/java/org/apache/sis/metadata/
test/java/org/apache/sis/test/suite/
Author: desruisseaux
Date: Fri May 3 20:30:29 2013
New Revision: 1478961
URL: http://svn.apache.org/r1478961
Log:
Renamed the tree-table package-private classes:
- Remove the "Metadata" prefix, which is redundant with the package name.
- The "TreeChildren" name was problematic since they are node children, not children of the whole tree.
- Emphase that the TreeTable is a view.
Added:
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java
- copied, changed from r1478864, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeNode.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java
- copied, changed from r1478864, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeChildren.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeTableView.java
- copied, changed from r1478864, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeTable.java
sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java
- copied, changed from r1478864, sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeChildrenTest.java
sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
- copied, changed from r1478864, sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeNodeTest.java
sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
- copied, changed from r1478864, sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeTableTest.java
Removed:
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeChildren.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeNode.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeTable.java
sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeChildrenTest.java
sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeNodeTest.java
sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeTableTest.java
Modified:
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java
sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ValueExistencePolicy.java
sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java?rev=1478961&r1=1478960&r2=1478961&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java [UTF-8] Fri May 3 20:30:29 2013
@@ -638,7 +638,7 @@ public class MetadataStandard implements
{
ensureNonNull("metadata", metadata);
ensureNonNull("valuePolicy", valuePolicy);
- return new MetadataTreeTable(this, metadata, valuePolicy);
+ return new TreeTableView(this, metadata, valuePolicy);
}
/**
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java?rev=1478961&r1=1478960&r2=1478961&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java [UTF-8] Fri May 3 20:30:29 2013
@@ -41,9 +41,6 @@ import org.opengis.annotation.Obligation
* fallbacks on alphabetical order.</li>
* </ol>
*
- * The first criterion (mandatory methods first) is necessary for reducing the risk
- * of ambiguity in the {@link MetadataTreeTable#parse} method.
- *
* @author Martin Desruisseaux (Geomatys)
* @since 0.3 (derived from geotk-2.4)
* @version 0.3
Copied: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java (from r1478864, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeNode.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java?p2=sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java&p1=sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeNode.java&r1=1478864&r2=1478961&rev=1478961&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeNode.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java [UTF-8] Fri May 3 20:30:29 2013
@@ -37,13 +37,13 @@ import org.apache.sis.util.resources.Voc
/**
- * A node in a {@link MetadataTreeTable} view. The {@code MetadataTreeTable} class is used directly
+ * A node in a {@link TreeTableView} view. The {@code TreeTableView} class is used directly
* only for the root node, or for nodes containing a fixed value instead than a value fetched from
* the metadata object. For all other nodes, the actual node class shall be either {@link Element}
* or {@link CollectionElement}.
*
* <p>The value of a node is extracted from the {@linkplain #metadata} object by {@link #getUserObject()}.
- * For each instance of {@code MetadataTreeTable}, that value is always a singleton, never a collection.
+ * For each instance of {@code TreeTableView}, that value is always a singleton, never a collection.
* If a metadata property is a collection, then there is an instance of the {@link CollectionElement}
* subclass for each element in the collection.</p>
*
@@ -56,7 +56,7 @@ import org.apache.sis.util.resources.Voc
* @version 0.3
* @module
*/
-class MetadataTreeNode implements Node, Serializable {
+class TreeNode implements Node, Serializable {
/**
* For cross-version compatibility.
*/
@@ -66,7 +66,7 @@ class MetadataTreeNode implements Node,
* The collection of {@linkplain #children} to return when the node does not allow children
* (i.e. is a leaf). This constant is also used as a sentinel value by {@link #isLeaf()}.
*
- * <p>We choose an empty set instead than an empty list because {@link MetadataTreeChildren}
+ * <p>We choose an empty set instead than an empty list because {@link TreeNodeChildren}
* does not implement the {@link List} interface. So we are better to never give to the user
* a collection implementing {@code List} in order to signal incorrect casts sooner.</p>
*/
@@ -86,10 +86,10 @@ class MetadataTreeNode implements Node,
* The table for which this node is an element. Contains information like
* the metadata standard and the value existence policy.
*
- * <p>All {@code MetadataTreeNode} instances in the same tree have
- * a reference to the same {@code MetadataTreeTable} instance.</p>
+ * <p>All {@code TreeNode} instances in the same tree have
+ * a reference to the same {@code TreeTableView} instance.</p>
*/
- final MetadataTreeTable table;
+ final TreeTableView table;
/**
* The parent of this node to be returned by {@link #getParent()},
@@ -97,14 +97,14 @@ class MetadataTreeNode implements Node,
*
* @see #getParent()
*/
- private final MetadataTreeNode parent;
+ private final TreeNode parent;
/**
* The metadata object from which the {@link #getUserObject()} method will fetch the value.
- * The value is fetched in different ways, which depend on the {@code MetadataTreeNode} subclass:
+ * The value is fetched in different ways, which depend on the {@code TreeNode} subclass:
*
* <ul>
- * <li>For {@code MetadataTreeNode} (the root of the tree),
+ * <li>For {@code TreeNode} (the root of the tree),
* the value is directly {@link #metadata}.</li>
* <li>For {@link Element} (a metadata property which is not a collection),
* the value is {@code accessor.get(indexInData, metadata)}.</li>
@@ -140,7 +140,7 @@ class MetadataTreeNode implements Node,
* @param table The table which is creating this root node.
* @param metadata The root metadata object (can not be null).
*/
- MetadataTreeNode(final MetadataTreeTable table, final Object metadata) {
+ TreeNode(final TreeTableView table, final Object metadata) {
this.table = table;
this.parent = null;
this.metadata = metadata;
@@ -153,7 +153,7 @@ class MetadataTreeNode implements Node,
* @param parent The parent of this node.
* @param metadata The metadata object for which this node will be a value.
*/
- MetadataTreeNode(final MetadataTreeNode parent, final Object metadata) {
+ TreeNode(final TreeNode parent, final Object metadata) {
this.table = parent.table;
this.parent = parent;
this.metadata = metadata;
@@ -230,13 +230,13 @@ class MetadataTreeNode implements Node,
* A node for a metadata property value. This class does not store the property value directly.
* Instead, is stores a reference to the metadata object that contains the property values,
* together with the index for fetching the value in that object. That way, the real storage
- * objects still the metadata object, which allow {@link MetadataTreeTable} to be a dynamic view.
+ * objects still the metadata object, which allow {@link TreeTableView} to be a dynamic view.
*
* <p>Instances of this class shall be instantiated only for metadata singletons. If a metadata
* property is a collection, then the {@link CollectionElement} subclass shall be instantiated
* instead.</p>
*/
- static class Element extends MetadataTreeNode {
+ static class Element extends TreeNode {
/**
* For cross-version compatibility.
*/
@@ -263,7 +263,7 @@ class MetadataTreeNode implements Node,
* @param accessor Accessor to use for fetching the name, type and value.
* @param indexInData Index to be given to the accessor of fetching the value.
*/
- Element(final MetadataTreeNode parent, final Object metadata,
+ Element(final TreeNode parent, final Object metadata,
final PropertyAccessor accessor, final int indexInData)
{
super(parent, metadata);
@@ -358,7 +358,7 @@ class MetadataTreeNode implements Node,
* @param indexInData Index to be given to the accessor of fetching the collection.
* @param indexInList Index of the element in the collection, in iteration order.
*/
- CollectionElement(final MetadataTreeNode parent, final Object metadata,
+ CollectionElement(final TreeNode parent, final Object metadata,
final PropertyAccessor accessor, final int indexInData, final int indexInList)
{
super(parent, metadata, accessor, indexInData);
@@ -418,9 +418,8 @@ class MetadataTreeNode implements Node,
} catch (NullPointerException | IndexOutOfBoundsException | NoSuchElementException e) {
/*
* May happen if the collection for this metadata property changed after the iteration
- * in the MetadataTreeChildren. Users should not keep MetadataTreeNode references
- * instances for a long time, but instead iterate again over MetadataTreeChildren
- * when needed.
+ * in the TreeNodeChildren. Users should not keep TreeNode references instances for a
+ * long time, but instead iterate again over TreeNodeChildren when needed.
*/
throw new ConcurrentModificationException(e);
}
@@ -517,8 +516,8 @@ class MetadataTreeNode implements Node,
/*
* If there is a value, check if the cached collection is still applicable.
*/
- if (children instanceof MetadataTreeChildren) {
- final MetadataTreeChildren candidate = (MetadataTreeChildren) children;
+ if (children instanceof TreeNodeChildren) {
+ final TreeNodeChildren candidate = (TreeNodeChildren) children;
if (candidate.metadata == value) {
return candidate;
}
@@ -527,7 +526,7 @@ class MetadataTreeNode implements Node,
* 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 MetadataTreeChildren(this, value, table.standard.getAccessor(value.getClass(), true));
+ children = new TreeNodeChildren(this, value, table.standard.getAccessor(value.getClass(), true));
}
return children;
}
@@ -559,7 +558,7 @@ class MetadataTreeNode implements Node,
}
/**
- * The proxy to be returned by {@link MetadataTreeNode#newChild()}.
+ * The proxy to be returned by {@link TreeNode#newChild()}.
* User shall not keep a reference to this proxy for a long time.
*/
private final class NewChild implements Node {
@@ -574,14 +573,14 @@ class MetadataTreeNode implements Node,
* The real node created after the identifier and the value have been specified.
* All operations will be delegated to that node after it has been determined.
*/
- private MetadataTreeNode delegate;
+ private TreeNode delegate;
/**
* Returns the {@link #delegate} node if non-null, or throw an exception otherwise.
*
* @throws IllegalStateException if the identifier and value columns have not yet been defined.
*/
- private MetadataTreeNode delegate() throws IllegalStateException {
+ private TreeNode delegate() throws IllegalStateException {
if (delegate != null) {
return delegate;
}
@@ -592,8 +591,8 @@ class MetadataTreeNode implements Node,
/**
* Returns all children of the parent node. The new child will be added to that list.
*/
- private MetadataTreeChildren getSiblings() {
- return (MetadataTreeChildren) MetadataTreeNode.this.getChildren();
+ private TreeNodeChildren getSiblings() {
+ return (TreeNodeChildren) TreeNode.this.getChildren();
}
/**
@@ -624,7 +623,7 @@ class MetadataTreeNode implements Node,
throw new IllegalStateException(Errors.format(Errors.Keys.MissingValueInColumn_1,
TableColumn.IDENTIFIER.getHeader()));
}
- final MetadataTreeChildren siblings = getSiblings();
+ final TreeNodeChildren siblings = getSiblings();
final int indexInList;
if (siblings.isCollection(indexInData)) {
indexInList = ((Collection<?>) siblings.valueAt(indexInData)).size();
@@ -647,7 +646,7 @@ class MetadataTreeNode implements Node,
*
* @throws IllegalStateException if the identifier and value columns have not yet been defined.
*/
- @Override public Node getParent() {return MetadataTreeNode.this;}
+ @Override public Node getParent() {return TreeNode.this;}
@Override public boolean isLeaf() {return delegate().isLeaf();}
@Override public Collection<Node> getChildren() {return delegate().getChildren();}
@Override public Node newChild() {return delegate().newChild();}
@@ -697,7 +696,7 @@ class MetadataTreeNode implements Node,
if (column == TableColumn.VALUE) {
ArgumentChecks.ensureNonNull("value", value);
setUserObject(value);
- } else if (MetadataTreeTable.COLUMNS.contains(column)) {
+ } else if (TreeTableView.COLUMNS.contains(column)) {
throw new UnsupportedOperationException(unmodifiableCellValue(column));
} else {
throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalArgumentValue_2, "column", column));
Copied: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java (from r1478864, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeChildren.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java?p2=sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java&p1=sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeChildren.java&r1=1478864&r2=1478961&rev=1478961&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeChildren.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java [UTF-8] Fri May 3 20:30:29 2013
@@ -28,9 +28,9 @@ import org.apache.sis.util.Debug;
/**
- * The collection of children to be returned by {@link MetadataTreeNode#getChildren()}.
- * This collection holds a reference to the metadata object at creation time; it does
- * not track changes in {@code parent.getUserObject()}.
+ * The collection of children to be returned by {@link TreeNode#getChildren()}.
+ * This collection holds a reference to the metadata object at creation time;
+ * it does not track changes in {@code parent.getUserObject()}.
*
* {@section Note on value existence policy}
* It is better to use this class with {@link ValueExistencePolicy#NON_EMPTY} in order
@@ -38,11 +38,11 @@ import org.apache.sis.util.Debug;
* If the policy is set to another value, we need to keep the following aspects in mind:
*
* <ul>
- * <li>When {@link Iter#hasNext()} finds a null or empty collection, it may needs to
- * simulate a singleton with a null value.</li>
- * <li>In {@link MetadataTreeNode#getUserObject()}, we need the same check than above
- * for simulating a singleton collection with a null value if the node is for the
- * element at index 0.</li>
+ * <li>When {@link Iter#hasNext()} finds a null or empty collection,
+ * it may needs to simulate a singleton with a null value.</li>
+ * <li>In {@link TreeNode#getUserObject()}, we need the same check than above
+ * for simulating a singleton collection with a null value if the node is
+ * for the element at index 0.</li>
* </ul>
*
* @author Martin Desruisseaux (Geomatys)
@@ -50,7 +50,7 @@ import org.apache.sis.util.Debug;
* @version 0.3
* @module
*/
-final class MetadataTreeChildren extends AbstractCollection<TreeTable.Node> {
+final class TreeNodeChildren extends AbstractCollection<TreeTable.Node> {
/**
* The parent of the children to be returned by the iterator.
* Some useful information are available indirectly through this parent:
@@ -61,14 +61,14 @@ final class MetadataTreeChildren extends
*
* @see #childAt(int)
*/
- private final MetadataTreeNode parent;
+ private final TreeNode parent;
/**
* The metadata object for which property values will be the elements of this collection.
* This is typically an {@link AbstractMetadata} instance, but not necessarily.
* Any type for which {@link MetadataStandard#isMetadata(Class)} returns {@code true} is okay.
*
- * <p>This field is a snapshot of the {@linkplain #parent} {@link MetadataTreeNode#getUserObject()} at
+ * <p>This field is a snapshot of the {@linkplain #parent} {@link TreeNode#getUserObject()} at
* creation time. This collection does not track changes in the reference returned by the above-cited
* {@code getUserObject()}. In other words, changes in the {@code metadata} object will be reflected
* in this collection, but if {@code parent.getUserObject()} returns a reference to another object,
@@ -94,7 +94,7 @@ final class MetadataTreeChildren extends
* <p>Not all elements in this array will be returned by the iterator.
* The value needs to be verified for the {@link ValueExistencePolicy}.</p>
*/
- private final MetadataTreeNode[] children;
+ private final TreeNode[] children;
/**
* Modification count, incremented when the content of this collection is modified. This check
@@ -110,11 +110,11 @@ final class MetadataTreeChildren extends
* @param metadata The metadata object for which property values will be the elements of this collection.
* @param accessor The accessor to use for accessing the property names, types and values of the metadata object.
*/
- MetadataTreeChildren(final MetadataTreeNode parent, final Object metadata, final PropertyAccessor accessor) {
+ TreeNodeChildren(final TreeNode parent, final Object metadata, final PropertyAccessor accessor) {
this.parent = parent;
this.metadata = metadata;
this.accessor = accessor;
- children = new MetadataTreeNode[accessor.count()];
+ children = new TreeNode[accessor.count()];
}
/**
@@ -188,16 +188,16 @@ final class MetadataTreeChildren extends
* collection (<em>not</em> the index in <em>this</em> collection). Otherwise -1.
* @return The node to be returned by public API.
*/
- final MetadataTreeNode childAt(final int index, final int subIndex) {
- MetadataTreeNode node = children[index];
+ final TreeNode childAt(final int index, final int subIndex) {
+ TreeNode node = children[index];
if (subIndex >= 0) {
/*
* If the value is an element of a collection, we will cache only the last used value.
* We don't cache all elements in order to avoid yet more complex code, and this cover
* the majority of cases where the collection has only one element anyway.
*/
- if (node == null || ((MetadataTreeNode.CollectionElement) node).indexInList != subIndex) {
- node = new MetadataTreeNode.CollectionElement(parent, metadata, accessor, index, subIndex);
+ if (node == null || ((TreeNode.CollectionElement) node).indexInList != subIndex) {
+ node = new TreeNode.CollectionElement(parent, metadata, accessor, index, subIndex);
}
} else {
/*
@@ -206,7 +206,7 @@ final class MetadataTreeChildren extends
* the node to reflect changes in the metadata object, and conversely.
*/
if (node == null) {
- node = new MetadataTreeNode.Element(parent, metadata, accessor, index);
+ node = new TreeNode.Element(parent, metadata, accessor, index);
}
}
children[index] = node;
@@ -261,7 +261,7 @@ final class MetadataTreeChildren extends
}
/**
- * The iterator over the elements in the enclosing {@link MetadataTreeChildren} collection.
+ * The iterator over the elements in the enclosing {@link TreeNodeChildren} collection.
* Each element is identified by its index in the {@link PropertyAccessor}, together with
* its position in its sub-iterator when the metadata property is a collection.
*
@@ -278,14 +278,14 @@ final class MetadataTreeChildren extends
*/
private final class Iter implements Iterator<TreeTable.Node> {
/**
- * Index in {@link MetadataTreeChildren#accessor} of the next element to be
- * returned by {@link #next()}, or {@link PropertyAccessor#count()} if we
- * have reached the end of the list.
+ * Index in {@link TreeNodeChildren#accessor} of the next element to be
+ * returned by {@link #next()}, or {@link PropertyAccessor#count()} if
+ * we have reached the end of the list.
*/
private int nextInAccessor;
/**
- * Index in {@link MetadataTreeChildren#accessor} of the element returned by
+ * Index in {@link TreeNodeChildren#accessor} of the element returned by
* the last call to {@link #next()}, or -1 if none.
*/
private int previousInAccessor = -1;
@@ -324,7 +324,7 @@ final class MetadataTreeChildren extends
private int subIndex = -1;
/**
- * The value of {@link MetadataTreeChildren#modCount} at construction time or after
+ * The value of {@link TreeNodeChildren#modCount} at construction time or after
* the last change done by this iterator. Used for concurrent modification checks.
*
* {@note Actually this iterator should be robust to most concurrent modifications.
@@ -425,7 +425,7 @@ final class MetadataTreeChildren extends
@Override
public TreeTable.Node next() {
if (hasNext()) {
- final MetadataTreeNode node = childAt(nextInAccessor, subIndex);
+ final TreeNode node = childAt(nextInAccessor, subIndex);
previousInAccessor = nextInAccessor;
if (subIterator == null) {
/*
@@ -496,7 +496,7 @@ final class MetadataTreeChildren extends
}
/**
- * Implementation of {@link #add(TreeTable.Node)}, also invoked by {@link MetadataTreeNode.NewChild}.
+ * Implementation of {@link #add(TreeTable.Node)}, also invoked by {@link TreeNode.NewChild}.
* This method will attempt to convert the given {@code value} to the expected type.
*
* @param index The index in the accessor (<em>not</em> the index in this collection).
@@ -533,7 +533,7 @@ final class MetadataTreeChildren extends
buffer.append(lineSeparator);
for (final TreeTable.Node node : this) {
buffer.append(" ");
- ((MetadataTreeNode) node).toString(buffer);
+ ((TreeNode) node).toString(buffer);
buffer.append(lineSeparator);
}
return buffer.toString();
Copied: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeTableView.java (from r1478864, sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeTable.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeTableView.java?p2=sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeTableView.java&p1=sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeTable.java&r1=1478864&r2=1478961&rev=1478961&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataTreeTable.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/TreeTableView.java [UTF-8] Fri May 3 20:30:29 2013
@@ -41,7 +41,7 @@ import org.apache.sis.internal.util.Unmo
* @version 0.3
* @module
*/
-final class MetadataTreeTable implements TreeTable, Serializable {
+final class TreeTableView implements TreeTable, Serializable {
/**
* For cross-version compatibility.
*/
@@ -85,10 +85,10 @@ final class MetadataTreeTable implements
* @param metadata The metadata object to wrap.
* @param valuePolicy The behavior of this map toward null or empty values.
*/
- MetadataTreeTable(final MetadataStandard standard, final Object metadata, final ValueExistencePolicy valuePolicy) {
+ TreeTableView(final MetadataStandard standard, final Object metadata, final ValueExistencePolicy valuePolicy) {
this.standard = standard;
this.valuePolicy = valuePolicy;
- this.root = new MetadataTreeNode(this, metadata);
+ this.root = new TreeNode(this, metadata);
}
/**
@@ -118,7 +118,7 @@ final class MetadataTreeTable implements
*/
@Override
public String toString() {
- synchronized (MetadataTreeTable.class) {
+ synchronized (TreeTableView.class) {
if (format == null) {
final TreeTableFormat f = new TreeTableFormat(null, null);
f.setColumns(TableColumn.NAME, TableColumn.VALUE);
Modified: sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ValueExistencePolicy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ValueExistencePolicy.java?rev=1478961&r1=1478960&r2=1478961&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ValueExistencePolicy.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/main/java/org/apache/sis/metadata/ValueExistencePolicy.java [UTF-8] Fri May 3 20:30:29 2013
@@ -47,7 +47,7 @@ public enum ValueExistencePolicy {
}
/** Substitutes null or empty collections by a null singleton element
- in order to make the property visible in {@link MetadataTreeNode}. */
+ in order to make the property visible in {@link TreeNode}. */
@Override boolean substituteByNullElement(final Collection<?> values) {
return (values == null) || values.isEmpty();
}
@@ -101,12 +101,12 @@ public enum ValueExistencePolicy {
abstract boolean isSkipped(Object value);
/**
- * Returns {@code true} if {@link MetadataTreeNode} shall substitute the given collection by
+ * Returns {@code true} if {@link TreeNode} shall substitute the given collection by
* a singleton containing only a null element.
*
* <p><b>Purpose:</b>
* When a collection is null or empty, while not excluded according this {@code ValueExistencePolicy},
- * we need an empty space for making the metadata property visible in {@code MetadataTreeNode}.</p>
+ * we need an empty space for making the metadata property visible in {@code TreeNode}.</p>
*/
abstract boolean substituteByNullElement(Collection<?> values);
Copied: sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java (from r1478864, sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeChildrenTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java?p2=sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java&p1=sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeChildrenTest.java&r1=1478864&r2=1478961&rev=1478961&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeChildrenTest.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java [UTF-8] Fri May 3 20:30:29 2013
@@ -36,14 +36,14 @@ import static org.apache.sis.test.TestUt
/**
- * Tests the {@link MetadataTreeChildren} class.
+ * Tests the {@link TreeNodeChildren} class.
* Unless otherwise specified, all tests use the {@link MetadataStandard#ISO_19115} constant.
*
* {@section Test dependency}
- * This class uses the {@link MetadataTreeNode#getUserObject()} method for comparing the values.
- * We can hardly avoid to use some {@code MetadataTreeNode} methods because of the cross-dependencies.
- * However we try to use nothing else than {@code getUserObject()} because the purpose of this class
- * is not to test {@link MetadataTreeNode}.
+ * This class uses the {@link TreeNode#getUserObject()} method for comparing the values.
+ * We can hardly avoid to use some {@code TreeNode} methods because of the cross-dependencies.
+ * However we try to use nothing else than {@code getUserObject()} because the purpose of this
+ * class is not to test {@link TreeNode}.
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
@@ -51,7 +51,7 @@ import static org.apache.sis.test.TestUt
* @module
*/
@DependsOn(PropertyAccessorTest.class)
-public final strictfp class MetadataTreeChildrenTest extends TestCase {
+public final strictfp class TreeNodeChildrenTest extends TestCase {
/**
* Creates a shallow metadata object without collections.
*
@@ -114,12 +114,12 @@ public final strictfp class MetadataTree
/**
* Creates a collection to be tested for the given metadata object and value policy.
*/
- private static MetadataTreeChildren create(final AbstractMetadata metadata, final ValueExistencePolicy valuePolicy) {
- final MetadataStandard standard = MetadataStandard.ISO_19115;
- final MetadataTreeTable table = new MetadataTreeTable(standard, metadata, valuePolicy);
- final MetadataTreeNode node = (MetadataTreeNode) table.getRoot();
- final PropertyAccessor accessor = standard.getAccessor(metadata.getClass(), true);
- return new MetadataTreeChildren(node, metadata, accessor);
+ private static TreeNodeChildren create(final AbstractMetadata metadata, final ValueExistencePolicy valuePolicy) {
+ final MetadataStandard standard = MetadataStandard.ISO_19115;
+ final TreeTableView table = new TreeTableView(standard, metadata, valuePolicy);
+ final TreeNode node = (TreeNode) table.getRoot();
+ final PropertyAccessor accessor = standard.getAccessor(metadata.getClass(), true);
+ return new TreeNodeChildren(node, metadata, accessor);
}
/**
@@ -127,8 +127,8 @@ public final strictfp class MetadataTree
*/
@Test
public void testReadOnlyWithoutCollections() {
- final DefaultCitation citation = metadataWithoutCollections();
- final MetadataTreeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
+ final DefaultCitation citation = metadataWithoutCollections();
+ final TreeNodeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
final String[] expected = {
"Some title",
"Some edition",
@@ -146,8 +146,8 @@ public final strictfp class MetadataTree
@Test
@DependsOnMethod("testReadOnlyWithoutCollections")
public void testReadOnlyWithSingletonInCollections() {
- final DefaultCitation citation = metadataWithSingletonInCollections();
- final MetadataTreeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
+ final DefaultCitation citation = metadataWithSingletonInCollections();
+ final TreeNodeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
final String[] expected = {
"Some title",
"First alternate title",
@@ -167,8 +167,8 @@ public final strictfp class MetadataTree
@Test
@DependsOnMethod("testReadOnlyWithSingletonInCollections")
public void testReadOnlyWithMultiOccurrences() {
- final DefaultCitation citation = metadataWithMultiOccurrences();
- final MetadataTreeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
+ final DefaultCitation citation = metadataWithMultiOccurrences();
+ final TreeNodeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
final String[] expected = {
"Some title",
"First alternate title",
@@ -184,14 +184,14 @@ public final strictfp class MetadataTree
}
/**
- * Tests the {@link MetadataTreeChildren#add(TreeTable.Node)} method.
+ * Tests the {@link TreeNodeChildren#add(TreeTable.Node)} method.
*/
@Test
@DependsOnMethod("testReadOnlyWithMultiOccurrences")
public void testAdd() {
- final DefaultCitation citation = metadataWithMultiOccurrences();
- final MetadataTreeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
- final DefaultTreeTable.Node toAdd = new DefaultTreeTable.Node(new DefaultTreeTable(
+ final DefaultCitation citation = metadataWithMultiOccurrences();
+ final TreeNodeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
+ final DefaultTreeTable.Node toAdd = new DefaultTreeTable.Node(new DefaultTreeTable(
TableColumn.IDENTIFIER,
TableColumn.VALUE));
final String[] expected = {
@@ -238,8 +238,8 @@ public final strictfp class MetadataTree
@Test
@DependsOnMethod("testReadOnlyWithoutCollections")
public void testRemoveWithoutCollections() {
- final DefaultCitation citation = metadataWithoutCollections();
- final MetadataTreeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
+ final DefaultCitation citation = metadataWithoutCollections();
+ final TreeNodeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
testRemove(createRandomNumberGenerator("testRemoveWithoutCollections"), children);
}
@@ -253,8 +253,8 @@ public final strictfp class MetadataTree
"testReadOnlyWithSingletonInCollections"
})
public void testRemoveWithSingletonInCollections() {
- final DefaultCitation citation = metadataWithSingletonInCollections();
- final MetadataTreeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
+ final DefaultCitation citation = metadataWithSingletonInCollections();
+ final TreeNodeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
testRemove(createRandomNumberGenerator("testRemoveWithSingletonInCollections"), children);
}
@@ -268,18 +268,18 @@ public final strictfp class MetadataTree
"testReadOnlyWithMultiOccurrences"
})
public void testRemoveWithMultiOccurrences() {
- final DefaultCitation citation = metadataWithSingletonInCollections();
- final MetadataTreeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
+ final DefaultCitation citation = metadataWithSingletonInCollections();
+ final TreeNodeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
testRemove(createRandomNumberGenerator("testRemoveWithMultiOccurrences"), children);
}
/**
- * Tests the {@link MetadataTreeChildren#clear()} method.
+ * Tests the {@link TreeNodeChildren#clear()} method.
*/
@Test
public void testClear() {
- final DefaultCitation citation = metadataWithSingletonInCollections();
- final MetadataTreeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
+ final DefaultCitation citation = metadataWithSingletonInCollections();
+ final TreeNodeChildren children = create(citation, ValueExistencePolicy.NON_EMPTY);
assertFalse(children.isEmpty());
children.clear();
assertTrue(children.isEmpty());
@@ -293,8 +293,8 @@ public final strictfp class MetadataTree
@Test
@DependsOnMethod("testReadOnlyWithMultiOccurrences")
public void testShowAll() {
- final DefaultCitation citation = metadataWithMultiOccurrences();
- final MetadataTreeChildren children = create(citation, ValueExistencePolicy.ALL);
+ final DefaultCitation citation = metadataWithMultiOccurrences();
+ final TreeNodeChildren children = create(citation, ValueExistencePolicy.ALL);
final String[] expected = {
"Some title",
"First alternate title",
@@ -324,8 +324,8 @@ public final strictfp class MetadataTree
* Returns the string representation of the user object in the given node.
* This is the value that we are going compare in the assertion methods below.
*
- * <p>We use only {@link MetadataTreeNode#getUserObject()}, nothing else,
- * because the purpose of this class is not to test {@link MetadataTreeNode}.</p>
+ * <p>We use only {@link TreeNode#getUserObject()}, nothing else,
+ * because the purpose of this class is not to test {@link TreeNode}.</p>
*/
private static String valueOf(final TreeTable.Node node) {
final Object value = node.getUserObject();
@@ -367,7 +367,7 @@ public final strictfp class MetadataTree
* @param random A random number generator.
* @param children The collection from which to remove elements.
*/
- private static void testRemove(final Random random, final MetadataTreeChildren children) {
+ private static void testRemove(final Random random, final TreeNodeChildren children) {
final List<TreeTable.Node> reference = new ArrayList<>(children);
assertFalse("The collection shall not be initially empty.", reference.isEmpty());
do {
Copied: sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java (from r1478864, sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeNodeTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java?p2=sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java&p1=sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeNodeTest.java&r1=1478864&r2=1478961&rev=1478961&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeNodeTest.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java [UTF-8] Fri May 3 20:30:29 2013
@@ -40,7 +40,7 @@ import static org.junit.Assert.*;
/**
- * Tests the {@link MetadataTreeNode} class.
+ * Tests the {@link TreeNode} class.
* Unless otherwise specified, all tests use the {@link MetadataStandard#ISO_19115} constant.
*
* @author Martin Desruisseaux (Geomatys)
@@ -48,8 +48,8 @@ import static org.junit.Assert.*;
* @version 0.3
* @module
*/
-@DependsOn(MetadataTreeChildrenTest.class)
-public final strictfp class MetadataTreeNodeTest extends TestCase {
+@DependsOn(TreeNodeChildrenTest.class)
+public final strictfp class TreeNodeTest extends TestCase {
/**
* Creates a metadata hierarchy to be used for the tests.
* This method creates the following metadata:
@@ -75,7 +75,7 @@ public final strictfp class MetadataTree
* }
*/
static DefaultCitation metadataWithHierarchy() {
- final DefaultCitation citation = MetadataTreeChildrenTest.metadataWithMultiOccurrences();
+ final DefaultCitation citation = TreeNodeChildrenTest.metadataWithMultiOccurrences();
DefaultResponsibleParty party = new DefaultResponsibleParty(Role.DISTRIBUTOR);
party.setOrganisationName(new SimpleInternationalString("Some organisation"));
citation.getCitedResponsibleParties().add(party);
@@ -95,10 +95,10 @@ public final strictfp class MetadataTree
/**
* Creates a node to be tested for the given metadata object and value policy.
*/
- private static MetadataTreeNode create(final AbstractMetadata metadata, final ValueExistencePolicy valuePolicy) {
+ private static TreeNode create(final AbstractMetadata metadata, final ValueExistencePolicy valuePolicy) {
final MetadataStandard standard = MetadataStandard.ISO_19115;
- final MetadataTreeTable table = new MetadataTreeTable(standard, metadata, valuePolicy);
- return (MetadataTreeNode) table.getRoot();
+ final TreeTableView table = new TreeTableView(standard, metadata, valuePolicy);
+ return (TreeNode) table.getRoot();
}
/**
@@ -106,8 +106,8 @@ public final strictfp class MetadataTree
*/
@Test
public void testRootNode() {
- final DefaultCitation citation = MetadataTreeChildrenTest.metadataWithoutCollections();
- final MetadataTreeNode node = create(citation, ValueExistencePolicy.NON_EMPTY);
+ final DefaultCitation citation = TreeNodeChildrenTest.metadataWithoutCollections();
+ final TreeNode node = create(citation, ValueExistencePolicy.NON_EMPTY);
assertEquals("getName()", "DefaultCitation", node.getName());
assertEquals("getIdentifier()", "CI_Citation", node.getIdentifier());
assertEquals("getElementType()", Citation.class, node.getElementType());
@@ -116,20 +116,20 @@ public final strictfp class MetadataTree
assertNull ("getParent()", node.getParent());
assertFalse ("isLeaf()", node.isLeaf());
- final MetadataTreeChildren children = (MetadataTreeChildren) node.getChildren();
+ 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());
}
/**
- * Tests {@link MetadataTreeNode#getName()} on a metadata with only one entry in collections.
+ * Tests {@link TreeNode#getName()} on a metadata with only one entry in collections.
* Those names shall <em>not</em> contain numbering like "<cite>(1 of 2)</cite>".
*/
@Test
@DependsOnMethod("testRootNode") // Because tested more basic methods than 'getValue(TableColumn)'.
public void testGetNameForSingleton() {
- final DefaultCitation citation = MetadataTreeChildrenTest.metadataWithSingletonInCollections();
+ final DefaultCitation citation = TreeNodeChildrenTest.metadataWithSingletonInCollections();
assertColumnContentEquals(create(citation, ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
"DefaultCitation",
"Title",
@@ -140,13 +140,13 @@ public final strictfp class MetadataTree
}
/**
- * Tests {@link MetadataTreeNode#getName()} on a metadata with more than one entry in collections.
+ * Tests {@link TreeNode#getName()} on a metadata with more than one entry in collections.
* Those names <em>shall</em> contain numbering like "<cite>(1 of 2)</cite>".
*/
@Test
@DependsOnMethod("testGetNameForSingleton")
public void testGetNameForMultiOccurrences() {
- final DefaultCitation citation = MetadataTreeChildrenTest.metadataWithMultiOccurrences();
+ final DefaultCitation citation = TreeNodeChildrenTest.metadataWithMultiOccurrences();
assertColumnContentEquals(create(citation, ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
"DefaultCitation",
"Title",
@@ -159,7 +159,7 @@ public final strictfp class MetadataTree
}
/**
- * Tests {@link MetadataTreeNode#getName()} on a metadata with a deeper hierarchy.
+ * Tests {@link TreeNode#getName()} on a metadata with a deeper hierarchy.
*/
@Test
@DependsOnMethod("testGetNameForMultiOccurrences")
@@ -186,7 +186,7 @@ public final strictfp class MetadataTree
}
/**
- * Tests {@link MetadataTreeNode#getIdentifier()} on a metadata with a hierarchy.
+ * Tests {@link TreeNode#getIdentifier()} on a metadata with a hierarchy.
* Those names shall <em>not</em> contain numbering like "<cite>(1 of 2)</cite>", even if the same
* identifiers are repeated. Those identifiers are not intended to be unique in a list of children.
* The repetition of the same identifier means that they shall be part of a collection.
@@ -216,7 +216,7 @@ public final strictfp class MetadataTree
}
/**
- * Tests {@link MetadataTreeNode#getElementType()} on a metadata with a hierarchy.
+ * Tests {@link TreeNode#getElementType()} on a metadata with a hierarchy.
*/
@Test
@DependsOnMethod("testGetIdentifier") // Because if identifiers are wrong, we are looking at wrong properties.
@@ -243,7 +243,7 @@ public final strictfp class MetadataTree
}
/**
- * Tests {@link MetadataTreeNode#getValue(TableColumn)} for the value column.
+ * Tests {@link TreeNode#getValue(TableColumn)} for the value column.
*/
@Test
@DependsOnMethod("testGetIdentifier") // Because if identifiers are wrong, we are looking at wrong properties.
@@ -270,13 +270,13 @@ public final strictfp class MetadataTree
}
/**
- * Tests {@link MetadataTreeNode#newChild()}.
+ * Tests {@link TreeNode#newChild()}.
*/
@Test
@DependsOnMethod("testGetValue")
public void testNewChild() {
final DefaultCitation citation = metadataWithHierarchy();
- final MetadataTreeNode node = create(citation, ValueExistencePolicy.NON_EMPTY);
+ final TreeNode node = create(citation, ValueExistencePolicy.NON_EMPTY);
/*
* Ensure that we can not overwrite existing nodes.
*/
@@ -319,7 +319,7 @@ public final strictfp class MetadataTree
* applied on the given node, and all other values are the result of the
* getter method applied on the children, in iteration order.
*/
- private static void assertColumnContentEquals(final MetadataTreeNode node,
+ private static void assertColumnContentEquals(final TreeNode node,
final TableColumn<?> column, final Object... values)
{
assertEquals("Missing values in the tested metadata.", values.length,
Copied: sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java (from r1478864, sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeTableTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java?p2=sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java&p1=sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeTableTest.java&r1=1478864&r2=1478961&rev=1478961&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTreeTableTest.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java [UTF-8] Fri May 3 20:30:29 2013
@@ -29,7 +29,7 @@ import static org.apache.sis.test.Assert
/**
- * Tests the {@link MetadataTreeTable} class.
+ * Tests the {@link TreeTableView} class.
* Unless otherwise specified, all tests use the {@link MetadataStandard#ISO_19115} constant.
*
* @author Martin Desruisseaux (Geomatys)
@@ -37,19 +37,19 @@ import static org.apache.sis.test.Assert
* @version 0.3
* @module
*/
-@DependsOn(MetadataTreeNodeTest.class)
-public final strictfp class MetadataTreeTableTest extends TestCase {
+@DependsOn(TreeNodeTest.class)
+public final strictfp class TreeTableViewTest extends TestCase {
/**
* Creates a table to be tested for the given value policy.
*/
- private static MetadataTreeTable create(final ValueExistencePolicy valuePolicy) {
- return new MetadataTreeTable(MetadataStandard.ISO_19115, MetadataTreeNodeTest.metadataWithHierarchy(), valuePolicy);
+ private static TreeTableView create(final ValueExistencePolicy valuePolicy) {
+ return new TreeTableView(MetadataStandard.ISO_19115, TreeNodeTest.metadataWithHierarchy(), valuePolicy);
}
/**
* Asserts that the given metadata object has the expected string representation.
*/
- private static void assertExpectedString(final MetadataTreeTable metadata) {
+ private static void assertExpectedString(final TreeTableView metadata) {
assertMultilinesEquals("toString()",
"DefaultCitation\n" +
" ├─Title…………………………………………………………………………………… Some title\n" +
@@ -72,7 +72,7 @@ public final strictfp class MetadataTree
}
/**
- * Tests {@link MetadataTreeTable#toString()}.
+ * Tests {@link TreeTableView#toString()}.
*/
@Test
public void testToString() {
@@ -98,6 +98,6 @@ public final strictfp class MetadataTree
try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(data))) {
deserialized = in.readObject();
}
- assertExpectedString((MetadataTreeTable) deserialized);
+ assertExpectedString((TreeTableView) deserialized);
}
}
Modified: sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java?rev=1478961&r1=1478960&r2=1478961&view=diff
==============================================================================
--- sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK7/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] Fri May 3 20:30:29 2013
@@ -42,9 +42,9 @@ import org.junit.BeforeClass;
org.apache.sis.metadata.TypeMapTest.class,
org.apache.sis.metadata.InformationMapTest.class,
org.apache.sis.metadata.ValueMapTest.class,
- org.apache.sis.metadata.MetadataTreeChildrenTest.class,
- org.apache.sis.metadata.MetadataTreeNodeTest.class,
- org.apache.sis.metadata.MetadataTreeTableTest.class,
+ org.apache.sis.metadata.TreeNodeChildrenTest.class,
+ org.apache.sis.metadata.TreeNodeTest.class,
+ org.apache.sis.metadata.TreeTableViewTest.class,
org.apache.sis.metadata.MetadataStandardTest.class,
org.apache.sis.metadata.PrunerTest.class,
org.apache.sis.metadata.iso.AllMetadataTest.class