directory-commits mailing list archives

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

Modified:
   incubator/directory/naming/trunk/core/src/test/org/apache/naming/resources/AbstractDirContextTest.java
Log:
Added base getAttributes test.

Modified: incubator/directory/naming/trunk/core/src/test/org/apache/naming/resources/AbstractDirContextTest.java
==============================================================================
--- incubator/directory/naming/trunk/core/src/test/org/apache/naming/resources/AbstractDirContextTest.java
(original)
+++ incubator/directory/naming/trunk/core/src/test/org/apache/naming/resources/AbstractDirContextTest.java
Sun Feb 15 19:34:34 2004
@@ -59,7 +59,14 @@
 import java.util.Iterator;
 import java.util.Map;
 
+import javax.naming.directory.DirContext;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.Attribute;
+import javax.naming.NamingEnumeration;
+
 import org.apache.naming.AbstractContextTest;
+import org.apache.naming.resources.Resource;
+
 
 
 /**
@@ -124,6 +131,16 @@
         assertEquals(expected.keySet(), returned.keySet());
     }
     
-    // todo: Add tests for DirContext 
+    /**
+     * Verify that getAttributes returns a valid NamingEnumeration of Attributes
+     */
+   public void testAttributes() throws Exception {
+      DirContext context = (DirContext) initialContext.lookup(firstContextName()+ "/" + secondContextName());
+      Attributes attrs = (Attributes) context.getAttributes(firstBoundName());
+      NamingEnumeration enum = attrs.getAll();
+      while (enum.hasMoreElements()) {
+          assertTrue(enum.nextElement() instanceof Attribute);
+      }
+   }
     
 }

Mime
View raw message