directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1748572 [23/23] - in /directory/apacheds/branches/apacheds-value: ./ benchmarks/installers-maven-plugin/ benchmarks/installers-maven-plugin/.settings/ benchmarks/installers-maven-plugin/target/ benchmarks/installers-maven-plugin/target/cla...
Date Wed, 15 Jun 2016 12:30:01 GMT
Added: directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqNotIndexedTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqNotIndexedTest.java?rev=1748572&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqNotIndexedTest.java (added)
+++ directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqNotIndexedTest.java Wed Jun 15 12:29:57 2016
@@ -0,0 +1,491 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ * 
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ * 
+ */
+package org.apache.directory.server.xdbm.search.impl;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.directory.api.util.FileUtils;
+import org.apache.directory.api.ldap.model.constants.SchemaConstants;
+import org.apache.directory.api.ldap.model.csn.CsnFactory;
+import org.apache.directory.api.ldap.model.cursor.InvalidCursorPositionException;
+import org.apache.directory.api.ldap.model.cursor.Tuple;
+import org.apache.directory.api.ldap.model.entry.DefaultEntry;
+import org.apache.directory.api.ldap.model.entry.Entry;
+import org.apache.directory.api.ldap.model.entry.Value;
+import org.apache.directory.api.ldap.model.exception.LdapSchemaException;
+import org.apache.directory.api.ldap.model.filter.GreaterEqNode;
+import org.apache.directory.api.ldap.model.name.Dn;
+import org.apache.directory.api.ldap.model.schema.AttributeType;
+import org.apache.directory.api.ldap.model.schema.LdapSyntax;
+import org.apache.directory.api.ldap.model.schema.MutableAttributeType;
+import org.apache.directory.api.ldap.model.schema.MutableMatchingRule;
+import org.apache.directory.api.ldap.model.schema.SchemaManager;
+import org.apache.directory.api.ldap.model.schema.comparators.StringComparator;
+import org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer;
+import org.apache.directory.api.ldap.model.schema.parsers.SyntaxCheckerDescription;
+import org.apache.directory.api.ldap.schema.extractor.SchemaLdifExtractor;
+import org.apache.directory.api.ldap.schema.extractor.impl.DefaultSchemaLdifExtractor;
+import org.apache.directory.api.ldap.schema.loader.LdifSchemaLoader;
+import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
+import org.apache.directory.api.util.Strings;
+import org.apache.directory.api.util.exception.Exceptions;
+import org.apache.directory.server.core.api.CacheService;
+import org.apache.directory.server.core.api.DnFactory;
+import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.api.partition.Partition;
+import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
+import org.apache.directory.server.core.shared.DefaultDnFactory;
+import org.apache.directory.server.xdbm.IndexEntry;
+import org.apache.directory.server.xdbm.Store;
+import org.apache.directory.server.xdbm.StoreUtils;
+import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
+import org.apache.directory.server.xdbm.search.cursor.GreaterEqCursor;
+import org.apache.directory.server.xdbm.search.evaluator.GreaterEqEvaluator;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Tests the GreaterEqEvaluator and GreaterEqCursor classes for correct operation.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class GreaterEqNotIndexedTest
+{
+    public static final Logger LOG = LoggerFactory.getLogger( GreaterEqNotIndexedTest.class );
+
+    File wkdir;
+    Store store;
+    static SchemaManager schemaManager = null;
+    private static DnFactory dnFactory;
+    private static CacheService cacheService;
+
+
+    @BeforeClass
+    public static void setup() throws Exception
+    {
+        // setup the standard registries
+        String workingDirectory = System.getProperty( "workingDirectory" );
+
+        if ( workingDirectory == null )
+        {
+            String path = GreaterEqNotIndexedTest.class.getResource( "" ).getPath();
+            int targetPos = path.indexOf( "target" );
+            workingDirectory = path.substring( 0, targetPos + 6 );
+        }
+
+        File schemaRepository = new File( workingDirectory, "schema" );
+        SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor( new File( workingDirectory ) );
+        extractor.extractOrCopy( true );
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        schemaManager = new DefaultSchemaManager( loader );
+
+        boolean loaded = schemaManager.loadAllEnabled();
+
+        if ( !loaded )
+        {
+            fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
+        }
+
+        loaded = schemaManager.loadWithDeps( loader.getSchema( "collective" ) );
+
+        if ( !loaded )
+        {
+            fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
+        }
+
+        cacheService = new CacheService();
+        cacheService.initialize( null );
+        dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
+    }
+
+
+    @Before
+    public void createStore() throws Exception
+    {
+        // setup the working directory for the store
+        wkdir = File.createTempFile( getClass().getSimpleName(), "db" );
+        wkdir.delete();
+        wkdir = new File( wkdir.getParentFile(), getClass().getSimpleName() );
+        wkdir.mkdirs();
+
+        StoreUtils.createdExtraAttributes( schemaManager );
+        
+        // initialize the store
+        store = new AvlPartition( schemaManager, dnFactory );
+        ( ( Partition ) store ).setId( "example" );
+        store.setCacheSize( 10 );
+        store.setPartitionPath( wkdir.toURI() );
+        store.setSyncOnWrite( false );
+
+        store.addIndex( new AvlIndex<String>( SchemaConstants.OU_AT_OID ) );
+        store.addIndex( new AvlIndex<String>( SchemaConstants.CN_AT_OID ) );
+        ( ( Partition ) store ).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
+        ( ( Partition ) store ).setCacheService( cacheService );
+        ( ( Partition ) store ).initialize();
+
+        StoreUtils.loadExampleData( store, schemaManager );
+        LOG.debug( "Created new store" );
+    }
+
+
+    @After
+    public void destroyStore() throws Exception
+    {
+        if ( store != null )
+        {
+            ( ( Partition ) store ).destroy();
+        }
+
+        store = null;
+        if ( wkdir != null )
+        {
+            FileUtils.deleteDirectory( wkdir );
+        }
+
+        wkdir = null;
+    }
+
+
+    @Test
+    public void testCursorNotIndexed() throws Exception
+    {
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_NO_INDEX_OID );
+        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new Value( at, "3" ) );
+        GreaterEqEvaluator<String> evaluator = new GreaterEqEvaluator<String>( node, store, schemaManager );
+        GreaterEqCursor<String> cursor = new GreaterEqCursor<String>( store, evaluator );
+        assertNotNull( cursor );
+        assertFalse( cursor.available() );
+        assertFalse( cursor.isClosed() );
+
+        // ---------- test bad get() ----------
+
+        try
+        {
+            cursor.get();
+            fail();
+        }
+        catch ( InvalidCursorPositionException e )
+        {
+        }
+
+        // ---------- test beforeFirst() ----------
+
+        Set<Tuple<String, String>> set = new HashSet<Tuple<String, String>>();
+        cursor.beforeFirst();
+        assertFalse( cursor.available() );
+
+        while ( cursor.next() )
+        {
+            assertTrue( cursor.available() );
+            set.add( new Tuple<String, String>( cursor.get().getKey(), cursor.get().getId() ) );
+        }
+        assertEquals( 4, set.size() );
+        assertTrue( set.contains( new Tuple<String, String>( "3", Strings.getUUID( 5L ) ) ) );
+        assertTrue( set.contains( new Tuple<String, String>( "4", Strings.getUUID( 6L ) ) ) );
+        assertTrue( set.contains( new Tuple<String, String>( "5", Strings.getUUID( 7L ) ) ) );
+        assertTrue( set.contains( new Tuple<String, String>( "6", Strings.getUUID( 8L ) ) ) );
+
+        assertFalse( cursor.next() );
+        assertFalse( cursor.available() );
+        assertFalse( cursor.isClosed() );
+        cursor.close();
+        assertTrue( cursor.isClosed() );
+
+        // ---------- test first() ----------
+
+        set.clear();
+        cursor = new GreaterEqCursor<String>( store, evaluator );
+        cursor.first();
+
+        assertTrue( cursor.available() );
+        set.add( new Tuple<String, String>( cursor.get().getKey(), cursor.get().getId() ) );
+
+        while ( cursor.next() )
+        {
+            assertTrue( cursor.available() );
+            set.add( new Tuple<String, String>( cursor.get().getKey(), cursor.get().getId() ) );
+        }
+
+        assertEquals( 4, set.size() );
+        assertTrue( set.contains( new Tuple<String, String>( "3", Strings.getUUID( 5L ) ) ) );
+        assertTrue( set.contains( new Tuple<String, String>( "4", Strings.getUUID( 6L ) ) ) );
+        assertTrue( set.contains( new Tuple<String, String>( "5", Strings.getUUID( 7L ) ) ) );
+        assertTrue( set.contains( new Tuple<String, String>( "6", Strings.getUUID( 8L ) ) ) );
+
+        assertFalse( cursor.next() );
+        assertFalse( cursor.available() );
+        assertFalse( cursor.isClosed() );
+        cursor.close();
+        assertTrue( cursor.isClosed() );
+
+        // ---------- test afterLast() ----------
+
+        set.clear();
+        cursor = new GreaterEqCursor<String>( store, evaluator );
+        cursor.afterLast();
+        assertFalse( cursor.available() );
+
+        while ( cursor.previous() )
+        {
+            assertTrue( cursor.available() );
+            set.add( new Tuple<String, String>( cursor.get().getKey(), cursor.get().getId() ) );
+        }
+        assertEquals( 4, set.size() );
+        assertTrue( set.contains( new Tuple<String, String>( "3", Strings.getUUID( 5L ) ) ) );
+        assertTrue( set.contains( new Tuple<String, String>( "4", Strings.getUUID( 6L ) ) ) );
+        assertTrue( set.contains( new Tuple<String, String>( "5", Strings.getUUID( 7L ) ) ) );
+        assertTrue( set.contains( new Tuple<String, String>( "6", Strings.getUUID( 8L ) ) ) );
+
+        assertFalse( cursor.previous() );
+        assertFalse( cursor.available() );
+        cursor.close();
+        assertTrue( cursor.isClosed() );
+
+        // ---------- test last() ----------
+
+        set.clear();
+        cursor = new GreaterEqCursor<String>( store, evaluator );
+        cursor.last();
+
+        assertTrue( cursor.available() );
+        set.add( new Tuple<String, String>( cursor.get().getKey(), cursor.get().getId() ) );
+
+        while ( cursor.previous() )
+        {
+            assertTrue( cursor.available() );
+            set.add( new Tuple<String, String>( cursor.get().getKey(), cursor.get().getId() ) );
+        }
+        assertEquals( 4, set.size() );
+        assertTrue( set.contains( new Tuple<String, String>( "3", Strings.getUUID( 5L ) ) ) );
+        assertTrue( set.contains( new Tuple<String, String>( "4", Strings.getUUID( 6L ) ) ) );
+        assertTrue( set.contains( new Tuple<String, String>( "5", Strings.getUUID( 7L ) ) ) );
+        assertTrue( set.contains( new Tuple<String, String>( "6", Strings.getUUID( 8L ) ) ) );
+
+        assertFalse( cursor.previous() );
+        assertFalse( cursor.available() );
+        cursor.close();
+        assertTrue( cursor.isClosed() );
+
+        // ---------- test before() ----------
+
+        cursor = new GreaterEqCursor<String>( store, evaluator );
+        IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
+        indexEntry.setKey( "2" );
+
+        try
+        {
+            cursor.before( indexEntry );
+            fail( "Should never get here." );
+        }
+        catch ( UnsupportedOperationException e )
+        {
+            cursor.close();
+            assertTrue( cursor.isClosed() );
+        }
+
+        // ---------- test after() ----------
+
+        cursor = new GreaterEqCursor<String>( store, evaluator );
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setKey( "2" );
+        try
+        {
+            cursor.after( indexEntry );
+            fail( "Should never get here." );
+        }
+        catch ( UnsupportedOperationException e )
+        {
+            cursor.close();
+            assertTrue( cursor.isClosed() );
+        }
+    }
+
+
+    // -----------------------------------------------------------------------
+    // Evaluator Test Cases
+    // -----------------------------------------------------------------------
+
+    @Test
+    public void testEvaluatorWithDescendantValue() throws Exception
+    {
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_OID );
+        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new Value( at, "2" ) );
+        GreaterEqEvaluator<String> evaluator = new GreaterEqEvaluator<String>( node, store, schemaManager );
+        IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
+        assertEquals( node, evaluator.getExpression() );
+        assertEquals( StoreUtils.TEST_INT_OID, evaluator.getAttributeType().getOid() );
+        assertNotNull( evaluator.getNormalizer() );
+        assertNotNull( evaluator.getComparator() );
+
+        Dn dn = new Dn( schemaManager, "cn=jane doe,o=good times co." );
+        Entry attrs = new DefaultEntry( schemaManager, dn );
+        attrs.add( "objectClass", "person" );
+        attrs.add( "testIntDescendant", "3" );
+        attrs.add( "cn", "jane doe" );
+        attrs.add( "sn", "doe" );
+        attrs.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
+        attrs.add( "entryUUID", Strings.getUUID( 12L ).toString() );
+
+        AddOperationContext addContext = new AddOperationContext( null, attrs );
+        ( ( Partition ) store ).add( addContext );
+
+        indexEntry.setId( Strings.getUUID( 12L ) );
+        assertTrue( evaluator.evaluate( indexEntry ) );
+    }
+
+
+    @Test
+    public void testEvaluatorWithoutDescendants() throws Exception
+    {
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_DESCENDANT_OID );
+        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new Value( at, "2" ) );
+
+        GreaterEqEvaluator<String> evaluator = new GreaterEqEvaluator<String>( node, store, schemaManager );
+        IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
+        assertEquals( node, evaluator.getExpression() );
+        assertEquals( StoreUtils.TEST_INT_DESCENDANT_OID, evaluator.getAttributeType().getOid() );
+        assertNotNull( evaluator.getNormalizer() );
+        assertNotNull( evaluator.getComparator() );
+
+        indexEntry.setId( Partition.DEFAULT_ID );
+        assertFalse( evaluator.evaluate( indexEntry ) );
+    }
+
+
+    @Test
+    public void testEvaluatorNotIndexed() throws Exception
+    {
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_NO_INDEX_OID );
+        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new Value( at, "3" ) );
+
+        GreaterEqEvaluator<String> evaluator = new GreaterEqEvaluator<String>( node, store, schemaManager );
+        IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
+        assertEquals( node, evaluator.getExpression() );
+        assertEquals( StoreUtils.TEST_INT_NO_INDEX_OID, evaluator.getAttributeType().getOid() );
+        assertNotNull( evaluator.getNormalizer() );
+        assertNotNull( evaluator.getComparator() );
+
+        indexEntry.setId( Strings.getUUID( 1L ) );
+        assertFalse( evaluator.evaluate( indexEntry ) );
+
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 4L ) );
+        assertFalse( evaluator.evaluate( indexEntry ) );
+
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 5L ) );
+        assertTrue( evaluator.evaluate( indexEntry ) );
+
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
+        assertTrue( evaluator.evaluate( indexEntry ) );
+
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 7L ) );
+        assertTrue( evaluator.evaluate( indexEntry ) );
+
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 8L ) );
+        assertTrue( evaluator.evaluate( indexEntry ) );
+
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 9L ) );
+        assertFalse( evaluator.evaluate( indexEntry ) );
+
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 10L ) );
+        assertFalse( evaluator.evaluate( indexEntry ) );
+    }
+
+
+    @Test(expected = LdapSchemaException.class)
+    public void testEvaluatorAttributeNoMatchingRule() throws Exception
+    {
+        LdapSyntax syntax = new BogusSyntax( 1 );
+        MutableAttributeType at = new MutableAttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".2000" );
+        at.addName( "bogus" );
+        at.setSchemaName( "other" );
+        at.setSyntax( syntax );
+
+        schemaManager.add( syntax );
+        schemaManager.add( at );
+
+        try
+        {
+            GreaterEqNode<String> node = new GreaterEqNode<String>( at, new Value( at, "3" ) );
+            new GreaterEqEvaluator<String>( node, store, schemaManager );
+        }
+        finally
+        {
+            schemaManager.delete( at );
+            schemaManager.delete( syntax );
+        }
+    }
+
+
+    @Test
+    public void testEvaluatorAttributeOrderingMatchingRule() throws Exception
+    {
+        LdapSyntax syntax = new BogusSyntax( 1 );
+        MutableMatchingRule mr = new MutableMatchingRule( "1.1" );
+        mr.setSyntax( syntax );
+        mr.setLdapComparator( new StringComparator( "1.1" ) );
+        mr.setNormalizer( new DeepTrimToLowerNormalizer() );
+
+        MutableAttributeType at = new MutableAttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".5000" );
+        at.addName( "bogus" );
+        at.setSchemaName( "other" );
+        at.setSyntax( syntax );
+        at.setOrdering( mr );
+
+        assertTrue( schemaManager.add( syntax ) );
+        assertTrue( schemaManager.add( mr ) );
+        assertTrue( schemaManager.add( at ) );
+
+        SyntaxCheckerDescription desc = new SyntaxCheckerDescription( at.getSyntax().getOid() );
+        desc.setDescription( "bogus" );
+        desc.setFqcn( BogusSyntax.class.getName() );
+        List<String> names = new ArrayList<String>();
+        names.add( "bogus" );
+        desc.setNames( names );
+        desc.setObsolete( false );
+        //schemaManager.register( at.getSyntax().getSyntaxChecker() );
+
+        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new Value( at, "3" ) );
+        new GreaterEqEvaluator<String>( node, store, schemaManager );
+        schemaManager.delete( at );
+    }
+}
\ No newline at end of file

