directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r925715 - in /directory/apacheds/trunk: avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ core-integ/ ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/ ldif-partition/src/test/java/org/a...
Date Sun, 21 Mar 2010 02:18:44 GMT
Author: seelmann
Date: Sun Mar 21 02:18:44 2010
New Revision: 925715

URL: http://svn.apache.org/viewvc?rev=925715&view=rev
Log:
Partial fix for DIRSERVER-1480:
o Added profiles to core-integ and server-integ to run test with all partitions
o Fixed AvlPartition and AvlStore to pass core-integ tests
  - removed reset of initialized flag because tests that restart the server won't work otherwise
  - fixed alias index
o Fixed LdifPartition to pass core-integ tests
  - handle case that context entry isn't specified on partition creation
  - delete old LDIF file in move/rename operations, even if deleteOldRdn is false, instead
the old RDN attribute must remain in the new LDIF file
  - added support for multi-valued RDNs, construct proper LDIF file name
  - removed unused member variables


Modified:
    directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java
    directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
    directory/apacheds/trunk/core-integ/pom.xml
    directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
    directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java
    directory/apacheds/trunk/server-integ/pom.xml
    directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
    directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java

Modified: directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java?rev=925715&r1=925714&r2=925715&view=diff
==============================================================================
--- directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java
(original)
+++ directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java
Sun Mar 21 02:18:44 2010
@@ -80,8 +80,14 @@ public class AvlPartition extends Abstra
 
         searchEngine = new DefaultSearchEngine<Long>( store, cursorBuilder, evaluatorBuilder,
optimizer );
 
+        if ( store.isInitialized() )
+        {
+            return;
+        }
+
         // initialize the store
         store.setName( getId() );
+        suffix.normalize( schemaManager.getNormalizerMapping() );
         store.setSuffixDn( suffix.getName() );
 
         Set<Index<?, ServerEntry, Long>> userIndices = new HashSet<Index<?,
ServerEntry, Long>>();

Modified: directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java?rev=925715&r1=925714&r2=925715&view=diff
==============================================================================
--- directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
(original)
+++ directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
Sun Mar 21 02:18:44 2010
@@ -364,7 +364,8 @@ public class AvlStore<E> implements Stor
      */
     public void destroy() throws Exception
     {
-        initialized = false;
+        // don't reset initialized flag
+        //initialized = false;
     }
 
 
@@ -915,12 +916,12 @@ public class AvlStore<E> implements Stor
 
         // update normalized DN index
         ndnIdx.drop( id );
-        
+
         if ( !updn.isNormalized() )
         {
             updn.normalize( schemaManager.getNormalizerMapping() );
         }
-        
+
         ndnIdx.add( updn.toNormName(), id );
 
         // update user provided DN index
@@ -948,7 +949,7 @@ public class AvlStore<E> implements Stor
         }
 
         Cursor<IndexEntry<Long, E, Long>> children = list( id );
