Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 37303998E for ; Wed, 22 Aug 2012 13:23:52 +0000 (UTC) Received: (qmail 98385 invoked by uid 500); 22 Aug 2012 13:23:52 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 98322 invoked by uid 500); 22 Aug 2012 13:23:52 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 98310 invoked by uid 99); 22 Aug 2012 13:23:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Aug 2012 13:23:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Aug 2012 13:23:50 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9C00F23888E3 for ; Wed, 22 Aug 2012 13:23:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1376032 - in /directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src: main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ Date: Wed, 22 Aug 2012 13:23:07 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120822132307.9C00F23888E3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Wed Aug 22 13:23:07 2012 New Revision: 1376032 URL: http://svn.apache.org/viewvc?rev=1376032&view=rev Log: Removed the JdbmIndex() constructor : it's not used anywhere (but in tests). Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?rev=1376032&r1=1376031&r2=1376032&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java (original) +++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java Wed Aug 22 13:23:07 2012 @@ -118,16 +118,6 @@ public class JdbmIndex extends Abs // C O N S T R U C T O R S // ---------------------------------------------------------------------- /** - * Creates a JdbmIndex instance. - */ - public JdbmIndex() - { - super( true ); - initialized = false; - } - - - /** * Creates a JdbmIndex instance for a give AttributeId */ public JdbmIndex( String attributeId ) Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java?rev=1376032&r1=1376031&r2=1376032&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java (original) +++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java Wed Aug 22 13:23:07 2012 @@ -137,7 +137,8 @@ public class JdbmIndexTest void initIndex() throws Exception { - JdbmIndex index = new JdbmIndex(); + AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OU_AT ); + JdbmIndex index = new JdbmIndex( attributeType.getName() ); index.setWkDirPath( dbFileDir.toURI() ); initIndex( index ); } @@ -145,13 +146,13 @@ public class JdbmIndexTest void initIndex( JdbmIndex jdbmIdx ) throws Exception { + AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OU_AT ); + if ( jdbmIdx == null ) { - jdbmIdx = new JdbmIndex(); + jdbmIdx = new JdbmIndex( attributeType.getName() ); } - AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OU_AT ); - jdbmIdx.init( schemaManager, attributeType ); this.idx = jdbmIdx; } @@ -165,8 +166,7 @@ public class JdbmIndexTest public void testAttributeId() throws Exception { // uninitialized index - JdbmIndex jdbmIndex1 = new JdbmIndex(); - jdbmIndex1.setAttributeId( "foo" ); + JdbmIndex jdbmIndex1 = new JdbmIndex( "foo" ); assertEquals( "foo", jdbmIndex1.getAttributeId() ); JdbmIndex jdbmIndex2 = new JdbmIndex( "bar" ); @@ -198,12 +198,13 @@ public class JdbmIndexTest public void testCacheSize() throws Exception { // uninitialized index - JdbmIndex jdbmIndex = new JdbmIndex(); + JdbmIndex jdbmIndex = new JdbmIndex( "ou" ); jdbmIndex.setCacheSize( 337 ); assertEquals( 337, jdbmIndex.getCacheSize() ); // initialized index initIndex(); + try { idx.setCacheSize( 30 ); @@ -222,7 +223,7 @@ public class JdbmIndexTest File wkdir = new File( dbFileDir, "foo" ); // uninitialized index - JdbmIndex jdbmIndex = new JdbmIndex(); + JdbmIndex jdbmIndex = new JdbmIndex( "foo" ); jdbmIndex.setWkDirPath( wkdir.toURI() ); assertEquals( "foo", new File( jdbmIndex.getWkDirPath() ).getName() ); @@ -241,7 +242,7 @@ public class JdbmIndexTest assertEquals( dbFileDir.toURI(), idx.getWkDirPath() ); destroyIndex(); - jdbmIndex = new JdbmIndex(); + jdbmIndex = new JdbmIndex( "ou" ); wkdir.mkdirs(); jdbmIndex.setWkDirPath( wkdir.toURI() ); initIndex( jdbmIndex ); @@ -253,13 +254,13 @@ public class JdbmIndexTest public void testNumDupLimit() throws Exception { // uninitialized index - JdbmIndex jdbmIndex = new JdbmIndex(); + JdbmIndex jdbmIndex = new JdbmIndex( "ou" ); jdbmIndex.setNumDupLimit( 337 ); assertEquals( 337, jdbmIndex.getNumDupLimit() ); // initialized index initIndex(); - + try { ( ( JdbmIndex ) idx ).setNumDupLimit( 30 ); @@ -268,7 +269,7 @@ public class JdbmIndexTest catch ( Exception e ) { } - + assertEquals( JdbmIndex.DEFAULT_DUPLICATE_LIMIT, ( ( JdbmIndex ) idx ).getNumDupLimit() ); } @@ -277,7 +278,7 @@ public class JdbmIndexTest public void testGetAttribute() throws Exception { // uninitialized index - JdbmIndex jdbmIndex = new JdbmIndex(); + JdbmIndex jdbmIndex = new JdbmIndex( "ou" ); assertNull( jdbmIndex.getAttribute() ); initIndex(); @@ -333,7 +334,7 @@ public class JdbmIndexTest { idx.add( String.valueOf( ch ), ( long ) ch ); } - + assertEquals( 26, idx.greaterThanCount( "a" ) ); } @@ -348,7 +349,7 @@ public class JdbmIndexTest { idx.add( String.valueOf( ch ), ( long ) ch ); } - + assertEquals( 26, idx.lessThanCount( "z" ) ); } @@ -543,7 +544,7 @@ public class JdbmIndexTest IndexEntry e3 = cursor.get(); assertEquals( 1234L, ( long ) e3.getId() ); assertEquals( "foo", e3.getKey() ); - + cursor.close(); // use reverse index's cursor @@ -564,7 +565,7 @@ public class JdbmIndexTest e3 = cursor.get(); assertEquals( 1234L, ( long ) e3.getId() ); assertEquals( "foo", e3.getKey() ); - + cursor.close(); } @@ -572,7 +573,7 @@ public class JdbmIndexTest @Test public void testNoEqualityMatching() throws Exception { - JdbmIndex jdbmIndex = new JdbmIndex(); + JdbmIndex jdbmIndex = new JdbmIndex( "1.1" ); try { @@ -594,7 +595,7 @@ public class JdbmIndexTest @Test public void testSingleValuedAttribute() throws Exception { - JdbmIndex jdbmIndex = new JdbmIndex(); + JdbmIndex jdbmIndex = new JdbmIndex( SchemaConstants.CREATORS_NAME_AT ); jdbmIndex.setWkDirPath( dbFileDir.toURI() ); jdbmIndex.init( schemaManager, schemaManager.lookupAttributeTypeRegistry( SchemaConstants.CREATORS_NAME_AT ) ); jdbmIndex.close();