Modified: directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java (original)
+++ directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java Wed Jun 15 12:29:57 2016
@@ -39,7 +39,8 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.cursor.Tuple;
 import org.apache.directory.api.ldap.model.entry.DefaultEntry;
 import org.apache.directory.api.ldap.model.entry.Entry;
-import org.apache.directory.api.ldap.model.entry.StringValue;
+import org.apache.directory.api.ldap.model.entry.Value;
+import org.apache.directory.api.ldap.model.exception.LdapSchemaException;
 import org.apache.directory.api.ldap.model.filter.GreaterEqNode;
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.api.ldap.model.schema.AttributeType;
@@ -48,6 +49,7 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.schema.MutableMatchingRule;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
 import org.apache.directory.api.ldap.model.schema.comparators.StringComparator;
+import org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer;
 import org.apache.directory.api.ldap.model.schema.parsers.SyntaxCheckerDescription;
 import org.apache.directory.api.ldap.schema.extractor.SchemaLdifExtractor;
 import org.apache.directory.api.ldap.schema.extractor.impl.DefaultSchemaLdifExtractor;
@@ -90,7 +92,6 @@ public class GreaterEqTest
     private static DnFactory dnFactory;
     private static CacheService cacheService;
 
-
     @BeforeClass
     public static void setup() throws Exception
     {
@@ -139,6 +140,8 @@ public class GreaterEqTest
         wkdir = new File( wkdir.getParentFile(), getClass().getSimpleName() );
         wkdir.mkdirs();
 
+        StoreUtils.createdExtraAttributes( schemaManager );
+
         // initialize the store
         store = new AvlPartition( schemaManager, dnFactory );
         ( ( Partition ) store ).setId( "example" );
@@ -148,7 +151,7 @@ public class GreaterEqTest
 
         store.addIndex( new AvlIndex<String>( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex<String>( SchemaConstants.CN_AT_OID ) );
-        store.addIndex( new AvlIndex<String>( SchemaConstants.POSTALCODE_AT_OID ) );
+        store.addIndex( new AvlIndex<String>( StoreUtils.TEST_INT_OID ) );
         ( ( Partition ) store ).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
         ( ( Partition ) store ).setCacheService( cacheService );
         ( ( Partition ) store ).initialize();
@@ -179,8 +182,8 @@ public class GreaterEqTest
     @Test
     public void testCursorIndexed() throws Exception
     {
-        AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.POSTALCODE_AT_OID );
-        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new StringValue( at, "3" ) );
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_OID );
+        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new Value( at, "3" ) );
         GreaterEqEvaluator<String> evaluator = new GreaterEqEvaluator<String>( node, store, schemaManager );
         GreaterEqCursor<String> cursor = new GreaterEqCursor<String>( store, evaluator );
         assertNotNull( cursor );
