directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r637687 - in /directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src: main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/
Date Sun, 16 Mar 2008 23:24:25 GMT
Author: akarasulu
Date: Sun Mar 16 16:24:23 2008
New Revision: 637687

URL: http://svn.apache.org/viewvc?rev=637687&view=rev
Log:
making certain index tests active and cleaning up some things in JdbmIndex

Modified:
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?rev=637687&r1=637686&r2=637687&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
Sun Mar 16 16:24:23 2008
@@ -368,13 +368,13 @@
     /**
      * @see Index#count(java.lang.Object)
      */
-    public int count( K attrVal ) throws IOException
+    public int count( K attrVal ) throws Exception
     {
         return forward.count( getNormalized( attrVal ) );
     }
 
 
-    public int greaterThanCount( K attrVal ) throws IOException
+    public int greaterThanCount( K attrVal ) throws Exception
     {
         return forward.greaterThanCount( getNormalized( attrVal ) );
     }
@@ -383,7 +383,7 @@
     /**
      * @see org.apache.directory.server.core.partition.impl.btree.Index#lessThanCount(java.lang.Object)
      */
-    public int lessThanCount( K attrVal ) throws IOException
+    public int lessThanCount( K attrVal ) throws Exception
     {
         return forward.lessThanCount( getNormalized( attrVal ) );
     }
@@ -430,7 +430,7 @@
     /**
      * @see Index#drop(Object,Long)
      */
-    public synchronized void drop( K attrVal, Long id ) throws IOException
+    public synchronized void drop( K attrVal, Long id ) throws Exception
     {
         forward.remove( getNormalized( attrVal ), id );
         reverse.remove( id, getNormalized( attrVal ) );
@@ -480,7 +480,7 @@
     /**
      * @see Index#hasValue(Object,Long)
      */
-    public boolean hasValue( K attrVal, Long id ) throws IOException
+    public boolean hasValue( K attrVal, Long id ) throws Exception
     {
         return forward.has( getNormalized( attrVal ), id );
     }
@@ -489,7 +489,7 @@
     /**
      * @see Index#hasValue(Object, Long, boolean)
      */
-    public boolean hasValue( K attrVal, Long id, boolean isGreaterThan ) throws IOException
+    public boolean hasValue( K attrVal, Long id, boolean isGreaterThan ) throws Exception
     {
         if ( isGreaterThan )
         {
@@ -532,27 +532,15 @@
      * TODO I don't think the keyCache is required anymore since the normalizer
      * will cache values for us.
      */
-    public K getNormalized( K attrVal ) throws IOException
+    public K getNormalized( K attrVal ) throws Exception
     {
-        if ( attrVal instanceof Long )
-        {
-            return attrVal;
-        }
-
         //noinspection unchecked
         K normalized = ( K ) keyCache.get( attrVal );
 
         if ( null == normalized )
         {
-            try
-            {
-                //noinspection unchecked
-                normalized = ( K ) attribute.getEquality().getNormalizer().normalize( attrVal
);
-            }
-            catch ( NamingException e )
-            {
-                throw new IOException ( "Failed to normalized the original value: " + attrVal,
e );
-            }
+            //noinspection unchecked
+            normalized = ( K ) attribute.getEquality().getNormalizer().normalize( attrVal
);
 
             // Double map it so if we use an already normalized
             // value we can get back the same normalized value.

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.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/JdbmIndexTest.java?rev=637687&r1=637686&r2=637687&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
Sun Mar 16 16:24:23 2008
@@ -343,7 +343,6 @@
 
 
     @Test
-    @Ignore( "Will not work until duplicates cursor is finished." )
     public void testAddDropById() throws Exception
     {
         initIndex();
@@ -371,7 +370,6 @@
         assertEquals( "foo", idx.reverseLookup( 1L ) );
 
         idx.drop( 0L );
-        assertEquals( 0L, ( long ) idx.forwardLookup( "foo" ) );
         assertEquals( "foo", idx.reverseLookup( 1L ) );
         assertFalse( idx.hasValue( "bar", 0L ) );
         assertFalse( idx.hasValue( "foo", 0L ) );
@@ -459,7 +457,6 @@
 
 
     @Test
-    @Ignore ( "not working now" )
     public void testSingleValuedAttribute() throws Exception
     {
         JdbmIndex jdbmIndex = new JdbmIndex();



Mime
View raw message