You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2013/04/22 14:52:46 UTC

svn commit: r1470485 - in /directory/apacheds/trunk: ldap-client-test/src/main/java/org/apache/directory/shared/client/api/ ldap-client-test/src/test/java/org/apache/directory/shared/client/api/ ldap-client-test/src/test/java/org/apache/directory/share...

Author: elecharny
Date: Mon Apr 22 12:52:46 2013
New Revision: 1470485

URL: http://svn.apache.org/r1470485
Log:
o Transfered the allowAnonymousAccess flag from the LdapServer to the DirectoryService in the server annotation processor
o Fixed tests that were expecting the server to be anonymous
o Added helper methods in LdapApiIntegrationUtils to bind anonymously
o Added a set of tests for anonymous searches (DIRAPI-80)

Added:
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/AnonymousClientSearchRequestTest.java
Modified:
    directory/apacheds/trunk/ldap-client-test/src/main/java/org/apache/directory/shared/client/api/LdapApiIntegrationUtils.java
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
    directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java

Modified: directory/apacheds/trunk/ldap-client-test/src/main/java/org/apache/directory/shared/client/api/LdapApiIntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/main/java/org/apache/directory/shared/client/api/LdapApiIntegrationUtils.java?rev=1470485&r1=1470484&r2=1470485&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/main/java/org/apache/directory/shared/client/api/LdapApiIntegrationUtils.java (original)
+++ directory/apacheds/trunk/ldap-client-test/src/main/java/org/apache/directory/shared/client/api/LdapApiIntegrationUtils.java Mon Apr 22 12:52:46 2013
@@ -104,11 +104,11 @@ public class LdapApiIntegrationUtils
     public static LdapConnection getPooledAdminConnection( LdapServer ldapServer ) throws Exception
     {
         LdapConnection ldapConnection = getAdminPool( ldapServer ).getConnection();
-        
+
         ldapConnection.setBinaryAttributeDetector(
             new SchemaBinaryAttributeDetector(
-                ldapServer.getDirectoryService().getSchemaManager()) );
-        
+                ldapServer.getDirectoryService().getSchemaManager() ) );
+
         return ldapConnection;
     }
 
