@Test
public void testSimplePredWithSurrogate() {
CompoundPredicate outerPredicate = new CompoundPredicate();
outerPredicate.setBooleanOperator("surrogate");
setupSimplePredicate(0,"TF1",SimpleSegmentPredicate.LESSER_EQUAL,"150");
outerPredicate.getSimplePredicatesAndCompoundPredicatesAndSimpleSetPredicates().add(simplePredicate[0]);
CompoundPredicate innerPredicate = new CompoundPredicate();
innerPredicate.setBooleanOperator("and");
setupSimplePredicate(1, "TF2", SimpleSegmentPredicate.GREATER, "150");
Array valueSet = getNewArray("string", new BigInteger("3"), "red", "white", "blue");
setupSimpleSetPredicate(0, "TF3", "isIn", valueSet);
setupSimplePredicate(2, "TF4", SimpleSegmentPredicate.GREATER_EQUAL,"10");
innerPredicate.getSimplePredicatesAndCompoundPredicatesAndSimpleSetPredicates().add(simplePredicate[1]);
innerPredicate.getSimplePredicatesAndCompoundPredicatesAndSimpleSetPredicates().add(simpleSetPredicate[0]);
outerPredicate.getSimplePredicatesAndCompoundPredicatesAndSimpleSetPredicates().add(innerPredicate);
outerPredicate.getSimplePredicatesAndCompoundPredicatesAndSimpleSetPredicates().add(simplePredicate[2]);
CompoundSegmentPredicate testPredicate = new CompoundSegmentPredicate(outerPredicate);
String text = testPredicate.getPrimaryPredicateRule();
assertNotNull(text);
assertEquals(text,"( mTF1 == false ) && ( vTF1 <= 150 )");
assertEquals(2,testPredicate.getSubpredicateCount());
text = testPredicate.getNextPredicateRule(0);
assertEquals(text,"( (mTF1 == true) && ( ((( mTF2 == false ) && ( vTF2 > 150 )) && (( mTF3 == false ) && ( vTF3 in ( \"red\" , \"white\" , \"blue\" ) ))) ) )");
}
}