public void testMatch2() throws Exception
{
Any defaultValue = getORB().create_any();
MappingFilterOperations _mappingFilter = new MappingFilterImpl(getORB(),
getConfiguration(), filter_, defaultValue);
AnyHolder anyHolder = new AnyHolder();
// filter is empty. should not match
assertTrue(!_mappingFilter.match(testPerson_, anyHolder));
// add some filter data
Any resultToSet = getORB().create_any();
resultToSet.insert_string("this is 10");
EventType[] _eventType = new EventType[1];
_eventType[0] = new EventType("*", "*");
ConstraintExp constraintExp = new ConstraintExp(_eventType, "$ == 10");
MappingConstraintPair[] mappingConstraintPair = new MappingConstraintPair[2];
mappingConstraintPair[0] = new MappingConstraintPair(constraintExp, resultToSet);
constraintExp = new ConstraintExp(_eventType, "$ == 20");
resultToSet = getORB().create_any();
resultToSet.insert_string("this is 20");
mappingConstraintPair[1] = new MappingConstraintPair(constraintExp, resultToSet);
MappingConstraintInfo[] _info = _mappingFilter
.add_mapping_constraints(mappingConstraintPair);
assertTrue(_info.length == 2);
Any testMessage = getORB().create_any();
testMessage.insert_long(10);
// this should match
assertTrue(_mappingFilter.match(testMessage, anyHolder));
assertEquals("this is 10", anyHolder.value.extract_string());
testMessage = getORB().create_any();
testMessage.insert_long(20);
assertTrue(_mappingFilter.match(testMessage, anyHolder));
assertEquals("this is 20", anyHolder.value.extract_string());
}