@@ -136,7 +136,7 @@ public class LdapApiIntegrationUtils
     private static LdapConnectionPool getAdminPool( LdapServer ldapServer )
     {
         int port = ldapServer.getPort();
-        
+
         if ( !pools.containsKey( port ) )
         {
             LdapConnectionConfig config = new LdapConnectionConfig();
@@ -153,4 +153,36 @@ public class LdapApiIntegrationUtils
         return pools.get( port );
     }
 
+
+    /**
+     * Gets an anonymous LdapNetworkConnection
+     * 
+     * @param dirService The Directory Service to be connected to
+     * @return A LdapNetworkConnection instance
+     * @exception If the connection could not be established.
+     */
+    public static LdapConnection getAnonymousNetworkConnection( String host, int port ) throws Exception
+    {
+        LdapConnection connection = new LdapNetworkConnection( host, port );
+        connection.bind();
+
+        return connection;
+    }
+
+
+    /**
+     * Gets an anonymous LdapNetworkConnection
+     * 
+     * @param ldapServer The LDAP server we want to connect to
+     * @return A LdapNetworkConnection instance
+     * @exception If the connection could not be established.
+     */
+    public static LdapConnection getAnonymousNetworkConnection( LdapServer ldapServer ) throws Exception
+    {
+        LdapConnection connection = new LdapNetworkConnection( "localHost", ldapServer.getPort() );
+        connection.setTimeOut( 0L );
+        connection.bind();
+
+        return connection;
+    }
 }

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java?rev=1470485&r1=1470484&r2=1470485&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java (original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java Mon Apr 22 12:52:46 2013
@@ -237,6 +237,7 @@ public void testLookup() throws Exceptio
     @Test
     public void testAnonBind() throws Exception
     {
+        getLdapServer().getDirectoryService().setAllowAnonymousAccess( true );
         LdapNetworkConnection connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort() );
 
         connection.bind();

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java?rev=1470485&r1=1470484&r2=1470485&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java (original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java Mon Apr 22 12:52:46 2013
@@ -209,6 +209,8 @@ public class SimpleBindRequestTest exten
     @Test
     public void testSimpleBindAnonymous() throws Exception
     {
+        getLdapServer().getDirectoryService().setAllowAnonymousAccess( true );
+
         //System.out.println( "------------------Create connection" + i + "-------------" );
         LdapConnection connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort() );
         //System.out.println( "------------------Bind" + i + "-------------" );

Added: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/AnonymousClientSearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/AnonymousClientSearchRequestTest.java?rev=1470485&view=auto
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/AnonymousClientSearchRequestTest.java (added)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/AnonymousClientSearchRequestTest.java Mon Apr 22 12:52:46 2013
@@ -0,0 +1,362 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+
+package org.apache.directory.shared.client.api.operations.search;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.concurrent.TimeUnit;
+
+import org.apache.directory.api.ldap.model.cursor.Cursor;
+import org.apache.directory.api.ldap.model.cursor.EntryCursor;
+import org.apache.directory.api.ldap.model.cursor.SearchCursor;
+import org.apache.directory.api.ldap.model.entry.Entry;
+import org.apache.directory.api.ldap.model.message.AliasDerefMode;
+import org.apache.directory.api.ldap.model.message.Response;
+import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
+import org.apache.directory.api.ldap.model.message.SearchRequest;
+import org.apache.directory.api.ldap.model.message.SearchRequestImpl;
+import org.apache.directory.api.ldap.model.message.SearchResultDone;
+import org.apache.directory.api.ldap.model.message.SearchResultEntry;
+import org.apache.directory.api.ldap.model.message.SearchScope;
+import org.apache.directory.api.ldap.model.message.controls.ManageDsaITImpl;
+import org.apache.directory.api.ldap.model.name.Dn;
+import org.apache.directory.ldap.client.api.LdapNetworkConnection;
+import org.apache.directory.ldap.client.api.future.SearchFuture;
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.ApplyLdifs;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.shared.client.api.LdapApiIntegrationUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+/**
+ * Test that we can search without having bound to the server, if the server allows
+ * anonymous operations.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@RunWith(FrameworkRunner.class)
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP"), @CreateTransport(protocol = "LDAPS") },
+    allowAnonymousAccess = true)
+@ApplyLdifs(
+    {
+        "dn: cn=user1,ou=system",
+        "objectClass: person",
+        "objectClass: top",
+        "sn: user1 sn",
+        "cn: user1",
+
+        // alias to the above entry
+        "dn: cn=user1-alias,ou=system",
+        "objectClass: alias",
+        "objectClass: top",
+        "objectClass: extensibleObject",
+        "aliasedObjectName: cn=user1,ou=system",
+        "cn: user1-alias",
+
+        // Another user
+        "dn: cn=elecharny,ou=system",
+        "objectClass: top",
+        "objectClass: person",
+        "objectClass: extensibleObject",
+        "sn:: RW1tYW51ZWwgTMOpY2hhcm55",
+        "cn: elecharny",
+        "publicKey:: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKbHnLFs5N2PHk0gkyI/g3XeIdjxnWOAW5RVap4zWZuNY4gNGH1MhfHPVHcy6WEMoo+zaxU0Xh+Iv6BzrIa70IUCAwEAAQ=="
+})
+public class AnonymousClientSearchRequestTest extends AbstractLdapTestUnit
+{
+private LdapNetworkConnection connection;
+
+
+@Before
+public void setup() throws Exception
+{
+    connection = ( LdapNetworkConnection ) LdapApiIntegrationUtils.getAnonymousNetworkConnection( getLdapServer() );
+    connection.setTimeOut( 0L );
+}
+
+
+@After
+public void shutdown() throws Exception
+{
+    connection.close();
+}
+
+
+@Test
+public void testSimpleSearch() throws Exception
+{
+    EntryCursor cursor = connection.search( "ou=system", "(objectclass=*)", SearchScope.ONELEVEL );
+    int count = 0;
+
+    while ( cursor.next() )
+    {
+        Entry entry = cursor.get();
+        assertNotNull( entry );
+        count++;
+    }
+
+    SearchResultDone done = cursor.getSearchResultDone();
+
+    assertNotNull( done );
+    assertEquals( ResultCodeEnum.SUCCESS, done.getLdapResult().getResultCode() );
+    assertEquals( 4, count );
+    cursor.close();
+}
+
+
+@Test
+public void testSimpleSearchWithControl() throws Exception
+{
+    SearchRequest searchRequest = new SearchRequestImpl().setBase( new Dn( "ou=system" ) )
+        .setFilter( "(objectclass=*)" )
+        .setScope( SearchScope.ONELEVEL ).addControl( new ManageDsaITImpl() );
+    SearchCursor cursor = connection.search( searchRequest );
+    int count = 0;
+
+    while ( cursor.next() )
+    {
+        Response response = cursor.get();
+        assertNotNull( response );
+
+        if ( response instanceof SearchResultEntry )
+        {
+            Entry entry = ( ( SearchResultEntry ) response ).getEntry();
+            assertNotNull( entry );
+        }
+
+        count++;
+    }
+
+    SearchResultDone done = cursor.getSearchResultDone();
+
+    assertNotNull( done );
+    assertEquals( ResultCodeEnum.SUCCESS, done.getLdapResult().getResultCode() );
+    assertEquals( 4, count );
+    cursor.close();
+}
+
+
+@Test
+public void testSearch() throws Exception
+{
+    EntryCursor cursor = connection.search( "ou=system", "(objectclass=*)",
+        SearchScope.ONELEVEL,
+        "*", "+" );
+    int count = 0;
+
+    while ( cursor.next() )
+    {
+        assertNotNull( cursor.get() );
+        count++;
+    }
+
+    SearchResultDone done = cursor.getSearchResultDone();
+
+    assertNotNull( done );
+    assertEquals( ResultCodeEnum.SUCCESS, done.getLdapResult().getResultCode() );
+    assertEquals( 4, count );
+    cursor.close();
+}
+
+
+@Test
+public void testSearchEquality() throws Exception
+{
+    EntryCursor cursor = connection.search( "ou=system", "(objectclass=organizationalUnit)",
+        SearchScope.ONELEVEL, "*", "+" );
+    int count = 0;
+
+    while ( cursor.next() )
+    {
+        Entry entry = cursor.get();
+        assertNotNull( entry );
+        count++;
+    }
+
+    assertEquals( 2, count );
+    cursor.close();
+}
+
+
+@Test
+public void testAsyncSearch() throws Exception
+{
+    SearchFuture searchFuture = connection.searchAsync( "ou=system", "(objectclass=*)", SearchScope.ONELEVEL, "*",
+        "+" );
+    int count = 0;
+    Response searchResponse = null;
+
+    do
+    {
+        searchResponse = searchFuture.get( 1000, TimeUnit.MILLISECONDS );
+        assertNotNull( searchResponse );
+        if ( !( searchResponse instanceof SearchResultDone ) )
+        {
+            count++;
+        }
+    }
+    while ( !( searchResponse instanceof SearchResultDone ) );
+
+    assertEquals( 4, count );
+}
+
+
+/**
+ * Test a search with a Substring filter
+ * @throws Exception
+ */
+@Test
+public void testSearchPersonSubstring() throws Exception
+{
+    SearchFuture searchFuture = connection.searchAsync( "ou=system", "(objectclass=*ers*)", SearchScope.SUBTREE,
+        "*", "+" );
+    int count = 0;
+    Response searchResponse = null;
+
+    do
+    {
+        searchResponse = searchFuture.get( 100000, TimeUnit.MILLISECONDS );
+        assertNotNull( searchResponse );
+
+        if ( !( searchResponse instanceof SearchResultDone ) )
+        {
+            count++;
+        }
+    }
+    while ( !( searchResponse instanceof SearchResultDone ) );
+
+    assertEquals( 2, count );
+}
+
+
+@Test
+public void testSearchWithDerefAlias() throws Exception
+{
+    SearchRequest searchRequest = new SearchRequestImpl();
+    searchRequest.setBase( new Dn( "ou=system" ) );
+    searchRequest.setFilter( "(objectClass=*)" );
+    searchRequest.setScope( SearchScope.ONELEVEL );
+    searchRequest.addAttributes( "*" );
+
+    int count = 0;
+    Cursor<Response> cursor = connection.search( searchRequest );
+
+    while ( cursor.next() )
+    {
+        count++;
+    }
+    cursor.close();
+
+    // due to dereferencing of aliases we get only one entry
+    assertEquals( 4, count );
+
+    count = 0;
+    searchRequest.setDerefAliases( AliasDerefMode.NEVER_DEREF_ALIASES );
+    cursor = connection.search( searchRequest );
+
+    while ( cursor.next() )
+    {
+        count++;
+    }
+    cursor.close();
+
+    assertEquals( 5, count );
+}
+
+
+@Test
+public void testSearchUTF8() throws Exception
+{
+    EntryCursor cursor = connection.search( "ou=system", "(sn=Emmanuel L\u00E9charny)", SearchScope.ONELEVEL,
+        "*", "+" );
+
+    assertTrue( cursor.next() );
+
+    Entry entry = cursor.get();
+    assertNotNull( entry );
+    assertTrue( entry.contains( "cn", "elecharny" ) );
+    assertTrue( entry.contains( "sn", "Emmanuel L\u00E9charny" ) );
+
+    cursor.close();
+}
+
+
+@Test
+public void testSearchBinary() throws Exception
+{
+    connection.loadSchema();
+    EntryCursor cursor = connection
+        .search(
+            "ou=system",
+            "(publicKey=\\30\\5C\\30\\0D\\06\\09\\2A\\86\\48\\86\\F7\\0D\\01\\01\\01\\05\\00\\03\\4B\\00\\30\\48\\02\\41\\00\\A6\\C7\\9C\\B1\\6C\\E4\\DD\\8F\\1E\\4D\\20\\93\\22\\3F\\83\\75\\DE\\21\\D8\\F1\\9D\\63\\80\\5B\\94\\55\\6A\\9E\\33\\59\\9B\\8D\\63\\88\\0D\\18\\7D\\4C\\85\\F1\\CF\\54\\77\\32\\E9\\61\\0C\\A2\\8F\\B3\\6B\\15\\34\\5E\\1F\\88\\BF\\A0\\73\\AC\\86\\BB\\D0\\85\\02\\03\\01\\00\\01)",
+            SearchScope.SUBTREE, "publicKey" );
+
+    assertTrue( cursor.next() );
+
+    Entry entry = cursor.get();
+    assertNotNull( entry.get( "publicKey" ) );
+
+    cursor.close();
+}
+
+
+@Test
+public void testSubDn() throws Exception
+{
+    connection.loadSchema();
+    EntryCursor cursor = connection.search( "ou=system", "(cn=user1)", SearchScope.SUBTREE, "publicKey" );
+
+    assertTrue( cursor.next() );
+
+    Entry entry = cursor.get();
+    assertEquals( "cn=user1,ou=system", entry.getDn().getName() );
+
+    cursor.close();
+
+    SearchRequest req = new SearchRequestImpl();
+    req.setScope( SearchScope.SUBTREE );
+    req.addAttributes( "*" );
+    req.setTimeLimit( 0 );
+    req.setBase( new Dn( "ou=system" ) );
+    req.setFilter( "(cn=user1)" );
+
+    SearchCursor searchCursor = connection.search( req );
+
+    assertTrue( searchCursor.next() );
+
+    Response response = searchCursor.get();
+
+    Entry resultEntry = ( ( SearchResultEntry ) response ).getEntry();
+    assertEquals( "cn=user1,ou=system", resultEntry.getDn().getName() );
+
+    cursor.close();
+}
+}

Modified: directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java?rev=1470485&r1=1470484&r2=1470485&view=diff
==============================================================================
--- directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java (original)
+++ directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java Mon Apr 22 12:52:46 2013
@@ -26,9 +26,9 @@ import java.net.ServerSocket;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.directory.server.annotations.CreateChngPwdServer;
 import org.apache.directory.api.ldap.model.constants.SupportedSaslMechanisms;
 import org.apache.directory.api.util.Strings;
+import org.apache.directory.server.annotations.CreateChngPwdServer;
 import org.apache.directory.server.annotations.CreateConsumer;
 import org.apache.directory.server.annotations.CreateKdcServer;
 import org.apache.directory.server.annotations.CreateLdapServer;
@@ -115,7 +115,7 @@ public class ServerAnnotationProcessor
             int port = AvailablePortFinder.getNextAvailable( 1024 );
             Transport ldap = new TcpTransport( port );
             ldapServer.addTransports( ldap );
-            
+
             port = AvailablePortFinder.getNextAvailable( port );
             Transport ldaps = new TcpTransport( port );
             ldaps.setEnableSSL( true );
@@ -143,6 +143,9 @@ public class ServerAnnotationProcessor
             // Associate the DS to this LdapServer
             ldapServer.setDirectoryService( directoryService );
 
+            // Propagate the anonymous flag to the DS
+            directoryService.setAllowAnonymousAccess( createLdapServer.allowAnonymousAccess() );
+
             ldapServer.setSaslHost( createLdapServer.saslHost() );
 
             ldapServer.setSaslPrincipal( createLdapServer.saslPrincipal() );
@@ -199,15 +202,15 @@ public class ServerAnnotationProcessor
                     }
                 }
             }
