@Test
public void testNonIndexedAttributes() throws Exception
{
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 ) );
node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "wa", null );
evaluator = new SubstringEvaluator( node, store, schemaManager );
indexEntry = new IndexEntry<String, String>();
indexEntry.setId( Strings.getUUID( 5L ) );
indexEntry.setEntry( store.fetch( Strings.getUUID( 5L ) ) );
assertTrue( evaluator.evaluate( indexEntry ) );
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 ) ) );
assertFalse( evaluator.evaluate( indexEntry ) );
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 ) ) );
assertFalse( evaluator.evaluate( indexEntry ) );
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 ) ) );
assertTrue( evaluator.evaluate( indexEntry ) );
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 ) ) );
assertTrue( evaluator.evaluate( indexEntry ) );