-        
+
         while ( children.next() )
         {
             // Get the child and its id
@@ -1910,8 +1911,11 @@ public class AvlStore<E> implements Stor
         String targetDn = aliasIdx.reverseLookup( aliasId );
         Long targetId = getEntryId( targetDn );
         String aliasDn = getEntryDn( aliasId );
-        DN ancestorDn = ( DN ) new DN( aliasDn ).getPrefix( 1 );
-        Long ancestorId = getEntryId( ancestorDn.getNormName() );
+        DN aliasDN = ( DN ) new DN( aliasDn );
+
+        DN ancestorDn = ( DN ) aliasDN.clone();
+        ancestorDn.remove( aliasDN.size() - 1 );
+        Long ancestorId = getEntryId( ancestorDn.toNormName() );
 
         /*
          * We cannot just drop all tuples in the one level and subtree userIndices
@@ -1927,9 +1931,9 @@ public class AvlStore<E> implements Stor
         oneAliasIdx.drop( ancestorId, targetId );
         subAliasIdx.drop( ancestorId, targetId );
 
-        while ( !ancestorDn.equals( suffixDn ) )
+        while ( !ancestorDn.equals( suffixDn ) && ancestorDn.size() > suffixDn.size()
)
         {
-            ancestorDn = ( DN ) ancestorDn.getPrefix( 1 );
+            ancestorDn = ( DN ) ancestorDn.getPrefix( ancestorDn.size() - 1 );
             ancestorId = getEntryId( ancestorDn.getNormName() );
 
             subAliasIdx.drop( ancestorId, targetId );
@@ -2170,7 +2174,7 @@ public class AvlStore<E> implements Stor
     public void setObjectClassIndex( Index<String, E, Long> index )
     {
         protect( "objectClassIndex" );
-        
+
         if ( index instanceof AvlIndex<?, ?> )
         {
             this.objectClassIdx = ( AvlIndex<String, E> ) index;

Modified: directory/apacheds/trunk/core-integ/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/pom.xml?rev=925715&r1=925714&r2=925715&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/pom.xml (original)
+++ directory/apacheds/trunk/core-integ/pom.xml Sun Mar 21 02:18:44 2010
@@ -93,7 +93,61 @@
         </plugins>
       </build>
     </profile>
-    
+
+    <!-- Runs tests three times: with JDBM partition, AVL partition, LDIF partition -->
+    <profile>
+      <id>integration-all-partitions</id>
+      <activation>
+        <property><name>test-all-partitions</name></property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <!-- default/JDBM execution -->
+            <configuration>
+              <includes>
+                <include>**/*ISuite.java</include>
+                <include>**/*ITest.java</include>
+              </includes>
+              <excludes>
+                <exclude>**/ReferralIT.java</exclude>
+              </excludes>
+              <systemPropertyVariables>
+                <apacheds.partition.factory>org.apache.directory.server.core.factory.JdbmPartitionFactory</apacheds.partition.factory>
+              </systemPropertyVariables>
+            </configuration>
+            <executions>
+              <!-- AVL execution -->
+       		  <execution>
+       		    <id>avl</id>
+       		    <goals>
+       		      <goal>test</goal>
+       		    </goals>
+                <configuration>
+                  <systemPropertyVariables>
+                    <apacheds.partition.factory>org.apache.directory.server.core.factory.AvlPartitionFactory</apacheds.partition.factory>
+                  </systemPropertyVariables>
+                </configuration>
+              </execution>
+              <!-- LDIF execution -->
+       		  <execution>
+       		    <id>ldif</id>
+       		    <goals>
+       		      <goal>test</goal>
+       		    </goals>
+                <configuration>
+                  <systemPropertyVariables>
+                    <apacheds.partition.factory>org.apache.directory.server.core.factory.LdifPartitionFactory</apacheds.partition.factory>
+                  </systemPropertyVariables>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
     <profile>
       <id>quicktest</id>
       <activation>

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=925715&r1=925714&r2=925715&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
(original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
Sun Mar 21 02:18:44 2010
@@ -50,11 +50,11 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
-import org.apache.directory.shared.ldap.exception.LdapNoSuchObjectException;
 import org.apache.directory.shared.ldap.ldif.LdapLdifException;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
+import org.apache.directory.shared.ldap.name.AVA;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -95,18 +95,12 @@ public class LdifPartition extends BTree
     /** A logger for this class */
     private static Logger LOG = LoggerFactory.getLogger( LdifPartition.class );
 
-    /** The LDIF file parser */
-    //private LdifReader ldifReader;
-
     /** The directory into which the partition is stored */
     private String workingDirectory;
 
     /** The directory into which the entries are stored */
     private File suffixDirectory;
 
-    /** The context entry */
-    private ServerEntry contextEntry;
-
     /** Flags used for the getFile() method */
     private static final boolean CREATE = Boolean.TRUE;
     private static final boolean DELETE = Boolean.FALSE;
@@ -201,10 +195,10 @@ public class LdifPartition extends BTree
         }
         else
         {
-            // The partition directory does not exist, we have to create it
+            // The partition directory does not exist, we have to create it, including parent
directories
             try
             {
-                suffixDirectory.mkdir();
+                suffixDirectory.mkdirs();
             }
             catch ( SecurityException se )
             {
@@ -228,7 +222,9 @@ public class LdifPartition extends BTree
                 }
                 else
                 {
-                    throw new LdapNoSuchObjectException( I18n.err( I18n.ERR_632 ) );
+                    // No context entry and no LDIF file exists.
+                    // Skip initialization of context entry here, it will be added later.
+                    return;
                 }
             }
 
@@ -347,7 +343,7 @@ public class LdifPartition extends BTree
         // Get the modified entry
         ClonedServerEntry modifiedEntry = lookup( id );
 
-        entryMoved( oldDn, modifiedEntry, id, true );
+        entryMoved( oldDn, modifiedEntry, id );
     }
 
 
