Search in sources :

Example 16 with DiagramElementReference

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")));
}
Also used : RelativeBusinessObjectReference(org.osate.ge.RelativeBusinessObjectReference) DiagramReference(org.osate.ge.tests.endToEnd.util.DiagramReference) DiagramElementReference(org.osate.ge.tests.endToEnd.util.DiagramElementReference)

Example 17 with DiagramElementReference

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);
}
Also used : RelativeBusinessObjectReference(org.osate.ge.RelativeBusinessObjectReference) DiagramReference(org.osate.ge.tests.endToEnd.util.DiagramReference) DiagramElementReference(org.osate.ge.tests.endToEnd.util.DiagramElementReference)

Aggregations

DiagramElementReference (org.osate.ge.tests.endToEnd.util.DiagramElementReference)17 DiagramReference (org.osate.ge.tests.endToEnd.util.DiagramReference)13 RelativeBusinessObjectReference (org.osate.ge.RelativeBusinessObjectReference)10 Test (org.junit.Test)2 AadlReferenceUtil (org.osate.ge.aadl2.internal.AadlReferenceUtil)2 OsateGeTestCommands (org.osate.ge.tests.endToEnd.util.OsateGeTestCommands)2 OsateGeTestUtil (org.osate.ge.tests.endToEnd.util.OsateGeTestUtil)2 UiTestUtil (org.osate.ge.tests.endToEnd.util.UiTestUtil)2 Objects (java.util.Objects)1 BiFunction (java.util.function.BiFunction)1 Shell (org.eclipse.swt.widgets.Shell)1 DirectionType (org.osate.aadl2.DirectionType)1 BehaviorAnnexReferenceUtil (org.osate.ge.ba.BehaviorAnnexReferenceUtil)1 EditEmbeddedTextDialog (org.osate.ge.ba.ui.EditEmbeddedTextDialog)1 BehaviorStatePropertySection (org.osate.ge.ba.ui.properties.BehaviorStatePropertySection)1 BehaviorTransitionPropertySection (org.osate.ge.ba.ui.properties.BehaviorTransitionPropertySection)1 ErrorModelReferenceUtil (org.osate.ge.errormodel.ErrorModelReferenceUtil)1 KeywordPropagationPointType (org.osate.ge.errormodel.model.KeywordPropagationPointType)1 ErrorFlowPropertySection (org.osate.ge.errormodel.ui.properties.ErrorFlowPropertySection)1 ErrorModelLibraryPropertySection (org.osate.ge.errormodel.ui.properties.ErrorModelLibraryPropertySection)1