directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: rev 6678 - incubator/directory/naming/trunk/core/src/test/org/apache/naming
Date Mon, 16 Feb 2004 03:29:12 GMT
Author: psteitz
Date: Sun Feb 15 19:29:11 2004
New Revision: 6678

Modified:
   incubator/directory/naming/trunk/core/src/test/org/apache/naming/AbstractContextTest.java
Log:
Added rebind test.

Modified: incubator/directory/naming/trunk/core/src/test/org/apache/naming/AbstractContextTest.java
==============================================================================
--- incubator/directory/naming/trunk/core/src/test/org/apache/naming/AbstractContextTest.java
(original)
+++ incubator/directory/naming/trunk/core/src/test/org/apache/naming/AbstractContextTest.java
Sun Feb 15 19:29:11 2004
@@ -330,4 +330,23 @@
     		}
     	}	
     }
+    
+    /**
+     *  Test rebind -- swap bound objects and verify
+     */
+    public void testRebind() throws Exception {
+        secondContext.rebind(firstBoundName(), secondBoundObject());
+        secondContext.rebind(secondBoundName(), firstBoundObject());
+        binding.put(firstBoundName(), secondBoundObject());
+        binding.put(secondBoundName(), firstBoundObject());      
+        NamingEnumeration enum;
+        Map result;
+        enum = secondContext.listBindings("");
+        result = new HashMap();
+        while (enum.hasMore()) {
+            Binding pair = (Binding) enum.next();
+            result.put(pair.getName(), pair.getObject());
+        }
+        verifyListBindings(binding, result);     
+    }
 }

Mime
View raw message