@@ -366,7 +362,7 @@ public class LdifPartition extends BTree
         ClonedServerEntry modifiedEntry = lookup( id );
         moveAndRenameContext.setAlteredEntry( modifiedEntry );
 
-        entryMoved( oldDn, modifiedEntry, id, moveAndRenameContext.getDelOldDn() );
+        entryMoved( oldDn, modifiedEntry, id );
     }
 
 
@@ -388,7 +384,7 @@ public class LdifPartition extends BTree
 
         // Now move the potential children for the old entry
         // and remove the old entry
-        entryMoved( oldDn, modifiedEntry, id, renameContext.getDelOldDn() );
+        entryMoved( oldDn, modifiedEntry, id );
     }
 
 
@@ -402,8 +398,7 @@ public class LdifPartition extends BTree
      * @param deleteOldEntry a flag to tell whether to delete the old entry files
      * @throws Exception
      */
-    private void entryMoved( DN oldEntryDn, Entry modifiedEntry, Long entryIdOld, boolean
deleteOldEntry )
-        throws Exception
+    private void entryMoved( DN oldEntryDn, Entry modifiedEntry, Long entryIdOld ) throws
Exception
     {
         // First, add the new entry
         add( modifiedEntry );
@@ -424,19 +419,16 @@ public class LdifPartition extends BTree
 
         cursor.close();
 
-        if ( deleteOldEntry )
-        {
-            // And delete the old entry's LDIF file
-            File file = getFile( oldEntryDn, DELETE );
-            boolean deleted = deleteFile( file );
-            LOG.warn( "move operation: deleted file {} {}", file.getAbsoluteFile(), deleted
);
-
-            // and the associated directory ( the file's name's minus ".ldif")
-            String dirName = file.getAbsolutePath();
-            dirName = dirName.substring( 0, dirName.indexOf( CONF_FILE_EXTN ) );
-            deleted = deleteFile( new File( dirName ) );
-            LOG.warn( "move operation: deleted dir {} {}", dirName, deleted );
-        }
+        // And delete the old entry's LDIF file
+        File file = getFile( oldEntryDn, DELETE );
+        boolean deleted = deleteFile( file );
+        LOG.warn( "move operation: deleted file {} {}", file.getAbsoluteFile(), deleted );
+
+        // and the associated directory ( the file's name's minus ".ldif")
+        String dirName = file.getAbsolutePath();
+        dirName = dirName.substring( 0, dirName.indexOf( CONF_FILE_EXTN ) );
+        deleted = deleteFile( new File( dirName ) );
+        LOG.warn( "move operation: deleted dir {} {}", dirName, deleted );
     }
 
 
@@ -564,16 +556,29 @@ public class LdifPartition extends BTree
      */
     private String getFileName( RDN rdn ) throws LdapException
     {
-        // First, get the AT name, or OID
-        String normAT = rdn.getAtav().getNormType();
-        AttributeType at = schemaManager.lookupAttributeTypeRegistry( normAT );
+        String fileName = "";
 
-        String atName = at.getName();
+        Iterator<AVA> iterator = rdn.iterator();
+        while ( iterator.hasNext() )
+        {
+            AVA ava = iterator.next();
 
-        // Now, get the normalized value
-        String normValue = rdn.getAtav().getNormValue().getString();
+            // First, get the AT name, or OID
+            String normAT = ava.getNormType();
+            AttributeType at = schemaManager.lookupAttributeTypeRegistry( normAT );
 
-        String fileName = atName + "=" + normValue;
+            String atName = at.getName();
+
+            // Now, get the normalized value
+            String normValue = ava.getNormValue().getString();
+
+            fileName += atName + "=" + normValue;
+
+            if ( iterator.hasNext() )
+            {
+                fileName += "+";
+            }
+        }
 
         return getOSFileName( fileName );
     }

Modified: directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java?rev=925715&r1=925714&r2=925715&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java
(original)
+++ directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java
Sun Mar 21 02:18:44 2010
@@ -200,12 +200,21 @@ public class LdifPartitionTest
         
         partition.add( addCtx );
         
