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 2012/01/24 17:22:36 UTC

svn commit: r1235328 [11/12] - in /directory/apacheds/trunk: server-annotations/src/main/java/org/apache/directory/server/annotations/ server-annotations/src/main/java/org/apache/directory/server/factory/ server-annotations/src/test/java/org/apache/dir...

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java Tue Jan 24 16:22:33 2012
@@ -61,434 +61,433 @@ import org.junit.runner.RunWith;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-@RunWith ( FrameworkRunner.class )
-@CreateLdapServer (
+@RunWith(FrameworkRunner.class)
+@CreateLdapServer(
     transports =
-    {
-        @CreateTransport( protocol = "LDAP" )
+        {
+            @CreateTransport(protocol = "LDAP")
     })
-@ApplyLdifs( {
-    "dn: ou=actors,ou=system",
-    "objectClass: top",
-    "objectClass: organizationalUnit",
-    "ou: actors",
-
-    "dn: uid=jblack,ou=actors,ou=system",
-    "objectClass: top",
-    "objectClass: person",
-    "objectClass: organizationalPerson",
-    "objectClass: uidObject",
-    "uid: jblack",
-    "ou: comedy",
-    "ou: adventure",
-    "cn: Jack Black",
-    "userPassword: secret",
-    "sn: Black",
-
-    "dn: uid=bpitt,ou=actors,ou=system",
-    "objectClass: top",
-    "objectClass: person",
-    "objectClass: organizationalPerson",
-    "objectClass: uidObject",
-    "uid: bpitt",
-    "ou: drama",
-    "ou: adventure",
-    "userPassword: secret",
-    "cn: Brad Pitt",
-    "sn: Pitt",
-
-    "dn: uid=gcloony,ou=actors,ou=system",
-    "objectClass: top",
-    "objectClass: person",
-    "objectClass: organizationalPerson",
-    "objectClass: uidObject",
-    "uid: gcloony",
-    "ou: drama",
-    "userPassword: secret",
-    "cn: Goerge Cloony",
-    "sn: Cloony",
-
-    "dn: uid=jnewbie,ou=actors,ou=system",
-    "objectClass: top",
-    "objectClass: person",
-    "objectClass: organizationalPerson",
-    "objectClass: uidObject",
-    "uid: jnewbie",
-    "userPassword: secret",
-    "cn: Joe Newbie",
-    "sn: Newbie"
-}
-    )
+@ApplyLdifs(
+    {
+        "dn: ou=actors,ou=system",
+        "objectClass: top",
+        "objectClass: organizationalUnit",
+        "ou: actors",
+
+        "dn: uid=jblack,ou=actors,ou=system",
+        "objectClass: top",
+        "objectClass: person",
+        "objectClass: organizationalPerson",
+        "objectClass: uidObject",
+        "uid: jblack",
+        "ou: comedy",
+        "ou: adventure",
+        "cn: Jack Black",
+        "userPassword: secret",
+        "sn: Black",
+
+        "dn: uid=bpitt,ou=actors,ou=system",
+        "objectClass: top",
+        "objectClass: person",
+        "objectClass: organizationalPerson",
+        "objectClass: uidObject",
+        "uid: bpitt",
+        "ou: drama",
+        "ou: adventure",
+        "userPassword: secret",
+        "cn: Brad Pitt",
+        "sn: Pitt",
+
+        "dn: uid=gcloony,ou=actors,ou=system",
+        "objectClass: top",
+        "objectClass: person",
+        "objectClass: organizationalPerson",
+        "objectClass: uidObject",
+        "uid: gcloony",
+        "ou: drama",
+        "userPassword: secret",
+        "cn: Goerge Cloony",
+        "sn: Cloony",
+
+        "dn: uid=jnewbie,ou=actors,ou=system",
+        "objectClass: top",
+        "objectClass: person",
+        "objectClass: organizationalPerson",
+        "objectClass: uidObject",
+        "uid: jnewbie",
+        "userPassword: secret",
+        "cn: Joe Newbie",
+        "sn: Newbie"
+})
 public class SearchLimitsIT extends AbstractLdapTestUnit
 {
 
-    /**
-     * An {@link Interceptor} that fakes a specified amount of delay to each
-     * search iteration so we can make sure search time limits are adhered to.
-     *
-     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
-     */
-    class DelayInducingInterceptor extends BaseInterceptor
+/**
+ * An {@link Interceptor} that fakes a specified amount of delay to each
+ * search iteration so we can make sure search time limits are adhered to.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+class DelayInducingInterceptor extends BaseInterceptor
+{
+    private Long delayMillis;
+
+
+    public DelayInducingInterceptor()
     {
-        private Long delayMillis;
-        
-        public DelayInducingInterceptor()
-        {
-            super( "DelayInterceptor" );
-        }
+        super( "DelayInterceptor" );
+    }
 
 
-        public EntryFilteringCursor search( SearchOperationContext searchContext ) throws LdapException
+    public EntryFilteringCursor search( SearchOperationContext searchContext ) throws LdapException
+    {
+        EntryFilteringCursor cursor = next( searchContext );
+        cursor.addEntryFilter( new EntryFilter()
         {
-            EntryFilteringCursor cursor = next( searchContext );
-            cursor.addEntryFilter( new EntryFilter() {
-                public boolean accept( SearchingOperationContext operation, Entry result ) throws Exception
+            public boolean accept( SearchingOperationContext operation, Entry result ) throws Exception
+            {
+                if ( delayMillis != null )
                 {
-                    if ( delayMillis != null )
-                    {
-                        Thread.sleep( delayMillis );
-                    }
-
-                    return true;
+                    Thread.sleep( delayMillis );
                 }
-            });
-
-            return cursor;
-        }
-
 
-        public void setDelayMillis( long delayMillis )
-        {
-            if ( delayMillis <= 0 )
-            {
-                this.delayMillis = null;
+                return true;
             }
+        } );
 
-            this.delayMillis = delayMillis;
-        }
+        return cursor;
     }
 
 
-    private int oldMaxTimeLimit;
-    private long oldMaxSizeLimit;
-    private DelayInducingInterceptor delayInterceptor;
-
-
-    @Before
-    public void setUp() throws Exception
+    public void setDelayMillis( long delayMillis )
     {
-        oldMaxTimeLimit = getLdapServer().getMaxTimeLimit();
-        oldMaxSizeLimit = getLdapServer().getMaxSizeLimit();
-        delayInterceptor = new DelayInducingInterceptor();
-        getLdapServer().getDirectoryService().addFirst( delayInterceptor );
-    }
-
+        if ( delayMillis <= 0 )
+        {
+            this.delayMillis = null;
+        }
 
-    @After
-    public void tearDown() throws Exception
-    {
-        getLdapServer().setMaxTimeLimit( oldMaxTimeLimit );
-        getLdapServer().setMaxSizeLimit( oldMaxSizeLimit );
-        getLdapServer().getDirectoryService().remove( "DelayInterceptor" );
+        this.delayMillis = delayMillis;
     }
+}
 
+private int oldMaxTimeLimit;
+private long oldMaxSizeLimit;
+private DelayInducingInterceptor delayInterceptor;
 
-    // -----------------------------------------------------------------------
-    // Time Limit Tests
-    // -----------------------------------------------------------------------
 
+@Before
+public void setUp() throws Exception
+{
+    oldMaxTimeLimit = getLdapServer().getMaxTimeLimit();
+    oldMaxSizeLimit = getLdapServer().getMaxSizeLimit();
+    delayInterceptor = new DelayInducingInterceptor();
+    getLdapServer().getDirectoryService().addFirst( delayInterceptor );
+}
 
-    /**
-     * Sets up the server with unlimited search time limit but constrains time
-     * by request time limit value to cause a time limit exceeded exception on
-     * the client.
-     */
-    @Test ( expected = TimeLimitExceededException.class )
-    public void testRequestConstrainedUnlimitByConfiguration() throws Exception
-    {
-        getLdapServer().setMaxTimeLimit( LdapServer.NO_TIME_LIMIT );
-        delayInterceptor.setDelayMillis( 500 );
 
-        getActorsWithLimit( "(objectClass=*)", 499, LdapServer.NO_SIZE_LIMIT );
-    }
+@After
+public void tearDown() throws Exception
+{
+    getLdapServer().setMaxTimeLimit( oldMaxTimeLimit );
+    getLdapServer().setMaxSizeLimit( oldMaxSizeLimit );
+    getLdapServer().getDirectoryService().remove( "DelayInterceptor" );
+}
 
 
-    /**
-     * Sets up the server with longer search time limit than the request's
-     * which constrains time by request time limit value to cause a time limit
-     * exceeded exception on the client.
-     */
-    @Test ( expected = TimeLimitExceededException.class )
-    public void testRequestConstrainedLessThanConfiguration() throws Exception
-    {
-        getLdapServer().setMaxTimeLimit( 10000 ); // this is in seconds
-        delayInterceptor.setDelayMillis( 500 );
+// -----------------------------------------------------------------------
+// Time Limit Tests
+// -----------------------------------------------------------------------
+
+/**
+ * Sets up the server with unlimited search time limit but constrains time
+ * by request time limit value to cause a time limit exceeded exception on
+ * the client.
+ */
+@Test(expected = TimeLimitExceededException.class)
+public void testRequestConstrainedUnlimitByConfiguration() throws Exception
+{
+    getLdapServer().setMaxTimeLimit( LdapServer.NO_TIME_LIMIT );
+    delayInterceptor.setDelayMillis( 500 );
 
-        getActorsWithLimit( "(objectClass=*)", 499, LdapServer.NO_SIZE_LIMIT );
-    }
+    getActorsWithLimit( "(objectClass=*)", 499, LdapServer.NO_SIZE_LIMIT );
+}
 
 
-    /**
-     * Sets up the server with shorter search time limit than the request's
-     * which constrains time by using server max limit value to cause a time
-     * limit exceeded exception on the client.
-     */
-    @Test ( expected = TimeLimitExceededException.class )
-    public void testRequestConstrainedGreaterThanConfiguration() throws Exception
-    {
-        getLdapServer().setMaxTimeLimit( 1 ); // this is in seconds
-        delayInterceptor.setDelayMillis( 1100 );
+/**
+ * Sets up the server with longer search time limit than the request's
+ * which constrains time by request time limit value to cause a time limit
+ * exceeded exception on the client.
+ */
+@Test(expected = TimeLimitExceededException.class)
+public void testRequestConstrainedLessThanConfiguration() throws Exception
+{
+    getLdapServer().setMaxTimeLimit( 10000 ); // this is in seconds
+    delayInterceptor.setDelayMillis( 500 );
 
-        getActorsWithLimit( "(objectClass=*)", 100000, LdapServer.NO_SIZE_LIMIT );
-    }
+    getActorsWithLimit( "(objectClass=*)", 499, LdapServer.NO_SIZE_LIMIT );
+}
 
 
-    /**
-     * Sets up the server with limited search time with unlimited request
-     * time limit.  Should work just fine for the administrative user.
-     */
-    @Test
-    public void testRequestUnlimitedConfigurationLimited() throws Exception
-    {
-        getLdapServer().setMaxTimeLimit( 1 ); // this is in seconds
-        delayInterceptor.setDelayMillis( 500 );
+/**
+ * Sets up the server with shorter search time limit than the request's
+ * which constrains time by using server max limit value to cause a time
+ * limit exceeded exception on the client.
+ */
+@Test(expected = TimeLimitExceededException.class)
+public void testRequestConstrainedGreaterThanConfiguration() throws Exception
+{
+    getLdapServer().setMaxTimeLimit( 1 ); // this is in seconds
+    delayInterceptor.setDelayMillis( 1100 );
 
-        getActorsWithLimit( "(objectClass=*)",
-            LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
-    }
+    getActorsWithLimit( "(objectClass=*)", 100000, LdapServer.NO_SIZE_LIMIT );
+}
 
 
-    /**
-     * Sets up the server with limited search time with unlimited request
-     * time limit.  Should not work for non administrative users.
-     */
-    @Test ( expected = TimeLimitExceededException.class )
-    public void testNonAdminRequestUnlimitedConfigurationLimited() throws Exception
-    {
-        getLdapServer().setMaxTimeLimit( 1 ); // this is in seconds
-        delayInterceptor.setDelayMillis( 500 );
+/**
+ * Sets up the server with limited search time with unlimited request
+ * time limit.  Should work just fine for the administrative user.
+ */
+@Test
+public void testRequestUnlimitedConfigurationLimited() throws Exception
+{
+    getLdapServer().setMaxTimeLimit( 1 ); // this is in seconds
+    delayInterceptor.setDelayMillis( 500 );
 
-        getActorsWithLimitNonAdmin( "(objectClass=*)",
-            LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
-    }
+    getActorsWithLimit( "(objectClass=*)",
+        LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
+}
 
 
-    // -----------------------------------------------------------------------
-    // Size Limit Tests
-    // -----------------------------------------------------------------------
+/**
+ * Sets up the server with limited search time with unlimited request
+ * time limit.  Should not work for non administrative users.
+ */
+@Test(expected = TimeLimitExceededException.class)
+public void testNonAdminRequestUnlimitedConfigurationLimited() throws Exception
+{
+    getLdapServer().setMaxTimeLimit( 1 ); // this is in seconds
+    delayInterceptor.setDelayMillis( 500 );
 
+    getActorsWithLimitNonAdmin( "(objectClass=*)",
+        LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
+}
 
-    /**
-     * Sets up the server with unlimited search size limit but constrains size
-     * by request size limit value to cause a size limit exceeded exception on
-     * the client.
-     */
-    @Test (expected = SizeLimitExceededException.class)
-    public void testRequestConstrainedUnlimitByConfigurationSize() throws Exception
-    {
-        getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
 
-        getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 1 );
-    }
+// -----------------------------------------------------------------------
+// Size Limit Tests
+// -----------------------------------------------------------------------
+
+/**
+ * Sets up the server with unlimited search size limit but constrains size
+ * by request size limit value to cause a size limit exceeded exception on
+ * the client.
+ */
+@Test(expected = SizeLimitExceededException.class)
+public void testRequestConstrainedUnlimitByConfigurationSize() throws Exception
+{
+    getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
 
+    getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 1 );
+}
 
-    /**
-     * Sets up the server with longer search size limit than the request's
-     * which constrains size by request size limit value to cause a size limit
-     * exceeded exception on the client.
-     */
-    @Test ( expected = SizeLimitExceededException.class )
-    public void testRequestConstrainedLessThanConfigurationSize() throws Exception
-    {
-        getLdapServer().setMaxSizeLimit( 10000 );
 
-        getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 1 );
-    }
+/**
+ * Sets up the server with longer search size limit than the request's
+ * which constrains size by request size limit value to cause a size limit
+ * exceeded exception on the client.
+ */
+@Test(expected = SizeLimitExceededException.class)
+public void testRequestConstrainedLessThanConfigurationSize() throws Exception
+{
+    getLdapServer().setMaxSizeLimit( 10000 );
 
+    getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 1 );
+}
 
-    /**
-     * Sets up the server with shorter search size limit than the request's
-     * which constrains size by using server max limit value. Should work
-     * just fine for the administrative user.
-     */
-    @Test
-    public void testRequestConstrainedGreaterThanConfigurationSize() throws Exception
-    {
-        getLdapServer().setMaxSizeLimit( 1 );
-        Set<String> set = getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 100000 );
-        assertEquals( 4, set.size() );
-    }
 
+/**
+ * Sets up the server with shorter search size limit than the request's
+ * which constrains size by using server max limit value. Should work
+ * just fine for the administrative user.
+ */
+@Test
+public void testRequestConstrainedGreaterThanConfigurationSize() throws Exception
+{
+    getLdapServer().setMaxSizeLimit( 1 );
+    Set<String> set = getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 100000 );
+    assertEquals( 4, set.size() );
+}
 
-    /**
-     * Sets up the server with shorter search size limit than the request's
-     * which constrains size by using server max limit value to cause a size
-     * limit exceeded exception on the client.
-     */
-    @Test (expected = SizeLimitExceededException.class )
-    public void testNonAdminRequestConstrainedGreaterThanConfigurationSize() throws Exception
-    {
-        getLdapServer().setMaxSizeLimit( 1 );
 
-        // We are not using the admin : it should fail
-        getActorsWithLimitNonAdmin( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 100000 );
-    }
+/**
+ * Sets up the server with shorter search size limit than the request's
+ * which constrains size by using server max limit value to cause a size
+ * limit exceeded exception on the client.
+ */
+@Test(expected = SizeLimitExceededException.class)
+public void testNonAdminRequestConstrainedGreaterThanConfigurationSize() throws Exception
+{
+    getLdapServer().setMaxSizeLimit( 1 );
 
+    // We are not using the admin : it should fail
+    getActorsWithLimitNonAdmin( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 100000 );
+}
 
-    /**
-     * Sets up the server with limited search size with unlimited request
-     * size limit.  Should work just fine for the administrative user.
-     */
-    @Test
-    public void testRequestUnlimitedConfigurationLimitedSize() throws Exception
-    {
-        getLdapServer().setMaxSizeLimit( 1 );
-        Set<String> set = getActorsWithLimit( "(objectClass=*)",
-            LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
 
-        assertEquals( 4, set.size() );
-    }
+/**
+ * Sets up the server with limited search size with unlimited request
+ * size limit.  Should work just fine for the administrative user.
+ */
+@Test
+public void testRequestUnlimitedConfigurationLimitedSize() throws Exception
+{
+    getLdapServer().setMaxSizeLimit( 1 );
+    Set<String> set = getActorsWithLimit( "(objectClass=*)",
+        LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
 
+    assertEquals( 4, set.size() );
+}
 
-    /**
-     * Sets up the server with limited search size with unlimited request
-     * size limit.  Should not work for non administrative users.
-     */
-    @Test ( expected = SizeLimitExceededException.class )
-    public void testNonAdminRequestUnlimitedConfigurationLimitedSize() throws Exception
-    {
-        getLdapServer().setMaxSizeLimit( 1 );
-        getActorsWithLimitNonAdmin( "(objectClass=*)",
-            LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
-    }
 
+/**
+ * Sets up the server with limited search size with unlimited request
+ * size limit.  Should not work for non administrative users.
+ */
+@Test(expected = SizeLimitExceededException.class)
+public void testNonAdminRequestUnlimitedConfigurationLimitedSize() throws Exception
+{
+    getLdapServer().setMaxSizeLimit( 1 );
+    getActorsWithLimitNonAdmin( "(objectClass=*)",
+        LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
+}
 
-    /**
-     * Test for DIRSERVER-1235.
-     * Sets up the server with unlimited search size limit but constrains size
-     * by request size limit value. The request size limit is less than the
-     * expected number of result entries, so exception expected.
-     * 
-     * cf RFC 4511 :
-     *  "sizeLimitExceeded (4)
-     *   Indicates that the size limit specified by the client was
-     *   exceeded before the operation could be completed."
-     */
-    @Test ( expected = SizeLimitExceededException.class )
-    public void testRequestConstraintedLessThanExpectedSize() throws Exception
-    {
-        getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
 
-        getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 3 );
-    }
+/**
+ * Test for DIRSERVER-1235.
+ * Sets up the server with unlimited search size limit but constrains size
+ * by request size limit value. The request size limit is less than the
+ * expected number of result entries, so exception expected.
+ * 
+ * cf RFC 4511 :
+ *  "sizeLimitExceeded (4)
+ *   Indicates that the size limit specified by the client was
+ *   exceeded before the operation could be completed."
+ */
+@Test(expected = SizeLimitExceededException.class)
+public void testRequestConstraintedLessThanExpectedSize() throws Exception
+{
+    getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
 
+    getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 3 );
+}
 
-    /**
-     * Test for DIRSERVER-1235.
-     * Sets up the server with unlimited search size limit but constrains size
-     * by request size limit value. The request size limit is equal to the
-     * expected number of result entries so no exception expected.
-     */
-    @Test
-    public void testRequestConstraintedEqualToExpectedSize() throws Exception
-    {
-        getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
-        Set<String> set = getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 4 );
-        assertEquals( 4, set.size() );
-    }
 
+/**
+ * Test for DIRSERVER-1235.
+ * Sets up the server with unlimited search size limit but constrains size
+ * by request size limit value. The request size limit is equal to the
+ * expected number of result entries so no exception expected.
+ */
+@Test
+public void testRequestConstraintedEqualToExpectedSize() throws Exception
+{
+    getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
+    Set<String> set = getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 4 );
+    assertEquals( 4, set.size() );
+}
 
-    /**
-     * Test for DIRSERVER-1235.
-     * Sets up the server with unlimited search size limit but constrains size
-     * by request size limit value. The request size limit is greater than the
-     * expected number of result entries so no exception expected.
-     */
-    @Test
-    public void testRequestConstraintedGreaterThanExpectedSize() throws Exception
-    {
-        getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
-        Set<String> set = getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 5 );
-        assertEquals( 4, set.size() );
-    }
 
