directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r951442 - in /directory/apacheds/trunk: ./ all/ core-api/ core-api/src/test/java/org/apache/directory/server/core/ core-mock/ core-mock/src/ core/ core/src/test/java/org/apache/directory/server/core/authz/support/ core/src/test/java/org/apa...
Date Fri, 04 Jun 2010 15:30:49 GMT
Author: seelmann
Date: Fri Jun  4 15:30:48 2010
New Revision: 951442

URL: http://svn.apache.org/viewvc?rev=951442&view=rev
Log:
o moved mock classes to core-api/src/test/java
o create a tests jar for core-api
o use this tests jar in ldap-partition and core
o removed duplicate mock classes in core
o removed core-mock module


Added:
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockCoreSession.java
      - copied unchanged from r951389, directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockCursor.java
      - copied unchanged from r951389, directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCursor.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java
      - copied, changed from r951389, directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.java
      - copied, changed from r951389, directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockInterceptor.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperation.java
      - copied unchanged from r951389, directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperation.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperationManager.java
      - copied unchanged from r951389, directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java
Removed:
    directory/apacheds/trunk/core-mock/pom.xml
    directory/apacheds/trunk/core-mock/src/
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/MockInterceptor.java
Modified:
    directory/apacheds/trunk/all/pom.xml
    directory/apacheds/trunk/core-api/pom.xml
    directory/apacheds/trunk/core/pom.xml
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
    directory/apacheds/trunk/ldif-partition/pom.xml
    directory/apacheds/trunk/pom.xml

Modified: directory/apacheds/trunk/all/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/all/pom.xml?rev=951442&r1=951441&r2=951442&view=diff
==============================================================================
--- directory/apacheds/trunk/all/pom.xml (original)
+++ directory/apacheds/trunk/all/pom.xml Fri Jun  4 15:30:48 2010
@@ -59,11 +59,6 @@
       <artifactId>apacheds-core-jndi</artifactId>
     </dependency>
     
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>apacheds-core-mock</artifactId>
-    </dependency>
-    
     <!-- 
     <dependency>
       <groupId>${project.groupId}</groupId>

Modified: directory/apacheds/trunk/core-api/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/pom.xml?rev=951442&r1=951441&r2=951442&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/pom.xml (original)
+++ directory/apacheds/trunk/core-api/pom.xml Fri Jun  4 15:30:48 2010
@@ -127,6 +127,17 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <artifactId>maven-jar-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-tests</id>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 

Copied: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java (from r951389, directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java?p2=directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java&p1=directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java&r1=951389&r2=951442&rev=951442&view=diff
==============================================================================
--- directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java Fri Jun  4 15:30:48 2010
@@ -49,6 +49,12 @@ public class MockDirectoryService implem
     int count;
     
     
+    public MockDirectoryService()
+    {
+        this( 0 );
+    }
+    
+    
     public MockDirectoryService( int count )
     {
         this.count = count;

Copied: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.java (from r951389, directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockInterceptor.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.java?p2=directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.java&p1=directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockInterceptor.java&r1=951389&r2=951442&rev=951442&view=diff
==============================================================================
--- directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockInterceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.java Fri Jun  4 15:30:48 2010
@@ -20,14 +20,12 @@
 package org.apache.directory.server.core;
 
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.interceptor.Interceptor;
-import org.apache.directory.server.core.interceptor.InterceptorChain;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
@@ -55,23 +53,16 @@ import org.apache.directory.shared.ldap.
 
 public class MockInterceptor implements Interceptor
 {
-    private static final int INTERCEPTOR_COUNT = 5;
-    List<MockInterceptor> interceptors = new ArrayList<MockInterceptor>( INTERCEPTOR_COUNT );
-    InterceptorChain test;
-    String name;
+    final String name;
+    final List<MockInterceptor> interceptors;
 
 
-    public void setName( String name )
+    public MockInterceptor( String name, List<MockInterceptor> interceptors )
     {
         this.name = name;
+        this.interceptors = interceptors;
     }
-    
-    
-    public void setTest( InterceptorChain test )
-    {
-        this.test = test;
-    }
-    
+
 
     public String getName()
     {
@@ -79,8 +70,13 @@ public class MockInterceptor implements 
     }
 
 
-    public void init( DirectoryService directoryService )
-        throws LdapException
+    public List<MockInterceptor> getInterceptors()
+    {
+        return interceptors;
+    }
+
+
+    public void init( DirectoryService directoryService ) throws LdapException
     {
     }
 
@@ -90,28 +86,29 @@ public class MockInterceptor implements 
     }
 
 
-    public ClonedServerEntry getRootDSE( NextInterceptor next, GetRootDSEOperationContext opContext ) throws LdapException
+    public ClonedServerEntry getRootDSE( NextInterceptor next, GetRootDSEOperationContext opContext )
+        throws LdapException
     {
         interceptors.add( this );
         return next.getRootDSE( opContext );
     }
 
 
-    public DN getMatchedName ( NextInterceptor next, GetMatchedNameOperationContext opContext ) throws LdapException
+    public DN getMatchedName( NextInterceptor next, GetMatchedNameOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         return next.getMatchedName( opContext );
     }
 
 
-    public DN getSuffix ( NextInterceptor next, GetSuffixOperationContext opContext ) throws LdapException
+    public DN getSuffix( NextInterceptor next, GetSuffixOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         return next.getSuffix( opContext );
     }
 
 
-    public Set<String> listSuffixes ( NextInterceptor next, ListSuffixOperationContext opContext ) throws LdapException
+    public Set<String> listSuffixes( NextInterceptor next, ListSuffixOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         return next.listSuffixes( opContext );
@@ -126,7 +123,8 @@ public class MockInterceptor implements 
     }
 
 
-    public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext opContext ) throws LdapException
+    public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext opContext )
+        throws LdapException
     {
         interceptors.add( this );
         next.removeContextPartition( opContext );
@@ -147,8 +145,7 @@ public class MockInterceptor implements 
     }
 
 
-    public void add( NextInterceptor next, AddOperationContext opContext )
-        throws LdapException
+    public void add( NextInterceptor next, AddOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         next.add( opContext );
@@ -190,8 +187,7 @@ public class MockInterceptor implements 
     }
 
 
-    public void rename( NextInterceptor next, RenameOperationContext opContext )
-        throws LdapException
+    public void rename( NextInterceptor next, RenameOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         next.rename( opContext );
@@ -205,16 +201,14 @@ public class MockInterceptor implements 
     }
 
 
-    public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext opContext )
-        throws LdapException
+    public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         next.moveAndRename( opContext );
     }
 
 
