directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r638169 - 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 Tue, 18 Mar 2008 01:37:20 GMT
Author: akarasulu
Date: Mon Mar 17 18:37:19 2008
New Revision: 638169

URL: http://svn.apache.org/viewvc?rev=638169&view=rev
Log:
100% coverage for master table and more clean up

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

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.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/JdbmMasterTable.java?rev=638169&r1=638168&r2=638169&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
Mon Mar 17 18:37:19 2008
@@ -49,14 +49,6 @@
 
         public int compare( Long o1, Long o2 )
         {
-            if ( o1 == null )
-            {
-                throw new IllegalArgumentException( "Argument 'obj1' is null" );
-            } else if ( o2 == null )
-            {
-                throw new IllegalArgumentException( "Argument 'obj2' is null" );
-            }
-
             return o1.compareTo( o2 );
         }
     };

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.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/JdbmMasterTableTest.java?rev=638169&r1=638168&r2=638169&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTableTest.java
Mon Mar 17 18:37:19 2008
@@ -101,18 +101,25 @@
     public void testAll() throws Exception
     {
         assertNull( table.get( 0L ) );
+        assertEquals( 0, table.count() );
 
         assertEquals( 0, ( long ) table.getCurrentId() );
         assertEquals( 1, ( long ) table.getNextId() );
         assertEquals( 1, ( long ) table.getCurrentId() );
         assertNull( table.put( 1L, 5 ) );
         assertEquals( 5, ( int ) table.get( 1L ) );
+        assertEquals( 1, table.count() );
 
         assertEquals( 1, ( long ) table.getCurrentId() );
         assertEquals( 2, ( long ) table.getNextId() );
         assertEquals( 2, ( long ) table.getCurrentId() );
         assertNull( table.put( 2L, 6 ) );
         assertEquals( 6, ( int ) table.get( 2L ) );
+        assertEquals( 2, table.count() );
+
+        assertEquals( 5, ( long ) table.delete( 1L ) );
+        assertNull( table.get( 1L ) );
+        assertEquals( 1, table.count() );
 
         assertNull( table.getProperty( "foo" ) );
         table.setProperty( "foo", "bar" );



Mime
View raw message