directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r348990 - /directory/naming/trunk/naming-config/src/test/org/apache/naming/config/XmlConfiguratorTest.java
Date Fri, 25 Nov 2005 17:58:12 GMT
Author: psteitz
Date: Fri Nov 25 09:58:09 2005
New Revision: 348990

URL: http://svn.apache.org/viewcvs?rev=348990&view=rev
Log:
Added test case verifying jndi url lookup works with default (0.8) config.

Modified:
    directory/naming/trunk/naming-config/src/test/org/apache/naming/config/XmlConfiguratorTest.java

Modified: directory/naming/trunk/naming-config/src/test/org/apache/naming/config/XmlConfiguratorTest.java
URL: http://svn.apache.org/viewcvs/directory/naming/trunk/naming-config/src/test/org/apache/naming/config/XmlConfiguratorTest.java?rev=348990&r1=348989&r2=348990&view=diff
==============================================================================
--- directory/naming/trunk/naming-config/src/test/org/apache/naming/config/XmlConfiguratorTest.java
(original)
+++ directory/naming/trunk/naming-config/src/test/org/apache/naming/config/XmlConfiguratorTest.java
Fri Nov 25 09:58:09 2005
@@ -208,6 +208,19 @@
         checkDs((DataSource) ctx.lookup("jndi:global/java:comp/env/jdbc/pool")); 
     }
     
+    /* Verify that jndi: urls work with default config, using default context name and root
*/
+    public void testJNDIDefault() throws Exception {
+        XmlConfigurator.loadConfiguration(getClass().getResourceAsStream("/test-jndi.xml"));
+        Hashtable env = new Hashtable();
+        env.put(Context.INITIAL_CONTEXT_FACTORY,
+        "org.apache.naming.NamingContextFactory");
+        env.put(Context.URL_PKG_PREFIXES, "org.apache.naming");
+        env.put(NamingContextFactory.NAME, "global"); //name attribute 
+        Context ctx = new InitialContext(env);
+        String defaultName = NamingContextFactory.DEFAULT_NAME;
+        checkDs((DataSource) ctx.lookup("jndi:" + defaultName + "/java:comp/env/jdbc/pool"));
      
+    }
+    
     /**
      * Tests ldap links.  To activate, change the name to "testLdapLinks" and
      * 



Mime
View raw message