directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r649703 - in /directory/sandbox/akarasulu/bigbang/apacheds: jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/
Date Fri, 18 Apr 2008 21:51:01 GMT
Author: akarasulu
Date: Fri Apr 18 14:51:00 2008
New Revision: 649703

URL: http://svn.apache.org/viewvc?rev=649703&view=rev
Log:
100% code coverage for PresenceCursor.java

Modified:
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
    directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceCursorTest.java

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=649703&r1=649702&r2=649703&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
Fri Apr 18 14:51:00 2008
@@ -626,7 +626,8 @@
         dn.normalize( attributeRegistry.getNormalizerMapping() );
 
         List<Modification> mods = new ArrayList<Modification>();
-        ServerAttribute attrib = new DefaultServerAttribute( SchemaConstants.OU_AT, attributeRegistry.lookup(
SchemaConstants.OU_AT_OID ) );
+        ServerAttribute attrib = new DefaultServerAttribute( SchemaConstants.OU_AT,
+            attributeRegistry.lookup( SchemaConstants.OU_AT_OID ) );
         attrib.add( "Engineering" );
         
         Modification add = new ServerModification( ModificationOperation.ADD_ATTRIBUTE, attrib
);
@@ -648,7 +649,7 @@
 
         store.modify( dn, ModificationOperation.REPLACE_ATTRIBUTE, entry );
 
-        entry.remove( "telephoneNumber" );
+        entry.removeAttributes( "telephoneNumber" );
         store.modify( dn, ModificationOperation.REMOVE_ATTRIBUTE, entry );
     }
     

Modified: directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceCursorTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceCursorTest.java?rev=649703&r1=649702&r2=649703&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceCursorTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceCursorTest.java
Fri Apr 18 14:51:00 2008
@@ -28,6 +28,7 @@
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.server.xdbm.tools.StoreUtils;
+import org.apache.directory.server.xdbm.tools.IndexUtils;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmStore;
 import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
@@ -278,11 +279,29 @@
         assertEquals( SchemaConstants.SN_AT_OID, cursor.get().getValue() );
 
         // test afterLast()
+        IndexUtils.printContents( store.getNdnIndex() );
         cursor.afterLast();
         assertFalse( cursor.available() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( SchemaConstants.SN_AT_OID, cursor.get().getValue() );
+        assertEquals( 5, (long) cursor.get().getId() );
+
+        // keep testing previous
+        assertTrue( cursor.previous() );
+        assertTrue( cursor.available() );
+        assertEquals( SchemaConstants.SN_AT_OID, cursor.get().getValue() );
+        assertEquals( 6, (long) cursor.get().getId() );
+
+        assertTrue( cursor.previous() );
+        assertTrue( cursor.available() );
+        assertEquals( SchemaConstants.SN_AT_OID, cursor.get().getValue() );
+        assertEquals( 8, (long) cursor.get().getId() );
+
+        assertFalse( cursor.previous() );
+        assertFalse( cursor.available() );
+
+        // ----------- organizationName attribute
 
         node = new PresenceNode( SchemaConstants.O_AT_OID );
         evaluator = new PresenceEvaluator( node, store, registries );



Mime
View raw message