You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by tr...@apache.org on 2015/05/21 02:37:41 UTC

svn commit: r1680712 - in /jackrabbit/oak/branches/1.0/oak-auth-ldap: ./ src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/ src/test/resources/

Author: tripod
Date: Thu May 21 00:37:41 2015
New Revision: 1680712

URL: http://svn.apache.org/r1680712
Log:
@Upgrade internal LDAP test server to version 2.0.0-M20

Modified:
    jackrabbit/oak/branches/1.0/oak-auth-ldap/pom.xml
    jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java
    jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/InternalLdapServer.java
    jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/resources/logback-test.xml

Modified: jackrabbit/oak/branches/1.0/oak-auth-ldap/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.0/oak-auth-ldap/pom.xml?rev=1680712&r1=1680711&r2=1680712&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.0/oak-auth-ldap/pom.xml (original)
+++ jackrabbit/oak/branches/1.0/oak-auth-ldap/pom.xml Thu May 21 00:37:41 2015
@@ -31,6 +31,10 @@
     <name>Oak LDAP Authentication Support</name>
     <packaging>bundle</packaging>
 
+    <properties>
+        <apacheds.test.version>2.0.0-M20</apacheds.test.version>
+    </properties>
+
     <build>
         <plugins>
             <plugin>
@@ -41,6 +45,7 @@
                         <Import-Package>
                             !org.dom4j.*,
                             !org.xmlpull.v1,
+                            !sun.net.util,
                             *
                         </Import-Package>
                         <Embed-Dependency>
@@ -172,38 +177,185 @@
             <artifactId>logback-classic</artifactId>
             <scope>test</scope>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>oak-core</artifactId>
+            <version>${project.version}</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>oak-auth-external</artifactId>
+            <version>${project.version}</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- test dependencies for apache DS server. -->
+        <!-- note: we don't include apacheds-all since we then have a duplicate schema ldiff in the classpath -->
         <dependency>
             <groupId>org.apache.directory.server</groupId>
-            <artifactId>apacheds-all</artifactId>
-            <version>2.0.0-M20</version>
+            <artifactId>apacheds-core</artifactId>
+            <version>${apacheds.test.version}</version>
             <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.directory.api</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.apache.directory.server</groupId>
-            <artifactId>apacheds-server-unit</artifactId>
-            <version>1.5.5</version>
+            <artifactId>apacheds-core-annotations</artifactId>
+            <version>${apacheds.test.version}</version>
             <scope>test</scope>
             <exclusions>
                 <exclusion>
-                    <groupId>org.apache.directory.server</groupId>
+                    <groupId>org.apache.directory.api</groupId>
                     <artifactId>*</artifactId>
                 </exclusion>
             </exclusions>
         </dependency>
         <dependency>
