use of org.osate.ge.tests.endToEnd.util.DiagramElementReference in project osate2 by osate.
the class PrototypeEndToEndTest method createInterfacesPackage.
private void createInterfacesPackage() {
//
// Create feature group with prototype
//
createNewPackageWithPackageDiagram(PROTOTYPE_TEST, INTERFACES);
final DiagramReference diagram = defaultDiagram(PROTOTYPE_TEST, INTERFACES);
final DiagramElementReference pkgElement = packageElement(INTERFACES);
final RelativeBusinessObjectReference pkg = getRelativeReferenceForPackage(INTERFACES);
createElementAndLayout(diagram, pkgElement, "Feature Group Type", getClassifierRelativeReference("new_classifier"), "subsystem_interface");
final DiagramElementReference subsystemInterface = element(pkg, getClassifierRelativeReference("subsystem_interface"));
// Create Prototypes
createPrototype(diagram, "subsystem_interface_new_prototype", subsystemInterface);
renamePrototype(diagram, "subsystem_interface_new_prototype", "message_cpt", subsystemInterface);
setPrototypeType(diagram, "message_cpt", "Data", subsystemInterface);
createPrototype(diagram, "subsystem_interface_new_prototype", subsystemInterface);
renamePrototype(diagram, "subsystem_interface_new_prototype", "event_fpt", subsystemInterface);
setPrototypeType(diagram, "event_fpt", "Feature", subsystemInterface);
//
// Create event data port which uses the message prototype
//
createElementAndLayout(diagram, subsystemInterface, "Event Data Port", getFeatureRelativeReference("subsystem_interface_new_feature"), "message_out");
setExtendedOrFeatureClassifierFromPropertiesView(diagram, "interfaces::subsystem_interface.message_cpt", element(pkg, getClassifierRelativeReference("subsystem_interface"), getFeatureRelativeReference("message_out")));
// Create an abstract feature that uses the event feature prototype
createElementAndLayout(diagram, subsystemInterface, "Abstract Feature", getFeatureRelativeReference("subsystem_interface_new_feature"), "events");
// Set direction to output
setFeatureDirectionFromPropertiesView(diagram, "Bidirectional", element(pkg, getClassifierRelativeReference("subsystem_interface"), getFeatureRelativeReference("events")));
setFeaturePrototypeFromPropertiesView(diagram, "interfaces::subsystem_interface.event_fpt", element(pkg, getClassifierRelativeReference("subsystem_interface"), getFeatureRelativeReference("events")));
}
use of org.osate.ge.tests.endToEnd.util.DiagramElementReference in project osate2 by osate.
the class PrototypeEndToEndTest method createSubsystemTypes.
private void createSubsystemTypes() {
final DiagramReference diagram = defaultDiagram(PROTOTYPE_TEST, PROTOTYPE_TEST);
final DiagramElementReference pkgElement = packageElement(PROTOTYPE_TEST);
final RelativeBusinessObjectReference pkg = getRelativeReferenceForPackage(PROTOTYPE_TEST);
// Create subsystem system type
createElementAndLayout(diagram, pkgElement, "System Type", getClassifierRelativeReference("new_classifier"), "subsystem");
final DiagramElementReference subsystem = element(pkg, getClassifierRelativeReference("subsystem"));
// Create feature group prototype
createPrototype(diagram, "subsystem_new_prototype", subsystem);
renamePrototype(diagram, "subsystem_new_prototype", "iface_pt", subsystem);
setPrototypeType(diagram, "iface_pt", "Feature Group", subsystem);
// Create subsystem extension
createElementAndLayout(diagram, pkgElement, "System Type", getClassifierRelativeReference("new_classifier"), "subsystem_ext");
final DiagramElementReference subsystemExt = element(pkg, getClassifierRelativeReference("subsystem_ext"));
setExtendedOrFeatureClassifierFromPropertiesView(diagram, "prototype_test::subsystem", subsystemExt);
// Set bindings
setClassifierBindingsFromPropertiesView(diagram, () -> {
// Edit the binding for iface_pt
clickButton("Choose...", 0);
waitForWindowWithTitle("Select Classifier and Prototype Bindings");
selectListItem(0, "interfaces::subsystem_interface");
clickButton("OK");
}, "iface_pt => interfaces::subsystem_interface", subsystemExt);
}
Aggregations