Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 95935 invoked from network); 1 Mar 2010 07:56:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Mar 2010 07:56:04 -0000 Received: (qmail 94355 invoked by uid 500); 28 Feb 2010 22:56:04 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 94314 invoked by uid 500); 28 Feb 2010 22:56:04 -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 94295 invoked by uid 99); 28 Feb 2010 22:56:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Feb 2010 22:56:04 +0000 X-ASF-Spam-Status: No, hits=-1999.6 required=10.0 tests=ALL_TRUSTED,SUBJECT_FUZZY_TION 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; Sun, 28 Feb 2010 22:55:58 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4C8222388A93; Sun, 28 Feb 2010 22:55:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r917312 [5/5] - in /directory/apacheds/trunk: avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/ core-annotations/src/main/java/org/apache/... Date: Sun, 28 Feb 2010 22:55:35 -0000 To: commits@directory.apache.org From: seelmann@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100228225537.4C8222388A93@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java?rev=917312&r1=917311&r2=917312&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java (original) +++ directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java Sun Feb 28 22:55:33 2010 @@ -62,7 +62,7 @@ private static final Logger LOG = LoggerFactory.getLogger( SubstringTest.class.getSimpleName() ); File wkdir; - Store store; + Store store; static SchemaManager schemaManager = null; @@ -147,8 +147,8 @@ public void testIndexedCnStartsWithJ() throws Exception { SubstringNode node = new SubstringNode( SchemaConstants.CN_AT_OID, "j", null ); - SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); - SubstringCursor cursor = new SubstringCursor( store, evaluator ); + SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); + SubstringCursor cursor = new SubstringCursor( store, evaluator ); assertEquals( node, evaluator.getExpression() ); assertTrue( cursor.isElementReused() ); @@ -191,7 +191,7 @@ // ---------- test first ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.first(); assertTrue( cursor.available() ); @@ -225,7 +225,7 @@ // ---------- test afterLast ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.afterLast(); assertFalse( cursor.available() ); @@ -261,7 +261,7 @@ // ---------- test last ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.last(); assertTrue( cursor.available() ); @@ -299,8 +299,8 @@ public void testIndexedCnStartsWithJim() throws Exception { SubstringNode node = new SubstringNode( SchemaConstants.CN_AT_OID, "jim", null ); - SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); - SubstringCursor cursor = new SubstringCursor( store, evaluator ); + SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); + SubstringCursor cursor = new SubstringCursor( store, evaluator ); assertEquals( node, evaluator.getExpression() ); assertTrue( cursor.isElementReused() ); @@ -325,7 +325,7 @@ // ---------- test first ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.first(); assertTrue( cursor.available() ); @@ -345,7 +345,7 @@ // ---------- test afterLast ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.afterLast(); assertFalse( cursor.available() ); @@ -367,7 +367,7 @@ // ---------- test last ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.last(); assertTrue( cursor.available() ); @@ -391,8 +391,8 @@ public void testIndexedCnEndsWithBean() throws Exception { SubstringNode node = new SubstringNode( SchemaConstants.CN_AT_OID, null, "bean" ); - SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); - SubstringCursor cursor = new SubstringCursor( store, evaluator ); + SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); + SubstringCursor cursor = new SubstringCursor( store, evaluator ); assertEquals( node, evaluator.getExpression() ); assertTrue( cursor.isElementReused() ); @@ -417,7 +417,7 @@ // ---------- test first ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.first(); assertTrue( cursor.available() ); @@ -437,7 +437,7 @@ // ---------- test afterLast ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.afterLast(); assertFalse( cursor.available() ); @@ -459,7 +459,7 @@ // ---------- test last ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.last(); assertTrue( cursor.available() ); @@ -483,8 +483,8 @@ public void testNonIndexedSnStartsWithB() throws Exception { SubstringNode node = new SubstringNode( SchemaConstants.SN_AT_OID, "b", null ); - SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); - SubstringCursor cursor = new SubstringCursor( store, evaluator ); + SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); + SubstringCursor cursor = new SubstringCursor( store, evaluator ); assertEquals( node, evaluator.getExpression() ); assertTrue( cursor.isElementReused() ); @@ -502,7 +502,7 @@ // ---------- test first ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.first(); assertTrue( cursor.available() ); @@ -514,7 +514,7 @@ // ---------- test afterLast ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.afterLast(); assertFalse( cursor.available() ); @@ -528,7 +528,7 @@ // ---------- test last ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.last(); assertTrue( cursor.available() ); @@ -545,8 +545,8 @@ public void testIndexedSnEndsWithEr() throws Exception { SubstringNode node = new SubstringNode( SchemaConstants.SN_AT_OID, null, "er" ); - SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); - SubstringCursor cursor = new SubstringCursor( store, evaluator ); + SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); + SubstringCursor cursor = new SubstringCursor( store, evaluator ); assertEquals( node, evaluator.getExpression() ); assertTrue( cursor.isElementReused() ); @@ -563,7 +563,7 @@ // ---------- test first ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.first(); assertTrue( cursor.available() ); @@ -575,7 +575,7 @@ // ---------- test afterLast ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.afterLast(); assertFalse( cursor.available() ); @@ -589,7 +589,7 @@ // ---------- test last ---------- - cursor = new SubstringCursor( store, evaluator ); + cursor = new SubstringCursor( store, evaluator ); cursor.last(); assertTrue( cursor.available() ); @@ -606,8 +606,8 @@ public void testNonIndexedAttributes() throws Exception { SubstringNode node = new SubstringNode( SchemaConstants.SN_AT_OID, "walk", null ); - SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); - ForwardIndexEntry indexEntry = new ForwardIndexEntry(); + SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); + ForwardIndexEntry indexEntry = new ForwardIndexEntry(); indexEntry.setId( 5L ); assertTrue( evaluator.evaluate( indexEntry ) ); indexEntry.setId( 3L ); @@ -618,36 +618,36 @@ assertFalse( evaluator.evaluate( indexEntry ) ); node = new SubstringNode( SchemaConstants.SN_AT_OID, "wa", null ); - evaluator = new SubstringEvaluator( node, store, schemaManager ); - indexEntry = new ForwardIndexEntry(); + evaluator = new SubstringEvaluator( node, store, schemaManager ); + indexEntry = new ForwardIndexEntry(); indexEntry.setId( 5L ); indexEntry.setObject( store.lookup( 5L ) ); assertTrue( evaluator.evaluate( indexEntry ) ); node = new SubstringNode( SchemaConstants.SEARCHGUIDE_AT_OID, "j", null ); - evaluator = new SubstringEvaluator( node, store, schemaManager ); - indexEntry = new ForwardIndexEntry(); + evaluator = new SubstringEvaluator( node, store, schemaManager ); + indexEntry = new ForwardIndexEntry(); indexEntry.setId( 6L ); indexEntry.setObject( store.lookup( 6L ) ); assertFalse( evaluator.evaluate( indexEntry ) ); node = new SubstringNode( SchemaConstants.ST_AT_OID, "j", null ); - evaluator = new SubstringEvaluator( node, store, schemaManager ); - indexEntry = new ForwardIndexEntry(); + evaluator = new SubstringEvaluator( node, store, schemaManager ); + indexEntry = new ForwardIndexEntry(); indexEntry.setId( 6L ); indexEntry.setObject( store.lookup( 6L ) ); assertFalse( evaluator.evaluate( indexEntry ) ); node = new SubstringNode( SchemaConstants.NAME_AT_OID, "j", null ); - evaluator = new SubstringEvaluator( node, store, schemaManager ); - indexEntry = new ForwardIndexEntry(); + evaluator = new SubstringEvaluator( node, store, schemaManager ); + indexEntry = new ForwardIndexEntry(); indexEntry.setId( 6L ); indexEntry.setObject( store.lookup( 6L ) ); assertTrue( evaluator.evaluate( indexEntry ) ); node = new SubstringNode( SchemaConstants.NAME_AT_OID, "s", null ); - evaluator = new SubstringEvaluator( node, store, schemaManager ); - indexEntry = new ForwardIndexEntry(); + evaluator = new SubstringEvaluator( node, store, schemaManager ); + indexEntry = new ForwardIndexEntry(); indexEntry.setId( 6L ); indexEntry.setObject( store.lookup( 6L ) ); assertTrue( evaluator.evaluate( indexEntry ) ); @@ -658,8 +658,8 @@ public void testEvaluatorIndexed() throws Exception { SubstringNode node = new SubstringNode( SchemaConstants.CN_AT_OID, "jim", null ); - SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); - ForwardIndexEntry indexEntry = new ForwardIndexEntry(); + SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); + ForwardIndexEntry indexEntry = new ForwardIndexEntry(); indexEntry.setId( 6L ); assertTrue( evaluator.evaluate( indexEntry ) ); indexEntry.setId( 3L ); @@ -667,15 +667,15 @@ assertFalse( evaluator.evaluate( indexEntry ) ); node = new SubstringNode( SchemaConstants.CN_AT_OID, "j", null ); - evaluator = new SubstringEvaluator( node, store, schemaManager ); - indexEntry = new ForwardIndexEntry(); + evaluator = new SubstringEvaluator( node, store, schemaManager ); + indexEntry = new ForwardIndexEntry(); indexEntry.setId( 6L ); indexEntry.setObject( store.lookup( 6L ) ); assertTrue( evaluator.evaluate( indexEntry ) ); node = new SubstringNode( SchemaConstants.CN_AT_OID, "s", null ); - evaluator = new SubstringEvaluator( node, store, schemaManager ); - indexEntry = new ForwardIndexEntry(); + evaluator = new SubstringEvaluator( node, store, schemaManager ); + indexEntry = new ForwardIndexEntry(); indexEntry.setId( 6L ); indexEntry.setObject( store.lookup( 6L ) ); assertFalse( evaluator.evaluate( indexEntry ) ); @@ -692,8 +692,8 @@ public void testInvalidCursorPositionException() throws Exception { SubstringNode node = new SubstringNode( SchemaConstants.SN_AT_OID, "b", null ); - SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); - SubstringCursor cursor = new SubstringCursor( store, evaluator ); + SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); + SubstringCursor cursor = new SubstringCursor( store, evaluator ); cursor.get(); } @@ -702,8 +702,8 @@ public void testInvalidCursorPositionException2() throws Exception { SubstringNode node = new SubstringNode( SchemaConstants.CN_AT_OID, "j", null ); - SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); - SubstringCursor cursor = new SubstringCursor( store, evaluator ); + SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); + SubstringCursor cursor = new SubstringCursor( store, evaluator ); cursor.get(); } @@ -712,11 +712,11 @@ public void testUnsupportBeforeWithoutIndex() throws Exception { SubstringNode node = new SubstringNode( SchemaConstants.SN_AT_OID, "j", null ); - SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); - SubstringCursor cursor = new SubstringCursor( store, evaluator ); + SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); + SubstringCursor cursor = new SubstringCursor( store, evaluator ); // test before() - ForwardIndexEntry entry = new ForwardIndexEntry(); + ForwardIndexEntry entry = new ForwardIndexEntry(); entry.setValue( SchemaConstants.SN_AT_OID ); cursor.before( entry ); } @@ -726,11 +726,11 @@ public void testUnsupportAfterWithoutIndex() throws Exception { SubstringNode node = new SubstringNode( SchemaConstants.SN_AT_OID, "j", null ); - SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); - SubstringCursor cursor = new SubstringCursor( store, evaluator ); + SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager ); + SubstringCursor cursor = new SubstringCursor( store, evaluator ); // test before() - ForwardIndexEntry entry = new ForwardIndexEntry(); + ForwardIndexEntry entry = new ForwardIndexEntry(); entry.setValue( SchemaConstants.SN_AT_OID ); cursor.after( entry ); } Modified: directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java?rev=917312&r1=917311&r2=917312&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java (original) +++ directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java Sun Feb 28 22:55:33 2010 @@ -47,7 +47,6 @@ import org.apache.directory.shared.ldap.message.AliasDerefMode; import org.apache.directory.shared.ldap.name.LdapDN; import org.apache.directory.shared.ldap.schema.SchemaManager; -import org.apache.directory.shared.ldap.schema.SchemaUtils; import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor; import org.apache.directory.shared.ldap.schema.ldif.extractor.impl.DefaultSchemaLdifExtractor; import org.apache.directory.shared.ldap.schema.loader.ldif.LdifSchemaLoader; @@ -72,7 +71,7 @@ public static final Logger LOG = LoggerFactory.getLogger( SubtreeScopeTest.class ); File wkdir; - Store store; + Store store; static SchemaManager schemaManager = null; @@ -158,8 +157,8 @@ { ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, SchemaConstants.OU_AT_OID + "=sales," + SchemaConstants.O_AT_OID + "=good times co.", SearchScope.SUBTREE ); - SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); - SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator ); + SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); + SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator ); assertTrue( cursor.isElementReused() ); @@ -170,7 +169,7 @@ assertTrue( cursor.next() ); assertTrue( cursor.available() ); - IndexEntry indexEntry = cursor.get(); + IndexEntry indexEntry = cursor.get(); assertNotNull( indexEntry ); assertEquals( 2L, ( long ) indexEntry.getId() ); assertEquals( 2L, ( long ) indexEntry.getValue() ); @@ -194,7 +193,7 @@ // --------- Test first() --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); assertFalse( cursor.available() ); cursor.first(); @@ -223,7 +222,7 @@ // --------- Test afterLast() --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); cursor.afterLast(); assertFalse( cursor.available() ); @@ -253,7 +252,7 @@ // --------- Test last() --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); assertFalse( cursor.available() ); cursor.last(); @@ -282,7 +281,7 @@ // --------- Test previous() before positioning --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); assertFalse( cursor.available() ); cursor.previous(); @@ -316,8 +315,8 @@ { ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING, SchemaConstants.OU_AT_OID + "=board of directors," + SchemaConstants.O_AT_OID + "=good times co.", SearchScope.SUBTREE ); - SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); - SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator ); + SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); + SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator ); assertTrue( cursor.isElementReused() ); @@ -328,7 +327,7 @@ assertTrue( cursor.next() ); assertTrue( cursor.available() ); - IndexEntry indexEntry = cursor.get(); + IndexEntry indexEntry = cursor.get(); assertNotNull( indexEntry ); assertEquals( 3L, ( long ) indexEntry.getId() ); assertEquals( 3L, ( long ) indexEntry.getValue() ); @@ -352,7 +351,7 @@ // --------- Test first() --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); assertFalse( cursor.available() ); cursor.first(); @@ -381,7 +380,7 @@ // --------- Test afterLast() --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); cursor.afterLast(); assertFalse( cursor.available() ); @@ -411,7 +410,7 @@ // --------- Test last() --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); assertFalse( cursor.available() ); cursor.last(); @@ -440,7 +439,7 @@ // --------- Test previous() before positioning --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); assertFalse( cursor.available() ); cursor.previous(); @@ -469,7 +468,7 @@ // --------- Test next() before positioning --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); assertFalse( cursor.available() ); cursor.next(); @@ -504,8 +503,8 @@ ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING, SchemaConstants.OU_AT_OID + "=apache," + SchemaConstants.OU_AT_OID + "=board of directors," + SchemaConstants.O_AT_OID + "=good times co.", SearchScope.SUBTREE ); - SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); - SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator ); + SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); + SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator ); assertTrue( cursor.isElementReused() ); @@ -516,7 +515,7 @@ assertTrue( cursor.next() ); assertTrue( cursor.available() ); - IndexEntry indexEntry = cursor.get(); + IndexEntry indexEntry = cursor.get(); assertNotNull( indexEntry ); assertEquals( 7L, ( long ) indexEntry.getId() ); assertEquals( 7L, ( long ) indexEntry.getValue() ); @@ -533,7 +532,7 @@ // --------- Test first() --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); assertFalse( cursor.available() ); cursor.first(); @@ -555,7 +554,7 @@ // --------- Test afterLast() --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); cursor.afterLast(); assertFalse( cursor.available() ); @@ -578,7 +577,7 @@ // --------- Test last() --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); assertFalse( cursor.available() ); cursor.last(); @@ -600,7 +599,7 @@ // --------- Test previous() before positioning --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); assertFalse( cursor.available() ); cursor.previous(); @@ -651,8 +650,8 @@ ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_IN_SEARCHING, SchemaConstants.OU_AT_OID + "=board of directors," + SchemaConstants.O_AT_OID + "=good times co.", SearchScope.SUBTREE ); - SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); - SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator ); + SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); + SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator ); assertTrue( cursor.isElementReused() ); @@ -663,7 +662,7 @@ assertTrue( cursor.next() ); assertTrue( cursor.available() ); - IndexEntry indexEntry = cursor.get(); + IndexEntry indexEntry = cursor.get(); assertNotNull( indexEntry ); assertEquals( 3L, ( long ) indexEntry.getId() ); assertEquals( 3L, ( long ) indexEntry.getValue() ); @@ -701,7 +700,7 @@ // --------- Test first() --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); assertFalse( cursor.available() ); cursor.first(); @@ -738,7 +737,7 @@ // --------- Test afterLast() --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); cursor.afterLast(); assertFalse( cursor.available() ); @@ -782,7 +781,7 @@ // --------- Test last() --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); assertFalse( cursor.available() ); cursor.last(); @@ -825,7 +824,7 @@ // --------- Test previous() before positioning --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); assertFalse( cursor.available() ); cursor.previous(); @@ -868,7 +867,7 @@ // --------- Test next() before positioning --------- - cursor = new SubtreeScopeCursor( store, evaluator ); + cursor = new SubtreeScopeCursor( store, evaluator ); assertFalse( cursor.available() ); cursor.next(); @@ -916,9 +915,9 @@ { ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, SchemaConstants.OU_AT_OID + "=sales," + SchemaConstants.O_AT_OID + "=good times co.", SearchScope.SUBTREE ); - SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); + SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); - ForwardIndexEntry indexEntry = new ForwardIndexEntry(); + ForwardIndexEntry indexEntry = new ForwardIndexEntry(); indexEntry.setId( 6L ); assertTrue( evaluator.evaluate( indexEntry ) ); } @@ -929,22 +928,22 @@ { ScopeNode node = new ScopeNode( AliasDerefMode.DEREF_ALWAYS, SchemaConstants.OU_AT_OID + "=engineering," + SchemaConstants.O_AT_OID + "=good times co.", SearchScope.SUBTREE ); - SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); + SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); assertEquals( node, evaluator.getExpression() ); /* * With dereferencing the evaluator does not accept candidates that * are aliases. This is done to filter out aliases from the results. */ - ForwardIndexEntry indexEntry = new ForwardIndexEntry(); + ForwardIndexEntry indexEntry = new ForwardIndexEntry(); indexEntry.setId( 11L ); assertFalse( evaluator.evaluate( indexEntry ) ); - indexEntry = new ForwardIndexEntry(); + indexEntry = new ForwardIndexEntry(); indexEntry.setId( 8L ); assertTrue( evaluator.evaluate( indexEntry ) ); - indexEntry = new ForwardIndexEntry(); + indexEntry = new ForwardIndexEntry(); indexEntry.setId( 6L ); assertFalse( evaluator.evaluate( indexEntry ) ); } @@ -955,8 +954,8 @@ { ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, SchemaConstants.OU_AT_OID + "=sales," + SchemaConstants.O_AT_OID + "=good times co.", SearchScope.SUBTREE ); - SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); - SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator ); + SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); + SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator ); cursor.get(); } @@ -966,11 +965,11 @@ { ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, SchemaConstants.OU_AT_OID + "=sales," + SchemaConstants.O_AT_OID + "=good times co.", SearchScope.SUBTREE ); - SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); - SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator ); + SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); + SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator ); // test before() - ForwardIndexEntry entry = new ForwardIndexEntry(); + ForwardIndexEntry entry = new ForwardIndexEntry(); entry.setValue( 3L ); cursor.before( entry ); } @@ -981,11 +980,11 @@ { ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, SchemaConstants.OU_AT_OID + "=sales," + SchemaConstants.O_AT_OID + "=good times co.", SearchScope.SUBTREE ); - SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); - SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator ); + SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); + SubtreeScopeCursor cursor = new SubtreeScopeCursor( store, evaluator ); // test after() - ForwardIndexEntry entry = new ForwardIndexEntry(); + ForwardIndexEntry entry = new ForwardIndexEntry(); entry.setValue( 3L ); cursor.after( entry ); } @@ -996,7 +995,7 @@ { ScopeNode node = new ScopeNode( AliasDerefMode.NEVER_DEREF_ALIASES, SchemaConstants.OU_AT_OID + "=sales," + SchemaConstants.O_AT_OID + "=good times co.", SearchScope.ONELEVEL ); - SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); + SubtreeScopeEvaluator evaluator = new SubtreeScopeEvaluator( store, node ); assertNull( evaluator ); } } Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java?rev=917312&r1=917311&r2=917312&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java (original) +++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java Sun Feb 28 22:55:33 2010 @@ -81,7 +81,7 @@ try { List recordForwards = new ArrayList(); - IndexCursor childList = db.list( id ); + IndexCursor childList = db.list( id ); while ( childList.next() ) { @@ -104,10 +104,11 @@ if ( db.getChildCount( rec.getId() ) == 0 ) { Evaluator evaluator = engine.evaluator( exprNode ); - if ( evaluator.evaluate( rec.getId() ) ) + if ( evaluator.evaluateId( rec.getId() ) ) { ServerEntry newEntry = db.lookup( rec.getId() ); - EntryNode child = new EntryNode( rec.getId(), this, db, newEntry, map, exprNode, engine ); + EntryNode child = new EntryNode( ( Long ) rec.getId(), this, db, newEntry, map, exprNode, + engine ); children.add( child ); } else @@ -118,7 +119,8 @@ else { ServerEntry newEntry = db.lookup( rec.getId() ); - EntryNode child = new EntryNode( rec.getId(), this, db, newEntry, map, exprNode, engine ); + EntryNode child = new EntryNode( ( Long ) rec.getId(), this, db, newEntry, map, exprNode, + engine ); children.add( child ); } } Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java?rev=917312&r1=917311&r2=917312&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java (original) +++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java Sun Feb 28 22:55:33 2010 @@ -62,7 +62,7 @@ * @author Apache Directory Project * @version $Rev$ */ -public class IndexDialog extends JDialog +public class IndexDialog extends JDialog { private static final Logger LOG = LoggerFactory.getLogger( IndexDialog.class ); @@ -88,10 +88,10 @@ private JLabel jLabel2 = new JLabel(); private JButton scanBut = new JButton(); - private Index index = null; + private Index index = null; - public IndexDialog( Frame parent, boolean modal, Index index ) + public IndexDialog( Frame parent, boolean modal, Index index ) { super( parent, modal ); this.index = index; @@ -99,7 +99,7 @@ } - public IndexDialog( Index index ) + public IndexDialog( Index index ) { super(); this.index = index; @@ -289,7 +289,7 @@ try { - Cursor> list; + Cursor> list; if ( scanType.equals( EQUALITY_CURSOR ) ) { @@ -297,7 +297,7 @@ list.beforeFirst(); while ( list.next() ) { - IndexEntry rec = list.get(); + IndexEntry rec = list.get(); row = new Object[2]; row[0] = rec.getValue(); row[1] = rec.getId(); @@ -308,12 +308,12 @@ else if ( scanType.equals( GREATER_CURSOR ) ) { list = index.forwardCursor(); - ForwardIndexEntry entry = new ForwardIndexEntry(); + ForwardIndexEntry entry = new ForwardIndexEntry(); entry.setValue( key ); list.before( entry ); while ( list.next() ) { - IndexEntry rec = list.get(); + IndexEntry rec = list.get(); row = new Object[2]; row[0] = rec.getValue(); row[1] = rec.getId(); @@ -324,12 +324,12 @@ else if ( scanType.equals( LESS_CURSOR ) ) { list = index.forwardCursor(); - ForwardIndexEntry entry = new ForwardIndexEntry(); + ForwardIndexEntry entry = new ForwardIndexEntry(); entry.setValue( key ); list.after( entry ); while ( list.previous() ) { - IndexEntry rec = list.get(); + IndexEntry rec = list.get(); row = new Object[2]; row[0] = rec.getValue(); row[1] = rec.getId(); @@ -362,7 +362,7 @@ list = index.forwardCursor(); while ( list.next() ) { - IndexEntry rec = list.get(); + IndexEntry rec = list.get(); row = new Object[2]; row[0] = rec.getValue(); row[1] = rec.getId(); Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java?rev=917312&r1=917311&r2=917312&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java (original) +++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java Sun Feb 28 22:55:33 2010 @@ -111,7 +111,7 @@ private JMenu indices = new JMenu(); // Non Swing Stuff - private BTreePartition partition; + private BTreePartition partition; private boolean doCleanUp; private Map nodes; private EntryNode root; @@ -126,7 +126,7 @@ * @param db the partition to view * @throws NamingException if there are problems accessing the partition */ - public PartitionFrame( BTreePartition db, SchemaManager schemaManager ) throws Exception + public PartitionFrame( BTreePartition db, SchemaManager schemaManager ) throws Exception { partition = db; this.schemaManager = schemaManager; @@ -662,7 +662,7 @@ limitMax = Integer.parseInt( limit ); } - IndexCursor cursor = partition.getSearchEngine().cursor( new LdapDN( base ), + IndexCursor cursor = partition.getSearchEngine().cursor( new LdapDN( base ), AliasDerefMode.DEREF_ALWAYS, root, ctls ); String[] cols = new String[2]; cols[0] = "id"; Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java?rev=917312&r1=917311&r2=917312&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java (original) +++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java Sun Feb 28 22:55:33 2010 @@ -63,7 +63,7 @@ * @author Apache Directory Project * @version $Rev: 639279 $ */ -public class IndexDialog extends JDialog +public class IndexDialog extends JDialog { private static final Logger LOG = LoggerFactory.getLogger( IndexDialog.class ); @@ -89,10 +89,10 @@ private JLabel jLabel2 = new JLabel(); private JButton scanBut = new JButton(); - private Index index = null; + private Index index = null; - public IndexDialog( Frame parent, boolean modal, Index index ) + public IndexDialog( Frame parent, boolean modal, Index index ) { super( parent, modal ); this.index = index; @@ -100,7 +100,7 @@ } - public IndexDialog( Index index ) + public IndexDialog( Index index ) { super(); this.index = index; @@ -291,7 +291,7 @@ try { - Cursor> list; + Cursor> list; if ( scanType.equals( EQUALITY_CURSOR ) ) { @@ -299,7 +299,7 @@ list.beforeFirst(); while ( list.next() ) { - IndexEntry rec = list.get(); + IndexEntry rec = list.get(); row = new Object[2]; row[0] = rec.getValue(); row[1] = rec.getId(); @@ -310,12 +310,12 @@ else if ( scanType.equals( GREATER_CURSOR ) ) { list = index.forwardCursor(); - ForwardIndexEntry entry = new ForwardIndexEntry(); + ForwardIndexEntry entry = new ForwardIndexEntry(); entry.setValue( key ); list.before( entry ); while ( list.next() ) { - IndexEntry rec = list.get(); + IndexEntry rec = list.get(); row = new Object[2]; row[0] = rec.getValue(); row[1] = rec.getId(); @@ -326,12 +326,12 @@ else if ( scanType.equals( LESS_CURSOR ) ) { list = index.forwardCursor(); - ForwardIndexEntry entry = new ForwardIndexEntry(); + ForwardIndexEntry entry = new ForwardIndexEntry(); entry.setValue( key ); list.after( entry ); while ( list.previous() ) { - IndexEntry rec = list.get(); + IndexEntry rec = list.get(); row = new Object[2]; row[0] = rec.getValue(); row[1] = rec.getId(); @@ -364,7 +364,7 @@ list = index.forwardCursor(); while ( list.next() ) { - IndexEntry rec = list.get(); + IndexEntry rec = list.get(); row = new Object[2]; row[0] = rec.getValue(); row[1] = rec.getId(); @@ -406,9 +406,9 @@ @SuppressWarnings("unchecked") - public static void show( Index index ) + public static void show( Index index ) { - IndexDialog dialog = new IndexDialog( index ); + IndexDialog dialog = new IndexDialog( index ); dialog.setVisible( true ); } } Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexUtils.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexUtils.java?rev=917312&r1=917311&r2=917312&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexUtils.java (original) +++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexUtils.java Sun Feb 28 22:55:33 2010 @@ -36,13 +36,13 @@ */ public class IndexUtils { - public static void printContents( Index idx ) throws Exception + public static void printContents( Index idx ) throws Exception { printContents( idx, System.out ); } - public static void printContents( Index idx, OutputStream outputStream ) throws Exception + public static void printContents( Index idx, OutputStream outputStream ) throws Exception { PrintStream out; @@ -59,7 +59,7 @@ out = new PrintStream( outputStream ); } - IndexCursor cursor = idx.forwardCursor(); + IndexCursor cursor = idx.forwardCursor(); cursor.first(); for ( Object entry : cursor ) { Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java?rev=917312&r1=917311&r2=917312&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java (original) +++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java Sun Feb 28 22:55:33 2010 @@ -20,13 +20,13 @@ package org.apache.directory.server.xdbm.tools; -import java.util.Set; import java.util.UUID; import org.apache.directory.server.core.entry.DefaultServerEntry; import org.apache.directory.server.core.entry.ServerEntry; import org.apache.directory.server.xdbm.ForwardIndexEntry; import org.apache.directory.server.xdbm.Index; +import org.apache.directory.server.xdbm.IndexCursor; import org.apache.directory.server.xdbm.IndexEntry; import org.apache.directory.server.xdbm.Store; import org.apache.directory.shared.ldap.constants.SchemaConstants; @@ -38,7 +38,6 @@ import org.apache.directory.shared.ldap.entry.client.DefaultClientEntry; import org.apache.directory.shared.ldap.name.LdapDN; import org.apache.directory.shared.ldap.schema.SchemaManager; -import org.apache.directory.shared.ldap.schema.SchemaUtils; /** @@ -65,7 +64,7 @@ * @param registries oid registries * @throws Exception on access exceptions */ - public static void loadExampleData( Store store, SchemaManager schemaManager ) throws Exception + public static void loadExampleData( Store store, SchemaManager schemaManager ) throws Exception { store.setSuffixDn( "o=Good Times Co." ); @@ -201,7 +200,7 @@ * @throws Exception if there are failures accessing the underlying store */ @SuppressWarnings("unchecked") - public Entry getAttributes( Store store, Long id ) throws Exception + public Entry getAttributes( Store store, Long id ) throws Exception { Entry entry = new DefaultClientEntry(); @@ -211,7 +210,7 @@ entry.put( "_parent", Long.toString( store.getParentId( id ) ) ); // Get all standard index attribute to value mappings - for ( Index index : ( Set ) store.getUserIndices() ) + for ( Index index : store.getUserIndices() ) { Cursor list = index.reverseCursor(); ForwardIndexEntry recordForward = new ForwardIndexEntry(); @@ -237,7 +236,7 @@ // Get all existence mappings for this id creating a special key // that looks like so 'existence[attribute]' and the value is set to id - Cursor list = store.getPresenceIndex().reverseCursor(); + IndexCursor list = store.getPresenceIndex().reverseCursor(); ForwardIndexEntry recordForward = new ForwardIndexEntry(); recordForward.setId( id ); list.before( recordForward ); @@ -265,7 +264,7 @@ // Get all parent child mappings for this entry as the parent using the // key 'child' with many entries following it. - Cursor children = store.getOneLevelIndex().forwardCursor(); + IndexCursor children = store.getOneLevelIndex().forwardCursor(); ForwardIndexEntry longRecordForward = new ForwardIndexEntry(); recordForward.setId( id ); children.before( longRecordForward ); @@ -293,7 +292,7 @@ * @param entry the server entry * @throws Exception in case of any problems in adding the entry to the store */ - public static void injectEntryInStore( Store store, ServerEntry entry ) throws Exception + public static void injectEntryInStore( Store store, ServerEntry entry ) throws Exception { entry.add( SchemaConstants.ENTRY_CSN_AT, CSN_FACTORY.newInstance().toString() ); entry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );