public void testFormalizedComponentClassOperationDTAssignement() throws CoreException { Component_c component = Component_c.ComponentInstance( modelRoot, new ClassQueryInterface_c() { public boolean evaluate(Object candidate) { return ((Component_c) candidate).getName().equals("IF Scope Test Component"); } }); assertNotNull(component); if (!component.Isformal()) formalizeComponent(component); Operation_c op = Operation_c.OperationInstance(modelRoot); OperationO_TFRPropertySource ps = new OperationO_TFRPropertySource(op); ps.getPropertyDescriptors(); ps.setPropertyValue("DataType", "component_ref"); DataType_c dt = DataType_c.getOneS_DTOnR116(op); SystemModel_c testSys = null; if (testGlobals) { testSys = SystemModel_c.getOneS_SYSOnR9100( GlobalElementInSystem_c.getOneG_EISOnR9100( PackageableElement_c.getOnePE_PEOnR8001(dt))); } else { testSys = SystemModel_c.getOneS_SYSOnR4402(SystemDatatypeInPackage_c.getOneSLD_SDINPOnR4401(dt)); } assertTrue("The chosen dt was not a system level one as expected.", testSys != null); }
@Override protected void setUp() throws Exception { if (!initialized) { super.setUp(); final IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); loadProject(projectName); m_sys = SystemModel_c.SystemModelInstance( Ooaofooa.getDefaultInstance(), new ClassQueryInterface_c() { public boolean evaluate(Object candidate) { return ((SystemModel_c) candidate).getName().equals(project.getName()); } }); m_sys.getPersistableComponent().loadComponentAndChildren(new NullProgressMonitor()); dispatchEvents(0); initialized = true; } }
public void testMCModelConsistency() throws Exception { testMCModelConsistencyPassed = false; test_id = String.valueOf(modelNumber + 1); EclipseOoaofooa.setPersistEnabled(true); final String fileName = testModel.getName(); this.loadProject(fileName); SystemModel_c system = SystemModel_c.SystemModelInstance( Ooaofooa.getDefaultInstance(), new ClassQueryInterface_c() { public boolean evaluate(Object candidate) { return ((SystemModel_c) candidate).getName().equals(fileName); } }); BaseTest.dispatchEvents(0); modelRoot.checkDomainConsistency(); // Graphics cannot be checked until Bugzilla 1156 has been // addressed. // OoaofgraphicsUtil.checkGraphicsConsistency(modelRoot.getId()); testMCModelConsistencyPassed = true; }
public boolean performFinish() { TransactionUtil.TransactionGroup transactionGroup = null; ModelRoot modelRoot = v_asyncMessage.getModelRoot(); try { transactionGroup = TransactionUtil.startTransactionsOnSelectedModelRoots( "Instance Event Formalize"); //$NON-NLS-1$ Message_c v_message = Message_c.getOneMSG_MOnR1018(v_asyncMessage); InteractionParticipant_c v_participant = InteractionParticipant_c.getOneSQ_POnR1007(v_message); Lifespan_c v_ls = Lifespan_c.getOneSQ_LSOnR930(v_participant); ClassInstanceParticipant_c v_cip = ClassInstanceParticipant_c.getOneSQ_CIPOnR930( InteractionParticipant_c.getOneSQ_POnR940(v_ls)); ModelClass_c v_cipclass = (ModelClass_c) modelRoot.getInstanceList(ModelClass_c.class).getGlobal(null, Gd_c.Null_unique_id()); if (((v_cip != null))) { v_cipclass = ModelClass_c.getOneO_OBJOnR934(v_cip); } else { v_cip = ClassInstanceParticipant_c.getOneSQ_CIPOnR930( InteractionParticipant_c.getOneSQ_POnR1007(v_message)); if (((v_cip != null))) { Communication_c v_communication = Communication_c.getOneCOMM_COMMOnR1126( ParticipantInCommunication_c.getOneCOMM_PICOnR1126( InteractionParticipant_c.getOneSQ_POnR930(v_cip))); if (((v_communication != null))) { v_cipclass = ModelClass_c.getOneO_OBJOnR934(v_cip); } } } if (((v_cipclass != null))) { StateMachineEvent_c v_evt = StateMachineEvent_c.getOneSM_EVTOnR1009( EventMessage_c.getOneMSG_EOnR1019(v_asyncMessage)); java.util.UUID v_existingId = Gd_c.Null_unique_id(); if (((v_evt != null))) { v_existingId = v_evt.getSmevt_id(); } StateMachine_c v_stateMachine = StateMachine_c.getOneSM_SMOnR517(InstanceStateMachine_c.getOneSM_ISMOnR518(v_cipclass)); StateMachine_c[] v_machines = StateMachine_c.getManySM_SMsOnR517( InstanceStateMachine_c.getManySM_ISMsOnR518( ModelClass_c.getManyO_OBJsOnR8001( PackageableElement_c.getManyPE_PEsOnR8000( Package_c.getManyEP_PKGsOnR1405( SystemModel_c.getManyS_SYSsOnR1405( Package_c.getManyEP_PKGsOnR8000( PackageableElement_c.getManyPE_PEsOnR8001( v_cipclass)))))))); if (((v_machines.length == 0))) { v_machines = StateMachine_c.getManySM_SMsOnR517( InstanceStateMachine_c.getManySM_ISMsOnR518( ModelClass_c.getManyO_OBJsOnR2( Subsystem_c.getManyS_SSsOnR1( Domain_c.getManyS_DOMsOnR1( Subsystem_c.getManyS_SSsOnR2(v_cipclass)))))); } if (((v_Message != null))) { if (v_asyncMessage != null) { v_asyncMessage.Formalizewithevent(v_Message.getSmevt_id()); } else { Throwable t = new Throwable(); t.fillInStackTrace(); CorePlugin.logError("Attempted to call an operation on a null instance.", t); } } } // catch all exceptions and cancel the transaction } catch (Exception e) { if (transactionGroup != null) TransactionUtil.cancelTransactions(transactionGroup, e); CorePlugin.logError("Transaction: Instance Event Formalize failed", e); // $NON-NLS-1$ // return true so that the wizard will // close return true; } if (transactionGroup != null) TransactionUtil.endTransactions(transactionGroup); if (m_viewer != null) { if (m_viewer instanceof StructuredViewer) { ((StructuredViewer) m_viewer).refresh(v_asyncMessage); } else { m_viewer.refresh(); } } return true; }
public void onPageEntry() { Ooaofooa modelRoot = Selection.getModelRoot( (StructuredSelection) ((CommunicationInstanceEventFormalizeOnMSG_AMWizard) getWizard()).getSelection()); // cache for previous user selections StateMachineEvent_c v_Message = ((CommunicationInstanceEventFormalizeOnMSG_AMWizard) getWizard()).v_Message; // cache for context AsynchronousMessage_c v_asyncMessage = ((CommunicationInstanceEventFormalizeOnMSG_AMWizard) getWizard()).v_asyncMessage; ClassInstanceParticipant_c v_cip = ((CommunicationInstanceEventFormalizeOnMSG_AMWizard) getWizard()).v_cip; if (((v_asyncMessage != null))) { if (((v_cip != null))) { Message_c v_message = Message_c.getOneMSG_MOnR1018(v_asyncMessage); InteractionParticipant_c v_participant = InteractionParticipant_c.getOneSQ_POnR930(v_cip); ModelClass_c v_mclass = ModelClass_c.getOneO_OBJOnR934(v_cip); if (((v_mclass != null))) { StateMachineEvent_c v_evt = StateMachineEvent_c.getOneSM_EVTOnR1009( EventMessage_c.getOneMSG_EOnR1019(v_asyncMessage)); java.util.UUID v_existingId = Gd_c.Null_unique_id(); if (((v_evt != null))) { v_existingId = v_evt.getSmevt_id(); } StateMachine_c v_stateMachine = StateMachine_c.getOneSM_SMOnR517(InstanceStateMachine_c.getOneSM_ISMOnR518(v_mclass)); StateMachine_c[] v_machines = StateMachine_c.getManySM_SMsOnR517( InstanceStateMachine_c.getManySM_ISMsOnR518( ModelClass_c.getManyO_OBJsOnR8001( PackageableElement_c.getManyPE_PEsOnR8000( Package_c.getManyEP_PKGsOnR1405( SystemModel_c.getManyS_SYSsOnR1405( Package_c.getManyEP_PKGsOnR8000( PackageableElement_c.getManyPE_PEsOnR8001( v_mclass)))))))); if (((v_machines.length == 0))) { v_machines = StateMachine_c.getManySM_SMsOnR517( InstanceStateMachine_c.getManySM_ISMsOnR518( ModelClass_c.getManyO_OBJsOnR2( Subsystem_c.getManyS_SSsOnR1( Domain_c.getManyS_DOMsOnR1( Subsystem_c.getManyS_SSsOnR2(v_mclass)))))); } if (((v_Message != null))) {} } } } }
@Override protected void setUp() throws Exception { if (!initialized) delayGlobalUpgrade = true; super.setUp(); if (!initialized) { CorePlugin.disableParseAllOnResourceChange(); // set perspective switch dialog on launch DebugUIPlugin.getDefault() .getPluginPreferences() .setValue(IDebugUIConstants.PLUGIN_ID + ".switch_to_perspective", "always"); CorePlugin.getDefault() .getPluginPreferences() .setDefault(BridgePointPreferencesStore.ALLOW_IMPLICIT_COMPONENT_ADDRESSING, true); CorePlugin.getDefault() .getPluginPreferences() .setValue(BridgePointPreferencesStore.SHOW_EVENT_PARAMETERS, true); // initialize test model final IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); File sourceProject = new File(m_workspace_path + "../" + projectName); TestingUtilities.copyProjectContents(sourceProject, project); TestingUtilities.allowJobCompletion(); TestingUtilities.allowJobCompletion(); m_sys = SystemModel_c.SystemModelInstance( Ooaofooa.getDefaultInstance(), new ClassQueryInterface_c() { public boolean evaluate(Object candidate) { return ((SystemModel_c) candidate).getName().equals(project.getName()); } }); PersistableModelComponent sys_comp = m_sys.getPersistableComponent(); sys_comp.loadComponentAndChildren(new NullProgressMonitor()); CorePlugin.enableParseAllOnResourceChange(); TestingUtilities.allowJobCompletion(); while (!ResourcesPlugin.getWorkspace().getRoot().isSynchronized(IProject.DEPTH_INFINITE)) { ResourcesPlugin.getWorkspace() .getRoot() .refreshLocal(IProject.DEPTH_INFINITE, new NullProgressMonitor()); while (PlatformUI.getWorkbench().getDisplay().readAndDispatch()) ; } Ooaofooa.setPersistEnabled(true); delayGlobalUpgrade = false; initialized = true; } }