-    public void bind( NextInterceptor next, BindOperationContext opContext )
-    throws LdapException
+    public void bind( NextInterceptor next, BindOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );
         next.bind( opContext );

Modified: directory/apacheds/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/pom.xml?rev=951442&r1=951441&r2=951442&view=diff
==============================================================================
--- directory/apacheds/trunk/core/pom.xml (original)
+++ directory/apacheds/trunk/core/pom.xml Fri Jun  4 15:30:48 2010
@@ -47,6 +47,13 @@
       <artifactId>apacheds-core-api</artifactId>
       <groupId>${project.groupId}</groupId>
     </dependency>
+
+    <dependency>
+      <artifactId>apacheds-core-api</artifactId>
+      <groupId>${project.groupId}</groupId>
+      <classifier>tests</classifier>
+      <scope>test</scope>
+    </dependency>
     
     <dependency>
       <groupId>commons-collections</groupId>

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java?rev=951442&r1=951441&r2=951442&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java Fri Jun  4 15:30:48 2010
@@ -21,78 +21,27 @@ package org.apache.directory.server.core
 
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
-import java.io.File;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
 import java.util.Set;
 
-import javax.naming.ldap.LdapContext;
-
-import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.server.core.DefaultCoreSession;
-import org.apache.directory.server.core.DefaultDirectoryService;
-import org.apache.directory.server.core.DirectoryService;
-import org.apache.directory.server.core.LdapPrincipal;
-import org.apache.directory.server.core.OperationManager;
-import org.apache.directory.server.core.ReferralHandlingMode;
-import org.apache.directory.server.core.ReferralManager;
-import org.apache.directory.server.core.changelog.ChangeLog;
-import org.apache.directory.server.core.entry.ClonedServerEntry;
-import org.apache.directory.server.core.event.EventService;
-import org.apache.directory.server.core.filtering.BaseEntryFilteringCursor;
-import org.apache.directory.server.core.filtering.EntryFilteringCursor;
-import org.apache.directory.server.core.interceptor.Interceptor;
-import org.apache.directory.server.core.interceptor.InterceptorChain;
-import org.apache.directory.server.core.interceptor.context.AddOperationContext;
-import org.apache.directory.server.core.interceptor.context.BindOperationContext;
-import org.apache.directory.server.core.interceptor.context.CompareOperationContext;
-import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
-import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetMatchedNameOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
-import org.apache.directory.server.core.interceptor.context.ListOperationContext;
-import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
-import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
-import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
-import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
-import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
-import org.apache.directory.server.core.interceptor.context.OperationContext;
-import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
-import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
-import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
-import org.apache.directory.server.core.journal.Journal;
-import org.apache.directory.server.core.partition.DefaultPartitionNexus;
-import org.apache.directory.server.core.partition.Partition;
-import org.apache.directory.server.core.replication.ReplicationConfiguration;
-import org.apache.directory.server.core.schema.SchemaService;
-import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.directory.server.core.MockOperation;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
 import org.apache.directory.shared.ldap.aci.UserClass;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
