incubator-oodt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r964912 - /incubator/oodt/trunk/metadata/src/test/org/apache/oodt/cas/metadata/TestMetadata.java
Date Fri, 16 Jul 2010 19:22:45 GMT
Author: kelly
Date: Fri Jul 16 19:22:45 2010
New Revision: 964912

URL: http://svn.apache.org/viewvc?rev=964912&view=rev
Log:
PGE wants a "replaceMetadata" method that takes a Metadata instance; write unit test to expose
method & ensure function

Modified:
    incubator/oodt/trunk/metadata/src/test/org/apache/oodt/cas/metadata/TestMetadata.java

Modified: incubator/oodt/trunk/metadata/src/test/org/apache/oodt/cas/metadata/TestMetadata.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/metadata/src/test/org/apache/oodt/cas/metadata/TestMetadata.java?rev=964912&r1=964911&r2=964912&view=diff
==============================================================================
--- incubator/oodt/trunk/metadata/src/test/org/apache/oodt/cas/metadata/TestMetadata.java
(original)
+++ incubator/oodt/trunk/metadata/src/test/org/apache/oodt/cas/metadata/TestMetadata.java
Fri Jul 16 19:22:45 2010
@@ -172,6 +172,20 @@ public class TestMetadata extends TestCa
 
     }
 
+    /**
+     * Ensure that replacing a Metadata instance with a Metadata instance works.
+     */
+    public void testReplacementWithMetadata() {
+        Metadata a = new Metadata();
+        Metadata b = new Metadata();
+        a.addMetadata("a", "1");
+        b.addMetadata("a", "2");
+        b.addMetadata("b", "3");
+        a.replaceMetadata(b);
+        assertEquals("2", a.getMetadata("a"));
+        assertEquals("3", a.getMetadata("b"));
+    }
+
     public void testEquals() {
         Metadata m1 = new Metadata();
         m1.addMetadata("key1", "val1");



Mime
View raw message