+/**
+ * Test for DIRSERVER-1235.
+ * Sets up the server with unlimited search size limit but constrains size
+ * by request size limit value. The request size limit is greater than the
+ * expected number of result entries so no exception expected.
+ */
+@Test
+public void testRequestConstraintedGreaterThanExpectedSize() throws Exception
+{
+    getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
+    Set<String> set = getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 5 );
+    assertEquals( 4, set.size() );
+}
 
-    /**
-     * Test for DIRSERVER-1235.
-     * Reads an entry using object scope and size limit 1, no exception
-     * expected.
-     */
-    @Test
-    public void testRequestObjectScopeAndSizeLimit() throws Exception
-    {
-        getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
 
-        DirContext ctx = getWiredContext( getLdapServer() );
-        String filter = "(objectClass=*)";
-        SearchControls controls = new SearchControls();
-        controls.setTimeLimit( 0 );
-        controls.setCountLimit( 1 );
-        controls.setSearchScope( SearchControls.OBJECT_SCOPE );
-
-        NamingEnumeration<SearchResult> namingEnumeration =
-            ctx.search( "ou=actors,ou=system", filter, controls );
-        assertTrue( namingEnumeration.hasMore() );
-        namingEnumeration.next();
-        assertFalse( namingEnumeration.hasMore() );
-    }
+/**
+ * Test for DIRSERVER-1235.
+ * Reads an entry using object scope and size limit 1, no exception
+ * expected.
+ */
+@Test
+public void testRequestObjectScopeAndSizeLimit() throws Exception
+{
+    getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
 
+    DirContext ctx = getWiredContext( getLdapServer() );
+    String filter = "(objectClass=*)";
+    SearchControls controls = new SearchControls();
+    controls.setTimeLimit( 0 );
+    controls.setCountLimit( 1 );
+    controls.setSearchScope( SearchControls.OBJECT_SCOPE );
+
+    NamingEnumeration<SearchResult> namingEnumeration =
+        ctx.search( "ou=actors,ou=system", filter, controls );
+    assertTrue( namingEnumeration.hasMore() );
+    namingEnumeration.next();
+    assertFalse( namingEnumeration.hasMore() );
+}
 