-import org.apache.directory.shared.ldap.csn.Csn;
-import org.apache.directory.shared.ldap.cursor.ClosureMonitor;
-import org.apache.directory.shared.ldap.cursor.Cursor;
-import org.apache.directory.shared.ldap.cursor.CursorIterator;
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.entry.Entry;
-import org.apache.directory.shared.ldap.entry.Modification;
-import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.ldif.LdifEntry;
-import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.loader.ldif.JarLdifSchemaLoader;
+import org.apache.directory.shared.ldap.schema.manager.impl.DefaultSchemaManager;
+import org.apache.directory.shared.ldap.util.LdapExceptionUtils;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -105,57 +54,70 @@ import org.junit.Test;
  */
 public class MaxImmSubFilterTest
 {
-    private static final Collection<ACITuple> EMPTY_ACI_TUPLE_COLLECTION = Collections.unmodifiableCollection( new ArrayList<ACITuple>() );
-    private static final Collection<UserClass> EMPTY_USER_CLASS_COLLECTION = Collections.unmodifiableCollection( new ArrayList<UserClass>() );
-    private static final Collection<ProtectedItem> EMPTY_PROTECTED_ITEM_COLLECTION = Collections.unmodifiableCollection( new ArrayList<ProtectedItem>() );
+    private static final Collection<ACITuple> EMPTY_ACI_TUPLE_COLLECTION = Collections
+        .unmodifiableCollection( new ArrayList<ACITuple>() );
+    private static final Collection<UserClass> EMPTY_USER_CLASS_COLLECTION = Collections
+        .unmodifiableCollection( new ArrayList<UserClass>() );
+    private static final Collection<ProtectedItem> EMPTY_PROTECTED_ITEM_COLLECTION = Collections
+        .unmodifiableCollection( new ArrayList<ProtectedItem>() );
 
-    private static final Set<MicroOperation> EMPTY_MICRO_OPERATION_SET = Collections.unmodifiableSet( new HashSet<MicroOperation>() );
+    private static final Set<MicroOperation> EMPTY_MICRO_OPERATION_SET = Collections
+        .unmodifiableSet( new HashSet<MicroOperation>() );
 
     private static final DN ROOTDSE_NAME = new DN();
     private static DN ENTRY_NAME;
     private static Collection<ProtectedItem> PROTECTED_ITEMS = new ArrayList<ProtectedItem>();
     private static Entry ENTRY;
-    
-    /** A reference to the directory service */
-    private static DirectoryService service;
 
-    
-    @BeforeClass 
+    /** A reference to the schemaManager */
+    private static SchemaManager schemaManager;
+
+
+    @BeforeClass
     public static void setup() throws Exception
     {
-        service = new DefaultDirectoryService();
+        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+
+        schemaManager = new DefaultSchemaManager( loader );
+
+        boolean loaded = schemaManager.loadAllEnabled();
+
+        if ( !loaded )
+        {
+            fail( "Schema load failed : " + LdapExceptionUtils.printErrors( schemaManager.getErrors() ) );
+        }
 
         ENTRY_NAME = new DN( "ou=test, ou=system" );
         PROTECTED_ITEMS.add( new ProtectedItem.MaxImmSub( 2 ) );
-        ENTRY = new DefaultEntry( service.getSchemaManager(), ENTRY_NAME );
+        ENTRY = new DefaultEntry( schemaManager, ENTRY_NAME );
     }
 
 
-    @Test 
+    @Test
     public void testWrongScope() throws Exception
     {
         MaxImmSubFilter filter = new MaxImmSubFilter();
         Collection<ACITuple> tuples = new ArrayList<ACITuple>();
-        tuples.add( new ACITuple( EMPTY_USER_CLASS_COLLECTION, AuthenticationLevel.NONE, 
+        tuples.add( new ACITuple( EMPTY_USER_CLASS_COLLECTION, AuthenticationLevel.NONE,
             EMPTY_PROTECTED_ITEM_COLLECTION, EMPTY_MICRO_OPERATION_SET, true, 0 ) );
 
         tuples = Collections.unmodifiableCollection( tuples );
 
-        assertEquals( tuples, filter.filter( null, tuples, OperationScope.ATTRIBUTE_TYPE, null, null, null, null,
-            null, ENTRY_NAME, null, null, ENTRY, null, null ) );
+        assertEquals( tuples, filter.filter( null, tuples, OperationScope.ATTRIBUTE_TYPE, null, null, null, null, null,
+            ENTRY_NAME, null, null, ENTRY, null, null ) );
 
         assertEquals( tuples, filter.filter( null, tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null,
             null, null, ENTRY_NAME, null, null, ENTRY, null, null ) );
     }
 
 
-    @Test 
+    @Test
     public void testRootDSE() throws Exception
     {
         MaxImmSubFilter filter = new MaxImmSubFilter();
 
         Collection<ACITuple> tuples = new ArrayList<ACITuple>();
-        tuples.add( new ACITuple( EMPTY_USER_CLASS_COLLECTION, AuthenticationLevel.NONE, 
+        tuples.add( new ACITuple( EMPTY_USER_CLASS_COLLECTION, AuthenticationLevel.NONE,
             EMPTY_PROTECTED_ITEM_COLLECTION, EMPTY_MICRO_OPERATION_SET, true, 0 ) );
 
         tuples = Collections.unmodifiableCollection( tuples );
@@ -165,23 +127,23 @@ public class MaxImmSubFilterTest
     }
 
 
-    @Test 
+    @Test
     public void testZeroTuple() throws Exception
     {
         MaxImmSubFilter filter = new MaxImmSubFilter();
 
-        assertEquals( 0, filter.filter( null, EMPTY_ACI_TUPLE_COLLECTION, OperationScope.ENTRY, null, null, null, null, null,
-            ENTRY_NAME, null, null, ENTRY, null, null ).size() );
+        assertEquals( 0, filter.filter( null, EMPTY_ACI_TUPLE_COLLECTION, OperationScope.ENTRY, null, null, null, null,
+            null, ENTRY_NAME, null, null, ENTRY, null, null ).size() );
     }
 
 
-    @Test 
+    @Test
     public void testDenialTuple() throws Exception
     {
         MaxImmSubFilter filter = new MaxImmSubFilter();
         Collection<ACITuple> tuples = new ArrayList<ACITuple>();
-        tuples.add( new ACITuple( EMPTY_USER_CLASS_COLLECTION, AuthenticationLevel.NONE, 
-            PROTECTED_ITEMS, EMPTY_MICRO_OPERATION_SET, false, 0 ) );
+        tuples.add( new ACITuple( EMPTY_USER_CLASS_COLLECTION, AuthenticationLevel.NONE, PROTECTED_ITEMS,
+            EMPTY_MICRO_OPERATION_SET, false, 0 ) );
 
         tuples = Collections.unmodifiableCollection( tuples );
 
@@ -190,13 +152,13 @@ public class MaxImmSubFilterTest
     }
 
 
-    @Test 
+    @Test
     public void testGrantTuple() throws Exception
     {
         MaxImmSubFilter filter = new MaxImmSubFilter();
         Collection<ACITuple> tuples = new ArrayList<ACITuple>();
-        tuples.add( new ACITuple( EMPTY_USER_CLASS_COLLECTION, AuthenticationLevel.NONE, 
-            PROTECTED_ITEMS, EMPTY_MICRO_OPERATION_SET, true, 0 ) );
+        tuples.add( new ACITuple( EMPTY_USER_CLASS_COLLECTION, AuthenticationLevel.NONE, PROTECTED_ITEMS,
+            EMPTY_MICRO_OPERATION_SET, true, 0 ) );
 
         assertEquals( 1, filter.filter( null, tuples, OperationScope.ENTRY, new MockOperation( 1 ), null, null, null,
             null, ENTRY_NAME, null, null, ENTRY, null, null ).size() );
@@ -204,984 +166,4 @@ public class MaxImmSubFilterTest
         assertEquals( 0, filter.filter( null, tuples, OperationScope.ENTRY, new MockOperation( 3 ), null, null, null,
             null, ENTRY_NAME, null, null, ENTRY, null, null ).size() );
     }
-
-    
-    class MockOperation implements OperationContext
-    {
-        final int count;
-        final CoreSession session; 
-
-
-        public MockOperation( int count ) throws Exception 
-        {
-            this.count = count;
-            this.session = new DefaultCoreSession( new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ), 
-                new MockDirectoryService( count ) );
-        }
-
-
-        public EntryFilteringCursor search( SearchOperationContext opContext )
-            throws LdapException
-        {
-            return new BaseEntryFilteringCursor( new BogusCursor( count ), opContext );
-        }
-
-
-        public EntryFilteringCursor search( SearchOperationContext opContext, Collection<String> bypass ) throws LdapException
-        {
-            return new BaseEntryFilteringCursor( new BogusCursor( count ), opContext );
-        }
-
-
-        public void addRequestControl( Control requestControl )
-        {
-        }
-
-
-        public void addRequestControls( Control[] requestControls )
-        {
-        }
-
-
-        public void addResponseControl( Control responseControl )
-        {
-        }
-
-
-        public Collection<String> getByPassed()
-        {
-            return null;
-        }
-
-
-        public DN getDn()
-        {
-            return null;
-        }
-
-
-        public String getName()
-        {
-            return null;
-        }
-
-
-        public Control getRequestControl( String numericOid )
-        {
-            return null;
-        }
-
-
-        public Control getResponseControl( String numericOid )
-        {
-            return null;
-        }
-
-
-        public int getResponseControlCount()
-        {
-            return 0;
-        }
-
-
-        public Control[] getResponseControls()
-        {
-            return null;
-        }
-
-
-        public CoreSession getSession()
-        {
-            return session;
-        }
-
-
-        public boolean hasBypass()
-        {
-            return false;
-        }
-
-
-        public boolean hasRequestControl( String numericOid )
-        {
-            return false;
-        }
-
-
-        public boolean hasRequestControls()
-        {
-            return false;
-        }
-
-
-        public boolean hasResponseControl( String numericOid )
-        {
-            return false;
-        }
-
-
-        public boolean hasResponseControls()
-        {
-            return false;
-        }
-
-
-        public boolean isBypassed( String interceptorName )
-        {
-            return false;
-        }
-
-
-        public boolean isCollateralOperation()
-        {
-            return false;
-        }
-
-
-        public ClonedServerEntry lookup( DN dn, Collection<String> bypass ) throws LdapException
-        {
-            return null;
-        }
-
-
-        public ClonedServerEntry lookup( LookupOperationContext lookupContext ) throws LdapException
-        {
-            return null;
-        }
-
-
-        public LookupOperationContext newLookupContext( DN dn )
-        {
-            return null;
-        }
-
-
-        public void setByPassed( Collection<String> byPassed )
-        {
-        }
-
-
-        public void setCollateralOperation( boolean collateralOperation )
-        {
-        }
-
-
-        public void setDn( DN dn )
-        {
-        }
-
-
-        public LdapPrincipal getEffectivePrincipal()
-        {
-            return null;
-        }
-
-
-        public OperationContext getFirstOperation()
-        {
-            return null;
-        }
-
-
-        public OperationContext getLastOperation()
-        {
-            return null;
-        }
-
-
-        public OperationContext getNextOperation()
-        {
-            return null;
-        }
-
-
-        public OperationContext getPreviousOperation()
-        {
-            return null;
-        }
-
-
-        public boolean isFirstOperation()
-        {
-            return false;
-        }
-
-
-        public void add( Entry entry, Collection<String> bypass ) throws LdapException
-        {
-        }
-
-
-        public void delete( DN dn, Collection<String> bypass ) throws LdapException
-        {
-        }
-
-
-        public void modify( DN dn, List<Modification> mods, Collection<String> bypass ) throws LdapException
-        {
-        }
-
-
-        public boolean hasEntry( DN dn, Collection<String> byPass ) throws LdapException
-        {
-            return false;
-        }
-
-
-        public ReferralHandlingMode getReferralHandlingMode()
-        {
-            return null;
-        }
-
-
-        public void setReferralHandlingMode( ReferralHandlingMode referralHandlingMode )
-        {
-        }
-
-
-        public ClonedServerEntry getEntry()
-        {
-            return null;
-        }
-
-
-        public void setEntry( ClonedServerEntry entry )
-        {
-        }
-
-
-        public void throwReferral()
-        {
-        }
-        
-        
-        public boolean isReferralThrown()
-        {
-            return false;
-        }
-
-
-        public void ignoreReferral()
-        {
-        }
-
-
-        public boolean isReferralIgnored()
-        {
-            return false;
-        }
-    }
-
-    class MockDirectoryService implements DirectoryService
-    {
-        int count;
-        
-        
-        public MockDirectoryService( int count )
-        {
-            this.count = count;
-        }
-        
-        public Hashtable<String, Object> getEnvironment()
-        {
-            return null;
-        }
-
-
-        public void setEnvironment( Hashtable<String, Object> environment )
-        {
-        }
-
-
-        public long revert( long revision ) throws LdapException
-        {
-            return 0;
-        }
-
-
-        public long revert() throws LdapException
-        {
-            return 0;
-        }
-
-
-        public DefaultPartitionNexus getPartitionNexus()
-        {
-            return null;
-        }
-
-
-        public InterceptorChain getInterceptorChain()
-        {
-            return null;
-        }
-
-
-        public void addPartition( Partition partition ) throws LdapException
-        {
-        }
-
-
-        public void removePartition( Partition partition ) throws LdapException
-        {
-        }
-
-
-        public SchemaManager getSchemaManager()
-        {
-            return null;
-        }
-
-
-        public ReferralManager getReferralManager()
-        {
-            return null;
-        }
-
-
-        public void setReferralManager( ReferralManager referralManager )
-        {
-        }
-
-
-        public void setRegistries( Registries registries )
-        {
-        }
-
-
-        public SchemaService getSchemaService()
-        {
-            return null;
-        }
-
-
-        public void setSchemaService( SchemaService schemaService )
-        {
-
-        }
-
-
-        public void startup() throws LdapException
-        {
-        }
-
-
-        public void shutdown() throws LdapException
-        {
-        }
-
-
-        public void sync() throws LdapException
-        {
-        }
-
-
-        public boolean isStarted()
-        {
-            return true;
-        }
-
-
-        public LdapContext getJndiContext() throws LdapException
-        {
-            return null;
-        }
-
-
-        public DirectoryService getDirectoryService()
-        {
-            return null;
-        }
-
-
-        public void setInstanceId( String instanceId )
-        {
-
-        }
-
-
-        public String getInstanceId()
-        {
-            return null;
-        }
-
-
-        public Set<? extends Partition> getPartitions()
-        {
-            return null;
-        }
-
-
-        public void setPartitions( Set<? extends Partition> partitions )
-        {
-        }
-
-
-        public boolean isAccessControlEnabled()
-        {
-            return false;
-        }
-
-
-        public void setAccessControlEnabled( boolean accessControlEnabled )
-        {
-        }
-
-
-        public boolean isAllowAnonymousAccess()
-        {
-            return false;
-        }
-
-
-        public void setAllowAnonymousAccess( boolean enableAnonymousAccess )
-        {
-
-        }
-
-
-        public List<Interceptor> getInterceptors()
-        {
-            return null;
-        }
-
-
-        public void setInterceptors( List<Interceptor> interceptors )
-        {
-
-        }
-
-
-        public List<LdifEntry> getTestEntries()
-        {
-            return null;
-        }
-
-
-        public void setTestEntries( List<? extends LdifEntry> testEntries )
-        {
-        }
-
-
-        public File getWorkingDirectory()
-        {
-            return null;
-        }
-
-
-        public void setWorkingDirectory( File workingDirectory )
-        {
-        }
-
-
-        public void validate()
-        {
-        }
-
-
-        public void setShutdownHookEnabled( boolean shutdownHookEnabled )
-        {
-
-        }
-
-
-        public boolean isShutdownHookEnabled()
-        {
-            return false;
-        }
-
-
-        public void setExitVmOnShutdown( boolean exitVmOnShutdown )
-        {
-
-        }
-
-
-        public boolean isExitVmOnShutdown()
-        {
-            return false;
-        }
-
-
-        public void setMaxSizeLimit( long maxSizeLimit )
-        {
-
-        }
-
-
-        public long getMaxSizeLimit()
-        {
-            return 0;
-        }
-
-
-        public void setMaxTimeLimit( int maxTimeLimit )
-        {
-
-        }
-
-
-        public int getMaxTimeLimit()
-        {
-            return 0;
-        }
-
-
-        public void setSystemPartition( Partition systemPartition )
-        {
-
-        }
-
-
-        public Partition getSystemPartition()
-        {
-            return null;
-        }
-
-
-        public boolean isDenormalizeOpAttrsEnabled()
-        {
-            return false;
-        }
-
-
-        public void setDenormalizeOpAttrsEnabled( boolean denormalizeOpAttrsEnabled )
-        {
-
-        }
-        
-        public void setChangeLog( ChangeLog changeLog )
-        {
-            
-        }
-        
-        public ChangeLog getChangeLog()
-        {
-            return null;
-        }
-
-
-        public Journal getJournal()
-        {
-            return null;
-        }
-
-
-        public Entry newEntry( DN dn ) throws LdapException
-        {
-            return null;
-        }
-        
-        public Entry newEntry( String ldif, String dn )
-        {
-            return null;
-        }
-
-
-        public OperationManager getOperationManager()
-        {
-            return new MockOperationManager( count );
-        }
-
-
-        public CoreSession getSession() throws Exception
-        {
-            return null;
-        }
-
-
-        public CoreSession getSession( LdapPrincipal principal ) throws Exception
-        {
-            return null;
-        }
-
-
-        public CoreSession getSession( DN principalDn, byte[] credentials ) throws LdapException
-        {
-            return null;
-        }
-
-        
-        public CoreSession getSession( DN principalDn, byte[] credentials, String saslMechanism, String saslAuthId )
-            throws Exception
-        {
-            return null;
-        }
-
-        public CoreSession getAdminSession()
-        {
-            return null;
-        }
-
-        public EventService getEventService()
-        {
-            return null;
-        }
-
-        public void setEventService( EventService eventService )
-        {
-        }
-        
-        public boolean isPasswordHidden()
-        {
-            return false;
-        }
-        
-        public void setPasswordHidden( boolean passwordHidden )
-        {
-        }
-
-
-        public int getMaxPDUSize()
-        {
-            return Integer.MAX_VALUE;
-        }
-
-
-        public void setMaxPDUSize( int maxPDUSize )
-        {
-            // Do nothing
-        }
-
-        
-        public Interceptor getInterceptor( String interceptorName )
-        {
-            return null;
-        }
-        
-        
-        public Csn getCSN()
-        {
-            return null;
-        }
-        
-        
-        public int getReplicaId()
-        {
-            return 0;
-        }
-        
-        
-        public void setReplicaId( int replicaId )
-        {
-            
-        }
-
-        public void setJournal( Journal journal )
-        {
-            
-        }
-
-        public void setReplicationConfiguration( ReplicationConfiguration replicationConfig )
-        {
-            // TODO Auto-generated method stub
-            
-        }
-
-        public ReplicationConfiguration getReplicationConfiguration()
-        {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        public void setSchemaManager( SchemaManager schemaManager )
-        {
-            // TODO Auto-generated method stub
-            
-        }
-
-        public String getContextCsn()
-        {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        public void setContextCsn( String lastKnownCsn )
-        {
-            // TODO Auto-generated method stub
-            
-        }
-
-        public long getSyncPeriodMillis()
-        {
-            // TODO Auto-generated method stub
-            return 0;
-        }
-
-        public void setSyncPeriodMillis( long syncPeriodMillis )
-        {
-            // TODO Auto-generated method stub
-            
-        }
-    }
-
-    
-    class MockOperationManager implements OperationManager
-    {
-        int count;
-        
-        public MockOperationManager( int count )
-        {
-            this.count = count;
-        }
-        
-        public void add( AddOperationContext opContext ) throws LdapException
-        {
-        }
-
-        
-        public void bind( BindOperationContext opContext ) throws LdapException
-        {
-        }
-
-        
-        public boolean compare( CompareOperationContext opContext ) throws LdapException
-        {
-            return false;
-        }
-
-
-        public void delete( DeleteOperationContext opContext ) throws LdapException
-        {
-        }
-
-        public DN getMatchedName( GetMatchedNameOperationContext opContext ) throws LdapException
-        {
-            return null;
-        }
-
-        public ClonedServerEntry getRootDSE( GetRootDSEOperationContext opContext ) throws LdapException
-        {
-            return null;
-        }
-
-        public DN getSuffix( GetSuffixOperationContext opContext ) throws LdapException
-        {
-            return null;
-        }
-
-        public boolean hasEntry( EntryOperationContext opContext ) throws LdapException
-        {
-            return false;
-        }
-
-        public EntryFilteringCursor list( ListOperationContext opContext ) throws LdapException
-        {
-            return null;
-        }
-
-        public Set<String> listSuffixes( ListSuffixOperationContext opContext ) throws LdapException
-        {
-            return null;
-        }
-
-        public ClonedServerEntry lookup( LookupOperationContext opContext ) throws LdapException
-        {
-            return null;
-        }
-
-        public void modify( ModifyOperationContext opContext ) throws LdapException
-        {
-        }
-
-        public void move( MoveOperationContext opContext ) throws LdapException
-        {
-        }
-
-        public void moveAndRename( MoveAndRenameOperationContext opContext ) throws LdapException
-        {
-        }
-
-        public void rename( RenameOperationContext opContext ) throws LdapException
-        {
-        }
-
-        public EntryFilteringCursor search( SearchOperationContext opContext ) throws LdapException
-        {
-            return new BaseEntryFilteringCursor( new BogusCursor( count ), opContext );
-        }
-
-
-        public void unbind( UnbindOperationContext opContext ) throws LdapException
-        {
-        }
-    }
-    
-
-    class BogusCursor implements Cursor<Entry>
-    {
-        final int count;
-        int ii;
-
-
-        public BogusCursor(int count)
-        {
-            this.count = count;
-        }
-
-
-        public boolean available() 
-        {
-            return ii < count;
-        }
-
-
-        public void close() throws LdapException
-        {
-            ii = count;
-        }
-
-
-        public boolean hasMoreElements()
-        {
-            return ii < count;
-        }
-
-
-        public Object nextElement()
-        {
-            if ( ii >= count )
-            {
-                throw new NoSuchElementException();
-            }
-
-            ii++;
-            
-            return new Object();
-        }
-
-
-        public void after( Entry element ) throws Exception
-        {
-        }
-
-
-        public void afterLast() throws Exception
-        {
-        }
-
-
-        public void before( Entry element ) throws Exception
-        {
-            throw new NotImplementedException();
-        }
-
-
-        public void beforeFirst() throws Exception
-        {
-            ii = -1;
-        }
-
-
-        public boolean first() throws Exception
-        {
-            ii = 0;
-            return ii < count;
-        }
-
-
-        public Entry get() throws Exception
-        {
-            return new DefaultEntry( service.getSchemaManager() );
-        }
-
-
-        public boolean isClosed() throws Exception
-        {
-            return false;
-        }
-
-
-        public boolean isElementReused()
-        {
-            return false;
-        }
-
-
-        public boolean last() throws Exception
-        {
-            ii = count;
-            return true;
-        }
-
-
-        public boolean next() 
-        {
-            if ( ii >= count )
-            {
-                return false;
-            }
-
-            ii++;
-            
-            return true;
-        }
-
-
-        public boolean previous() throws Exception
-        {
-            if ( ii < 0 )
-            {
-                return false;
-            }
-            
-            ii--;
-            return true;
-        }
-
-
-        public Iterator<Entry> iterator()
-        {
-            return new CursorIterator<Entry>( this );
-        }
-
-
-        public void close( Exception reason ) throws Exception
-        {
-        }
-
-
-        public void setClosureMonitor( ClosureMonitor monitor )
-        {
-        }
-
-        /**
-         * {@inheritDoc}
-         */
-        public boolean isAfterLast() throws Exception
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_02014_UNSUPPORTED_OPERATION, getClass().getName()
-                .concat( "." ).concat( "isAfterLast()" ) ) );
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public boolean isBeforeFirst() throws Exception
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_02014_UNSUPPORTED_OPERATION, getClass().getName()
-                .concat( "." ).concat( "isBeforeFirst()" ) ) );
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public boolean isFirst() throws Exception
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_02014_UNSUPPORTED_OPERATION, getClass().getName()
-                .concat( "." ).concat( "isFirst()" ) ) );
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public boolean isLast() throws Exception
-        {
-            throw new UnsupportedOperationException( I18n.err( I18n.ERR_02014_UNSUPPORTED_OPERATION, getClass().getName()
-                .concat( "." ).concat( "isLast()" ) ) );
-        }
-    }
 }

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java?rev=951442&r1=951441&r2=951442&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java Fri Jun  4 15:30:48 2010
@@ -22,40 +22,22 @@ package org.apache.directory.server.core
 
 import static org.junit.Assert.assertEquals;
 
