From commits-return-12794-apmail-directory-commits-archive=directory.apache.org@directory.apache.org Mon Mar 12 23:50:36 2007 Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 31538 invoked from network); 12 Mar 2007 23:50:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Mar 2007 23:50:35 -0000 Received: (qmail 80399 invoked by uid 500); 12 Mar 2007 23:50:43 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 80343 invoked by uid 500); 12 Mar 2007 23:50:43 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 80332 invoked by uid 99); 12 Mar 2007 23:50:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Mar 2007 16:50:43 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Mar 2007 16:50:34 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 0EAF91A9838; Mon, 12 Mar 2007 16:50:14 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: erodriguez@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070312235014.0EAF91A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 env = new Hashtable(); env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" ); env.put( Context.PROVIDER_URL, "ldap://localhost:" + port );