@@ -415,8 +418,8 @@ public class GreaterEqTest
     @Test
     public void testCursorNotIndexed() throws Exception
     {
-        AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.POSTOFFICEBOX_AT_OID );
-        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new StringValue( at, "3" ) );
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_NO_INDEX_OID );
+        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new Value( at, "3" ) );
         GreaterEqEvaluator<String> evaluator = new GreaterEqEvaluator<String>( node, store, schemaManager );
         GreaterEqCursor<String> cursor = new GreaterEqCursor<String>( store, evaluator );
         assertNotNull( cursor );
@@ -574,12 +577,12 @@ public class GreaterEqTest
     @Test
     public void testEvaluatorIndexed() throws Exception
     {
-        AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.POSTALCODE_AT_OID );
-        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new StringValue( at, "3" ) );
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_OID );
+        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new Value( at, "3" ) );
         GreaterEqEvaluator<String> evaluator = new GreaterEqEvaluator<String>( node, store, schemaManager );
         IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
         assertEquals( node, evaluator.getExpression() );
-        assertEquals( SchemaConstants.POSTALCODE_AT_OID, evaluator.getAttributeType().getOid() );
+        assertEquals( StoreUtils.TEST_INT_OID, evaluator.getAttributeType().getOid() );
         assertNotNull( evaluator.getNormalizer() );
         assertNotNull( evaluator.getComparator() );
 