-    // -----------------------------------------------------------------------
-    // Utility Methods
-    // -----------------------------------------------------------------------
 
+// -----------------------------------------------------------------------
+// Utility Methods
+// -----------------------------------------------------------------------
+
+/**
+ * Do a search request from the ou=actors,ou=system base, with a principal
+ * which is the administrator.
+ */
+private Set<String> getActorsWithLimit( String filter, int timeLimitMillis, long sizeLimit ) throws Exception
+{
+    DirContext ctx = getWiredContext( getLdapServer() );
+    Set<String> results = new HashSet<String>();
+    SearchControls controls = new SearchControls();
+    controls.setTimeLimit( timeLimitMillis );
+    controls.setCountLimit( sizeLimit );
+    controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
 
-    /**
-     * Do a search request from the ou=actors,ou=system base, with a principal
-     * which is the administrator.
-     */
-    private Set<String> getActorsWithLimit( String filter, int timeLimitMillis, long sizeLimit ) throws Exception
-    {
-        DirContext ctx = getWiredContext( getLdapServer() );
-        Set<String> results = new HashSet<String>();
-        SearchControls controls = new SearchControls();
-        controls.setTimeLimit( timeLimitMillis );
-        controls.setCountLimit( sizeLimit );
-        controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
+    NamingEnumeration<SearchResult> namingEnumeration =
+        ctx.search( "ou=actors,ou=system", filter, controls );
 
-        NamingEnumeration<SearchResult> namingEnumeration =
-            ctx.search( "ou=actors,ou=system", filter, controls );
+    while ( namingEnumeration.hasMore() )
+    {
+        results.add( namingEnumeration.next().getNameInNamespace() );
+    }
 
-        while( namingEnumeration.hasMore() )
-        {
-            results.add( namingEnumeration.next().getNameInNamespace() );
-        }
+    return results;
+}
 
-        return results;
-    }
 
-    /**
-     * Do a search request from the ou=actors,ou=system base, with a principal
-     * which is not the administrator.
-     */
-    private Set<String> getActorsWithLimitNonAdmin( String filter, int timeLimitMillis, long sizeLimit )
-        throws Exception
-        {
-        DirContext ctx = getWiredContext( getLdapServer(), "uid=jblack,ou=actors,ou=system", "secret" );
-        Set<String> results = new HashSet<String>();
-        SearchControls controls = new SearchControls();
-        controls.setTimeLimit( timeLimitMillis );
-        controls.setCountLimit( sizeLimit );
-        controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
+/**
+ * Do a search request from the ou=actors,ou=system base, with a principal
+ * which is not the administrator.
+ */
+private Set<String> getActorsWithLimitNonAdmin( String filter, int timeLimitMillis, long sizeLimit )
+    throws Exception
+{
+    DirContext ctx = getWiredContext( getLdapServer(), "uid=jblack,ou=actors,ou=system", "secret" );
+    Set<String> results = new HashSet<String>();
+    SearchControls controls = new SearchControls();
+    controls.setTimeLimit( timeLimitMillis );
+    controls.setCountLimit( sizeLimit );
+    controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
 
-        NamingEnumeration<SearchResult> namingEnumeration =
-            ctx.search( "ou=actors,ou=system", filter, controls );
+    NamingEnumeration<SearchResult> namingEnumeration =
+        ctx.search( "ou=actors,ou=system", filter, controls );
 
-        while( namingEnumeration.hasMore() )
-        {
-            results.add( namingEnumeration.next().getNameInNamespace() );
-        }
+    while ( namingEnumeration.hasMore() )
+    {
+        results.add( namingEnumeration.next().getNameInNamespace() );
+    }
 
-        return results;
-        }
+    return results;
+}
 }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java Tue Jan 24 16:22:33 2012
@@ -82,11 +82,11 @@ public class SearchPerfIT extends Abstra
             for ( int j = 0; j < 10000; j++ )
             {
                 cursor = connection.search( "uid=admin,ou=system", "(ObjectClass=*)", SearchScope.OBJECT, "*" );
-                
+
                 while ( cursor.next() )
                 {
                 }
-                
+
                 cursor.close();
             }
 

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java Tue Jan 24 16:22:33 2012
@@ -51,6 +51,7 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+
 /**
  * Tests the initial refresh of a client
  *
@@ -61,18 +62,19 @@ public class ClientInitialRefreshIT
     private static LdapServer providerServer;
 
     private static SchemaManager schemaManager;
-    
+
     private static CoreSession providerSession;
-    
+
     private static AtomicInteger entryCount = new AtomicInteger();
-    
+
+
     @BeforeClass
     public static void setUp() throws Exception
     {
         Class<?> justLoadToSetControlProperties = Class.forName( FrameworkRunner.class.getName() );
-        
+
         startProvider();
-        
+
         // Load 1000 entries
         for ( int i = 0; i < 1000; i++ )
         {
@@ -89,7 +91,7 @@ public class ClientInitialRefreshIT
         providerServer.stop();
     }
 
-    
+
     /**
      * Check that the entry exists in the target server. We wait up to 10 seconds, by
      * 100ms steps, until either the entry s found, or we have exhausted the 10 seconds delay.
@@ -97,74 +99,74 @@ public class ClientInitialRefreshIT
     private boolean checkEntryExistence( CoreSession session, Dn entryDn ) throws Exception
     {
         boolean replicated = false;
-        
+
         for ( int i = 0; i < 100; i++ )
         {
             Thread.sleep( 100 );
-            
+
             if ( session.exists( entryDn ) )
             {
                 replicated = true;
                 break;
             }
         }
-        
+
         return replicated;
     }
-    
-    
+
+
     private void waitAndCompareEntries( Dn dn ) throws Exception
     {
         // sleep for 2 sec (twice the refresh interval), just to let the first refresh request succeed
         Entry providerEntry = providerSession.lookup( dn, "*", "+" );
-        
+
         //Entry consumerEntry = consumerSession.lookup( dn, "*", "+" );
         //assertEquals( providerEntry, consumerEntry );
     }
-    
-    
+
+
     private static Entry createEntry() throws Exception
     {
-        String user = "user"+ entryCount.incrementAndGet();
-        
+        String user = "user" + entryCount.incrementAndGet();
+
         String dn = "cn=" + user + ",dc=example,dc=com";
-        
+
         DefaultEntry entry = new DefaultEntry( schemaManager, dn,
             "objectClass", "person",
             "cn", user,
             "sn", user );
-        
+
         return entry;
     }
-    
-    
+
+
     @CreateDS(allowAnonAccess = true, name = "provider-replication", partitions =
         {
             @CreatePartition(
                 name = "example",
                 suffix = "dc=example,dc=com",
                 indexes =
-                {
-                    @CreateIndex(attribute = "objectClass"),
-                    @CreateIndex(attribute = "dc"),
-                    @CreateIndex(attribute = "ou")
+                    {
+                        @CreateIndex(attribute = "objectClass"),
+                        @CreateIndex(attribute = "dc"),
+                        @CreateIndex(attribute = "ou")
                 },
-                contextEntry=@ContextEntry( entryLdif = 
+                contextEntry = @ContextEntry(entryLdif =
                     "dn: dc=example,dc=com\n" +
-                    "objectClass: domain\n" +
-                    "dc: example" ) )
-             })
+                        "objectClass: domain\n" +
+                        "dc: example"))
+    })
     @CreateLdapServer(transports =
-        { @CreateTransport( port=16000, protocol = "LDAP") })
+        { @CreateTransport(port = 16000, protocol = "LDAP") })
     public static void startProvider() throws Exception
     {
         DirectoryService provDirService = DSAnnotationProcessor.getDirectoryService();
 
         providerServer = ServerAnnotationProcessor.getLdapServer( provDirService );
-        
+
         providerServer.setReplicationReqHandler( new SyncReplRequestHandler() );
         providerServer.startReplicationProducer();
-        
+
         Runnable r = new Runnable()
         {
             public void run()
@@ -174,7 +176,7 @@ public class ClientInitialRefreshIT
                     schemaManager = providerServer.getDirectoryService().getSchemaManager();
                     providerSession = providerServer.getDirectoryService().getAdminSession();
                 }
-                catch( Exception e )
+                catch ( Exception e )
                 {
                     e.printStackTrace();
                 }
@@ -186,8 +188,8 @@ public class ClientInitialRefreshIT
         t.start();
         t.join();
     }
-    
-    
+
+
     /**
      * Wait for the expected number of entries to be added into the client
      */
