List<BaseColumn> allColumns = dtable.getExpandedColumns();
List<ActionCol52> allActions = dtable.getActionCols();
//Row 0
List<DTCellValue52> dtRowData0 = DataUtilities.makeDataRowList( data[ 0 ] );
TemplateDataProvider rowDataProvider0 = new GuidedDTTemplateDataProvider( allColumns,
dtRowData0 );
p.doActions( allColumns,
allActions,
rowDataProvider0,
dtRowData0,
rm );
assertEquals( 2,
rm.rhs.length );
assertEquals( "Baddie",
( (ActionInsertFact) rm.rhs[ 0 ] ).getFactType() );
assertEquals( "Smurf",
( (ActionInsertFact) rm.rhs[ 1 ] ).getFactType() );
// examine the first action
ActionInsertFact result0Action1 = (ActionInsertFact) rm.rhs[ 0 ];
assertEquals( 1,
result0Action1.getFieldValues().length );
ActionFieldValue result0Action1FieldValue1 = (ActionFieldValue) result0Action1.getFieldValues()[ 0 ];
assertEquals( DataType.TYPE_STRING,
result0Action1FieldValue1.getType() );
assertEquals( "name",
result0Action1FieldValue1.getField() );
assertEquals( "Gargamel",
result0Action1FieldValue1.getValue() );
// examine the second action
ActionInsertFact result0Action2 = (ActionInsertFact) rm.rhs[ 1 ];
assertEquals( 2,
result0Action2.getFieldValues().length );
ActionFieldValue result0Action2FieldValue1 = (ActionFieldValue) result0Action2.getFieldValues()[ 0 ];
assertEquals( DataType.TYPE_STRING,
result0Action2FieldValue1.getType() );
assertEquals( "name",
result0Action2FieldValue1.getField() );
assertEquals( "$name",
result0Action2FieldValue1.getValue() );
ActionFieldValue result0Action2FieldValue2 = (ActionFieldValue) result0Action2.getFieldValues()[ 1 ];
assertEquals( DataType.TYPE_NUMERIC_INTEGER,
result0Action2FieldValue2.getType() );
assertEquals( "age",
result0Action2FieldValue2.getField() );
assertEquals( "$age",
result0Action2FieldValue2.getValue() );
//Row 1
List<DTCellValue52> dtRowData1 = DataUtilities.makeDataRowList( data[ 1 ] );
TemplateDataProvider rowDataProvider1 = new GuidedDTTemplateDataProvider( allColumns,
dtRowData1 );
p.doActions( allColumns,
allActions,
rowDataProvider1,
dtRowData1,
rm );
assertEquals( 2,
rm.rhs.length );
assertEquals( "Baddie",
( (ActionInsertFact) rm.rhs[ 0 ] ).getFactType() );
assertEquals( "Smurf",
( (ActionInsertFact) rm.rhs[ 1 ] ).getFactType() );
// examine the first action
ActionInsertFact result1Action1 = (ActionInsertFact) rm.rhs[ 0 ];
assertEquals( 1,
result1Action1.getFieldValues().length );
ActionFieldValue result1Action1FieldValue1 = (ActionFieldValue) result1Action1.getFieldValues()[ 0 ];
assertEquals( DataType.TYPE_STRING,
result1Action1FieldValue1.getType() );
assertEquals( "name",
result1Action1FieldValue1.getField() );
assertEquals( "Gargamel",
result1Action1FieldValue1.getValue() );
// examine the second action
ActionInsertFact result1Action2 = (ActionInsertFact) rm.rhs[ 1 ];
assertEquals( 2,
result1Action2.getFieldValues().length );
ActionFieldValue result1Action2FieldValue1 = (ActionFieldValue) result1Action2.getFieldValues()[ 0 ];
assertEquals( DataType.TYPE_STRING,
result1Action2FieldValue1.getType() );
assertEquals( "name",
result1Action2FieldValue1.getField() );
assertEquals( "$name",
result1Action2FieldValue1.getValue() );
ActionFieldValue result1Action2FieldValue2 = (ActionFieldValue) result1Action2.getFieldValues()[ 1 ];
assertEquals( DataType.TYPE_NUMERIC_INTEGER,
result1Action2FieldValue2.getType() );
assertEquals( "age",
result1Action2FieldValue2.getField() );
assertEquals( "$age",
result1Action2FieldValue2.getValue() );
//Row 2
List<DTCellValue52> dtRowData2 = DataUtilities.makeDataRowList( data[ 2 ] );
TemplateDataProvider rowDataProvider2 = new GuidedDTTemplateDataProvider( allColumns,
dtRowData2 );
p.doActions( allColumns,
allActions,
rowDataProvider2,
dtRowData2,