+        ClonedServerEntry entryMvrdn = createEntry( "dc=mvrdn+objectClass=domain,dc=test,ou=test,ou=system"
);
+        entryMvrdn.put( "ObjectClass", "top", "domain" );
+        entryMvrdn.put( "dc", "mvrdn" );
+        addCtx.setEntry( entryMvrdn );
+        
+        partition.add( addCtx );
+        
         assertTrue( new File( wkdir, "ou=test,ou=system" ).exists() );
         assertTrue( new File( wkdir, "ou=test,ou=system.ldif" ).exists() );
         assertTrue( new File( wkdir, "ou=test,ou=system/dc=test" ).exists() );
         assertTrue( new File( wkdir, "ou=test,ou=system/dc=test.ldif" ).exists() );
         assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=test" ).exists() );
         assertTrue( new File( wkdir, "ou=test,ou=system/dc=test/dc=test.ldif" ).exists()
);
+        assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=mvrdn+objectclass=domain"
).exists() );
+        assertTrue( new File( wkdir, "ou=test,ou=system/dc=test/dc=mvrdn+objectclass=domain.ldif"
).exists() );
     }
 
     
@@ -294,6 +303,13 @@ public class LdifPartitionTest
         addCtx.setEntry( entry3 );
         
         partition.add( addCtx );
+
+        ClonedServerEntry entryMvrdn = createEntry( "dc=mvrdn+objectClass=domain,dc=test,ou=test,ou=system"
);
+        entryMvrdn.put( "ObjectClass", "top", "domain" );
+        entryMvrdn.put( "dc", "mvrdn" );
+        addCtx.setEntry( entryMvrdn );
+        
+        partition.add( addCtx );
         
         DeleteOperationContext delCtx = new DeleteOperationContext( session );
 
@@ -312,6 +328,8 @@ public class LdifPartitionTest
         assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=test1.ldif" ).exists()
);
         assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=test2" ).exists() );
         assertTrue( new File( wkdir, "ou=test,ou=system/dc=test/dc=test2.ldif" ).exists()
);
+        assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=mvrdn+objectclass=domain"
).exists() );
+        assertTrue( new File( wkdir, "ou=test,ou=system/dc=test/dc=mvrdn+objectclass=domain.ldif"
).exists() );
 
         dn = new DN( "dc=test2,dc=test,ou=test,ou=system" );
         dn.normalize( schemaManager.getNormalizerMapping() );
@@ -319,6 +337,13 @@ public class LdifPartitionTest
         delCtx.setDn( dn );
         
         partition.delete( delCtx );
+        
+        dn = new DN( "dc=mvrdn+objectClass=domain,dc=test,ou=test,ou=system" );
+        dn.normalize( schemaManager.getNormalizerMapping() );
+        
+        delCtx.setDn( dn );
+        
+        partition.delete( delCtx );
 
         assertTrue( new File( wkdir, "ou=test,ou=system" ).exists() );
         assertTrue( new File( wkdir, "ou=test,ou=system.ldif" ).exists() );
@@ -326,6 +351,8 @@ public class LdifPartitionTest
         assertTrue( new File( wkdir, "ou=test,ou=system/dc=test.ldif" ).exists() );
         assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=test2" ).exists() );
         assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=test2.ldif" ).exists()
);
+        assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=mvrdn+objectclass=domain"
).exists() );
+        assertFalse( new File( wkdir, "ou=test,ou=system/dc=test/dc=mvrdn+objectclass=domain.ldif"
).exists() );
     }
     //-------------------------------------------------------------------------
     // Partition.delete() tests
@@ -462,8 +489,8 @@ public class LdifPartitionTest
         RenameOperationContext renameOpCtx = new RenameOperationContext( session, childDn1,
newRdn, false );
         partition.rename( renameOpCtx );
         
-        assertTrue( new File( wkdir, "ou=test,ou=system/dc=child1" ).exists() );
-        assertTrue( new File( wkdir, "ou=test,ou=system/dc=child1.ldif" ).exists() );
+        assertFalse( new File( wkdir, "ou=test,ou=system/dc=child1" ).exists() );
+        assertFalse( new File( wkdir, "ou=test,ou=system/dc=child1.ldif" ).exists() );
 
         assertTrue( new File( wkdir, "ou=test,ou=system/dc=renamedchild1" ).exists() );
         assertTrue( new File( wkdir, "ou=test,ou=system/dc=renamedchild1.ldif" ).exists()
);
@@ -473,6 +500,11 @@ public class LdifPartitionTest
         assertTrue( new File( wkdir, "ou=test,ou=system/dc=renamedchild1/dc=grandchild12.ldif"
).exists() );
         assertFalse( new File( wkdir, "ou=test,ou=system/dc=renamedchild1/dc=grandchild11/dc=greatgrandchild111"
).exists() );
         assertTrue( new File( wkdir, "ou=test,ou=system/dc=renamedchild1/dc=grandchild11/dc=greatgrandchild111.ldif"
).exists() );
+
+        // the renamed LDIF must contain the old an new RDN attribute
+        String content = FileUtils.readFileToString( new File( wkdir, "ou=test,ou=system/dc=renamedchild1.ldif"
) );
+        assertTrue( content.contains( "dc: child1" ) );
+        assertTrue( content.contains( "dc: renamedChild1" ) );
     }
 
     
