// there should only be two children
// open page
ShapeNodeEditPart page = assertHasFrame(editor, "container");
DiagramDocumentEditor editor_page = openDiagram(page);
try {
ShapeNodeEditPart form = assertHasInputForm(editor_page, "target form", false);
// lets run the action
runAction(new RefreshFormMappingsWithDrools(), form);
// the current editor should still be the same
// should have three children
assertEditorHasChildren(3, editor_page);
assertHasInputForm(editor_page, "target form", false);
// open input form
DiagramDocumentEditor editor_form = openDiagram(form);
try {
assertEditorVisual(editor_form);
// no longer empty!
// text fields in the form
assertEditorHasChildren(6, editor_form);
ShapeNodeEditPart a1 = assertHasInputTextField(editor_form, "attribute one", false);
assertGenerated(a1);
ShapeNodeEditPart a2 = assertHasInputTextField(editor_form, "attribute two", false);
assertGenerated(a2);
ShapeNodeEditPart a3 = assertHasInputTextField(editor_form, "attribute three", false);
assertGenerated(a3);
// attribute instances in the iterator
ShapeNodeEditPart d1 = assertHasDomainAttributeInstance(editor_form, "attribute one", true);
assertGenerated(d1);
ShapeNodeEditPart d2 = assertHasDomainAttributeInstance(editor_form, "attribute two", true);
assertGenerated(d2);
ShapeNodeEditPart d3 = assertHasDomainAttributeInstance(editor_form, "attribute three", true);
assertGenerated(d3);
// conneced by SyncWires
ConnectionNodeEditPart s1 = assertHasSyncWire(editor_form, a1, d1, "sync");
assertGenerated(s1);
ConnectionNodeEditPart s2 = assertHasSyncWire(editor_form, a2, d2, "sync");
assertGenerated(s2);
ConnectionNodeEditPart s3 = assertHasSyncWire(editor_form, a3, d3, "sync");
assertGenerated(s3);
} finally {
editor_form.close(false);
}
} finally {
editor_page.close(false);
}