-            
+
             List<String> realms = new ArrayList<String>();
-            for( String s : createLdapServer.saslRealms() )
+            for ( String s : createLdapServer.saslRealms() )
             {
                 realms.add( s );
             }
-            
+
             ldapServer.setSaslRealms( realms );
-            
+
             return ldapServer;
         }
         else
@@ -375,10 +378,11 @@ public class ServerAnnotationProcessor
         return createKdcServer( createKdcServer, directoryService, startPort );
     }
 
-    
-    private static KdcServer createKdcServer( CreateKdcServer createKdcServer, DirectoryService directoryService, int startPort )
+
+    private static KdcServer createKdcServer( CreateKdcServer createKdcServer, DirectoryService directoryService,
+        int startPort )
     {
-        if( createKdcServer == null )
+        if ( createKdcServer == null )
         {
             return null;
         }
@@ -388,22 +392,22 @@ public class ServerAnnotationProcessor
         kdcConfig.setPrimaryRealm( createKdcServer.primaryRealm() );
         kdcConfig.setMaximumTicketLifetime( createKdcServer.maxTicketLifetime() );
         kdcConfig.setMaximumRenewableLifetime( createKdcServer.maxRenewableLifetime() );
-        
+
         KdcServer kdcServer = new KdcServer( kdcConfig );
-        
+
         kdcServer.setSearchBaseDn( createKdcServer.searchBaseDn() );
-        
+
         CreateTransport[] transportBuilders = createKdcServer.transports();
-        
-        if( transportBuilders == null )
+
+        if ( transportBuilders == null )
         {
             // create only UDP transport if none specified
             UdpTransport defaultTransport = new UdpTransport( AvailablePortFinder.getNextAvailable( startPort ) );
             kdcServer.addTransports( defaultTransport );
         }
-        else if( transportBuilders.length > 0 )
+        else if ( transportBuilders.length > 0 )
         {
-            for( CreateTransport transportBuilder : transportBuilders )
+            for ( CreateTransport transportBuilder : transportBuilders )
             {
                 Transport t = createTransport( transportBuilder, startPort );
                 startPort = t.getPort() + 1;
@@ -412,29 +416,28 @@ public class ServerAnnotationProcessor
         }
 
         CreateChngPwdServer[] createChngPwdServers = createKdcServer.chngPwdServer();
-        
-        
-        if( createChngPwdServers.length > 0 )
+
+        if ( createChngPwdServers.length > 0 )
         {
-            
+
             CreateChngPwdServer createChngPwdServer = createChngPwdServers[0];
             ChangePasswordConfig config = new ChangePasswordConfig( kdcConfig );
             config.setServicePrincipal( createChngPwdServer.srvPrincipal() );
-            
+
             ChangePasswordServer chngPwdServer = new ChangePasswordServer( config );
-            
-            for( CreateTransport transportBuilder : createChngPwdServer.transports() )
+
+            for ( CreateTransport transportBuilder : createChngPwdServer.transports() )
             {
                 Transport t = createTransport( transportBuilder, startPort );
                 startPort = t.getPort() + 1;
                 chngPwdServer.addTransports( t );
             }
-            
+
             chngPwdServer.setDirectoryService( directoryService );
-            
+
             kdcServer.setChangePwdServer( chngPwdServer );
         }
-        
+
         kdcServer.setDirectoryService( directoryService );
 
         // Launch the server
@@ -449,8 +452,8 @@ public class ServerAnnotationProcessor
 
         return kdcServer;
     }
-    
-    
+
+
     public static Transport createTransport( CreateTransport transportBuilder, int startPort )
     {
         String protocol = transportBuilder.protocol();
@@ -464,7 +467,7 @@ public class ServerAnnotationProcessor
             port = AvailablePortFinder.getNextAvailable( startPort );
             startPort = port + 1;
         }
-        
+
         if ( protocol.equalsIgnoreCase( "TCP" ) )
         {
             Transport tcp = new TcpTransport( address, port, nbThreads, backlog );
@@ -480,9 +483,10 @@ public class ServerAnnotationProcessor
             throw new IllegalArgumentException( I18n.err( I18n.ERR_689, protocol ) );
         }
     }
-    
-    
-    public static KdcServer getKdcServer( Description description, DirectoryService directoryService, int startPort ) throws Exception
+
+
+    public static KdcServer getKdcServer( Description description, DirectoryService directoryService, int startPort )
+        throws Exception
     {
         CreateKdcServer createLdapServer = description.getAnnotation( CreateKdcServer.class );
 

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java?rev=1470485&r1=1470484&r2=1470485&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java Mon Apr 22 12:52:46 2013
@@ -72,6 +72,7 @@ public class DelegatedAuthIT extends Abs
     @Rule
     public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
 
+
     /**
      * Test with bindDn which is not even found under any namingContext of the
      * server.
@@ -165,7 +166,7 @@ public class DelegatedAuthIT extends Abs
         transports =
             {
                 @CreateTransport(protocol = "LDAP")
-        })
+        }, allowAnonymousAccess = true)
     @Test
     public void testMultipleAuthenticators() throws Exception
     {