-import java.io.File;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.Hashtable;
 import java.util.List;
 import java.util.Set;
 
-import javax.naming.ldap.LdapContext;
-
-import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
-import org.apache.directory.server.core.OperationManager;
-import org.apache.directory.server.core.ReferralManager;
-import org.apache.directory.server.core.changelog.ChangeLog;
-import org.apache.directory.server.core.event.EventService;
+import org.apache.directory.server.core.MockDirectoryService;
+import org.apache.directory.server.core.MockInterceptor;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.invocation.InvocationStack;
-import org.apache.directory.server.core.journal.Journal;
 import org.apache.directory.server.core.partition.ByPassConstants;
-import org.apache.directory.server.core.partition.DefaultPartitionNexus;
-import org.apache.directory.server.core.partition.Partition;
-import org.apache.directory.server.core.replication.ReplicationConfiguration;
-import org.apache.directory.server.core.schema.SchemaService;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
-import org.apache.directory.shared.ldap.csn.Csn;
-import org.apache.directory.shared.ldap.entry.Entry;
-import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.name.DN;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -74,12 +56,12 @@ public class InterceptorChainTest
     private InterceptorChain chain;
     List<MockInterceptor> interceptors = new ArrayList<MockInterceptor>( INTERCEPTOR_COUNT );
 
