{
// there should only be two children
assertEditorHasChildren(2, editor);
// get contents
ShapeNodeEditPart target = assertHasFrame(editor, "target");
assertHasFrame(editor, "other");
// select the first text field and infer!
runAction(getAction(), target);
// save it
editor.doSave(new NullProgressMonitor());
// nothing should be added (remember we are using
// a custom rule set)
assertEditorHasChildren(2, editor);
// however, if we open up the text field, there should be elements
// in here generated
editor_page = openDiagram(target);
checkPartialInferenceEditor();
editor_page.close(false);
editor_page = null;
editor.close(false);
editor = null;
}
// delete the target diagram
IFile model = getProject().getFile(getModel());
IFile modelNew = getProject().getFile("new-model.iaml");
IFile diagramNew = getProject().getFile("new-model.iaml_diagram");
// infer entire model
inferSourceModelFile(model, getFullAction());
getProject().refreshProject();
// try renaming the model file
// (otherwise, it seems only the old diagram is stored in memory, and the test case below fails)
model.move(modelNew.getFullPath(), true, monitor);
getProject().refreshProject();
assertTrue("New model file " + modelNew + " exists", modelNew.exists());
// re-init diagram and reload
initialiseAndLoadDiagram(modelNew, diagramNew);
{
// there should now be three children
assertEditorHasChildren(3, editor);
// get contents
ShapeNodeEditPart target = assertHasFrame(editor, "target");
assertHasFrame(editor, "other");
assertHasFrame(editor, "outside activation");
// however, if we open up the text field, there should be elements
// in here generated