}
@Test
@SuppressWarnings("serial")
public void testRowExpansionWithValuesListAndDefaultValues() {
GuidedDecisionTable52 model = new GuidedDecisionTable52();
final ProjectDataModelOracle projectLoader = ProjectDataModelOracleBuilder.newProjectOracleBuilder()
.addFact( "Driver" )
.addField( new ModelField( "age",
Integer.class.getName(),
ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS,
ModelField.FIELD_ORIGIN.DECLARED,
FieldAccessorsAndMutators.BOTH,
DataType.TYPE_NUMERIC_INTEGER ) )
.addField( new ModelField( "name",
String.class.getName(),
ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS,
ModelField.FIELD_ORIGIN.DECLARED,
FieldAccessorsAndMutators.BOTH,
DataType.TYPE_STRING ) )
.addField( new ModelField( "dateOfBirth",
Boolean.class.getName(),
ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS,
ModelField.FIELD_ORIGIN.DECLARED,
FieldAccessorsAndMutators.BOTH,
DataType.TYPE_DATE ) )
.end()
.build();
//Emulate server-to-client conversions
final AsyncPackageDataModelOracle oracle = new AsyncPackageDataModelOracleImpl();
final PackageDataModelOracleBaselinePayload dataModel = new PackageDataModelOracleBaselinePayload();
dataModel.setModelFields( projectLoader.getProjectModelFields() );
populateDataModelOracle( mock( Path.class ),
model,
oracle,
dataModel );
Pattern52 p1 = new Pattern52();
p1.setBoundName( "c1" );
p1.setFactType( "Driver" );
ConditionCol52 c1 = new ConditionCol52();
c1.setFactField( "name" );
c1.setOperator( "==" );
c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
c1.setValueList( "c1a,c1b" );
c1.setDefaultValue( new DTCellValue52( "c1default" ) );
p1.getChildColumns().add( c1 );
model.getConditions().add( p1 );
Pattern52 p2 = new Pattern52();
p2.setBoundName( "c2" );
p2.setFactType( "Driver" );
ConditionCol52 c2 = new ConditionCol52();
c2.setFactField( "age" );
c2.setOperator( "==" );
c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
c2.setValueList( "c2a,c2b" );
c2.setDefaultValue( new DTCellValue52( "c2default" ) );
p2.getChildColumns().add( c2 );
model.getConditions().add( p2 );
Pattern52 p3 = new Pattern52();
p3.setBoundName( "c3" );
p3.setFactType( "Driver" );
ConditionCol52 c3 = new ConditionCol52();
c3.setFactField( "dateOfBirth" );
c3.setOperator( "==" );
c3.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
c3.setDefaultValue( new DTCellValue52( "c3default" ) );
p3.getChildColumns().add( c3 );
model.getConditions().add( p3 );
RowExpander re = new RowExpander( model,
oracle );
assertEquals( 5,