-    
+
     public InterceptorChainTest()
     {
     }
-    
-    
+
+
     @Before
     public void setUp() throws Exception
     {
@@ -87,12 +69,10 @@ public class InterceptorChainTest
 
         for ( int ii = 0; ii < INTERCEPTOR_COUNT; ii++ )
         {
-            MockInterceptor interceptor = new MockInterceptor();
-            interceptor.setTest( this );
-            interceptor.setName( Integer.toString( ii ) );
-            chain.addLast(interceptor);
+            MockInterceptor interceptor = new MockInterceptor( Integer.toString( ii ), interceptors );
+            chain.addLast( interceptor );
         }
-        
+
     }
 
 
@@ -109,8 +89,8 @@ public class InterceptorChainTest
     {
         DN dn = new DN( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
-        DefaultCoreSession session = new DefaultCoreSession( 
-            new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ), ds );
+        DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ),
+            ds );
         LookupOperationContext opContext = new LookupOperationContext( session, dn );
         InvocationStack.getInstance().push( opContext );
 
@@ -135,8 +115,8 @@ public class InterceptorChainTest
     {
         DN dn = new DN( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
-        DefaultCoreSession session = new DefaultCoreSession( 
-            new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ), ds );
+        DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ),
+            ds );
         LookupOperationContext opContext = new LookupOperationContext( session, dn );
         opContext.setByPassed( Collections.singleton( "0" ) );
         InvocationStack.getInstance().push( opContext );