@@ -195,11 +197,11 @@ public class ClientInitialRefreshIT
     {
         System.out.println( "\nNbAdded every 100ms : " );
         boolean isFirst = true;
-        
+
         for ( int i = 0; i < 50; i++ )
         {
-            int nbAdded = ((MockSyncReplConsumer)consumer).getNbAdded();
-            
+            int nbAdded = ( ( MockSyncReplConsumer ) consumer ).getNbAdded();
+
             if ( isFirst )
             {
                 isFirst = false;
@@ -208,20 +210,20 @@ public class ClientInitialRefreshIT
             {
                 System.out.print( ", " );
             }
-            
+
             System.out.print( nbAdded );
-            
+
             if ( nbAdded == expected )
             {
                 return true;
             }
-            
+
             Thread.sleep( 100 );
         }
-        
+
         return false;
     }
-    
+
 
     /**
      * Wait for the expected number of entries to be added into the client
@@ -233,34 +235,34 @@ public class ClientInitialRefreshIT
         int nbConsumers = consumers.length;
         int[] nbAddeds = new int[nbConsumers];
         int nbCompleted = 0;
-        
+
         for ( int i = 0; i < 50; i++ )
         {
             for ( int j = 0; j < nbConsumers; j++ )
             {
                 if ( nbAddeds[j] != limit )
                 {
-                    nbAddeds[j] = ((MockSyncReplConsumer)consumers[j]).getNbAdded();
-                    
+                    nbAddeds[j] = ( ( MockSyncReplConsumer ) consumers[j] ).getNbAdded();
+
                     if ( nbAddeds[j] >= limit )
                     {
-                        nbCompleted ++;
+                        nbCompleted++;
                         System.out.println( "(consumer" + ( j + 1 ) + " completed) " );
                     }
                 }
             }
 
-            if ( nbCompleted  == nbConsumers )
+            if ( nbCompleted == nbConsumers )
             {
                 return true;
             }
-            
+
             Thread.sleep( 100 );
         }
-        
+
         return false;
     }
-    
+
 
     private ReplicationConsumer createConsumer() throws Exception
     {
@@ -273,7 +275,7 @@ public class ClientInitialRefreshIT
         config.setUseTls( false );
         config.setBaseDn( "dc=example,dc=com" );
         config.setRefreshInterval( 1000 );
-        
+
         syncreplClient.setConfig( config );
 
         assertTrue( true );
@@ -301,7 +303,7 @@ public class ClientInitialRefreshIT
 
                     DirectoryService directoryService = new MockDirectoryService();
                     directoryService.setSchemaManager( schemaManager );
-                    ((MockSyncReplConsumer)syncreplClient).init( directoryService );
+                    ( ( MockSyncReplConsumer ) syncreplClient ).init( directoryService );
                     syncreplClient.start();
                 }
                 catch ( Exception e )
@@ -314,11 +316,11 @@ public class ClientInitialRefreshIT
         Thread consumerThread = new Thread( consumerTask );
         consumerThread.setDaemon( true );
         consumerThread.start();
-        
+
         return syncreplClient;
     }
-    
-    
+
+
     /**
      * Launch the consumer in a separated thread.
      */
@@ -343,7 +345,7 @@ public class ClientInitialRefreshIT
         consumerThread.setDaemon( true );
         consumerThread.start();
     }
