directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r955969 - /directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java
Date Fri, 18 Jun 2010 12:23:40 GMT
Author: elecharny
Date: Fri Jun 18 12:23:40 2010
New Revision: 955969

URL: http://svn.apache.org/viewvc?rev=955969&view=rev
Log:
Added a JNDI test to demonstrate that DIRSERVER-1285 is fixed

Modified:
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java?rev=955969&r1=955968&r2=955969&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java
Fri Jun 18 12:23:40 2010
@@ -429,4 +429,47 @@ public class SimpleBindIT extends Abstra
             assertTrue( true );
         }
     }
+
+
+    /**
+     * try to connect using a known user/password and read an entry.
+     * 
+     * @throws Exception on error
+     */
+    @Test
+    public void testSimpleBindWithDoubleQuote()
+    {
+        // We will bind using JNDI
+        // Set up the environment for creating the initial context
+        Hashtable<String, Object> env = new Hashtable<String, Object>();
+        env.put( DirectoryService.JNDI_KEY, service );
+        env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
+        env.put( Context.PROVIDER_URL, "ou=system" );
+
+        // Authenticate as admin and password "secret"
+        env.put( Context.SECURITY_AUTHENTICATION, "simple" );
+        env.put( Context.SECURITY_PRINCIPAL, "uid=\"admin\",ou=\"system\"" );
+        env.put( Context.SECURITY_CREDENTIALS, "secret" );
+
+        DirContext ctx = null;
+
+        // Create the initial context
+        try
+        {
+            ctx = new InitialDirContext( env );
+        }
+        catch ( NamingException ne )
+        {
+            fail();
+        }
+
+        try
+        {
+            ctx.close();
+        }
+        catch ( NamingException ne )
+        {
+            fail();
+        }
+    }
 }



Mime
View raw message