@@ -619,19 +622,19 @@ public class GreaterEqTest
     @Test
     public void testEvaluatorWithDescendantValue() throws Exception
     {
-        AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.STREET_AT_OID );
-        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new StringValue( at, "2" ) );
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_OID);
+        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new Value( at, "2" ) );
         GreaterEqEvaluator<String> evaluator = new GreaterEqEvaluator<String>( node, store, schemaManager );
         IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
         assertEquals( node, evaluator.getExpression() );
-        assertEquals( SchemaConstants.STREET_AT_OID, evaluator.getAttributeType().getOid() );
+        assertEquals( StoreUtils.TEST_INT_OID, evaluator.getAttributeType().getOid() );
         assertNotNull( evaluator.getNormalizer() );
         assertNotNull( evaluator.getComparator() );
 
         Dn dn = new Dn( schemaManager, "cn=jane doe,o=good times co." );
         Entry attrs = new DefaultEntry( schemaManager, dn );
         attrs.add( "objectClass", "person" );
-        attrs.add( "c-street", "3" );
+        attrs.add( "testIntDescendant", "3" );
         attrs.add( "cn", "jane doe" );
         attrs.add( "sn", "doe" );
         attrs.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
@@ -648,13 +651,13 @@ public class GreaterEqTest
     @Test
     public void testEvaluatorWithoutDescendants() throws Exception
     {
-        AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.C_POSTALCODE_AT_OID );
-        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new StringValue( at, "2" ) );
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_DESCENDANT_NO_INDEX_OID );
+        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new Value( at, "2" ) );
 
         GreaterEqEvaluator<String> evaluator = new GreaterEqEvaluator<String>( node, store, schemaManager );
         IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
         assertEquals( node, evaluator.getExpression() );
-        assertEquals( SchemaConstants.C_POSTALCODE_AT_OID, evaluator.getAttributeType().getOid() );
+        assertEquals( StoreUtils.TEST_INT_DESCENDANT_NO_INDEX_OID, evaluator.getAttributeType().getOid() );
         assertNotNull( evaluator.getNormalizer() );
         assertNotNull( evaluator.getComparator() );
 
@@ -666,13 +669,13 @@ public class GreaterEqTest
     @Test
     public void testEvaluatorNotIndexed() throws Exception
     {
-        AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.POSTOFFICEBOX_AT_OID );
-        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new StringValue( at, "3" ) );
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_NO_INDEX_OID );
+        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new Value( at, "3" ) );
 
         GreaterEqEvaluator<String> evaluator = new GreaterEqEvaluator<String>( node, store, schemaManager );
         IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
         assertEquals( node, evaluator.getExpression() );