-    
+
 
     /**
      * First test : create a consumer, and see if it gets the 1000 entries
@@ -351,18 +353,18 @@ public class ClientInitialRefreshIT
     @Test
     public void testInitialRefreshLoad() throws Exception
     {
-        System.out.println( "\n---> Running testInitialRefreshLoad");
-        
+        System.out.println( "\n---> Running testInitialRefreshLoad" );
+
         ReplicationConsumer consumer = createConsumer();
-        
+
         // We should have 1000 entries plus the base entry = 1001
-        assertTrue( waitForSyncReplClient( consumer, 1001 ) ); 
+        assertTrue( waitForSyncReplClient( consumer, 1001 ) );
         consumer.stop();
-        
+
         System.out.println( "\n<-- Done" );
     }
-    
-    
+
+
     /**
      * Test that we can load entries, then add one entry in the producer
      * and see this entry present in the consumer
@@ -370,31 +372,31 @@ public class ClientInitialRefreshIT
     @Test
     public void testInitialRefreshLoadAndAdd() throws Exception
     {
-        System.out.println( "\n---> Running testInitialRefreshLoadAndAdd");
+        System.out.println( "\n---> Running testInitialRefreshLoadAndAdd" );
 
         ReplicationConsumer consumer = createConsumer();
-        
+
         // We should have 1000 entries plus the base entry = 1001
         assertTrue( waitForSyncReplClient( consumer, 1001 ) );
-        
+
         // Inject a new intry in the producer
         Entry addedEntry = createEntry();
         providerSession.add( addedEntry );
-        
+
         // Reset the added counter
-        ((MockSyncReplConsumer)consumer).resetNbAdded();
+        ( ( MockSyncReplConsumer ) consumer ).resetNbAdded();
 
         // Now check that the entry has been copied in the consumer
         assertTrue( waitForSyncReplClient( consumer, 1 ) );
-        
+
         // Removed the added entry
         providerSession.delete( addedEntry.getDn() );
         consumer.stop();
-        
+
         System.out.println( "\n<-- Done" );
     }
-    
-    
+
+
     /**
      * Test that we can load entries, kill the consumer in the middle of the load, 
      * restart the consumer and still get all the entries.
@@ -402,43 +404,43 @@ public class ClientInitialRefreshIT
     @Test
     public void testInitialRefreshStopAndGo() throws Exception
     {
-        System.out.println( "\n---> Running testInitialRefreshStopAndGo");
+        System.out.println( "\n---> Running testInitialRefreshStopAndGo" );
 
         ReplicationConsumer consumer = createConsumer();
-        
+
         // Load but stop after 200 entries have been loaded
         waitUntilLimitSyncReplClient( 200, consumer );
-        
+
         // Stop the consumer
         consumer.stop();
-        
+
         // Start it again
         runConsumer( consumer );
-        
+
         // We should have 1000 entries plus the base entry = 1001
         assertTrue( waitForSyncReplClient( consumer, 1001 ) );
         consumer.stop();
-        
+
         System.out.println( "\n<-- Done" );
     }
-    
-    
+
+
     /**
      * Test with 2 consumers
      */
     @Test
     public void testInitialRefresh4Consumers() throws Exception
     {
-        System.out.println( "\n--->Running testInitialRefresh4Consumers");
+        System.out.println( "\n--->Running testInitialRefresh4Consumers" );
 
         ReplicationConsumer consumer1 = createConsumer();
         ReplicationConsumer consumer2 = createConsumer();
         ReplicationConsumer consumer3 = createConsumer();
         ReplicationConsumer consumer4 = createConsumer();
-        
+
         // Load but stop after 200 entries have been loaded
         assertTrue( waitUntilLimitSyncReplClient( 1001, consumer1, consumer2, consumer3, consumer4 ) );
-        
+
         consumer1.stop();
         consumer2.stop();
         consumer3.stop();

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java Tue Jan 24 16:22:33 2012
@@ -61,6 +61,7 @@ import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 
+
 /**
  * Tests for replication subsystem in client-server mode.
  *
@@ -73,13 +74,14 @@ public class ClientServerReplicationIT
     private static LdapServer consumerServer;
 
     private static SchemaManager schemaManager;
-    
+
     private static CoreSession providerSession;
-    
+
     private static CoreSession consumerSession;
-    
+
     private static AtomicInteger entryCount = new AtomicInteger();
-    
+
+
     @BeforeClass
     public static void setUp() throws Exception
     {
@@ -95,38 +97,40 @@ public class ClientServerReplicationIT
         consumerServer.stop();
         providerServer.stop();
     }
-    
-    
+
+
     private void dump( CoreSession session, Dn entryDn )
     {
         try
         {
             SearchRequest searchRequest = new SearchRequestImpl();
-            
+
             searchRequest.setBase( new Dn( schemaManager, "dc=example,dc=com" ) );
             searchRequest.setFilter( "(objectClass=*)" );
             searchRequest.setScope( SearchScope.SUBTREE );
             searchRequest.addAttributes( "entryUuid" );
-            
+
             System.out.println( "-----------> Dumping the server <-----------" );
             System.out.println( "-----------> Looking for " + entryDn.getNormName() + " <-----------" );
-            
+
             EntryFilteringCursor cursor = session.search( searchRequest );
-            
+
             while ( cursor.next() )
             {
                 Entry entry = cursor.get();
-                
+
                 if ( entry.getDn().equals( entryDn ) )
                 {
                     System.out.println( "The searched entry exists !!!" );
-                    System.out.println( "found Entry " + entry.getDn().getNormName() + " exists, entrtyUuid = " + entry.get( "entryUuid" ) );
+                    System.out.println( "found Entry " + entry.getDn().getNormName() + " exists, entrtyUuid = "
+                        + entry.get( "entryUuid" ) );
                     continue;
                 }
-                
-                System.out.println( "Entry " + entry.getDn().getNormName() + " exists, entrtyUuid = " + entry.get( "entryUuid" ) );
+
+                System.out.println( "Entry " + entry.getDn().getNormName() + " exists, entrtyUuid = "
+                    + entry.get( "entryUuid" ) );
             }
-            
+
             cursor.close();
 
             System.out.println( "-----------> Dump done <-----------" );
@@ -138,7 +142,7 @@ public class ClientServerReplicationIT
         }
     }
 
-    
+
     /**
      * Check that the entry exists in the target server. We wait up to 10 seconds, by
      * 100ms steps, until either the entry s found, or we have exhausted the 10 seconds delay.
@@ -147,8 +151,8 @@ public class ClientServerReplicationIT
     {
         return checkEntryExistence( session, entryDn, false );
     }
-    
-    
+
+
     /**
      * Check that the entry exists in the target server. We wait up to 10 seconds, by
      * 100ms steps, until either the entry s found, or we have exhausted the 10 seconds delay.
@@ -156,34 +160,34 @@ public class ClientServerReplicationIT
     private boolean checkEntryExistence( CoreSession session, Dn entryDn, boolean print ) throws Exception
     {
         boolean replicated = false;
-        
+
         for ( int i = 0; i < 100; i++ )
         {
             Thread.sleep( 50 );
-            
+
             if ( session.exists( entryDn ) )
             {
                 if ( print )
-                {      
+                {
                     System.out.println( entryDn.getName() + " exists " );
                 }
-                
+
                 replicated = true;
                 break;
             }
-            
+
             Thread.sleep( 50 );
         }
-        
+
         if ( replicated == false )
         {
             dump( session, entryDn );
         }
-        
+
         return replicated;
     }
-    
-    
+
+
     /**
      * Check that the entry exists and has been deleted in the target server. We wait up to 10 seconds, by
      * 100ms steps, until either the entry is deleted, or we have exhausted the 10 seconds delay,
@@ -192,18 +196,18 @@ public class ClientServerReplicationIT
     private boolean checkEntryDeletion( CoreSession session, Dn entryDn ) throws Exception
     {
         boolean exists = session.exists( entryDn );
-        
-        if ( ! exists )
+
+        if ( !exists )
         {
             return true;
         }
-        
+
         for ( int i = 0; i < 100; i++ )
         {
             Thread.sleep( 50 );
 
             exists = session.exists( entryDn );
-            
+
             if ( !exists )
             {
                 return true;
@@ -211,160 +215,160 @@ public class ClientServerReplicationIT
 
             Thread.sleep( 50 );
         }
-        
+
         dump( session, entryDn );
-        
+
         return false;
     }
 
-    
+
     @Test
     public void testModify() throws Exception
     {
         Entry provUser = createEntry();
-        
+
         assertFalse( consumerSession.exists( provUser.getDn() ) );
-        
+
         providerSession.add( provUser );
-        
+
         assertTrue( providerSession.exists( provUser.getDn() ) );
-        
+
         ModifyRequest modReq = new ModifyRequestImpl();
         modReq.setName( provUser.getDn() );
         modReq.add( "userPassword", "secret" );
-        
+
         providerSession.modify( modReq );
-        
+
         assertTrue( checkEntryExistence( consumerSession, provUser.getDn() ) );
         waitAndCompareEntries( provUser.getDn() );
     }
-    
-    
+
+
     @Test
     public void testModDn() throws Exception
     {
         Entry provUser = createEntry();
-        
+
         assertFalse( consumerSession.exists( provUser.getDn() ) );
-        
+
         // Add entry : "cn=entryN,dc=example,dc=com"
         providerSession.add( provUser ); // 1
-        
+
         Dn usersContainer = new Dn( schemaManager, "ou=users,dc=example,dc=com" );
-        
+
         DefaultEntry entry = new DefaultEntry( schemaManager, usersContainer,
             "objectClass: organizationalUnit",
             "ou: users" );
-        
+
         // Add entry "ou=users,dc=example,dc=com"
         providerSession.add( entry ); // 2
-        
+
         assertTrue( checkEntryExistence( consumerSession, usersContainer ) );
         waitAndCompareEntries( entry.getDn() );
-        
+
         // Move entry "cn=entryN,dc=example,dc=com" to "ou=users,dc=example,dc=com"
         Dn userDn = provUser.getDn();
         providerSession.move( userDn, usersContainer );
-        
+
         // The moved entry : "cn=entryN,ou=users,dc=example,dc=com"
         Dn movedEntryDn = usersContainer.add( userDn.getRdn() );
-        
+
         assertTrue( checkEntryExistence( consumerSession, movedEntryDn ) );
         waitAndCompareEntries( movedEntryDn );
-        
-        Rdn newName = new Rdn( schemaManager, movedEntryDn.getRdn().getName() + "renamed");
-        
+
+        Rdn newName = new Rdn( schemaManager, movedEntryDn.getRdn().getName() + "renamed" );
+
         // Rename "cn=entryN,ou=users,dc=example,dc=com" to "cn=entryNrenamed,ou=users,dc=example,dc=com"
         providerSession.rename( movedEntryDn, newName, true );
-        
+
         Dn renamedEntryDn = usersContainer.add( newName );
-        
+
         assertTrue( checkEntryExistence( consumerSession, renamedEntryDn ) );
         waitAndCompareEntries( renamedEntryDn );
-        
+
         // now move and rename
         Dn newParent = usersContainer.getParent();
-        
-        newName = new Rdn( schemaManager, renamedEntryDn.getRdn().getName() + "MovedAndRenamed");
-        
+
+        newName = new Rdn( schemaManager, renamedEntryDn.getRdn().getName() + "MovedAndRenamed" );
+
         // Move and rename "cn=entryNrenamed,ou=users,dc=example,dc=com" to
         // "cn=entryNMovedAndRenamed,dc=example,dc=com"
         providerSession.moveAndRename( renamedEntryDn, newParent, newName, false ); //4
-        
+
         Dn movedAndRenamedEntry = newParent.add( newName );
 
         assertTrue( checkEntryExistence( consumerSession, movedAndRenamedEntry ) );
         waitAndCompareEntries( movedAndRenamedEntry );
     }
-    
-    
+
+
     @Test
-    @Ignore( "Run this test alone, otherwise it conflicts with moddn" )
+    @Ignore("Run this test alone, otherwise it conflicts with moddn")
     public void testModDnLoop() throws Exception
     {
         for ( int i = 0; i < 10; i++ )
         {
             System.out.println( ">>>>>> loop " + ( i + 1 ) + " <<<<<<" );
             Entry newuser = createEntry();
-            
+
             assertFalse( consumerSession.exists( newuser.getDn() ) );
-            
+
             // Add entry : "cn=entryN,dc=example,dc=com"
             providerSession.add( newuser ); // 1
-            
+
             Dn usersContainer = new Dn( schemaManager, "ou=users,dc=example,dc=com" );
-            
+
             DefaultEntry usersEntry = new DefaultEntry( schemaManager, usersContainer,
                 "objectClass: organizationalUnit",
                 "ou: users" );
-            
+
             // Add entry "ou=users,dc=example,dc=com"
             providerSession.add( usersEntry ); // 2
-            
+
             assertTrue( checkEntryExistence( consumerSession, usersContainer ) );
             waitAndCompareEntries( usersEntry.getDn() );
-            
+
             // Move entry "cn=entryN,dc=example,dc=com" to "ou=users,dc=example,dc=com"
             Dn userDn = newuser.getDn();
             providerSession.move( userDn, usersContainer );
-            
+
             // The moved entry : "cn=entryN,ou=users,dc=example,dc=com"
             Dn movedEntryDn = usersContainer.add( userDn.getRdn() );
-            
+
             assertTrue( checkEntryExistence( consumerSession, movedEntryDn ) );
             waitAndCompareEntries( movedEntryDn );
-            
-            Rdn newName = new Rdn( schemaManager, movedEntryDn.getRdn().getName() + "renamed");
-            
+
+            Rdn newName = new Rdn( schemaManager, movedEntryDn.getRdn().getName() + "renamed" );
+
             // Rename "cn=entryN,ou=users,dc=example,dc=com" to "cn=entryNrenamed,ou=users,dc=example,dc=com"
             providerSession.rename( movedEntryDn, newName, true );
-            
+
             Dn renamedEntryDn = usersContainer.add( newName );
-            
+
             assertTrue( checkEntryExistence( consumerSession, renamedEntryDn ) );
             waitAndCompareEntries( renamedEntryDn );
-            
+
             // now move and rename
             Dn newParent = usersContainer.getParent();
-            
-            newName = new Rdn( schemaManager, renamedEntryDn.getRdn().getName() + "MovedAndRenamed");
-            
+
+            newName = new Rdn( schemaManager, renamedEntryDn.getRdn().getName() + "MovedAndRenamed" );
+
             // Move and rename "cn=entryNrenamed,ou=users,dc=example,dc=com" to
             // "cn=entryNMovedAndRenamed,dc=example,dc=com"
             providerSession.moveAndRename( renamedEntryDn, newParent, newName, false ); //4
-            
+
             Dn movedAndRenamedEntry = newParent.add( newName );
-    
+
             assertTrue( checkEntryExistence( consumerSession, movedAndRenamedEntry ) );
             waitAndCompareEntries( movedAndRenamedEntry );
-            
+
             // Ok, no failure, revert everything
             providerSession.delete( movedAndRenamedEntry );
             providerSession.delete( usersContainer );
         }
     }
-    
-    
+
+
     /**
      * Test the replication of a deleted entry
      */
@@ -372,125 +376,125 @@ public class ClientServerReplicationIT
     public void testDelete() throws Exception
     {
         Entry provUser = createEntry();
-        
+
         providerSession.add( provUser );
-        
+
         assertTrue( checkEntryExistence( consumerSession, provUser.getDn() ) );
         waitAndCompareEntries( provUser.getDn() );
-        
+
         assertTrue( providerSession.exists( provUser.getDn() ) );
         assertTrue( consumerSession.exists( provUser.getDn() ) );
 
         providerSession.delete( provUser.getDn() );
-        
+
         assertTrue( checkEntryDeletion( consumerSession, provUser.getDn() ) );
         assertFalse( providerSession.exists( provUser.getDn() ) );
     }
-    
-    
+
+
     private Entry restartConsumer( Entry provUser ) throws Exception
     {
         // Now stop the consumer
         consumerServer.stop();
-        
+
         // And delete the entry in the provider
         Dn deletedUserDn = provUser.getDn();
 
         providerSession.delete( deletedUserDn );
-        
+
         // Create a new entry
         provUser = createEntry();
         Dn addedUserDn = provUser.getDn();
 
         providerSession.add( provUser );
-        
+
         // let the provider log the events before the consumer sends a request
         // we are dealing with fraction of seconds cause of the programmatic simulation
         // it is impossible in the real world scenario
         Thread.sleep( 1000 );
-        
+
         // Restart the consumer
         consumerServer.start();
-        
+
         assertTrue( checkEntryDeletion( consumerSession, deletedUserDn ) );
-        
+
         assertTrue( checkEntryExistence( consumerSession, addedUserDn ) );
         waitAndCompareEntries( addedUserDn );
 
         return provUser;
     }
-    
-    
+
+
     @Test
     public void testRebootConsumer() throws Exception
     {
         Entry provUser = createEntry();
-        
-        assertFalse( providerSession.exists(provUser.getDn() ) );
-        assertFalse( consumerSession.exists(provUser.getDn() ) );
-        
+
+        assertFalse( providerSession.exists( provUser.getDn() ) );
+        assertFalse( consumerSession.exists( provUser.getDn() ) );
+
         providerSession.add( provUser );
-        
+
         assertTrue( checkEntryExistence( consumerSession, provUser.getDn() ) );
         waitAndCompareEntries( provUser.getDn() );
 
-        assertTrue( providerSession.exists(provUser.getDn() ) );
-        assertTrue( consumerSession.exists(provUser.getDn() ) );
-        
+        assertTrue( providerSession.exists( provUser.getDn() ) );
+        assertTrue( consumerSession.exists( provUser.getDn() ) );
+
         for ( int i = 0; i < 10; i++ )
         {
             provUser = restartConsumer( provUser );
         }
     }
-    
-    
+
+
     private void waitAndCompareEntries( Dn dn ) throws Exception
     {
         // sleep for 2 sec (twice the refresh interval), just to let the first refresh request succeed
         Entry providerEntry = providerSession.lookup( dn, "*", "+" );
-        
+
         Entry consumerEntry = consumerSession.lookup( dn, "*", "+" );
         assertEquals( providerEntry, consumerEntry );
     }
-    
-    
+
+
     private Entry createEntry() throws Exception
     {
-        String user = "user"+ entryCount.incrementAndGet();
-        
+        String user = "user" + entryCount.incrementAndGet();
+
         String dn = "cn=" + user + ",dc=example,dc=com";
-        
+
         DefaultEntry entry = new DefaultEntry( schemaManager, dn,
             "objectClass", "person",
             "cn", user,
             "sn", user );
-        
+
         return entry;
     }
-    
-    
+
+
     @CreateDS(
-        allowAnonAccess = true, 
-        name = "provider-replication", 
+        allowAnonAccess = true,
+        name = "provider-replication",
         enableChangeLog = false,
         partitions =
-        {
-            @CreatePartition(
-                name = "example",
-                suffix = "dc=example,dc=com",
-                indexes =
-                {
-                    @CreateIndex(attribute = "objectClass"),
-                    @CreateIndex(attribute = "dc"),
-                    @CreateIndex(attribute = "ou")
-                },
-                contextEntry=@ContextEntry( entryLdif = 
-                    "dn: dc=example,dc=com\n" +
-                    "objectClass: domain\n" +
-                    "dc: example" ) )
-             })
+            {
+                @CreatePartition(
+                    name = "example",
+                    suffix = "dc=example,dc=com",
+                    indexes =
+                        {
+                            @CreateIndex(attribute = "objectClass"),
+                            @CreateIndex(attribute = "dc"),
+                            @CreateIndex(attribute = "ou")
+                    },
+                    contextEntry = @ContextEntry(entryLdif =
+                        "dn: dc=example,dc=com\n" +
+                            "objectClass: domain\n" +
+                            "dc: example"))
+        })
     @CreateLdapServer(transports =
-        { @CreateTransport( port=16000, protocol = "LDAP") })
+        { @CreateTransport(port = 16000, protocol = "LDAP") })
     public static void startProvider() throws Exception
     {
         DirectoryService provDirService = DSAnnotationProcessor.getDirectoryService();
@@ -498,10 +502,10 @@ public class ClientServerReplicationIT
         providerServer = ServerAnnotationProcessor.getLdapServer( provDirService );
         providerServer.setReplicationReqHandler( new SyncReplRequestHandler() );
         providerServer.startReplicationProducer();
-        
+
         Runnable r = new Runnable()
         {
-            
+
             public void run()
             {
                 try
@@ -509,7 +513,7 @@ public class ClientServerReplicationIT
                     schemaManager = providerServer.getDirectoryService().getSchemaManager();
                     providerSession = providerServer.getDirectoryService().getAdminSession();
                 }
-                catch( Exception e )
+                catch ( Exception e )
                 {
                     e.printStackTrace();
                 }
@@ -521,30 +525,30 @@ public class ClientServerReplicationIT
         t.start();
         t.join();
     }
-    
-    
+
+
     @CreateDS(
-        allowAnonAccess = true, 
+        allowAnonAccess = true,
         enableChangeLog = false,
-        name = "consumer-replication", 
+        name = "consumer-replication",
         partitions =
-        {
-            @CreatePartition(
-                name = "example",
-                suffix = "dc=example,dc=com",
-                indexes =
-                {
-                    @CreateIndex(attribute = "objectClass"),
-                    @CreateIndex(attribute = "dc"),
-                    @CreateIndex(attribute = "ou")
-                },
-                contextEntry=@ContextEntry( entryLdif = 
-                    "dn: dc=example,dc=com\n" +
-                    "objectClass: domain\n" +
-                    "dc: example" ) )
-             })
+            {
+                @CreatePartition(
+                    name = "example",
+                    suffix = "dc=example,dc=com",
+                    indexes =
+                        {
+                            @CreateIndex(attribute = "objectClass"),
+                            @CreateIndex(attribute = "dc"),
+                            @CreateIndex(attribute = "ou")
+                    },
+                    contextEntry = @ContextEntry(entryLdif =
+                        "dn: dc=example,dc=com\n" +
+                            "objectClass: domain\n" +
+                            "dc: example"))
+        })
     @CreateLdapServer(transports =
-        { @CreateTransport( port=17000, protocol = "LDAP") })
+        { @CreateTransport(port = 17000, protocol = "LDAP") })
     @CreateConsumer
         (
             remoteHost = "localhost",
@@ -556,19 +560,19 @@ public class ClientServerReplicationIT
             refreshInterval = 1000,
             replicaId = 1
         )
