sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1497942 - in /sis/branches/JDK7: application/sis-console/src/test/java/org/apache/sis/console/ core/sis-metadata/src/main/java/org/apache/sis/metadata/ core/sis-metadata/src/test/java/org/apache/sis/metadata/ storage/sis-netcdf/src/test/ja...
Date Fri, 28 Jun 2013 21:58:01 GMT
Author: desruisseaux
Date: Fri Jun 28 21:58:01 2013
New Revision: 1497942

URL: http://svn.apache.org/r1497942
Log:
Name of root node shall be derived from public interface rather than implementation class.

Modified:
    sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/AbstractMetadataTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
    sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java

Modified: sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java?rev=1497942&r1=1497941&r2=1497942&view=diff
==============================================================================
--- sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/MetadataSCTest.java
[UTF-8] Fri Jun 28 21:58:01 2013
@@ -47,7 +47,7 @@ public final strictfp class MetadataSCTe
         assertNotNull(IOTestCase.NCEP, url);
         final MetadataSC test = new MetadataSC(0, SubCommand.TEST, url.toString());
         test.run();
-        verifyNetCDF("DefaultMetadata", test.outputBuffer.toString());
+        verifyNetCDF("Metadata", test.outputBuffer.toString());
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java?rev=1497942&r1=1497941&r2=1497942&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNode.java
[UTF-8] Fri Jun 28 21:58:01 2013
@@ -206,7 +206,8 @@ class TreeNode implements Node {
      * <p>The default implementation is suitable only for the root node - subclasses
must override.</p>
      */
     CharSequence getName() {
-        return Classes.getShortClassName(metadata);
+        return CharSequences.camelCaseToSentence(Classes.getShortName(
+                table.standard.getInterface(metadata.getClass()))).toString();
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/AbstractMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/AbstractMetadataTest.java?rev=1497942&r1=1497941&r2=1497942&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/AbstractMetadataTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/AbstractMetadataTest.java
[UTF-8] Fri Jun 28 21:58:01 2013
@@ -54,7 +54,7 @@ public final strictfp class AbstractMeta
      *
      * <p>The tree formatted by this test is:</p>
      * {@preformat text
-     *     DefaultPlatform
+     *     Platform
      *       ├─Description……………………… A platform.
      *       └─Instrument
      *           ├─Type……………………………… An instrument type.
@@ -69,7 +69,7 @@ public final strictfp class AbstractMeta
          * We can not perform a full comparison of the string, since it is locale-dependent.
          * Compare only the tree structure. The full tree is English is shown in javadoc.
          */
-        assertTrue(text, text.startsWith("DefaultPlatform"));
+        assertTrue(text, text.startsWith("Platform"));
         assertArrayEquals(new String[] {
             "",
             "  ├─",

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java?rev=1497942&r1=1497941&r2=1497942&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
[UTF-8] Fri Jun 28 21:58:01 2013
@@ -55,7 +55,7 @@ public final strictfp class TreeNodeTest
      * This method creates the following metadata:
      *
      * {@preformat text
-     *   DefaultCitation
+     *   Citation
      *     ├─Title……………………………………………………………………………………
Some title
      *     ├─Alternate title (1 of 2)………………………………… First
alternate title
      *     ├─Alternate title (2 of 2)………………………………… Second
alternate title
@@ -108,13 +108,13 @@ public final strictfp class TreeNodeTest
     public void testRootNode() {
         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());
-        assertSame  ("getUserObject()",  citation,          node.getUserObject());
-        assertFalse ("isWritable()",                        node.isWritable());
-        assertNull  ("getParent()",                         node.getParent());
-        assertFalse ("isLeaf()",                            node.isLeaf());
+        assertEquals("getName()",        "Citation",     node.getName());
+        assertEquals("getIdentifier()",  "CI_Citation",  node.getIdentifier());
+        assertEquals("getElementType()", Citation.class, node.getElementType());
+        assertSame  ("getUserObject()",  citation,       node.getUserObject());
+        assertFalse ("isWritable()",                     node.isWritable());
+        assertNull  ("getParent()",                      node.getParent());
+        assertFalse ("isLeaf()",                         node.isLeaf());
 
         final TreeNodeChildren children = (TreeNodeChildren) node.getChildren();
         assertSame ("children.metadata", citation, children.metadata);
@@ -131,7 +131,7 @@ public final strictfp class TreeNodeTest
     public void testGetNameForSingleton() {
         final DefaultCitation citation = TreeNodeChildrenTest.metadataWithSingletonInCollections();
         assertColumnContentEquals(create(citation, ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
-            "DefaultCitation",
+            "Citation",
               "Title",
               "Alternate title",
               "Edition",
@@ -148,7 +148,7 @@ public final strictfp class TreeNodeTest
     public void testGetNameForMultiOccurrences() {
         final DefaultCitation citation = TreeNodeChildrenTest.metadataWithMultiOccurrences();
         assertColumnContentEquals(create(citation, ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
-            "DefaultCitation",
+            "Citation",
               "Title",
               "Alternate title (1 of 2)",
               "Alternate title (2 of 2)",
@@ -166,7 +166,7 @@ public final strictfp class TreeNodeTest
     public void testGetNameForHierarchy() {
         final DefaultCitation citation = metadataWithHierarchy();
         assertColumnContentEquals(create(citation, ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
-            "DefaultCitation",
+            "Citation",
               "Title",
               "Alternate title (1 of 2)",
               "Alternate title (2 of 2)",

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java?rev=1497942&r1=1497941&r2=1497942&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
[UTF-8] Fri Jun 28 21:58:01 2013
@@ -105,7 +105,7 @@ public final strictfp class TreeTableFor
         final DefaultCitation citation = createCitation();
         final String text = format.format(citation.asTreeTable());
         assertMultilinesEquals(
-            "DefaultCitation\n" +
+            "Citation\n" +
             "  ├─Title………………………………………………………………………
Undercurrent\n" +
             "  ├─Alternate title (1 of 2)…………………… Alt A\n" +
             "  ├─Alternate title (2 of 2)…………………… Alt B\n" +
@@ -140,7 +140,7 @@ public final strictfp class TreeTableFor
         processing.getDocumentations().add(untitled);
         final String text = format.format(processing.asTreeTable());
         assertMultilinesEquals(
-            "DefaultProcessing\n" +
+            "Processing\n" +
             "  ├─Documentation (1 of 3)\n" +
             "  │   ├─Title………………………………………………
Some specification\n" +
             "  │   └─Presentation form……………… Document hardcopy\n"
+
@@ -161,15 +161,15 @@ public final strictfp class TreeTableFor
         image.getDimensions().add(createBand(0.28, 0.29));
         final String text = format.format(image.asTreeTable());
         assertMultilinesEquals(
-            "DefaultImageDescription\n" +
+            "Image description\n" +
             "  ├─Dimension (1 of 2)\n" +
-            "  │   ├─Max value……………… 0.26\n" +
-            "  │   ├─Min value……………… 0.25\n" +
-            "  │   └─Units………………………… cm\n" +
+            "  │   ├─Max value…………… 0.26\n" +
+            "  │   ├─Min value…………… 0.25\n" +
+            "  │   └─Units……………………… cm\n" +
             "  └─Dimension (2 of 2)\n" +
-            "      ├─Max value……………… 0.29\n" +
-            "      ├─Min value……………… 0.28\n" +
-            "      └─Units………………………… cm\n", text);
+            "      ├─Max value…………… 0.29\n" +
+            "      ├─Min value…………… 0.28\n" +
+            "      └─Units……………………… cm\n", text);
     }
 
     /**
@@ -194,7 +194,7 @@ public final strictfp class TreeTableFor
 
         final String text = format.format(identification.asTreeTable());
         assertMultilinesEquals(
-            "DefaultDataIdentification\n" +
+            "Data identification\n" +
             "  ├─Topic category (1 of 3)…… Health\n" +
             "  ├─Topic category (2 of 3)…… Oceans\n" +
             "  ├─Topic category (3 of 3)…… Test\n" +

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java?rev=1497942&r1=1497941&r2=1497942&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
[UTF-8] Fri Jun 28 21:58:01 2013
@@ -53,23 +53,23 @@ public final strictfp class TreeTableVie
      * with {@link ValueExistencePolicy#NON_EMPTY}.
      */
     private static final String EXPECTED =
-                "DefaultCitation\n" +
-                "  ├─Title……………………………………………………………………………………
Some title\n" +
-                "  ├─Alternate title (1 of 2)…………………………………
First alternate title\n" +
-                "  ├─Alternate title (2 of 2)…………………………………
Second alternate title\n" +
-                "  ├─Edition………………………………………………………………………………
Some edition\n" +
-                "  ├─Cited responsible party (1 of 2)\n" +
-                "  │   ├─Organisation name…………………………………………
Some organisation\n" +
-                "  │   └─Role……………………………………………………………………………
Distributor\n" +
-                "  ├─Cited responsible party (2 of 2)\n" +
-                "  │   ├─Individual name………………………………………………
Some person of contact\n" +
-                "  │   ├─Contact info\n" +
-                "  │   │   └─Address\n" +
-                "  │   │       └─Electronic mail address…… Some email\n"
+
-                "  │   └─Role……………………………………………………………………………
Point of contact\n" +
-                "  ├─Presentation form (1 of 2)…………………………… Map
digital\n" +
-                "  ├─Presentation form (2 of 2)…………………………… Map
hardcopy\n" +
-                "  └─Other citation details………………………………………
Some other details\n";
+            "Citation\n" +
+            "  ├─Title……………………………………………………………………………………
Some title\n" +
+            "  ├─Alternate title (1 of 2)………………………………… First
alternate title\n" +
+            "  ├─Alternate title (2 of 2)………………………………… Second
alternate title\n" +
+            "  ├─Edition………………………………………………………………………………
Some edition\n" +
+            "  ├─Cited responsible party (1 of 2)\n" +
+            "  │   ├─Organisation name…………………………………………
Some organisation\n" +
+            "  │   └─Role……………………………………………………………………………
Distributor\n" +
+            "  ├─Cited responsible party (2 of 2)\n" +
+            "  │   ├─Individual name………………………………………………
Some person of contact\n" +
+            "  │   ├─Contact info\n" +
+            "  │   │   └─Address\n" +
+            "  │   │       └─Electronic mail address…… Some email\n"
+
+            "  │   └─Role……………………………………………………………………………
Point of contact\n" +
+            "  ├─Presentation form (1 of 2)…………………………… Map digital\n"
+
+            "  ├─Presentation form (2 of 2)…………………………… Map hardcopy\n"
+
+            "  └─Other citation details………………………………………
Some other details\n";
 
     /**
      * Tests {@link TreeTableView#toString()}.

Modified: sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java?rev=1497942&r1=1497941&r2=1497942&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
[UTF-8] Fri Jun 28 21:58:01 2013
@@ -82,7 +82,7 @@ public final strictfp class MetadataRead
      */
     static void compareToExpected(final Metadata actual) {
         assertMultilinesEquals(
-            "DefaultMetadata\n" +
+            "Metadata\n" +
             "  ├─File identifier…………………………………………………………………………
edu.ucar.unidata:NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc\n" +
             "  ├─Hierarchy level…………………………………………………………………………
Dataset\n" +
             "  ├─Contact\n" +



Mime
View raw message