-        assertEquals( SchemaConstants.POSTOFFICEBOX_AT_OID, evaluator.getAttributeType().getOid() );
+        assertEquals( StoreUtils.TEST_INT_NO_INDEX_OID, evaluator.getAttributeType().getOid() );
         assertNotNull( evaluator.getNormalizer() );
         assertNotNull( evaluator.getComparator() );
 
@@ -709,7 +712,7 @@ public class GreaterEqTest
     }
 
 
-    @Test(expected = IllegalStateException.class)
+    @Test(expected = LdapSchemaException.class)
     public void testEvaluatorAttributeNoMatchingRule() throws Exception
     {
         LdapSyntax syntax = new BogusSyntax( 1 );
@@ -723,7 +726,7 @@ public class GreaterEqTest
 
         try
         {
-            GreaterEqNode<String> node = new GreaterEqNode<String>( at, new StringValue( at, "3" ) );
+            GreaterEqNode<String> node = new GreaterEqNode<String>( at, new Value( at, "3" ) );
             new GreaterEqEvaluator<String>( node, store, schemaManager );
         }
         finally
@@ -741,6 +744,7 @@ public class GreaterEqTest
         MutableMatchingRule mr = new MutableMatchingRule( "1.1" );
         mr.setSyntax( syntax );
         mr.setLdapComparator( new StringComparator( "1.1" ) );
+        mr.setNormalizer( new DeepTrimToLowerNormalizer() );
 
         MutableAttributeType at = new MutableAttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".5000" );
         at.addName( "bogus" );
@@ -761,7 +765,7 @@ public class GreaterEqTest
         desc.setObsolete( false );
         //schemaManager.register( at.getSyntax().getSyntaxChecker() );
 
-        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new StringValue( at, "3" ) );
+        GreaterEqNode<String> node = new GreaterEqNode<String>( at, new Value( at, "3" ) );
         new GreaterEqEvaluator<String>( node, store, schemaManager );
         schemaManager.delete( at );
     }

Modified: directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java (original)
+++ directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java Wed Jun 15 12:29:57 2016
@@ -39,7 +39,8 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.cursor.Tuple;
 import org.apache.directory.api.ldap.model.entry.DefaultEntry;
 import org.apache.directory.api.ldap.model.entry.Entry;
-import org.apache.directory.api.ldap.model.entry.StringValue;
+import org.apache.directory.api.ldap.model.entry.Value;
+import org.apache.directory.api.ldap.model.exception.LdapSchemaException;
 import org.apache.directory.api.ldap.model.filter.LessEqNode;
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.api.ldap.model.schema.AttributeType;
@@ -48,6 +49,7 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.schema.MutableMatchingRule;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
 import org.apache.directory.api.ldap.model.schema.comparators.StringComparator;
+import org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer;
 import org.apache.directory.api.ldap.model.schema.parsers.SyntaxCheckerDescription;
 import org.apache.directory.api.ldap.schema.extractor.SchemaLdifExtractor;
 import org.apache.directory.api.ldap.schema.extractor.impl.DefaultSchemaLdifExtractor;
@@ -139,6 +141,8 @@ public class LessEqTest
         wkdir = new File( wkdir.getParentFile(), getClass().getSimpleName() );
         wkdir.mkdirs();
 
+        StoreUtils.createdExtraAttributes( schemaManager );
+
         // initialize the store
         store = new AvlPartition( schemaManager, dnFactory );
         ( ( Partition ) store ).setId( "example" );
@@ -148,7 +152,7 @@ public class LessEqTest
 
         store.addIndex( new AvlIndex<String>( SchemaConstants.OU_AT_OID ) );
         store.addIndex( new AvlIndex<String>( SchemaConstants.CN_AT_OID ) );
-        store.addIndex( new AvlIndex<String>( SchemaConstants.POSTALCODE_AT_OID ) );
+        store.addIndex( new AvlIndex<String>( StoreUtils.TEST_INT_OID ) );
         ( ( Partition ) store ).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
         ( ( Partition ) store ).setCacheService( cacheService );
         ( ( Partition ) store ).initialize();
@@ -179,8 +183,8 @@ public class LessEqTest
     @Test
     public void testCursorIndexed() throws Exception
     {
-        AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.POSTALCODE_AT_OID );
-        LessEqNode<String> node = new LessEqNode<String>( at, new StringValue( at, "3" ) );
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_OID );
+        LessEqNode<String> node = new LessEqNode<String>( at, new Value( at, "3" ) );
         LessEqEvaluator<String> evaluator = new LessEqEvaluator<String>( node, store, schemaManager );
         LessEqCursor<String> cursor = new LessEqCursor<String>( store, evaluator );
         assertNotNull( cursor );
@@ -367,7 +371,7 @@ public class LessEqTest
 
         cursor = new LessEqCursor<String>( store, evaluator );
         indexEntry = new IndexEntry<String, String>();
-        indexEntry.setKey( "7" );
+        indexEntry.setKey( " 7 " );
         cursor.before( indexEntry );
         assertFalse( cursor.available() );
         assertTrue( cursor.previous() );
@@ -412,7 +416,7 @@ public class LessEqTest
 
         cursor = new LessEqCursor<String>( store, evaluator );
         indexEntry = new IndexEntry<String, String>();
-        indexEntry.setKey( "7" );
+        indexEntry.setKey( " 7 " );
         cursor.after( indexEntry );
         assertFalse( cursor.available() );
         assertTrue( cursor.previous() );
@@ -435,8 +439,8 @@ public class LessEqTest
     @Test
     public void testCursorNotIndexed() throws Exception
     {
-        AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.POSTOFFICEBOX_AT_OID );
-        LessEqNode<String> node = new LessEqNode<String>( at, new StringValue( at, "3" ) );
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_NO_INDEX_OID );
+        LessEqNode<String> node = new LessEqNode<String>( at, new Value( at, "3" ) );
         LessEqEvaluator<String> evaluator = new LessEqEvaluator<String>( node, store, schemaManager );
         LessEqCursor<String> cursor = new LessEqCursor<String>( store, evaluator );
         assertNotNull( cursor );
