commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1587013 - in /commons/proper/configuration/branches/immutableNodes/src: main/java/org/apache/commons/configuration/tree/InMemoryNodeModel.java test/java/org/apache/commons/configuration/tree/TestInMemoryNodeModel.java
Date Sun, 13 Apr 2014 15:59:58 GMT
Author: oheger
Date: Sun Apr 13 15:59:58 2014
New Revision: 1587013

URL: http://svn.apache.org/r1587013
Log:
Implemented getInMemoryRepresentation() in InMemoryNodeModel.

Modified:
    commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/InMemoryNodeModel.java
    commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/tree/TestInMemoryNodeModel.java

Modified: commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/InMemoryNodeModel.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/InMemoryNodeModel.java?rev=1587013&r1=1587012&r2=1587013&view=diff
==============================================================================
--- commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/InMemoryNodeModel.java
(original)
+++ commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/tree/InMemoryNodeModel.java
Sun Apr 13 15:59:58 2014
@@ -364,11 +364,14 @@ public class InMemoryNodeModel implement
         setRootNode(newRoot);
     }
 
+    /**
+     * {@inheritDoc} This implementation simply returns the current root node of this
+     * model.
+     */
     @Override
     public ImmutableNode getInMemoryRepresentation()
     {
-        // TODO implementation
-        throw new UnsupportedOperationException("Not yet implemented!");
+        return getTreeData().getRootNode();
     }
 
     /**

Modified: commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/tree/TestInMemoryNodeModel.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/tree/TestInMemoryNodeModel.java?rev=1587013&r1=1587012&r2=1587013&view=diff
==============================================================================
--- commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/tree/TestInMemoryNodeModel.java
(original)
+++ commons/proper/configuration/branches/immutableNodes/src/test/java/org/apache/commons/configuration/tree/TestInMemoryNodeModel.java
Sun Apr 13 15:59:58 2014
@@ -1055,4 +1055,18 @@ public class TestInMemoryNodeModel
         ImmutableNode rootNode = model.getRootNode();
         assertTrue("Got children", rootNode.getChildren().isEmpty());
     }
+
+    /**
+     * Tests whether the model's data can be represented as immutable node
+     * objects (which is trivial in this case).
+     */
+    @Test
+    public void testGetInMemoryRepresentation()
+    {
+        InMemoryNodeModel model =
+                new InMemoryNodeModel(NodeStructureHelper.ROOT_AUTHORS_TREE);
+        assertSame("Wrong in-memory representation",
+                NodeStructureHelper.ROOT_AUTHORS_TREE,
+                model.getInMemoryRepresentation());
+    }
 }



Mime
View raw message