@@ -162,8 +142,8 @@ public class InterceptorChainTest
     {
         DN dn = new DN( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
-        DefaultCoreSession session = new DefaultCoreSession( 
-            new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ), ds );
+        DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ),
+            ds );
         LookupOperationContext opContext = new LookupOperationContext( session, dn );
         Set<String> bypass = new HashSet<String>();
         bypass.add( "0" );
@@ -192,8 +172,8 @@ public class InterceptorChainTest
     {
         DN dn = new DN( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
-        DefaultCoreSession session = new DefaultCoreSession( 
-            new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ), ds );
+        DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ),
+            ds );
         LookupOperationContext opContext = new LookupOperationContext( session, dn );
         Set<String> bypass = new HashSet<String>();
         bypass.add( "0" );
@@ -221,8 +201,8 @@ public class InterceptorChainTest
     {
         DN dn = new DN( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
-        DefaultCoreSession session = new DefaultCoreSession( 
-            new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ), ds );
+        DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ),
+            ds );
         LookupOperationContext opContext = new LookupOperationContext( session, dn );
         Set<String> bypass = new HashSet<String>();
         bypass.add( "1" );
@@ -249,9 +229,9 @@ public class InterceptorChainTest
     public void testCompleteBypass() throws Exception
     {
         DN dn = new DN( "ou=system" );
-        DirectoryService ds = new MockDirectoryService();
-        DefaultCoreSession session = new DefaultCoreSession( 
-            new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ), ds );
+        DirectoryService ds = new MockDirectoryService( 0 );
+        DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ),
+            ds );
         LookupOperationContext opContext = new LookupOperationContext( session, dn );
         opContext.setByPassed( ByPassConstants.BYPASS_ALL_COLLECTION );
         InvocationStack.getInstance().push( opContext );