@@ -520,8 +552,8 @@ public class LdifPartitionTest
         MoveAndRenameOperationContext moveAndRenameOpCtx = new MoveAndRenameOperationContext(
session, childDn1, childDn2, newRdn, false );
         partition.moveAndRename( moveAndRenameOpCtx );
         
-        assertTrue( new File( wkdir, "ou=test,ou=system/dc=child1" ).exists() );
-        assertTrue( new File( wkdir, "ou=test,ou=system/dc=child1.ldif" ).exists() );
+        assertFalse( new File( wkdir, "ou=test,ou=system/dc=child1" ).exists() );
+        assertFalse( new File( wkdir, "ou=test,ou=system/dc=child1.ldif" ).exists() );
 
         assertTrue( new File( wkdir, "ou=test,ou=system/dc=child2/dc=movedchild1" ).exists()
);
         assertTrue( new File( wkdir, "ou=test,ou=system/dc=child2/dc=movedchild1.ldif" ).exists()
);
@@ -531,6 +563,12 @@ public class LdifPartitionTest
         assertTrue( new File( wkdir, "ou=test,ou=system/dc=child2/dc=movedchild1/dc=grandchild12.ldif"
).exists() );
         assertFalse( new File( wkdir, "ou=test,ou=system/dc=child2/dc=movedchild1/dc=grandchild11/dc=greatgrandchild111"
).exists() );
         assertTrue( new File( wkdir, "ou=test,ou=system/dc=child2/dc=movedchild1/dc=grandchild11/dc=greatgrandchild111.ldif"
).exists() );
+
+        // the renamed LDIF must contain the old an new RDN attribute
+        String content = FileUtils
+            .readFileToString( new File( wkdir, "ou=test,ou=system/dc=child2/dc=movedchild1.ldif"
) );
+        assertTrue( content.contains( "dc: child1" ) );
+        assertTrue( content.contains( "dc: movedChild1" ) );
     }
 
     

Modified: directory/apacheds/trunk/server-integ/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/pom.xml?rev=925715&r1=925714&r2=925715&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/pom.xml (original)
+++ directory/apacheds/trunk/server-integ/pom.xml Sun Mar 21 02:18:44 2010
@@ -75,27 +75,95 @@
     </dependency>  
   </dependencies>
 
