Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 39121 invoked from network); 5 Feb 2006 20:16:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Feb 2006 20:16:59 -0000 Received: (qmail 30501 invoked by uid 500); 5 Feb 2006 20:16:58 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 30477 invoked by uid 500); 5 Feb 2006 20:16:58 -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 30466 invoked by uid 99); 5 Feb 2006 20:16:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Feb 2006 12:16:58 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 05 Feb 2006 12:16:57 -0800 Received: (qmail 38928 invoked by uid 65534); 5 Feb 2006 20:16:37 -0000 Message-ID: <20060205201637.38925.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r375094 - /directory/sandbox/akarasulu/rc1refactor/apacheds/simple/unit/src/main/java/org/apache/ldap/server/AbstractServerTest.java Date: Sun, 05 Feb 2006 20:16:37 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: akarasulu Date: Sun Feb 5 12:16:36 2006 New Revision: 375094 URL: http://svn.apache.org/viewcvs?rev=375094&view=rev Log: formatting Modified: directory/sandbox/akarasulu/rc1refactor/apacheds/simple/unit/src/main/java/org/apache/ldap/server/AbstractServerTest.java Modified: directory/sandbox/akarasulu/rc1refactor/apacheds/simple/unit/src/main/java/org/apache/ldap/server/AbstractServerTest.java URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1refactor/apacheds/simple/unit/src/main/java/org/apache/ldap/server/AbstractServerTest.java?rev=375094&r1=375093&r2=375094&view=diff ============================================================================== --- directory/sandbox/akarasulu/rc1refactor/apacheds/simple/unit/src/main/java/org/apache/ldap/server/AbstractServerTest.java (original) +++ directory/sandbox/akarasulu/rc1refactor/apacheds/simple/unit/src/main/java/org/apache/ldap/server/AbstractServerTest.java Sun Feb 5 12:16:36 2006 @@ -77,7 +77,6 @@ port = AvailablePortFinder.getNextAvailable( 1024 ); configuration.setLdapPort( port ); configuration.setShutdownHookEnabled( false ); - setSysRoot( "uid=admin,ou=system", "secret" ); } @@ -114,11 +113,9 @@ protected LdapContext setSysRoot( String user, String passwd ) throws NamingException { Hashtable env = new Hashtable( configuration.toJndiEnvironment() ); - env.put( Context.SECURITY_PRINCIPAL, user ); env.put( Context.SECURITY_CREDENTIALS, passwd ); env.put( Context.SECURITY_AUTHENTICATION, "simple" ); - return setSysRoot( env ); } @@ -137,7 +134,6 @@ Hashtable envFinal = new Hashtable( env ); envFinal.put( Context.PROVIDER_URL, "ou=system" ); envFinal.put( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName() ); - return sysRoot = new InitialLdapContext( envFinal, null ); } @@ -150,19 +146,12 @@ protected void tearDown() throws Exception { super.tearDown(); - Hashtable env = new Hashtable(); - env.put( Context.PROVIDER_URL, "ou=system" ); - env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.ldap.server.jndi.ServerContextFactory" ); - env.putAll( new ShutdownConfiguration().toJndiEnvironment() ); - env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" ); - env.put( Context.SECURITY_CREDENTIALS, "secret" ); - try { new InitialContext( env ); } catch( Exception e ) {} sysRoot = null; @@ -183,40 +172,28 @@ protected void importLdif( InputStream in ) throws NamingException { Hashtable env = new Hashtable(); - env.putAll( sysRoot.getEnvironment() ); - LdapContext ctx = new InitialLdapContext( env, null ); - LdifParser parser = new LdifParserImpl(); try { LdifIterator iterator = new LdifIterator( in ); - while ( iterator.hasNext() ) { Attributes attributes = new LockableAttributesImpl(); - String ldif = ( String ) iterator.next(); - parser.parse( attributes, ldif ); - Name dn = new LdapName( ( String ) attributes.remove( "dn" ).get() ); - dn.remove( 0 ); - ctx.createSubcontext( dn, attributes ); } } catch ( Exception e ) { String msg = "failed while trying to parse system ldif file"; - NamingException ne = new LdapConfigurationException( msg ); - ne.setRootCause( e ); - throw ne; } }