-    public static void startConsumer() throws Exception
+        public static void startConsumer() throws Exception
     {
         DirectoryService provDirService = DSAnnotationProcessor.getDirectoryService();
         consumerServer = ServerAnnotationProcessor.getLdapServer( provDirService );
-        
-        final ReplicationConsumerImpl consumer = (ReplicationConsumerImpl)ServerAnnotationProcessor.createConsumer();
-        
+
+        final ReplicationConsumerImpl consumer = ( ReplicationConsumerImpl ) ServerAnnotationProcessor.createConsumer();
+
         List<ReplicationConsumer> replConsumers = new ArrayList<ReplicationConsumer>();
         replConsumers.add( consumer );
-        
+
         consumerServer.setReplConsumers( replConsumers );
         consumerServer.startReplicationConsumers();
-        
+
         Runnable r = new Runnable()
         {
             public void run()
@@ -576,10 +580,10 @@ public class ClientServerReplicationIT
                 try
                 {
                     DirectoryService ds = consumerServer.getDirectoryService();
-                    
+
                     Dn configDn = new Dn( ds.getSchemaManager(), "ads-replConsumerId=localhost,ou=system" );
                     consumer.getConfig().setConfigEntryDn( configDn );
-                    
+
                     Entry provConfigEntry = new DefaultEntry( ds.getSchemaManager(), configDn,
                         "objectClass: ads-replConsumer",
                         "ads-replConsumerId: localhost",
@@ -594,15 +598,15 @@ public class ClientServerReplicationIT
                         "ads-replSearchTimeOut", String.valueOf( consumer.getConfig().getSearchTimeout() ),
                         "ads-replUserDn", consumer.getConfig().getReplUserDn(),
                         "ads-replUserPassword", consumer.getConfig().getReplUserPassword() );
-                    
-                    provConfigEntry.put( "ads-replAliasDerefMode", consumer.getConfig().getAliasDerefMode().getJndiValue() );
+
+                    provConfigEntry.put( "ads-replAliasDerefMode", consumer.getConfig().getAliasDerefMode()
+                        .getJndiValue() );
                     provConfigEntry.put( "ads-replAttributes", consumer.getConfig().getAttributes() );
 
-                    
                     consumerSession = consumerServer.getDirectoryService().getAdminSession();
                     consumerSession.add( provConfigEntry );
                 }
-                catch( Exception e )
+                catch ( Exception e )
                 {
                     e.printStackTrace();
                 }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/MockSyncReplConsumer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/MockSyncReplConsumer.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/MockSyncReplConsumer.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/MockSyncReplConsumer.java Tue Jan 24 16:22:33 2012
@@ -119,21 +119,21 @@ public class MockSyncReplConsumer implem
 
     /** flag to indicate whether the consumer was disconnected */
     private boolean disconnected;
-    
+
     /** The number of added entries */
-    private AtomicInteger nbAdded = new AtomicInteger(0); 
+    private AtomicInteger nbAdded = new AtomicInteger( 0 );
 
     /** attributes on which modification should be ignored */
     private static final String[] MOD_IGNORE_AT = new String[]
         {
-            SchemaConstants.ENTRY_UUID_AT, 
-            SchemaConstants.ENTRY_CSN_AT, 
+            SchemaConstants.ENTRY_UUID_AT,
+            SchemaConstants.ENTRY_CSN_AT,
             SchemaConstants.MODIFIERS_NAME_AT,
-            SchemaConstants.MODIFY_TIMESTAMP_AT, 
-            SchemaConstants.CREATE_TIMESTAMP_AT, 
-            SchemaConstants.CREATORS_NAME_AT, 
-            SchemaConstants.ENTRY_PARENT_ID_AT 
-        };
+            SchemaConstants.MODIFY_TIMESTAMP_AT,
+            SchemaConstants.CREATE_TIMESTAMP_AT,
+            SchemaConstants.CREATORS_NAME_AT,
+            SchemaConstants.ENTRY_PARENT_ID_AT
+    };
 
     /** A thread used to refresh in refreshOnly mode */
     private RefresherThread refreshThread;
@@ -201,19 +201,19 @@ public class MockSyncReplConsumer implem
         {
             String providerHost = config.getRemoteHost();
             int port = config.getRemotePort();
-            
+
             // Create a connection
             if ( connection == null )
             {
                 connection = new LdapNetworkConnection( providerHost, port );
                 connection.setTimeOut( -1L );
-                
-                if( config.isUseTls() )
+
+                if ( config.isUseTls() )
                 {
                     connection.getConfig().setTrustManagers( config.getTrustManager() );
                     connection.startTls();
                 }
-                
+
                 connection.addConnectionClosedEventListener( this );
             }
 
@@ -267,12 +267,12 @@ public class MockSyncReplConsumer implem
     {
         LOG.debug( "///////////////// handleSearchDone //////////////////" );
 
-        SyncDoneValue ctrl = (SyncDoneValue)searchDone.getControls().get( SyncDoneValue.OID );
+        SyncDoneValue ctrl = ( SyncDoneValue ) searchDone.getControls().get( SyncDoneValue.OID );
 
         if ( ( ctrl != null ) && ( ctrl.getCookie() != null ) )
         {
             syncCookie = ctrl.getCookie();
-            LOG.debug( "assigning cookie from sync done value control: " + Strings.utf8ToString(syncCookie) );
+            LOG.debug( "assigning cookie from sync done value control: " + Strings.utf8ToString( syncCookie ) );
             storeCookie();
         }
 
@@ -303,7 +303,7 @@ public class MockSyncReplConsumer implem
             {
                 syncCookie = syncStateCtrl.getCookie();
                 LOG.debug( "assigning the cookie from sync state value control: "
-                    + Strings.utf8ToString(syncCookie) );
+                    + Strings.utf8ToString( syncCookie ) );
             }
 
             SyncStateTypeEnum state = syncStateCtrl.getSyncStateType();
@@ -313,7 +313,7 @@ public class MockSyncReplConsumer implem
             // check to avoid conversion of UUID from byte[] to String
             if ( LOG.isDebugEnabled() )
             {
-                LOG.debug( "entryUUID = {}", Strings.uuidToString(syncStateCtrl.getEntryUUID()) );
+                LOG.debug( "entryUUID = {}", Strings.uuidToString( syncStateCtrl.getEntryUUID() ) );
             }
 
             switch ( state )
@@ -331,7 +331,7 @@ public class MockSyncReplConsumer implem
                 case MODDN:
                     String entryUuid = Strings.uuidToString( syncStateCtrl.getEntryUUID() );
                     applyModDnOperation( remoteEntry, entryUuid );
-                    
+
                     break;
 
                 case DELETE:
@@ -373,14 +373,14 @@ public class MockSyncReplConsumer implem
 
             SyncInfoValue decorator = new SyncInfoValueDecorator( ldapCodecService );
             byte[] syncinfo = syncInfoResp.getResponseValue();
-            ((SyncInfoValueDecorator)decorator).setValue( syncinfo );
-            SyncInfoValue syncInfoValue = ((SyncInfoValueDecorator)decorator).getDecorated();
+            ( ( SyncInfoValueDecorator ) decorator ).setValue( syncinfo );
+            SyncInfoValue syncInfoValue = ( ( SyncInfoValueDecorator ) decorator ).getDecorated();
 
             byte[] cookie = syncInfoValue.getCookie();
 
             if ( cookie != null )
             {
-                LOG.debug( "setting the cookie from the sync info: " + Strings.utf8ToString(cookie) );
+                LOG.debug( "setting the cookie from the sync info: " + Strings.utf8ToString( cookie ) );
                 syncCookie = cookie;
             }
 
@@ -499,7 +499,7 @@ public class MockSyncReplConsumer implem
         nbAdded.getAndSet( 0 );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -507,8 +507,8 @@ public class MockSyncReplConsumer implem
     {
         return String.valueOf( getConfig().getReplicaId() );
     }
-    
-    
+
+
     /**
      * performs a search on connection with updated syncRequest control.
      *
@@ -523,7 +523,7 @@ public class MockSyncReplConsumer implem
 
         if ( syncCookie != null )
         {
-            LOG.debug( "searching with searchRequest, cookie '{}'", Strings.utf8ToString(syncCookie) );
+            LOG.debug( "searching with searchRequest, cookie '{}'", Strings.utf8ToString( syncCookie ) );
             syncReq.setCookie( syncCookie );
         }
 
@@ -533,7 +533,7 @@ public class MockSyncReplConsumer implem
         SearchFuture sf = connection.searchAsync( searchRequest );
 
         Response resp = sf.get();
-        
+
         while ( !( resp instanceof SearchResultDone ) && !sf.isCancelled() && !disconnected )
         {
             if ( resp instanceof SearchResultEntry )
@@ -546,7 +546,7 @@ public class MockSyncReplConsumer implem
             }
             else if ( resp instanceof IntermediateResponse )
             {
-                handleSyncInfo( (IntermediateResponse) resp );
+                handleSyncInfo( ( IntermediateResponse ) resp );
             }
 
             resp = sf.get();
@@ -555,7 +555,7 @@ public class MockSyncReplConsumer implem
         ResultCodeEnum resultCode = handleSearchDone( ( SearchResultDone ) resp );
 
         LOG.debug( "sync operation returned result code {}", resultCode );
-        
+
         if ( resultCode == ResultCodeEnum.NO_SUCH_OBJECT )
         {
             // log the error and handle it appropriately
@@ -642,7 +642,7 @@ public class MockSyncReplConsumer implem
             fout.write( syncCookie.length );
             fout.write( syncCookie );
             fout.close();
-            
+
             lastSavedCookie = new byte[syncCookie.length];
             System.arraycopy( syncCookie, 0, lastSavedCookie, 0, syncCookie.length );
 
@@ -668,11 +668,11 @@ public class MockSyncReplConsumer implem
                 syncCookie = new byte[fin.read()];
                 fin.read( syncCookie );
                 fin.close();
-    
+
                 lastSavedCookie = new byte[syncCookie.length];
                 System.arraycopy( syncCookie, 0, lastSavedCookie, 0, syncCookie.length );
-    
-                LOG.debug( "read the cookie from file: " + Strings.utf8ToString(syncCookie) );
+
+                LOG.debug( "read the cookie from file: " + Strings.utf8ToString( syncCookie ) );
             }
         }
         catch ( Exception e )
@@ -703,7 +703,7 @@ public class MockSyncReplConsumer implem
     private void applyModDnOperation( Entry remoteEntry, String entryUuid ) throws Exception
     {
         LOG.debug( "MODDN for entry {}, new entry : {}", entryUuid, remoteEntry );
-        
+
         // First, compute the MODDN type
         SyncModifyDnType modDnType = null;
 
@@ -711,7 +711,8 @@ public class MockSyncReplConsumer implem
         {
             // Retrieve locally the moved or renamed entry
             String filter = "(entryUuid=" + entryUuid + ")";
-            EntryCursor cursor = connection.search( Dn.ROOT_DSE, filter, SearchScope.SUBTREE, SchemaConstants.ALL_ATTRIBUTES_ARRAY );
+            EntryCursor cursor = connection.search( Dn.ROOT_DSE, filter, SearchScope.SUBTREE,
+                SchemaConstants.ALL_ATTRIBUTES_ARRAY );
 
             Entry localEntry = cursor.get();
 
@@ -750,7 +751,7 @@ public class MockSyncReplConsumer implem
             {
                 case MOVE:
                     LOG.debug( "moving {} to the new parent {}", localDn, remoteParentDn );
-                    
+
                     break;
 
                 case RENAME:
@@ -763,7 +764,11 @@ public class MockSyncReplConsumer implem
                     LOG.debug(
                         "moveAndRename on the Dn {} with new newParent Dn {}, new Rdn {} and deleteOldRdn flag set to {}",
                         new String[]
-                            { localDn.getName(), remoteParentDn.getName(), remoteRdn.getName(), String.valueOf( deleteOldRdn ) } );
+                            {
+                                localDn.getName(),
+                                remoteParentDn.getName(),
+                                remoteRdn.getName(),
+                                String.valueOf( deleteOldRdn ) } );
 
                     break;
             }
@@ -834,7 +839,7 @@ public class MockSyncReplConsumer implem
 
         for ( byte[] uuid : uuidList )
         {
-            LOG.info( "uuid: {}", Strings.uuidToString(uuid) );
+            LOG.info( "uuid: {}", Strings.uuidToString( uuid ) );
         }
 
         // if it is refreshPresent list then send all the UUIDs for
@@ -883,7 +888,7 @@ public class MockSyncReplConsumer implem
         int size = limitedUuidList.size();
         if ( size == 1 )
         {
-            String uuid = Strings.uuidToString(limitedUuidList.get(0));
+            String uuid = Strings.uuidToString( limitedUuidList.get( 0 ) );
             filter = new EqualityNode<String>( SchemaConstants.ENTRY_UUID_AT,
                 new org.apache.directory.shared.ldap.model.entry.StringValue( uuid ) );
             if ( isRefreshPresent )
@@ -904,18 +909,18 @@ public class MockSyncReplConsumer implem
 
             for ( int i = 0; i < size; i++ )
             {
-                String uuid = Strings.uuidToString(limitedUuidList.get(i));
+                String uuid = Strings.uuidToString( limitedUuidList.get( i ) );
                 ExprNode uuidEqNode = new EqualityNode<String>( SchemaConstants.ENTRY_UUID_AT,
                     new org.apache.directory.shared.ldap.model.entry.StringValue( uuid ) );
 
                 if ( isRefreshPresent )
                 {
                     uuidEqNode = new NotNode( uuidEqNode );
-                    ( (AndNode) filter ).addNode( uuidEqNode );
+                    ( ( AndNode ) filter ).addNode( uuidEqNode );
                 }
                 else
                 {
-                    ( (OrNode) filter ).addNode( uuidEqNode );
+                    ( ( OrNode ) filter ).addNode( uuidEqNode );
                 }
             }
         }
@@ -945,10 +950,11 @@ public class MockSyncReplConsumer implem
     {
         /** A field used to tell the thread it should stop */
         private volatile boolean stop = false;
-        
+
         /** A mutex used to make the thread sleeping for a moment */
         private final Object mutex = new Object();
 
+
         public RefresherThread()
         {
             setDaemon( true );
@@ -985,7 +991,7 @@ public class MockSyncReplConsumer implem
         public void stopRefreshing()
         {
             stop = true;
-            
+
             // just in case if it is sleeping, wake up the thread
             mutex.notify();
         }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/schema/SchemaIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/schema/SchemaIT.java?rev=1235328&r1=1235327&r2=1235328&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/schema/SchemaIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/schema/SchemaIT.java Tue Jan 24 16:22:33 2012
@@ -1,24 +1,25 @@
-    /*
-     *  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.
-     *
-     */
+/*
+ *  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.server.schema;
 
+
 import static org.apache.directory.server.core.integ.IntegrationUtils.getRootContext;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSchemaContext;
 import static org.junit.Assert.assertEquals;
@@ -55,13 +56,14 @@ import org.apache.directory.shared.ldap.
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * An integration test class for testing the addition of schema elements
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(FrameworkRunner.class)
-@CreateDS( name="SchemaIT-class" )
+@CreateDS(name = "SchemaIT-class")
 public class SchemaIT extends AbstractLdapTestUnit
 {
     private static final String SUBSCHEMA_SUBENTRY = "subschemaSubentry";
@@ -76,7 +78,7 @@ public class SchemaIT extends AbstractLd
      * @throws Exception on error
      */
     @Test
-    @CreateDS( name="SchemaAddAT-test" )
+    @CreateDS(name = "SchemaAddAT-test")
     @ApplyLdifs(
         {
             // Inject an AT
@@ -94,7 +96,7 @@ public class SchemaIT extends AbstractLd
             "m-obsolete: FALSE",
             "m-noUserModification: FALSE",
             "m-syntax: 1.3.6.1.4.1.1466.115.121.1.27",
-            
+
             // Inject an OC
             "dn: m-oid=1.3.6.1.4.1.18060.0.4.1.1.999,ou=objectClasses,cn=other,ou=schema",
             "objectClass: top",
@@ -109,13 +111,13 @@ public class SchemaIT extends AbstractLd
             "m-typeObjectClass: STRUCTURAL",
             "m-obsolete: FALSE",
             "m-description: A ship"
-        }
+    }
         )
-    public void testAddAttributeTypeObjectClass() throws Exception
+        public void testAddAttributeTypeObjectClass() throws Exception
     {
         checkAttributeTypePresent( "1.3.6.1.4.1.18060.0.4.1.2.999", "other", true );
         checkObjectClassPresent( "1.3.6.1.4.1.18060.0.4.1.1.999", "other", true );
-        
+
         // sync operation happens anyway on shutdowns but just to make sure we can do it again
         getService().sync();
 
@@ -125,10 +127,10 @@ public class SchemaIT extends AbstractLd
         checkAttributeTypePresent( "1.3.6.1.4.1.18060.0.4.1.2.999", "other", true );
         checkObjectClassPresent( "1.3.6.1.4.1.18060.0.4.1.1.999", "other", true );
     }
-    
-    
+
+
     @Test
-    @CreateDS( name="SchemaAddAT-test" )
+    @CreateDS(name = "SchemaAddAT-test")
     @ApplyLdifs(
         {
             // Inject an AT
@@ -137,20 +139,20 @@ public class SchemaIT extends AbstractLd
             "add: attributeTypes",
             "attributeTypes: ( 1.3.6.1.4.1.65536.0.4.3.2.1 NAME 'templateData' DESC 'template data' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE X-SCHEMA 'other' )",
             "-",
-            
+
             // Inject an OC
             "dn: cn=schema",
             "changetype: modify",
             "add: objectClasses",
             "objectClasses: ( 1.3.6.1.4.1.65536.0.4.3.2.2 NAME 'templateObject' DESC 'test OC' SUP top STRUCTURAL MUST ( templateData $ cn ) X-SCHEMA 'other' )",
             "-"
-        }
+    }
         )
-    public void testAddAttributeTypeObjectClassSubSchemaSubEntry() throws Exception
+        public void testAddAttributeTypeObjectClassSubSchemaSubEntry() throws Exception
     {
         checkAttributeTypePresent( "1.3.6.1.4.1.65536.0.4.3.2.1", "other", true );
         checkObjectClassPresent( "1.3.6.1.4.1.65536.0.4.3.2.2", "other", true );
-        
+
         // sync operation happens anyway on shutdowns but just to make sure we can do it again
         getService().sync();
 
@@ -161,7 +163,7 @@ public class SchemaIT extends AbstractLd
         checkObjectClassPresent( "1.3.6.1.4.1.65536.0.4.3.2.2", "other", true );
     }
 
-    
+
     @Test
     public void testAddBinaryAttributeType() throws Exception
     {
@@ -173,23 +175,23 @@ public class SchemaIT extends AbstractLd
 
         descriptions.add(
             "( 1.3.6.1.4.1.65536.0.4.3.2.1" +
-            " NAME 'templateData'" +
-            " DESC 'template data'" +
-            " SYNTAX 1.3.6.1.4.1.1466.115.121.1.5" +
-            " SINGLE-VALUE" +
-            " X-SCHEMA 'other' )" );
+                " NAME 'templateData'" +
+                " DESC 'template data'" +
+                " SYNTAX 1.3.6.1.4.1.1466.115.121.1.5" +
+                " SINGLE-VALUE" +
+                " X-SCHEMA 'other' )" );
 
         modify( DirContext.ADD_ATTRIBUTE, descriptions, "attributeTypes" );
 
         descriptions.clear();
         descriptions.add(
             "( 1.3.6.1.4.1.65536.0.4.3.2.2 " +
-            " NAME 'templateObject' " +
-            " DESC 'test OC' " +
-            " SUP top " +
-            " STRUCTURAL " +
-            " MUST ( templateData $ cn ) " +
-            " X-SCHEMA 'other' )");
+                " NAME 'templateObject' " +
+                " DESC 'test OC' " +
+                " SUP top " +
+                " STRUCTURAL " +
+                " MUST ( templateData $ cn ) " +
+                " X-SCHEMA 'other' )" );
 
         modify( DirContext.ADD_ATTRIBUTE, descriptions, "objectClasses" );
 
