You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by bi...@apache.org on 2011/06/12 21:08:33 UTC

svn commit: r1134959 - /maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/CollectionUtilsTest.java

Author: bimargulies
Date: Sun Jun 12 19:08:33 2011
New Revision: 1134959

URL: http://svn.apache.org/viewvc?rev=1134959&view=rev
Log:
Start work on CollectionUtils.

Added:
    maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/CollectionUtilsTest.java   (with props)

Added: maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/CollectionUtilsTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/CollectionUtilsTest.java?rev=1134959&view=auto
==============================================================================
--- maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/CollectionUtilsTest.java (added)
+++ maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/CollectionUtilsTest.java Sun Jun 12 19:08:33 2011
@@ -0,0 +1,33 @@
+package org.codehaus.plexus.util;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class CollectionUtilsTest extends Assert
+{
+    @SuppressWarnings( "rawtypes" )
+    @Test
+    public void testMergeMaps() throws Exception {
+        Map<String, String> dom = new HashMap<String, String>();
+        Map<String, String> rec = new HashMap<String, String>();
+        Map<String, String> expected = new HashMap<String, String>(); 
+        
+        dom.put( "name", "Sir Launcelot of Camelot" );
+        dom.put( "quest", "the holy grail" );
+        dom.put( "favorite color", "yellow" );
+        
+        rec.put( "meaning of life", "42" );
+        rec.put( "quest", "the perfect tan" );
+        
+        expected.put( "name", "Sir Launcelot of Camelot" );
+        expected.put( "quest", "the holy grail" );
+        expected.put( "favorite color", "yellow" );
+        expected.put( "meaning of life", "42" );
+        
+        Map res = CollectionUtils.mergeMaps( dom, rec );
+        assertEquals( expected, res );
+    }
+}

Propchange: maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/CollectionUtilsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/CollectionUtilsTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain