SuggestionCompletionEngine.TYPE_BOOLEAN )
} );
}
} );
GuidedDecisionTable dt = new GuidedDecisionTable();
AttributeCol salienceAttribute = new AttributeCol();
salienceAttribute.setAttribute( "salience" );
AttributeCol enabledAttribute = new AttributeCol();
enabledAttribute.setAttribute( "enabled" );
dt.getAttributeCols().add( salienceAttribute );
dt.getAttributeCols().add( enabledAttribute );
ConditionCol conditionColName = new ConditionCol();
conditionColName.setBoundName( "c1" );
conditionColName.setFactType( "Driver" );
conditionColName.setFactField( "name" );
conditionColName.setOperator( "==" );
conditionColName.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
dt.getConditionCols().add( conditionColName );
ConditionCol conditionColAge = new ConditionCol();
conditionColAge.setBoundName( "c1" );
conditionColAge.setFactType( "Driver" );
conditionColAge.setFactField( "age" );
conditionColAge.setOperator( "==" );
conditionColAge.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
dt.getConditionCols().add( conditionColAge );
ConditionCol conditionColDate = new ConditionCol();
conditionColDate.setBoundName( "c1" );
conditionColDate.setFactType( "Driver" );
conditionColDate.setFactField( "date" );
conditionColDate.setOperator( "==" );
conditionColDate.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
dt.getConditionCols().add( conditionColDate );
ConditionCol conditionColApproved = new ConditionCol();
conditionColApproved.setBoundName( "c1" );
conditionColApproved.setFactType( "Driver" );
conditionColApproved.setFactField( "approved" );
conditionColApproved.setOperator( "==" );
conditionColApproved.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
dt.getConditionCols().add( conditionColApproved );
ConditionCol conditionColAge2 = new ConditionCol();
conditionColAge2.setBoundName( "c1" );
conditionColAge2.setFactType( "Driver" );
conditionColAge2.setFactField( "age" );
conditionColAge2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
dt.getConditionCols().add( conditionColAge2 );
ActionSetFieldCol a = new ActionSetFieldCol();
a.setBoundName( "c1" );
a.setFactField( "name" );
dt.getActionCols().add( a );
ActionSetFieldCol a2 = new ActionSetFieldCol();
a2.setBoundName( "c1" );
a2.setFactField( "age" );
dt.getActionCols().add( a2 );
ActionInsertFactCol ins = new ActionInsertFactCol();
ins.setBoundName( "x" );
ins.setFactType( "Driver" );
ins.setFactField( "name" );
dt.getActionCols().add( ins );
ActionInsertFactCol ins_ = new ActionInsertFactCol();
ins_.setBoundName( "x" );
ins_.setFactType( "Driver" );
ins_.setFactField( "age" );
dt.getActionCols().add( ins_ );
assertEquals( "salience",
dt.getType( salienceAttribute,
sce ) );
assertEquals( "enabled",
dt.getType( enabledAttribute,
sce ) );
assertEquals( SuggestionCompletionEngine.TYPE_STRING,
dt.getType( conditionColName,
sce ) );
assertEquals( SuggestionCompletionEngine.TYPE_NUMERIC,
dt.getType( conditionColAge,
sce ) );
assertEquals( SuggestionCompletionEngine.TYPE_DATE,
dt.getType( conditionColDate,
sce ) );
assertEquals( SuggestionCompletionEngine.TYPE_BOOLEAN,
dt.getType( conditionColApproved,
sce ) );
assertEquals( SuggestionCompletionEngine.TYPE_STRING,
dt.getType( a,
sce ) );
assertEquals( SuggestionCompletionEngine.TYPE_NUMERIC,
dt.getType( a2,
sce ) );
assertEquals( SuggestionCompletionEngine.TYPE_STRING,
dt.getType( ins,
sce ) );
assertEquals( SuggestionCompletionEngine.TYPE_NUMERIC,
dt.getType( ins_,
sce ) );
assertEquals( SuggestionCompletionEngine.TYPE_NUMERIC,
dt.getType( conditionColAge2,
sce ) );
}