@@ -214,10 +216,11 @@ public class SchemaIT extends AbstractLd
         attrs.put( "templateData", templateData );
         attrs.put( "cn", "atemplate" );
         getRootContext( getService() ).bind( "cn=atemplate,ou=system", null, attrs );
-        
-        Attributes data = getRootContext( getService() ).getAttributes( "cn=atemplate,ou=system", new String[]{"templateData", "cn"} );
-        
-        assertTrue( Arrays.equals( templateData, (byte[])data.get( "templateData" ).get() ) );
+
+        Attributes data = getRootContext( getService() ).getAttributes( "cn=atemplate,ou=system", new String[]
+            { "templateData", "cn" } );
+
+        assertTrue( Arrays.equals( templateData, ( byte[] ) data.get( "templateData" ).get() ) );
     }
 
 
@@ -255,7 +258,8 @@ public class SchemaIT extends AbstractLd
         controls.setReturningAttributes( new String[]
             { SUBSCHEMA_SUBENTRY } );
 
-        NamingEnumeration<SearchResult> results = getRootContext( getService() ).search( "", "(objectClass=*)", controls );
+        NamingEnumeration<SearchResult> results = getRootContext( getService() ).search( "", "(objectClass=*)",
+            controls );
         SearchResult result = results.next();
         results.close();
         Attribute subschemaSubentry = result.getAttributes().get( SUBSCHEMA_SUBENTRY );
@@ -324,7 +328,8 @@ public class SchemaIT extends AbstractLd
 
         if ( isPresent )
         {
-            attrs = getSchemaContext( getService() ).getAttributes( "m-oid=" + oid + ",ou=attributeTypes,cn=" + schemaName );
+            attrs = getSchemaContext( getService() ).getAttributes(
+                "m-oid=" + oid + ",ou=attributeTypes,cn=" + schemaName );
             assertNotNull( attrs );
         }
         else
@@ -397,7 +402,8 @@ public class SchemaIT extends AbstractLd
 
         if ( isPresent )
         {
-            attrs = getSchemaContext( getService() ).getAttributes( "m-oid=" + oid + ",ou=objectClasses,cn=" + schemaName );
+            attrs = getSchemaContext( getService() ).getAttributes(
+                "m-oid=" + oid + ",ou=objectClasses,cn=" + schemaName );
             assertNotNull( attrs );
         }
         else