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 2008/12/03 20:54:56 UTC
svn commit: r723043 - in
/directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core:
operations/bind/ operations/search/ partition/ schema/
Author: elecharny
Date: Wed Dec 3 11:54:56 2008
New Revision: 723043
URL: http://svn.apache.org/viewvc?rev=723043&view=rev
Log:
Replaced tabs by 4 spaces
Modified:
directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java
directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java
directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/partition/PartitionIT.java
directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java
Modified: directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java?rev=723043&r1=723042&r2=723043&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java (original)
+++ directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/operations/bind/SimpleBindIT.java Wed Dec 3 11:54:56 2008
@@ -57,7 +57,7 @@
@RunWith ( CiRunner.class )
public class SimpleBindIT
{
- /** The directory service */
+ /** The directory service */
public static DirectoryService service;
/**
@@ -85,38 +85,38 @@
@Test
public void testSimpleBindUserPassword()
{
- // We will bind using JNDI
- // Set up the environment for creating the initial context
+ // We will bind using JNDI
+ // Set up the environment for creating the initial context
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, service );
env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
env.put( Context.PROVIDER_URL, "ou=system" );
- // Authenticate as admin and password "secret"
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
- env.put(Context.SECURITY_PRINCIPAL, "uid=admin,ou=system");
- env.put(Context.SECURITY_CREDENTIALS, "secret");
-
- DirContext ctx = null;
-
- // Create the initial context
- try
- {
- ctx = new InitialDirContext(env);
- }
- catch ( NamingException ne )
- {
- fail();
- }
-
- try
- {
- ctx.close();
- }
- catch ( NamingException ne )
- {
- fail();
- }
+ // Authenticate as admin and password "secret"
+ env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ env.put(Context.SECURITY_PRINCIPAL, "uid=admin,ou=system");
+ env.put(Context.SECURITY_CREDENTIALS, "secret");
+
+ DirContext ctx = null;
+
+ // Create the initial context
+ try
+ {
+ ctx = new InitialDirContext(env);
+ }
+ catch ( NamingException ne )
+ {
+ fail();
+ }
+
+ try
+ {
+ ctx.close();
+ }
+ catch ( NamingException ne )
+ {
+ fail();
+ }
}
@@ -128,34 +128,34 @@
@Test
public void testSimpleBindUserBadPassword()
{
- // We will bind using JNDI
- // Set up the environment for creating the initial context
+ // We will bind using JNDI
+ // Set up the environment for creating the initial context
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, service );
env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
env.put( Context.PROVIDER_URL, "ou=system" );
- // Authenticate as admin and password "badsecret"
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
- env.put(Context.SECURITY_PRINCIPAL, "uid=admin,ou=system");
- env.put(Context.SECURITY_CREDENTIALS, "badsecret");
-
- // Create the initial context
- try
- {
- new InitialDirContext(env);
-
- // We should not be connected
- fail();
- }
- catch ( LdapAuthenticationException lae )
- {
- assertTrue( true );
- }
- catch ( NamingException ne )
- {
- fail();
- }
+ // Authenticate as admin and password "badsecret"
+ env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ env.put(Context.SECURITY_PRINCIPAL, "uid=admin,ou=system");
+ env.put(Context.SECURITY_CREDENTIALS, "badsecret");
+
+ // Create the initial context
+ try
+ {
+ new InitialDirContext(env);
+
+ // We should not be connected
+ fail();
+ }
+ catch ( LdapAuthenticationException lae )
+ {
+ assertTrue( true );
+ }
+ catch ( NamingException ne )
+ {
+ fail();
+ }
}
@@ -167,34 +167,34 @@
@Test
public void testSimpleBindBadUserPassword()
{
- // We will bind using JNDI
- // Set up the environment for creating the initial context
+ // We will bind using JNDI
+ // Set up the environment for creating the initial context
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, service );
env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
env.put( Context.PROVIDER_URL, "ou=system" );
- // Authenticate as admin and password "secret"
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
- env.put(Context.SECURITY_PRINCIPAL, "admin");
- env.put(Context.SECURITY_CREDENTIALS, "secret");
-
- // Create the initial context
- try
- {
- new InitialDirContext(env);
-
- // We should not be connected
- fail();
- }
- catch ( InvalidNameException ine )
- {
- assertEquals( "Bad DN : admin", ine.getMessage() );
- }
- catch ( NamingException ne )
- {
- fail();
- }
+ // Authenticate as admin and password "secret"
+ env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ env.put(Context.SECURITY_PRINCIPAL, "admin");
+ env.put(Context.SECURITY_CREDENTIALS, "secret");
+
+ // Create the initial context
+ try
+ {
+ new InitialDirContext(env);
+
+ // We should not be connected
+ fail();
+ }
+ catch ( InvalidNameException ine )
+ {
+ assertEquals( "Bad DN : admin", ine.getMessage() );
+ }
+ catch ( NamingException ne )
+ {
+ fail();
+ }
}
@@ -206,34 +206,34 @@
@Test
public void testSimpleBindUnknowUserPassword()
{
- // We will bind using JNDI
- // Set up the environment for creating the initial context
+ // We will bind using JNDI
+ // Set up the environment for creating the initial context
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, service );
env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
env.put( Context.PROVIDER_URL, "ou=system" );
- // Authenticate as uid=unknown and password "secret"
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
- env.put(Context.SECURITY_PRINCIPAL, "uid=unknown,ou=system");
- env.put(Context.SECURITY_CREDENTIALS, "secret");
-
- // Create the initial context
- try
- {
- new InitialDirContext(env);
-
- // We should not be connected
- fail();
- }
- catch ( LdapAuthenticationException lae )
- {
- assertEquals( "Cannot authenticate user uid=unknown,ou=system", lae.getMessage() );
- }
- catch ( NamingException ne )
- {
- fail();
- }
+ // Authenticate as uid=unknown and password "secret"
+ env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ env.put(Context.SECURITY_PRINCIPAL, "uid=unknown,ou=system");
+ env.put(Context.SECURITY_CREDENTIALS, "secret");
+
+ // Create the initial context
+ try
+ {
+ new InitialDirContext(env);
+
+ // We should not be connected
+ fail();
+ }
+ catch ( LdapAuthenticationException lae )
+ {
+ assertEquals( "Cannot authenticate user uid=unknown,ou=system", lae.getMessage() );
+ }
+ catch ( NamingException ne )
+ {
+ fail();
+ }
}
@@ -245,8 +245,8 @@
@Test
public void testSimpleBindNoUserNoPassword()
{
- // We will bind using JNDI
- // Set up the environment for creating the initial context
+ // We will bind using JNDI
+ // Set up the environment for creating the initial context
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, service );
env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
@@ -254,63 +254,63 @@
// Bind on the rootDSE
env.put( Context.PROVIDER_URL, "" );
- // Authenticate as admin and password "secret"
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
- env.put(Context.SECURITY_PRINCIPAL, "");
- env.put(Context.SECURITY_CREDENTIALS, "");
-
- DirContext ctx = null;
-
- // Create the initial context
- try
- {
- ctx = new InitialDirContext(env);
- }
- catch ( NamingException ne )
- {
- fail();
- }
-
- // We should be anonymous here.
- // Check that we can read the rootDSE
- try
- {
- NamingEnumeration<SearchResult> list = search( ctx, "", "(ObjectClass=*)", SearchControls.OBJECT_SCOPE );
-
- assertNotNull( list );
-
+ // Authenticate as admin and password "secret"
+ env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ env.put(Context.SECURITY_PRINCIPAL, "");
+ env.put(Context.SECURITY_CREDENTIALS, "");
+
+ DirContext ctx = null;
+
+ // Create the initial context
+ try
+ {
+ ctx = new InitialDirContext(env);
+ }
+ catch ( NamingException ne )
+ {
+ fail();
+ }
+
+ // We should be anonymous here.
+ // Check that we can read the rootDSE
+ try
+ {
+ NamingEnumeration<SearchResult> list = search( ctx, "", "(ObjectClass=*)", SearchControls.OBJECT_SCOPE );
+
+ assertNotNull( list );
+
while ( list.hasMore() )
{
SearchResult result = list.next();
assertNotNull( result );
}
- }
- catch ( NamingException ne )
- {
- fail();
- }
-
- // Check that we cannot read another entry being anonymous
- try
- {
- NamingEnumeration<SearchResult> list = search( ctx, "uid=admin, ou=system", "(ObjectClass=*)", SearchControls.OBJECT_SCOPE );
-
- assertNotNull( list );
- assertFalse( list.hasMore() );
- }
- catch ( NamingException ne )
- {
- fail();
- }
-
- try
- {
- ctx.close();
- }
- catch ( NamingException ne )
- {
- fail();
- }
+ }
+ catch ( NamingException ne )
+ {
+ fail();
+ }
+
+ // Check that we cannot read another entry being anonymous
+ try
+ {
+ NamingEnumeration<SearchResult> list = search( ctx, "uid=admin, ou=system", "(ObjectClass=*)", SearchControls.OBJECT_SCOPE );
+
+ assertNotNull( list );
+ assertFalse( list.hasMore() );
+ }
+ catch ( NamingException ne )
+ {
+ fail();
+ }
+
+ try
+ {
+ ctx.close();
+ }
+ catch ( NamingException ne )
+ {
+ fail();
+ }
}
@@ -322,8 +322,8 @@
@Test
public void testSimpleBindUserNoPassword()
{
- // We will bind using JNDI
- // Set up the environment for creating the initial context
+ // We will bind using JNDI
+ // Set up the environment for creating the initial context
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, service );
env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
@@ -331,24 +331,24 @@
// Bind on the rootDSE
env.put( Context.PROVIDER_URL, "" );
- // Authenticate as admin and password "secret"
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
- env.put(Context.SECURITY_PRINCIPAL, "uid=admin,ou=system");
- env.put(Context.SECURITY_CREDENTIALS, "");
-
- // Create the initial context
- try
- {
- new InitialDirContext(env);
- }
- catch ( OperationNotSupportedException onse )
- {
- assertEquals( "Cannot Bind for DN uid=admin,ou=system", onse.getMessage() );
- }
- catch ( NamingException ne )
- {
- fail();
- }
+ // Authenticate as admin and password "secret"
+ env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ env.put(Context.SECURITY_PRINCIPAL, "uid=admin,ou=system");
+ env.put(Context.SECURITY_CREDENTIALS, "");
+
+ // Create the initial context
+ try
+ {
+ new InitialDirContext(env);
+ }
+ catch ( OperationNotSupportedException onse )
+ {
+ assertEquals( "Cannot Bind for DN uid=admin,ou=system", onse.getMessage() );
+ }
+ catch ( NamingException ne )
+ {
+ fail();
+ }
}
@@ -360,8 +360,8 @@
@Test
public void testSimpleBindNoUserPassword() throws Exception
{
- // We will bind using JNDI
- // Set up the environment for creating the initial context
+ // We will bind using JNDI
+ // Set up the environment for creating the initial context
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, service );
env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
@@ -369,23 +369,23 @@
// Bind on the rootDSE
env.put( Context.PROVIDER_URL, "" );
- // Authenticate as admin and password "secret"
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
- env.put(Context.SECURITY_PRINCIPAL, "");
- env.put(Context.SECURITY_CREDENTIALS, "secret");
-
- // Create the initial context
- try
- {
- new InitialDirContext(env);
- }
- catch ( LdapNameNotFoundException lnnfe )
- {
- assertTrue( true );
- }
- catch ( NamingException ne )
- {
- fail();
- }
+ // Authenticate as admin and password "secret"
+ env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ env.put(Context.SECURITY_PRINCIPAL, "");
+ env.put(Context.SECURITY_CREDENTIALS, "secret");
+
+ // Create the initial context
+ try
+ {
+ new InitialDirContext(env);
+ }
+ catch ( LdapNameNotFoundException lnnfe )
+ {
+ assertTrue( true );
+ }
+ catch ( NamingException ne )
+ {
+ fail();
+ }
}
}
Modified: directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java?rev=723043&r1=723042&r2=723043&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java (original)
+++ directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java Wed Dec 3 11:54:56 2008
@@ -486,8 +486,8 @@
{
SearchResult result = ( SearchResult ) list.next();
- // leep 201 ms before fetching the next element ...
- Thread.sleep( 201 );
+ // Sleep 201 ms before fetching the next element ...
+ Thread.sleep( 201 );
map.put( result.getName(), result.getAttributes() );
}
Modified: directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/partition/PartitionIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/partition/PartitionIT.java?rev=723043&r1=723042&r2=723043&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/partition/PartitionIT.java (original)
+++ directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/partition/PartitionIT.java Wed Dec 3 11:54:56 2008
@@ -80,8 +80,8 @@
*/
public static class Factory implements DirectoryServiceFactory
{
- public DirectoryService newInstance() throws Exception
- {
+ public DirectoryService newInstance() throws Exception
+ {
DirectoryService service = new DefaultDirectoryService();
service.getChangeLog().setEnabled( true );
@@ -96,7 +96,7 @@
service.addPartition( bar );
return service;
- }
+ }
}
Modified: directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java?rev=723043&r1=723042&r2=723043&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java (original)
+++ directory/apacheds/branches/apacheds-mina2/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java Wed Dec 3 11:54:56 2008
@@ -599,12 +599,12 @@
try
{
- getSchemaContext( service ).createSubcontext( dn, attrs );
- fail();
+ getSchemaContext( service ).createSubcontext( dn, attrs );
+ fail();
}
catch ( NamingException ne )
{
- assertTrue( true );
+ assertTrue( true );
}
}
@@ -638,12 +638,12 @@
try
{
- getSchemaContext( service ).createSubcontext( dn, attrs );
- fail();
+ getSchemaContext( service ).createSubcontext( dn, attrs );
+ fail();
}
catch ( NamingException ne )
{
- assertTrue( true );
+ assertTrue( true );
}
}
@@ -740,12 +740,12 @@
try
{
- getSchemaContext( service ).createSubcontext( dn, attrs );
- fail();
+ getSchemaContext( service ).createSubcontext( dn, attrs );
+ fail();
}
catch ( NamingException ne )
{
- assertTrue( true );
+ assertTrue( true );
}
}