-  <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <includes>
-            <include>**/*ISuite.java</include>
-            <include>**/*IndexedNegationSearchIT.java</include>
-            <!-- commenting this test makes running the test suite with -Dintegration
pass
-                 so far no clue why is this test despite having it own instance of LdapServer
-                 causes the StartTlsIT tests fail
-             <include>**/*LdapsIT.java</include> -->
-            <include>**/*MiscBindIT.java</include>
-            <include>**/*SaslBindIT.java</include>
-            <include>**/*KeyDerivationServiceIT.java</include>
-            <include>**/*PasswordPolicyServiceIT.java</include>
-            <include>**/*StoredProcedureIT.java</include>
-          </includes>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
+  <profiles>
+    <profile>
+      <id>integration</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <includes>
+                <include>**/*ISuite.java</include>
+                <include>**/*IndexedNegationSearchIT.java</include>
+                <!-- commenting this test makes running the test suite with -Dintegration
pass
+                     so far no clue why is this test despite having it own instance of LdapServer
+                     causes the StartTlsIT tests fail
+                 <include>**/*LdapsIT.java</include> -->
+                <include>**/*MiscBindIT.java</include>
+                <include>**/*SaslBindIT.java</include>
+                <include>**/*KeyDerivationServiceIT.java</include>
+                <include>**/*PasswordPolicyServiceIT.java</include>
+                <include>**/*StoredProcedureIT.java</include>
+              </includes>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
+    <!-- Runs tests three times: with JDBM partition, AVL partition, LDIF partition -->
+    <profile>
+      <id>integration-all-partitions</id>
+      <activation>
+        <property><name>test-all-partitions</name></property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <!-- default/JDBM execution -->
+            <configuration>
+              <includes>
+                <include>**/*ISuite.java</include>
+                <include>**/*IndexedNegationSearchIT.java</include>
+                <!-- commenting this test makes running the test suite with -Dintegration
pass
+                     so far no clue why is this test despite having it own instance of LdapServer
+                     causes the StartTlsIT tests fail
+                 <include>**/*LdapsIT.java</include> -->
+                <include>**/*MiscBindIT.java</include>
+                <include>**/*SaslBindIT.java</include>
+                <include>**/*KeyDerivationServiceIT.java</include>
+                <include>**/*PasswordPolicyServiceIT.java</include>
+                <include>**/*StoredProcedureIT.java</include>
+              </includes>
+              <systemPropertyVariables>
+                <apacheds.partition.factory>org.apache.directory.server.core.factory.JdbmPartitionFactory</apacheds.partition.factory>
+              </systemPropertyVariables>              
+            </configuration>
+            <executions>
+              <!-- AVL execution -->
+       		  <execution>
+       		    <id>avl</id>
+       		    <goals>
+       		      <goal>test</goal>
+       		    </goals>
+                <configuration>
+                  <systemPropertyVariables>
+                    <apacheds.partition.factory>org.apache.directory.server.core.factory.AvlPartitionFactory</apacheds.partition.factory>
+                  </systemPropertyVariables>
+                </configuration>
+              </execution>
+              <!-- LDIF execution -->
+       		  <execution>
+       		    <id>ldif</id>
+       		    <goals>
+       		      <goal>test</goal>
+       		    </goals>
+                <configuration>
+                  <systemPropertyVariables>
+                    <apacheds.partition.factory>org.apache.directory.server.core.factory.LdifPartitionFactory</apacheds.partition.factory>
+                  </systemPropertyVariables>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>
 

Modified: directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java?rev=925715&r1=925714&r2=925715&view=diff
==============================================================================
--- directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
(original)
+++ directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
Sun Mar 21 02:18:44 2010
@@ -29,6 +29,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.factory.DSAnnotationProcessor;
 import org.apache.directory.server.core.factory.DefaultDirectoryServiceFactory;
 import org.apache.directory.server.core.factory.DirectoryServiceFactory;
+import org.apache.directory.server.core.factory.PartitionFactory;
 import org.apache.directory.server.factory.ServerAnnotationProcessor;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.kerberos.kdc.KdcServer;
@@ -225,6 +226,13 @@ public class FrameworkRunner extends Blo
                 // TODO add suite level KdcServer support
             }
 
+            if ( suite == null )
+            {
+                // print out information which partition factory we use
+                PartitionFactory partitionFactory = DefaultDirectoryServiceFactory.DEFAULT.getPartitionFactory();
+                System.out.println( "Using partition factory " + partitionFactory.getClass().getSimpleName()
);
+            }
+
             // Now run the class
             super.run( notifier );
 

Modified: directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java?rev=925715&r1=925714&r2=925715&view=diff
==============================================================================
--- directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java
(original)
+++ directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java
Sun Mar 21 02:18:44 2010
@@ -24,6 +24,8 @@ import org.apache.directory.server.annot
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.annotations.CreatePartition;
 import org.apache.directory.server.core.factory.DSAnnotationProcessor;
+import org.apache.directory.server.core.factory.DefaultDirectoryServiceFactory;
+import org.apache.directory.server.core.factory.PartitionFactory;
 import org.apache.directory.server.factory.ServerAnnotationProcessor;
 import org.apache.directory.server.ldap.LdapServer;
 import org.junit.runner.Description;
@@ -138,6 +140,10 @@ public class FrameworkSuite extends Suit
     {
         try
         {
+            // print out information which partition factory we use
+            PartitionFactory partitionFactory = DefaultDirectoryServiceFactory.DEFAULT.getPartitionFactory();
+            System.out.println( "Using partition factory " + partitionFactory.getClass().getSimpleName()
);
+
             // Create and initialize the Suite DS
             startDS( getDescription() );
             



Mime
View raw message