directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r517466 - in /directory/apacheds/branches/apacheds-sasl-branch: core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java server-unit/src/test/java/org/apache/directory/server/SaslBindTest.java
Date Mon, 12 Mar 2007 23:50:13 GMT
Author: erodriguez
Date: Mon Mar 12 16:50:13 2007
New Revision: 517466

URL: http://svn.apache.org/viewvc?view=rev&rev=517466
Log:
Updates regarding supportedSASLMechanisms:
o  Removed SIMPLE from the list of supportedSASLMechanisms.
o  Added an integration test to check that the supportedSASLMechanisms are returned from a
RootDSE query.

Modified:
    directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/SaslBindTest.java

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?view=diff&rev=517466&r1=517465&r2=517466
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Mon Mar 12 16:50:13 2007
@@ -152,7 +152,6 @@
         // Add the supportedSASLMechanisms attribute to rootDSE
         attr = new AttributeImpl( SupportedSASLMechanisms.ATTRIBUTE );
         rootDSE.put( attr );
-        attr.add( SupportedSASLMechanisms.SIMPLE );
         attr.add( SupportedSASLMechanisms.GSSAPI );
         attr.add( SupportedSASLMechanisms.DIGEST_MD5 );
         attr.add( SupportedSASLMechanisms.CRAM_MD5 );

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/SaslBindTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/SaslBindTest.java?view=diff&rev=517466&r1=517465&r2=517466
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/SaslBindTest.java
(original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-unit/src/test/java/org/apache/directory/server/SaslBindTest.java
Mon Mar 12 16:50:13 2007
@@ -25,6 +25,7 @@
 import java.util.Set;
 
 import javax.naming.Context;
+import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
@@ -153,8 +154,6 @@
 
     /**
      * Tests to make sure the server properly returns the supportedSASLMechanisms.
-     * 
-     * TODO - complete test when 'supportedSASLMechanisms' attribute return is implemented.
      */
     public void testSupportedSASLMechanisms()
     {
@@ -165,9 +164,27 @@
             Attributes attrs = ctx.getAttributes( "ldap://localhost:" + port, new String[]
                 { "supportedSASLMechanisms" } );
 
-            System.out.println( attrs );
+            try
+            {
+                NamingEnumeration answer = attrs.getAll();
 
-            ctx.close();
+                if ( answer.hasMore() )
+                {
+                    Attribute result = ( Attribute ) answer.next();
+                    assertTrue( result.size() == 3 );
+                    assertTrue( result.contains( "GSSAPI" ) );
+                    assertTrue( result.contains( "DIGEST-MD5" ) );
+                    assertTrue( result.contains( "CRAM-MD5" ) );
+                }
+                else
+                {
+                    fail();
+                }
+            }
+            catch ( NamingException e )
+            {
+                e.printStackTrace();
+            }
         }
         catch ( NamingException e )
         {
@@ -470,7 +487,6 @@
     {
         try
         {
-            // Create the initial context
             Hashtable<String, String> env = new Hashtable<String, String>();
             env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"
);
             env.put( Context.PROVIDER_URL, "ldap://localhost:" + port );



Mime
View raw message