@@ -266,476 +246,4 @@ public class InterceptorChainTest
 
         assertEquals( 0, interceptors.size() );
     }
-
-    
-    class MockDirectoryService implements DirectoryService
-    {
-        public Hashtable<String, Object> getEnvironment()
-        {
-            return null;
-        }
-
-
-        public void setEnvironment( Hashtable<String, Object> environment )
-        {
-        }
-
-
-        public long revert( long revision ) throws LdapException
-        {
-            return 0;
-        }
-
-
-        public long revert() throws LdapException
-        {
-            return 0;
-        }
-
-
-        public DefaultPartitionNexus getPartitionNexus()
-        {
-            return null;
-        }
-
-
-        public InterceptorChain getInterceptorChain()
-        {
-            return null;
-        }
-
-
-        public void addPartition( Partition partition ) throws LdapException
-        {
-        }
-
-
-        public void removePartition( Partition partition ) throws LdapException
-        {
-        }
-
-
-        public ReferralManager getReferralManager()
-        {
-            return null;
-        }
-
-
-        public void setReferralManager( ReferralManager referralManager )
-        {
-        }
-
-
-        public SchemaManager getSchemaManager()
-        {
-            return null;
-        }
-
-
-        public void setRegistries( Registries registries )
-        {
-        }
-
-
-        public SchemaService getSchemaService()
-        {
-            return null;
-        }
-
-
-        public void setSchemaService( SchemaService schemaService )
-        {
-
-        }
-
-
-        public void startup() throws LdapException
-        {
-        }
-
-
-        public void shutdown() throws LdapException
-        {
-        }
-
-
-        public void sync() throws LdapException
-        {
-        }
-
-
-        public boolean isStarted()
-        {
-            return false;
-        }
-
-
-        public LdapContext getJndiContext() throws LdapException
-        {
-            return null;
-        }
-
-
-        public DirectoryService getDirectoryService()
-        {
-            return null;
-        }
-
-
-        public LdapContext getJndiContext( String baseName ) throws LdapException
-        {
-            return null;
-        }
-
-
-        public LdapContext getJndiContext( LdapPrincipal principal ) throws LdapException
-        {
-            return null;
-        }
-
-
-        public LdapContext getJndiContext( LdapPrincipal principal, String dn ) throws LdapException
-        {
-            return null;
-        }
-
-
-        public LdapContext getJndiContext( DN principalDn, String principal, byte[] credential,
-            String authentication, String baseName ) throws LdapException
-        {
-            return null;
-        }
-
-
-        public void setInstanceId( String instanceId )
-        {
-        }
-
-
-        public String getInstanceId()
-        {
-            return null;
-        }
-
-
-        public Set<? extends Partition> getPartitions()
-        {
-            return null;
-        }
-
-
-        public void setPartitions( Set<? extends Partition> partitions )
-        {
-        }
-
-
-        public boolean isAccessControlEnabled()
-        {
-            return false;
-        }
-
-
-        public void setAccessControlEnabled( boolean accessControlEnabled )
-        {
-        }
-
-
-        public boolean isAllowAnonymousAccess()
-        {
-            return false;
-        }
-
-
-        public void setAllowAnonymousAccess( boolean enableAnonymousAccess )
-        {
-        }
-
-
-        public List<Interceptor> getInterceptors()
-        {
-            return null;
-        }
-
-
-        public void setInterceptors( List<Interceptor> interceptors )
-        {
-        }
-
-
-        public List<LdifEntry> getTestEntries()
-        {
-            return null;
-        }
-
-
-        public void setTestEntries( List<? extends LdifEntry> testEntries )
-        {
-        }
-
-
-        public File getWorkingDirectory()
-        {
-            return null;
-        }
-
-
-        public void setWorkingDirectory( File workingDirectory )
-        {
-        }
-
-
-        public void validate()
-        {
-        }
-
-
-        public void setShutdownHookEnabled( boolean shutdownHookEnabled )
-        {
-        }
-
-
-        public boolean isShutdownHookEnabled()
-        {
-            return false;
-        }
-
-
-        public void setExitVmOnShutdown( boolean exitVmOnShutdown )
-        {
-        }
-
-
-        public boolean isExitVmOnShutdown()
-        {
-            return false;
-        }
-
-
-        public void setMaxSizeLimit( long maxSizeLimit )
-        {
-        }
-
-
-        public long getMaxSizeLimit()
-        {
-            return 0;
-        }
-
-
-        public void setMaxTimeLimit( int maxTimeLimit )
-        {
-        }
-
-
-        public int getMaxTimeLimit()
-        {
-            return 0;
-        }
-
-
-        public void setSystemPartition( Partition systemPartition )
-        {
-        }
-
-
-        public Partition getSystemPartition()
-        {
-            return null;
-        }
-
-
-        public boolean isDenormalizeOpAttrsEnabled()
-        {
-            return false;
-        }
-
-
-        public void setDenormalizeOpAttrsEnabled( boolean denormalizeOpAttrsEnabled )
-        {
-        }
-        
-        public void setChangeLog( ChangeLog changeLog )
-        {
-            
-        }
-
-        
-        public ChangeLog getChangeLog()
-        {
-            return null;
-        }
-
-
-        public Journal getJournal()
-        {
-            return null;
-        }
-
-
-        public Entry newEntry( DN dn ) throws LdapException
-        {
-            return null;
-        }
-
-        
-        public Entry newEntry( String ldif, String dn )
-        {
-            return null;
-        }
-
-
-        public OperationManager getOperationManager()
-        {
-            return null;
-        }
-
-
-        public CoreSession getSession() throws LdapException
-        {
-            return null;
-        }
-
-
-        public CoreSession getSession( LdapPrincipal principal ) throws LdapException
-        {
-            return null;
-        }
-
-
-        public CoreSession getSession( DN principalDn, byte[] credentials ) throws LdapException
-        {
-            return null;
-        }
-
-
-        public CoreSession getSession( DN principalDn, byte[] credentials, String saslMechanism, String saslAuthId )
-            throws LdapException
-        {
-            return null;
-        }
-
-
-        public CoreSession getAdminSession()
-        {
-            return null;
-        }
-
-
-        public EventService getEventService()
-        {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-
-        public void setEventService( EventService eventService )
-        {
-            // TODO Auto-generated method stub
-            
-        }
-
-        
-        public boolean isPasswordHidden()
-        {
-            return false;
-        }
-        
-        
-        public void setPasswordHidden( boolean passwordHidden )
-        {
-        }
-
-
-        public int getMaxPDUSize()
-        {
-            return Integer.MAX_VALUE;
-        }
-
-
-        public void setMaxPDUSize( int maxPDUSize )
-        {
-            // Do nothing
-        }
-
-        
-        public Interceptor getInterceptor( String interceptorName )
-        {
-            return null;
-        }
-        
-        
-        public Csn getCSN()
-        {
-            return null;
-        }
-        
-        
-        public int getReplicaId()
-        {
-            return 0;
-        }
-        
-        
-        public void setReplicaId( int replicaId )
-        {
-            
-        }
-
-
-        public void setJournal( Journal journal )
-        {
-            // TODO Auto-generated method stub
-            
-        }
-
-
-        public void setReplicationConfiguration( ReplicationConfiguration replicationConfig )
-        {
-            // TODO Auto-generated method stub
-            
-        }
-
-
-        public ReplicationConfiguration getReplicationConfiguration()
-        {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-
-        public void setSchemaManager( SchemaManager schemaManager )
-        {
-            // TODO Auto-generated method stub
-            
-        }
-
-
-        public String getContextCsn()
-        {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-
-        public void setContextCsn( String lastKnownCsn )
-        {
-            // TODO Auto-generated method stub
-            
-        }
-
-
-        public long getSyncPeriodMillis()
-        {
-            // TODO Auto-generated method stub
-            return 0;
-        }
-
-
-        public void setSyncPeriodMillis( long syncPeriodMillis )
-        {
-            // TODO Auto-generated method stub
-            
-        }
-        
-    }
 }

Modified: directory/apacheds/trunk/ldif-partition/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/pom.xml?rev=951442&r1=951441&r2=951442&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/pom.xml (original)
+++ directory/apacheds/trunk/ldif-partition/pom.xml Fri Jun  4 15:30:48 2010
@@ -43,7 +43,9 @@
 
     <dependency>
       <groupId>${project.groupId}</groupId>
-      <artifactId>apacheds-core-mock</artifactId>
+      <artifactId>apacheds-core-api</artifactId>
+      <classifier>tests</classifier>
+      <scope>test</scope>
     </dependency>
 
     <dependency>

Modified: directory/apacheds/trunk/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/pom.xml?rev=951442&r1=951441&r2=951442&view=diff
==============================================================================
--- directory/apacheds/trunk/pom.xml (original)
+++ directory/apacheds/trunk/pom.xml Fri Jun  4 15:30:48 2010
@@ -107,7 +107,6 @@
     <module>core-api</module>
     <module>core-annotations</module>
     <module>server-annotations</module>
-    <module>core-mock</module>
     <module>core-jndi</module>
     <module>core-constants</module>
     <module>core-integ</module>
@@ -196,31 +195,32 @@
       
       <dependency>
         <groupId>${project.groupId}</groupId>
-        <artifactId>apacheds-core-avl</artifactId>
+        <artifactId>apacheds-core-api</artifactId>
         <version>${project.version}</version>
+        <classifier>tests</classifier>
       </dependency>
       
       <dependency>
         <groupId>${project.groupId}</groupId>
-        <artifactId>apacheds-core-constants</artifactId>
+        <artifactId>apacheds-core-avl</artifactId>
         <version>${project.version}</version>
       </dependency>
       
       <dependency>
         <groupId>${project.groupId}</groupId>
-        <artifactId>apacheds-core-integ</artifactId>
+        <artifactId>apacheds-core-constants</artifactId>
         <version>${project.version}</version>
       </dependency>
       
       <dependency>
         <groupId>${project.groupId}</groupId>
-        <artifactId>apacheds-core-jndi</artifactId>
+        <artifactId>apacheds-core-integ</artifactId>
         <version>${project.version}</version>
       </dependency>
       
       <dependency>
         <groupId>${project.groupId}</groupId>
-        <artifactId>apacheds-core-mock</artifactId>
+        <artifactId>apacheds-core-jndi</artifactId>
         <version>${project.version}</version>
       </dependency>
       



Mime
View raw message