@Test
public void testMaxValueCount() throws Exception
{
Set<MaxValueCountElem> mvcItems = new HashSet<MaxValueCountElem>();
mvcItems.add( new MaxValueCountElem( CN_AT, 3 ) );
Collection<ACITuple> tuples = getTuples( new MaxValueCountItem( mvcItems ) );
// Test wrong scope
AciContext aciContext = new AciContext( null, null );
aciContext.setAciTuples( tuples );
aciContext.setUserDn( USER_NAME );
aciContext.setAttributeType( CN_AT );
assertEquals( 0, filterA.filter( aciContext, OperationScope.ENTRY, null ).size() );
tuples = getTuples( new MaxValueCountItem( mvcItems ) );
aciContext = new AciContext( null, null );
aciContext.setAciTuples( tuples );
aciContext.setUserDn( USER_NAME );
aciContext.setAttributeType( CN_AT );
assertEquals( 0, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE, null ).size() );
tuples = getTuples( new MaxValueCountItem( mvcItems ) );
aciContext = new AciContext( null, null );
aciContext.setAciTuples( tuples );
aciContext.setUserDn( USER_NAME );
aciContext.setAttributeType( CN_AT );