sfc0cc0Clone.getValue() );
}
@Test
public void testFactPattern_CompositeFieldConstraints() {
RuleModel model = new RuleModel();
model.lhs = new IPattern[1];
FactPattern fp0 = new FactPattern();
fp0.setBoundName( "$t0" );
fp0.setFactType( "FT0" );
CompositeFieldConstraint cfc0 = new CompositeFieldConstraint();
cfc0.compositeJunctionType = CompositeFieldConstraint.COMPOSITE_TYPE_OR;
SingleFieldConstraint sfc0 = new SingleFieldConstraint();
sfc0.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
sfc0.setFieldBinding( "$sfc0" );
sfc0.setFieldName( "sfc0" );
sfc0.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
sfc0.setOperator( "==" );
sfc0.setParameter( "sfc0p0",
"sfc0p0Value" );
sfc0.setValue( "sfc0Value" );
cfc0.addConstraint( sfc0 );
SingleFieldConstraint sfc1 = new SingleFieldConstraint();
sfc1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
sfc1.setFieldBinding( "$sfc1" );
sfc1.setFieldName( "sfc1" );
sfc1.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
sfc1.setOperator( "==" );
sfc1.setParameter( "sfc1p0",
"sfc1p0Value" );
sfc1.setValue( "sfc1Value" );
cfc0.addConstraint( sfc1 );
fp0.addConstraint( cfc0 );
model.lhs[0] = fp0;
RuleModelCloneVisitor cloneVisitor = new RuleModelCloneVisitor();
RuleModel clone = cloneVisitor.visitRuleModel( model );
assertEquals( 1,
clone.lhs.length );
assertNotSame( model.lhs[0],
clone.lhs[0] );