public void testMoreThanOneTuples() throws Exception
{
final int MAX_PRECEDENCE = 10;
HighestPrecedenceFilter filter = new HighestPrecedenceFilter();
Collection tuples = new ArrayList();
tuples.add( new ACITuple(
EMPTY_COLLECTION, AuthenticationLevel.NONE, EMPTY_COLLECTION,
EMPTY_SET, true, MAX_PRECEDENCE ) );
tuples.add( new ACITuple(
EMPTY_COLLECTION, AuthenticationLevel.NONE, EMPTY_COLLECTION,
EMPTY_SET, true, MAX_PRECEDENCE / 2 ) );
tuples.add( new ACITuple(
EMPTY_COLLECTION, AuthenticationLevel.NONE, EMPTY_COLLECTION,
EMPTY_SET, true, MAX_PRECEDENCE ) );
tuples.add( new ACITuple(
EMPTY_COLLECTION, AuthenticationLevel.NONE, EMPTY_COLLECTION,
EMPTY_SET, true, MAX_PRECEDENCE / 3 ) );
tuples = filter.filter(
tuples, null, null, null, null, null, null,
null, null, null, null, null );
for( Iterator i = tuples.iterator(); i.hasNext(); )
{
ACITuple tuple = ( ACITuple ) i.next();
Assert.assertEquals( MAX_PRECEDENCE, tuple.getPrecedence() );
}
}