@@ -598,13 +602,13 @@ public class LessEqTest
     @Test
     public void testEvaluatorIndexed() throws Exception
     {
-        AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.POSTALCODE_AT_OID );
-        LessEqNode<String> node = new LessEqNode<String>( at, new StringValue( at, "3" ) );
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_OID );
+        LessEqNode<String> node = new LessEqNode<String>( at, new Value( at, "3" ) );
 
         LessEqEvaluator<String> evaluator = new LessEqEvaluator<String>( node, store, schemaManager );
         IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
         assertEquals( node, evaluator.getExpression() );
-        assertEquals( SchemaConstants.POSTALCODE_AT_OID, evaluator.getAttributeType().getOid() );
+        assertEquals( StoreUtils.TEST_INT_OID, evaluator.getAttributeType().getOid() );
         assertNotNull( evaluator.getNormalizer() );
         assertNotNull( evaluator.getComparator() );
 
@@ -644,20 +648,20 @@ public class LessEqTest
     @Test
     public void testEvaluatorWithDescendantValue() throws Exception
     {
-        AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.STREET_AT_OID );
-        LessEqNode<String> node = new LessEqNode<String>( at, new StringValue( at, "2" ) );
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_OID );
+        LessEqNode<String> node = new LessEqNode<String>( at, new Value( at, "2" ) );
 
         LessEqEvaluator<String> evaluator = new LessEqEvaluator<String>( node, store, schemaManager );
         IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
         assertEquals( node, evaluator.getExpression() );
-        assertEquals( SchemaConstants.STREET_AT_OID, evaluator.getAttributeType().getOid() );
+        assertEquals( StoreUtils.TEST_INT_OID, evaluator.getAttributeType().getOid() );
         assertNotNull( evaluator.getNormalizer() );
         assertNotNull( evaluator.getComparator() );
 
         Dn dn = new Dn( schemaManager, "cn=jane doe,o=good times co." );
         Entry attrs = new DefaultEntry( schemaManager, dn );
         attrs.add( "objectClass", "person" );
-        attrs.add( "c-street", "1" );
+        attrs.add( StoreUtils.TEST_INT_DESCENDANT_OID, "1" );
         attrs.add( "cn", "jane doe" );
         attrs.add( "sn", "doe" );
         attrs.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
@@ -674,13 +678,13 @@ public class LessEqTest
     @Test
     public void testEvaluatorWithoutDescendants() throws Exception
     {
-        AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.C_POSTALCODE_AT_OID );
-        LessEqNode<String> node = new LessEqNode<String>( at, new StringValue( at, "2" ) );
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_DESCENDANT_NO_INDEX_OID );
+        LessEqNode<String> node = new LessEqNode<String>( at, new Value( at, "2" ) );
 
         LessEqEvaluator<String> evaluator = new LessEqEvaluator<String>( node, store, schemaManager );
         IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
         assertEquals( node, evaluator.getExpression() );
-        assertEquals( SchemaConstants.C_POSTALCODE_AT_OID, evaluator.getAttributeType().getOid() );
+        assertEquals( StoreUtils.TEST_INT_DESCENDANT_NO_INDEX_OID, evaluator.getAttributeType().getOid() );
         assertNotNull( evaluator.getNormalizer() );
         assertNotNull( evaluator.getComparator() );
 
@@ -692,13 +696,13 @@ public class LessEqTest
     @Test
     public void testEvaluatorNotIndexed() throws Exception
     {
-        AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.POSTOFFICEBOX_AT_OID );
-        LessEqNode<String> node = new LessEqNode<String>( at, new StringValue( at, "3" ) );
+        AttributeType at = schemaManager.lookupAttributeTypeRegistry( StoreUtils.TEST_INT_NO_INDEX_OID );
+        LessEqNode<String> node = new LessEqNode<String>( at, new Value( at, "3" ) );
 
         LessEqEvaluator<String> evaluator = new LessEqEvaluator<String>( node, store, schemaManager );
         IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
         assertEquals( node, evaluator.getExpression() );
-        assertEquals( SchemaConstants.POSTOFFICEBOX_AT_OID, evaluator.getAttributeType().getOid() );
+        assertEquals( StoreUtils.TEST_INT_NO_INDEX_OID, evaluator.getAttributeType().getOid() );
         assertNotNull( evaluator.getNormalizer() );
         assertNotNull( evaluator.getComparator() );
 
@@ -735,7 +739,7 @@ public class LessEqTest
     }
 
 
-    @Test(expected = IllegalStateException.class)
+    @Test(expected = LdapSchemaException.class)
     public void testEvaluatorAttributeNoMatchingRule() throws Exception
     {
         LdapSyntax syntax = new BogusSyntax( 10 );
@@ -749,7 +753,7 @@ public class LessEqTest
 
         try
         {
-            LessEqNode<String> node = new LessEqNode<String>( at, new StringValue( at, "3" ) );
+            LessEqNode<String> node = new LessEqNode<String>( at, new Value( at, "3" ) );
 
             new LessEqEvaluator<String>( node, store, schemaManager );
         }
@@ -769,6 +773,7 @@ public class LessEqTest
         MutableMatchingRule mr = new MutableMatchingRule( "1.1" );
         mr.setSyntax( syntax );
         mr.setLdapComparator( new StringComparator( "1.1" ) );
+        mr.setNormalizer( new DeepTrimToLowerNormalizer( "1.1" ) );
 
         MutableAttributeType at = new MutableAttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".3000" );
         at.addName( "bogus" );
@@ -788,7 +793,7 @@ public class LessEqTest
         desc.setNames( names );
         desc.setObsolete( false );
 
-        LessEqNode<String> node = new LessEqNode<String>( at, new StringValue( at, "3" ) );
+        LessEqNode<String> node = new LessEqNode<String>( at, new Value( at, "3" ) );
         new LessEqEvaluator<String>( node, store, schemaManager );
         schemaManager.delete( at );
     }

