You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2012/04/26 12:13:35 UTC

svn commit: r1330747 - /directory/apacheds/branches/index-work/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java

Author: elecharny
Date: Thu Apr 26 10:13:35 2012
New Revision: 1330747

URL: http://svn.apache.org/viewvc?rev=1330747&view=rev
Log:
Removed the subLevel index tests

Modified:
    directory/apacheds/branches/index-work/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java

Modified: directory/apacheds/branches/index-work/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=1330747&r1=1330746&r2=1330747&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java (original)
+++ directory/apacheds/branches/index-work/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java Thu Apr 26 10:13:35 2012
@@ -249,11 +249,6 @@ public class JdbmStoreTest
         jdbmPartition.addIndex( new JdbmIndex<String, Entry>( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID ) );
         assertNotNull( jdbmPartition.getPresenceIndex() );
 
-        assertNull( jdbmPartition.getSubLevelIndex() );
-        ( ( Store<Entry, Long> ) jdbmPartition ).addIndex( new JdbmIndex<Long, Entry>(
-            ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID ) );
-        assertNotNull( jdbmPartition.getSubLevelIndex() );
-
         assertNull( jdbmPartition.getId() );
         jdbmPartition.setId( "foo" );
         assertEquals( "foo", jdbmPartition.getId() );
@@ -328,16 +323,6 @@ public class JdbmStoreTest
         {
         }
 
-        assertNotNull( store.getSubLevelIndex() );
-        try
-        {
-            store.addIndex( new JdbmIndex<Long, Entry>( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID ) );
-            fail();
-        }
-        catch ( IllegalStateException e )
-        {
-        }
-
         assertNotNull( store.getId() );
         try
         {
@@ -392,7 +377,7 @@ public class JdbmStoreTest
 
         Iterator<String> systemIndices = store.getSystemIndices();
 
-        for ( int ii = 0; ii < 9; ii++ )
+        for ( int ii = 0; ii < 8; ii++ )
         {
             assertTrue( systemIndices.hasNext() );
             assertNotNull( systemIndices.next() );
@@ -537,132 +522,6 @@ public class JdbmStoreTest
     }
 
 
-    @Test
-    public void testSubLevelIndex() throws Exception
-    {
-        Index idx = store.getSubLevelIndex();
-
-        assertEquals( 19, idx.count() );
-
-        Cursor<IndexEntry<Long, Long>> cursor = idx.forwardCursor( 2L );
-
-        assertTrue( cursor.next() );
-        assertEquals( 2, ( long ) cursor.get().getId() );
-
-        assertTrue( cursor.next() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
-
-        assertTrue( cursor.next() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
-
-        assertFalse( cursor.next() );
-
-        idx.drop( 5L );
-
-        cursor.close();
-        
-        cursor = idx.forwardCursor( 2L );
-
-        assertTrue( cursor.next() );
-        assertEquals( 2, ( long ) cursor.get().getId() );
-
-        assertTrue( cursor.next() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
-
-        assertFalse( cursor.next() );
-
-        cursor.close();
-
-        // dn id 12
-        Dn martinDn = new Dn( schemaManager, "cn=Marting King,ou=Sales,o=Good Times Co." );
-        Entry entry = new DefaultEntry( schemaManager, martinDn,
-            "objectClass: top", 
-            "objectClass: person", 
-            "objectClass: organizationalPerson",
-            "ou: Sales",
-            "cn: Martin King",
-            "entryCSN", new CsnFactory( 1 ).newInstance().toString(),
-            "entryUUID", UUID.randomUUID().toString() );
-        AddOperationContext addContext = new AddOperationContext( null, entry );
-        store.add( addContext );
-
-        cursor = idx.forwardCursor( 2L );
-        cursor.afterLast();
-        assertTrue( cursor.previous() );
-        assertEquals( 12, ( long ) cursor.get().getId() );
-        
-        cursor.close();
-
-        Dn newParentDn = new Dn( schemaManager, "ou=Board of Directors,o=Good Times Co." );
-
-        Dn newDn = newParentDn.add( martinDn.getRdn() );
-
-        store.move( martinDn, newParentDn, newDn, entry );
-        cursor = idx.forwardCursor( 3L );
-        cursor.afterLast();
-        assertTrue( cursor.previous() );
-        assertEquals( 12, ( long ) cursor.get().getId() );
-
-        cursor.close();
-
-        // dn id 13
-        Dn marketingDn = new Dn( schemaManager, "ou=Marketing,ou=Sales,o=Good Times Co." );
-        entry = new DefaultEntry( schemaManager, marketingDn,
-            "objectClass: top", 
-            "objectClass: organizationalUnit",
-            "ou: Marketing",
-            "entryCSN", new CsnFactory( 1 ).newInstance().toString(),
-            "entryUUID", UUID.randomUUID().toString() );
-        addContext = new AddOperationContext( null, entry );
-        store.add( addContext );
-
-        // dn id 14
-        Dn jimmyDn = new Dn( schemaManager, "cn=Jimmy Wales,ou=Marketing, ou=Sales,o=Good Times Co." );
-        entry = new DefaultEntry( schemaManager, jimmyDn,
-            "objectClass: top", 
-            "objectClass: person", 
-            "objectClass: organizationalPerson",
-            "ou", "Marketing",
-            "cn", "Jimmy Wales",
-            "entryCSN", new CsnFactory( 1 ).newInstance().toString(),
-            "entryUUID", UUID.randomUUID().toString() );
-        addContext = new AddOperationContext( null, entry );
-        store.add( addContext );
-
-        newDn = newParentDn.add( marketingDn.getRdn() );
-
-        store.move( marketingDn, newParentDn, newDn, entry );
-
-        cursor = idx.forwardCursor( 3L );
-        cursor.afterLast();
-
-        assertTrue( cursor.previous() );
-        assertEquals( 14, ( long ) cursor.get().getId() );
-
-        assertTrue( cursor.previous() );
-        assertEquals( 13, ( long ) cursor.get().getId() );
-
-        assertTrue( cursor.previous() );
-        assertEquals( 12, ( long ) cursor.get().getId() );
-
-        assertTrue( cursor.previous() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
-
-        assertTrue( cursor.previous() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
-
-        assertTrue( cursor.previous() );
-        assertEquals( 7, ( long ) cursor.get().getId() );
-
-        assertTrue( cursor.previous() );
-        assertEquals( 3, ( long ) cursor.get().getId() );
-
-        assertFalse( cursor.previous() );
-
-        cursor.close();
-    }
-
-
     @Test(expected = LdapNoSuchObjectException.class)
     public void testAddWithoutParentId() throws Exception
     {