directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1546669 - /directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
Date Sat, 30 Nov 2013 00:28:52 GMT
Author: elecharny
Date: Sat Nov 30 00:28:52 2013
New Revision: 1546669

URL: http://svn.apache.org/r1546669
Log:
Added a test to check that we correctly handle the Dn MR

Modified:
    directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java

Modified: directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java?rev=1546669&r1=1546668&r2=1546669&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
(original)
+++ directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
Sat Nov 30 00:28:52 2013
@@ -360,6 +360,30 @@ public class JdbmIndexTest
     // -----------------------------------------------------------------------
     // Add, Drop and Lookup Test Methods
     // -----------------------------------------------------------------------
+    
+
+    @Test
+    public void testLookupsToo() throws Exception
+    {
+        AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( "seeAlso"
);
+        JdbmIndex<String> index = new JdbmIndex<String>( attributeType.getName(),
false );
+        index.setWkDirPath( dbFileDir.toURI() );
+        index.init( schemaManager, attributeType );
+        this.idx = index;
+
+        String foobarDn = "uid=foo,ou=bar";
+        String bazbarDn = "uid=baz,ou=bar";
+
+        assertNull( idx.forwardLookup( foobarDn ) );
+        assertNull( idx.forwardLookup( bazbarDn ) );
+        idx.add( foobarDn, Strings.getUUID( 0L ) );
+        assertEquals( Strings.getUUID( 0L ), idx.forwardLookup( foobarDn ) );
+        assertNull( idx.forwardLookup( bazbarDn ) );
+        idx.add( bazbarDn, Strings.getUUID( 24L ) );
+        assertEquals( Strings.getUUID( 24L ), idx.forwardLookup( bazbarDn ) );
+        assertEquals( Strings.getUUID( 0L ), idx.forwardLookup( foobarDn ) );
+    }
+
 
     @Test
     public void testLookups() throws Exception



Mime
View raw message