Modified: directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java (original)
+++ directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java Wed Jun 15 12:29:57 2016
@@ -132,6 +132,8 @@ public class NestedFilterTest extends Ab
         wkdir = new File( wkdir.getParentFile(), getClass().getSimpleName() );
         wkdir.mkdirs();
 
+        StoreUtils.createdExtraAttributes( schemaManager );
+        
         // initialize the store
         store = new AvlPartition( schemaManager, directoryService.getDnFactory() );
         ( ( Partition ) store ).setId( "example" );

Modified: directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java (original)
+++ directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java Wed Jun 15 12:29:57 2016
@@ -133,6 +133,8 @@ public class NotCursorTest extends Abstr
         wkdir = new File( wkdir.getParentFile(), getClass().getSimpleName() );
         wkdir.mkdirs();
 
+        StoreUtils.createdExtraAttributes( schemaManager );
+        
         // initialize the store
         store = new AvlPartition( schemaManager, directoryService.getDnFactory() );
         ( ( Partition ) store ).setId( "example" );

Modified: directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java (original)
+++ directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java Wed Jun 15 12:29:57 2016
@@ -135,6 +135,8 @@ public class OrCursorTest extends Abstra
         wkdir = new File( wkdir.getParentFile(), getClass().getSimpleName() );
         wkdir.mkdirs();
 
+        StoreUtils.createdExtraAttributes( schemaManager );
+        
         // initialize the store
         store = new AvlPartition( schemaManager, directoryService.getDnFactory() );
         ( ( Partition ) store ).setId( "example" );

Modified: directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java (original)
+++ directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java Wed Jun 15 12:29:57 2016
@@ -43,6 +43,7 @@ import org.apache.directory.api.ldap.sch
 import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
 import org.apache.directory.api.util.Strings;
 import org.apache.directory.api.util.exception.Exceptions;
+import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.core.api.CacheService;
 import org.apache.directory.server.core.api.DnFactory;
 import org.apache.directory.server.core.api.partition.Partition;
@@ -76,6 +77,7 @@ public class PresenceTest
     static SchemaManager schemaManager = null;
     private static DnFactory dnFactory;
     private static CacheService cacheService;
+    private static String NORMALIZED_CN_OID;
 
 
     @BeforeClass
@@ -113,6 +115,8 @@ public class PresenceTest
         cacheService = new CacheService();
         cacheService.initialize( null );
         dnFactory = new DefaultDnFactory( schemaManager, cacheService.getCache( "dnCache" ) );
+        
+        NORMALIZED_CN_OID = schemaManager.getAttributeType( ApacheSchemaConstants.APACHE_PRESENCE_AT ).getEquality().getNormalizer().normalize( SchemaConstants.CN_AT_OID );
     }
 
 
@@ -125,6 +129,8 @@ public class PresenceTest
         wkdir = new File( wkdir.getParentFile(), getClass().getSimpleName() );
         wkdir.mkdirs();
 
+        StoreUtils.createdExtraAttributes( schemaManager );
+        
         // initialize the store
         store = new AvlPartition( schemaManager, dnFactory );
         ( ( Partition ) store ).setId( "example" );
@@ -132,8 +138,8 @@ public class PresenceTest
         store.setPartitionPath( wkdir.toURI() );
         store.setSyncOnWrite( false );
 
-        store.addIndex( new AvlIndex<String>( SchemaConstants.OU_AT_OID ) );
-        store.addIndex( new AvlIndex<String>( SchemaConstants.CN_AT_OID ) );
+        store.addIndex( new AvlIndex<String>( SchemaConstants.OU_AT_OID, false ) );
+        store.addIndex( new AvlIndex<String>( SchemaConstants.CN_AT_OID, false ) );
         ( ( Partition ) store ).setSuffixDn( new Dn( schemaManager, "o=Good Times Co." ) );
         ( ( Partition ) store ).setCacheService( cacheService );
         ( ( Partition ) store ).initialize();
@@ -174,6 +180,7 @@ public class PresenceTest
         assertEquals( node, evaluator.getExpression() );
 
         cursor.beforeFirst();
+        
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
@@ -198,26 +205,26 @@ public class PresenceTest
         // test first()
         cursor.first();
         assertTrue( cursor.available() );
-        assertEquals( SchemaConstants.CN_AT_OID, cursor.get().getKey() );
+        assertEquals( NORMALIZED_CN_OID, cursor.get().getKey() );
 
         // test last()
         cursor.last();
         assertTrue( cursor.available() );
