efl0Clone.getCurrentName() );
}
@Test
public void testCompositeFactPatterns() {
RuleModel model = new RuleModel();
model.lhs = new IPattern[1];
CompositeFactPattern cfp0 = new CompositeFactPattern();
cfp0.type = CompositeFactPattern.COMPOSITE_TYPE_OR;
FactPattern fp0 = new FactPattern();
fp0.setBoundName( "$t0" );
fp0.setFactType( "FT0" );
fp0.setNegated( true );
SingleFieldConstraint fp0sfc0 = new SingleFieldConstraint();
fp0sfc0.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
fp0sfc0.setFieldBinding( "$fp0sfc0" );
fp0sfc0.setFieldName( "fp0sfc0" );
fp0sfc0.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
fp0sfc0.setOperator( "==" );
fp0sfc0.setParameter( "fp0sfc0p0",
"fp0sfc0p0Value" );
fp0sfc0.setValue( "fp0sfc0Value" );
fp0.addConstraint( fp0sfc0 );
FactPattern fp1 = new FactPattern();
fp1.setBoundName( "$t1" );
fp1.setFactType( "FT1" );
fp1.setNegated( true );
SingleFieldConstraint fp1sfc0 = new SingleFieldConstraint();
fp1sfc0.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
fp1sfc0.setFieldBinding( "$fp1sfc0" );
fp1sfc0.setFieldName( "fp1sfc0" );
fp1sfc0.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
fp1sfc0.setOperator( "==" );
fp1sfc0.setParameter( "fp1sfc0p0",
"fp1sfc0p0Value" );
fp1sfc0.setValue( "fp1sfc0Value" );
fp1.addConstraint( fp1sfc0 );
cfp0.addFactPattern( fp0 );
cfp0.addFactPattern( fp1 );
model.lhs[0] = cfp0;
RuleModelCloneVisitor cloneVisitor = new RuleModelCloneVisitor();
RuleModel clone = cloneVisitor.visitRuleModel( model );
assertEquals( 1,
clone.lhs.length );
assertNotSame( model.lhs[0],
clone.lhs[0] );