@Test
public void testNonIndexedAttributes() throws Exception
{
SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "walk", null );
SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
ForwardIndexEntry<String, Entry, Long> indexEntry = new ForwardIndexEntry<String, Entry, Long>();
indexEntry.setId( 5L );
assertTrue( evaluator.evaluate( indexEntry ) );
indexEntry.setId( 3L );
indexEntry.setObject( null );
assertFalse( evaluator.evaluate( indexEntry ) );
indexEntry.setId( 6L );
indexEntry.setObject( null );
assertFalse( evaluator.evaluate( indexEntry ) );
node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "wa", null );
evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
indexEntry = new ForwardIndexEntry<String, Entry, Long>();
indexEntry.setId( 5L );
indexEntry.setObject( store.lookup( 5L ) );
assertTrue( evaluator.evaluate( indexEntry ) );
node = new SubstringNode( schemaManager.getAttributeType( "searchGuide" ), "j", null );
evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
indexEntry = new ForwardIndexEntry<String, Entry, Long>();
indexEntry.setId( 6L );
indexEntry.setObject( store.lookup( 6L ) );
assertFalse( evaluator.evaluate( indexEntry ) );
node = new SubstringNode( schemaManager.getAttributeType( "st" ), "j", null );
evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
indexEntry = new ForwardIndexEntry<String, Entry, Long>();
indexEntry.setId( 6L );
indexEntry.setObject( store.lookup( 6L ) );
assertFalse( evaluator.evaluate( indexEntry ) );
node = new SubstringNode( schemaManager.getAttributeType( "name" ), "j", null );
evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
indexEntry = new ForwardIndexEntry<String, Entry, Long>();
indexEntry.setId( 6L );
indexEntry.setObject( store.lookup( 6L ) );
assertTrue( evaluator.evaluate( indexEntry ) );
node = new SubstringNode( schemaManager.getAttributeType( "name" ), "s", null );
evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
indexEntry = new ForwardIndexEntry<String, Entry, Long>();
indexEntry.setId( 6L );
indexEntry.setObject( store.lookup( 6L ) );
assertTrue( evaluator.evaluate( indexEntry ) );