-        assertEquals( SchemaConstants.CN_AT_OID, cursor.get().getKey() );
+        assertEquals( NORMALIZED_CN_OID, cursor.get().getKey() );
 
         // test beforeFirst()
         cursor.beforeFirst();
         assertFalse( cursor.available() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( SchemaConstants.CN_AT_OID, cursor.get().getKey() );
+        assertEquals( NORMALIZED_CN_OID, cursor.get().getKey() );
 
         // test afterLast()
         cursor.afterLast();
         assertFalse( cursor.available() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( SchemaConstants.CN_AT_OID, cursor.get().getKey() );
+        assertEquals( NORMALIZED_CN_OID, cursor.get().getKey() );
 
         // test before()
         IndexEntry<String, String> entry = new IndexEntry<String, String>();
@@ -225,14 +232,14 @@ public class PresenceTest
         cursor.before( entry );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( SchemaConstants.CN_AT_OID, cursor.get().getKey() );
+        assertEquals( NORMALIZED_CN_OID, cursor.get().getKey() );
 
         // test after()
         entry = new IndexEntry<String, String>();
         cursor.after( entry );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( SchemaConstants.CN_AT_OID, cursor.get().getKey() );
+        assertEquals( NORMALIZED_CN_OID, cursor.get().getKey() );
         cursor.close();
 
         node = new PresenceNode( schemaManager.getAttributeType( "ou" ) );

Modified: directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java?rev=1748572&r1=1748571&r2=1748572&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java (original)
+++ directory/apacheds/branches/apacheds-value/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java Wed Jun 15 12:29:57 2016
@@ -121,6 +121,8 @@ public class SubstringTest
         wkdir = new File( wkdir.getParentFile(), getClass().getSimpleName() );
         wkdir.mkdirs();
 
+        StoreUtils.createdExtraAttributes( schemaManager );
+        
         // initialize the store
         store = new AvlPartition( schemaManager, dnFactory );
         ( ( Partition ) store ).setId( "example" );
@@ -175,29 +177,29 @@ public class SubstringTest
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 8 ), cursor.get().getId() );
-        assertEquals( "jack daniels", cursor.get().getKey() );
+        assertEquals( " jack  daniels ", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getKey() );
+        assertEquals( " johnny  walker ", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 11 ), cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getKey() );
+        assertEquals( " johnny  walker ", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -213,29 +215,29 @@ public class SubstringTest
 
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 8 ), cursor.get().getId() );
-        assertEquals( "jack daniels", cursor.get().getKey() );
+        assertEquals( " jack  daniels ", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getKey() );
+        assertEquals( " johnny  walker ", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 11 ), cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getKey() );
+        assertEquals( " johnny  walker ", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -250,29 +252,29 @@ public class SubstringTest
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 11 ), cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getKey() );
+        assertEquals( " johnny  walker ", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getKey() );
+        assertEquals( " johnny  walker ", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 8 ), cursor.get().getId() );
-        assertEquals( "jack daniels", cursor.get().getKey() );
+        assertEquals( " jack  daniels ", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -285,29 +287,29 @@ public class SubstringTest
         assertTrue( cursor.available() );
 
         assertEquals( Strings.getUUID( 11 ), cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getKey() );
+        assertEquals( " johnny  walker ", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
-        assertEquals( "johnny walker", cursor.get().getKey() );
+        assertEquals( " johnny  walker ", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 8 ), cursor.get().getId() );
-        assertEquals( "jack daniels", cursor.get().getKey() );
+        assertEquals( " jack  daniels ", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -329,15 +331,15 @@ public class SubstringTest
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -350,15 +352,15 @@ public class SubstringTest
 
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -373,15 +375,15 @@ public class SubstringTest
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -394,15 +396,15 @@ public class SubstringTest
         assertTrue( cursor.available() );
 
         assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -424,15 +426,15 @@ public class SubstringTest
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -446,15 +448,15 @@ public class SubstringTest
 
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -469,15 +471,15 @@ public class SubstringTest
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -490,15 +492,15 @@ public class SubstringTest
         assertTrue( cursor.available() );
 
         assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "jim bean", cursor.get().getKey() );
+        assertEquals( " jim  bean ", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -520,7 +522,7 @@ public class SubstringTest
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "bean", cursor.get().getKey() );
+        assertEquals( "BEAN", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -533,7 +535,7 @@ public class SubstringTest
 
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "bean", cursor.get().getKey() );
+        assertEquals( "BEAN", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -548,7 +550,7 @@ public class SubstringTest
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "bean", cursor.get().getKey() );
+        assertEquals( "BEAN", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -562,7 +564,7 @@ public class SubstringTest
 
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
-        assertEquals( "bean", cursor.get().getKey() );
+        assertEquals( "BEAN", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -584,7 +586,7 @@ public class SubstringTest
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
-        assertEquals( "walker", cursor.get().getKey() );
+        assertEquals( "WAlkeR", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -597,7 +599,7 @@ public class SubstringTest
 
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
-        assertEquals( "walker", cursor.get().getKey() );
+        assertEquals( "WAlkeR", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
@@ -612,7 +614,7 @@ public class SubstringTest
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
-        assertEquals( "walker", cursor.get().getKey() );
+        assertEquals( "WAlkeR", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -626,7 +628,7 @@ public class SubstringTest
 
         assertTrue( cursor.available() );
         assertEquals( Strings.getUUID( 5L ), cursor.get().getId() );
-        assertEquals( "walker", cursor.get().getKey() );
+        assertEquals( "WAlkeR", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
@@ -639,12 +641,15 @@ public class SubstringTest
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "walk", null );
         SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        
         IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
         indexEntry.setId( Strings.getUUID( 5L ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
+        
         indexEntry.setId( Strings.getUUID( 3L ) );
         indexEntry.setEntry( null );
         assertFalse( evaluator.evaluate( indexEntry ) );
+        
         indexEntry.setId( Strings.getUUID( 6L ) );
         indexEntry.setEntry( null );
         assertFalse( evaluator.evaluate( indexEntry ) );
@@ -658,6 +663,7 @@ public class SubstringTest
 
         node = new SubstringNode( schemaManager.getAttributeType( "searchGuide" ), "j", null );
         evaluator = new SubstringEvaluator( node, store, schemaManager );
+        
         indexEntry = new IndexEntry<String, String>();
         indexEntry.setId( Strings.getUUID( 6L ) );
         indexEntry.setEntry( store.fetch( Strings.getUUID( 6L ) ) );
@@ -665,6 +671,7 @@ public class SubstringTest
 
         node = new SubstringNode( schemaManager.getAttributeType( "st" ), "j", null );
         evaluator = new SubstringEvaluator( node, store, schemaManager );
+        
         indexEntry = new IndexEntry<String, String>();
         indexEntry.setId( Strings.getUUID( 6L ) );
         indexEntry.setEntry( store.fetch( Strings.getUUID( 6L ) ) );
@@ -672,6 +679,7 @@ public class SubstringTest
 
         node = new SubstringNode( schemaManager.getAttributeType( "name" ), "j", null );
         evaluator = new SubstringEvaluator( node, store, schemaManager );
+        
         indexEntry = new IndexEntry<String, String>();
         indexEntry.setId( Strings.getUUID( 6L ) );
         indexEntry.setEntry( store.fetch( Strings.getUUID( 6L ) ) );
@@ -679,6 +687,7 @@ public class SubstringTest
 
         node = new SubstringNode( schemaManager.getAttributeType( "name" ), "s", null );
         evaluator = new SubstringEvaluator( node, store, schemaManager );
+        
         indexEntry = new IndexEntry<String, String>();
         indexEntry.setId( Strings.getUUID( 6L ) );
         indexEntry.setEntry( store.fetch( Strings.getUUID( 6L ) ) );



Mime
View raw message