-            <groupId>org.apache.jackrabbit</groupId>
-            <artifactId>oak-core</artifactId>
-            <version>${project.version}</version>
-            <classifier>tests</classifier>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-core-api</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.directory.api</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-core-avl</artifactId>
+            <version>${apacheds.test.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.jackrabbit</groupId>
-            <artifactId>oak-auth-external</artifactId>
-            <version>${project.version}</version>
-            <classifier>tests</classifier>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-core-constants</artifactId>
+            <version>${apacheds.test.version}</version>
             <scope>test</scope>
         </dependency>
-
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-core-jndi</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-interceptor-kerberos</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-kerberos-codec</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-ldif-partition</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.directory.api</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-protocol-dhcp</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-protocol-dns</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-protocol-kerberos</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-protocol-ldap</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.directory.api</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-protocol-ntp</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-protocol-shared</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-server-annotations</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-server-config</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.directory.api</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-server-jndi</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.directory.api</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.directory.server</groupId>
+            <artifactId>apacheds-xdbm-partition</artifactId>
+            <version>${apacheds.test.version}</version>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.directory.api</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
     </dependencies>
 </project>

Modified: jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java?rev=1680712&r1=1680711&r2=1680712&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java (original)
+++ jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/AbstractServer.java Thu May 21 00:37:41 2015
@@ -20,6 +20,7 @@
 package org.apache.jackrabbit.oak.security.authentication.ldap;
 
 
+import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -36,26 +37,24 @@ import javax.naming.ldap.InitialLdapCont
 import javax.naming.ldap.LdapContext;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.api.ldap.model.constants.SupportedSaslMechanisms;
 import org.apache.directory.api.ldap.model.entry.DefaultEntry;
 import org.apache.directory.api.ldap.model.ldif.LdifEntry;
 import org.apache.directory.api.ldap.model.ldif.LdifReader;
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
-import org.apache.directory.api.ldap.model.schema.registries.SchemaLoader;
-import org.apache.directory.api.ldap.schema.extractor.SchemaLdifExtractor;
-import org.apache.directory.api.ldap.schema.extractor.impl.DefaultSchemaLdifExtractor;
-import org.apache.directory.api.ldap.schema.loader.LdifSchemaLoader;
 import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
 import org.apache.directory.server.constants.ServerDNConstants;
+import org.apache.directory.server.constants.SystemSchemaConstants;
 import org.apache.directory.server.core.DefaultDirectoryService;
+import org.apache.directory.server.core.api.CacheService;
 import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.core.api.InstanceLayout;
 import org.apache.directory.server.core.api.schema.SchemaPartition;
-import org.apache.directory.server.core.factory.JdbmPartitionFactory;
 import org.apache.directory.server.core.jndi.CoreContextFactory;
-import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
 import org.apache.directory.server.core.partition.ldif.LdifPartition;
+import org.apache.directory.server.core.shared.DefaultDnFactory;
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.server.ldap.handlers.extended.StartTlsHandler;
 import org.apache.directory.server.ldap.handlers.extended.StoredProcedureExtendedOperationHandler;
@@ -66,17 +65,12 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.server.ldap.handlers.sasl.ntlm.NtlmMechanismHandler;
 import org.apache.directory.server.ldap.handlers.sasl.plain.PlainMechanismHandler;
 import org.apache.directory.server.protocol.shared.transport.TcpTransport;
-import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
 import org.apache.mina.util.AvailablePortFinder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * A simple testcase for testing JNDI provider functionality.
- *
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev: 784530 $
+ * A simple ldap test server
  */
 public abstract class AbstractServer {
     private static final Logger LOG = LoggerFactory.getLogger(AbstractServer.class);
@@ -84,21 +78,11 @@ public abstract class AbstractServer {
     private static final String CTX_FACTORY = "com.sun.jndi.ldap.LdapCtxFactory";
 
     /**
-     * the context root for the system partition
-     */
-    protected LdapContext sysRoot;
-
-    /**
      * the context root for the rootDSE
      */
     protected CoreSession rootDSE;
 
     /**
-     * the context root for the schema
-     */
-    protected LdapContext schemaRoot;
-
-    /**
      * flag whether to delete database files for each test or not
      */
     protected boolean doDelete = true;
@@ -111,54 +95,30 @@ public abstract class AbstractServer {
 
 
     /**
-     * If there is an LDIF file with the same name as the test class
-     * but with the .ldif extension then it is read and the entries
-     * it contains are added to the server.  It appears as though the
-     * administor adds these entries to the server.
-     *
-     * @param verifyEntries whether or not all entry additions are checked
-     *                      to see if they were in fact correctly added to the server
-     * @return a list of entries added to the server in the order they were added
-     * @throws NamingException of the load fails
-     */
-    protected List<LdifEntry> loadTestLdif(boolean verifyEntries) throws Exception {
-        return loadLdif(getClass().getResourceAsStream(getClass().getSimpleName() + ".ldif"), verifyEntries);
-    }
-
-
-    /**
      * Loads an LDIF from an input stream and adds the entries it contains to
      * the server.  It appears as though the administrator added these entries
      * to the server.
      *
      * @param in            the input stream containing the LDIF entries to load
-     * @param verifyEntries whether or not all entry additions are checked
-     *                      to see if they were in fact correctly added to the server
      * @return a list of entries added to the server in the order they were added
      * @throws NamingException of the load fails
      */
-    protected List<LdifEntry> loadLdif(InputStream in, boolean verifyEntries) throws Exception {
+    protected List<LdifEntry> loadLdif(InputStream in) throws Exception {
         if (in == null) {
             return EMPTY_LIST;
         }
-
         LdifReader ldifReader = new LdifReader(in);
-        return loadLdif(ldifReader, verifyEntries);
+        return loadLdif(ldifReader);
     }
 
-    protected List<LdifEntry> loadLdif(LdifReader ldifReader, boolean verifyEntries) throws Exception {
+    protected List<LdifEntry> loadLdif(LdifReader ldifReader) throws Exception {
         List<LdifEntry> entries = new ArrayList<LdifEntry>();
         for (LdifEntry ldifEntry : ldifReader) {
             Dn dn = ldifEntry.getDn();
             if (ldifEntry.isEntry()) {
                 org.apache.directory.api.ldap.model.entry.Entry items = ldifEntry.getEntry();
                 rootDSE.add(new DefaultEntry(directoryService.getSchemaManager(), items));
-                if (verifyEntries) {
-                    verify(ldifEntry);
-                    LOG.info("Successfully verified addition of entry {}", dn);
-                } else {
-                    LOG.info("Added entry {} without verification", dn);
-                }
+                LOG.info("Added entry {}", dn);
                 entries.add(ldifEntry);
             }
         }
@@ -172,39 +132,12 @@ public abstract class AbstractServer {
      * @param ldif the entries to inject
      * @throws NamingException if the entries cannot be added
      */
-    protected void injectEntries(String ldif) throws Exception {
-        LdifReader reader = new LdifReader();
-        loadLdif(reader, false);
-    }
-
-    /**
-     * Verifies that an entry exists in the directory with the
-     * specified attributes.
-     *
-     * @param entry the entry to verify
-     * @throws NamingException if there are problems accessing the entry
-     */
-    protected void verify(LdifEntry entry) throws Exception {
-//        Entry readEntry = rootDSE.lookup( entry.getDn() );
-//
-//        for ( EntryAttribute readAttribute:readEntry )
-//        {
-//            String id = readAttribute.getId();
-//            EntryAttribute origAttribute = entry.getEntry().get( id );
-//
-//            for ( Value<?> value:origAttribute )
-//            {
-//                if ( ! readAttribute.contains( value ) )
-//                {
-//                    LOG.error( "Failed to verify entry addition of {}. {} attribute in original " +
-//                            "entry missing from read entry.", entry.getDn(), id );
-//                    throw new AssertionFailedError( "Failed to verify entry addition of " + entry.getDn()  );
-//                }
-//            }
-//        }
+    protected void addEntry(String ldif) throws Exception {
+        ByteArrayInputStream in = new ByteArrayInputStream(ldif.getBytes("utf-8"));
+        LdifReader reader = new LdifReader(in);
+        loadLdif(reader);
     }
 
-
     /**
      * Common code to get an initial context via a simple bind to the
      * server over the wire using the SUN JNDI LDAP provider. Do not use
@@ -231,11 +164,6 @@ public abstract class AbstractServer {
      * @throws NamingException if the server cannot be contacted
      */
     protected LdapContext getWiredContext(String bindPrincipalDn, String password) throws Exception {
-//        if ( ! apacheDS.isStarted() )
-//        {
-//            throw new ConfigurationException( "The server is not online! Cannot connect to it." );
-//        }
-
         Hashtable<String, String> env = new Hashtable<String, String>();
         env.put(Context.INITIAL_CONTEXT_FACTORY, CTX_FACTORY);
         env.put(Context.PROVIDER_URL, "ldap://localhost:" + port);
@@ -254,18 +182,40 @@ public abstract class AbstractServer {
         File cwd = new File("target", "apacheds");
         doDelete(cwd);
 
+        // setup directory service
         directoryService = new DefaultDirectoryService();
         directoryService.setShutdownHookEnabled(false);
         directoryService.setInstanceLayout(new InstanceLayout(cwd));
-        directoryService.setSystemPartition(createSystemPartition(directoryService, cwd));
 
+        CacheService cache = new CacheService();
+        cache.initialize(directoryService.getInstanceLayout());
 
+        SchemaManager schemaManager = new DefaultSchemaManager();
+        directoryService.setSchemaManager(schemaManager);
+        directoryService.setDnFactory(new DefaultDnFactory(directoryService.getSchemaManager(), cache.getCache("dnCache")));
+
+        LdifPartition schLdifPart = new LdifPartition(directoryService.getSchemaManager(), directoryService.getDnFactory());
+        schLdifPart.setId("schema");
+        schLdifPart.setPartitionPath(new File(directoryService.getInstanceLayout().getPartitionsDirectory(), "schema").toURI());
+        schLdifPart.setSuffixDn(directoryService.getDnFactory().create(ServerDNConstants.CN_SCHEMA_DN));
+        SchemaPartition schPart = new SchemaPartition(directoryService.getSchemaManager());
+        schPart.setWrappedPartition(schLdifPart);
+        directoryService.setSchemaPartition(schPart);
+
+
+        LdifPartition sysPart = new LdifPartition(directoryService.getSchemaManager(), directoryService.getDnFactory());
+        sysPart.setId(SystemSchemaConstants.SCHEMA_NAME);
+        sysPart.setPartitionPath(new File(directoryService.getInstanceLayout().getPartitionsDirectory(), SystemSchemaConstants.SCHEMA_NAME).toURI());
+        sysPart.setSuffixDn(directoryService.getDnFactory().create(ServerDNConstants.SYSTEM_DN));
+        directoryService.setSystemPartition(sysPart);
+
+        // setup ldap server
         port = AvailablePortFinder.getNextAvailable(1024);
         ldapServer = new LdapServer();
         ldapServer.setTransports(new TcpTransport(port));
         ldapServer.setDirectoryService(directoryService);
 
-        setupSaslMechanisms(ldapServer);
+        setupSaslMechanisms();
 
         directoryService.startup();
 
@@ -276,19 +226,7 @@ public abstract class AbstractServer {
         setContexts(ServerDNConstants.ADMIN_SYSTEM_DN, "secret");
     }
 
-    private JdbmPartition createSystemPartition(DirectoryService service,
-                                                final File workingDirectory) throws Exception {
-        JdbmPartitionFactory partitionFactory = new JdbmPartitionFactory();
-        JdbmPartition systemPartition = partitionFactory.createPartition(
-                service.getSchemaManager(),
-                service.getDnFactory(), "system", ServerDNConstants.SYSTEM_DN, 500,
-                new File(workingDirectory, "system"));
-        partitionFactory.addIndex(systemPartition, SchemaConstants.OBJECT_CLASS_AT, 100);
-        systemPartition.setSchemaManager(service.getSchemaManager());
-        return systemPartition;
-    }
-
-    private void setupSaslMechanisms(LdapServer server) {
+    private void setupSaslMechanisms() {
         Map<String, MechanismHandler> mechanismHandlerMap = new HashMap<String, MechanismHandler>();
 
         mechanismHandlerMap.put(SupportedSaslMechanisms.PLAIN, new PlainMechanismHandler());
@@ -352,7 +290,6 @@ public abstract class AbstractServer {
         setContexts(env);
     }
 
-
     /**
      * Sets the contexts of this class taking into account the extras and overrides
      * properties.
@@ -362,17 +299,10 @@ public abstract class AbstractServer {
      */
     protected void setContexts(Hashtable<String, Object> env) throws Exception {
         Hashtable<String, Object> envFinal = new Hashtable<String, Object>(env);
-        envFinal.put(Context.PROVIDER_URL, ServerDNConstants.SYSTEM_DN);
-        sysRoot = new InitialLdapContext(envFinal, null);
-
         envFinal.put(Context.PROVIDER_URL, "");
         rootDSE = directoryService.getAdminSession();
-
-        envFinal.put(Context.PROVIDER_URL, ServerDNConstants.CN_SCHEMA_DN);
-        schemaRoot = new InitialLdapContext(envFinal, null);
     }
 
-
     /**
      * Sets the system context root to null.
      */
@@ -381,41 +311,7 @@ public abstract class AbstractServer {
         try {
             directoryService.shutdown();
         } catch (Exception e) {
+            // ignore
         }
-
-        sysRoot = null;
     }
-
-
-//    /**
-//     * Imports the LDIF entries packaged with the Eve JNDI provider jar into
-//     * the newly created system partition to prime it up for operation.  Note
-//     * that only ou=system entries will be added - entries for other partitions
-//     * cannot be imported and will blow chunks.
-//     *
-//     * @throws NamingException if there are problems reading the ldif file and
-//     * adding those entries to the system partition
-//     * @param in the input stream with the ldif
-//     */
-//    protected void importLdif( InputStream in ) throws NamingException
-//    {
-//        try
-//        {
-//            for ( LdifEntry ldifEntry:new LdifReader( in ) )
-//            {
-//                rootDSE.add(
-//                    new DefaultServerEntry(
-//                        rootDSE.getDirectoryService().getRegistries(), ldifEntry.getEntry() ) );
-//            }
-//        }
-//        catch ( Exception e )
-//        {
-//            String msg = "failed while trying to parse system ldif file";
-//            NamingException ne = new LdapConfigurationException( msg );
-//            ne.setRootCause( e );
-//            throw ne;
-//        }
-//    }
-//
-//
 }

Modified: jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/InternalLdapServer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/InternalLdapServer.java?rev=1680712&r1=1680711&r2=1680712&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/InternalLdapServer.java (original)
+++ jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/java/org/apache/jackrabbit/oak/security/authentication/ldap/InternalLdapServer.java Thu May 21 00:37:41 2015
@@ -16,8 +16,6 @@
  */
 package org.apache.jackrabbit.oak.security.authentication.ldap;
 
-import java.io.InputStream;
-
 import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.ldap.LdapContext;
@@ -55,7 +53,7 @@ class InternalLdapServer extends Abstrac
                 .append('\n').append("givenName:").append(firstName)
                 .append('\n').append("uid: ").append(userId)
                 .append('\n').append("userPassword: ").append(password).append("\n\n");
-        injectEntries(entries.toString());
+        addEntry(entries.toString());
         return dn;
     }
 
@@ -65,7 +63,7 @@ class InternalLdapServer extends Abstrac
         entries.append("dn: ").append(dn).append('\n').append("objectClass: ")
                 .append(GROUP_CLASS_ATTR).append('\n').append(GROUP_MEMBER_ATTR)
                 .append(":\n").append("cn: ").append(name).append("\n\n");
-        injectEntries(entries.toString());
+        addEntry(entries.toString());
         return dn;
     }
 
@@ -83,10 +81,6 @@ class InternalLdapServer extends Abstrac
         ctxt.modifyAttributes(groupDN, DirContext.REMOVE_ATTRIBUTE, attrs);
     }
 
-    public void loadLdif(InputStream in) throws Exception {
-        super.loadLdif(in, false);
-    }
-
     private static String buildDn(String name, boolean isGroup) {
         StringBuilder dn = new StringBuilder();
         dn.append("cn=").append(name).append(',');

Modified: jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/resources/logback-test.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/resources/logback-test.xml?rev=1680712&r1=1680711&r2=1680712&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/resources/logback-test.xml (original)
+++ jackrabbit/oak/branches/1.0/oak-auth-ldap/src/test/resources/logback-test.xml Thu May 21 00:37:41 2015
@@ -29,14 +29,14 @@
         </encoder>
     </appender>
 
-    <logger name="org.apache.directory.ldap" level="DEBUG" />
-    <logger name="org.apache.jackrabbit.oak.security.authentication.ldap" level="DEBUG" />
+    <!--<logger name="org.apache.directory.ldap" level="DEBUG" />-->
+    <!--<logger name="org.apache.jackrabbit.oak.security.authentication.ldap" level="DEBUG" />-->
 
     <root level="INFO">
         <!--
-        <appender-ref ref="file"/>
-        -->
         <appender-ref ref="console"/>
+        -->
+        <appender-ref ref="file"/>
     </root>
 
 </configuration>