private void runVerifier() { Package_c[] pkgs = Package_c.getManyEP_PKGsOnR1401(m_sys); NonRootModelElement[] selectedElement = null; NonRootModelElement[] compRefs = null; NonRootModelElement[] components = null; for (Package_c pkg : pkgs) { if (pkg.getName().equalsIgnoreCase("system")) { components = Component_c.getManyC_CsOnR8001(PackageableElement_c.getManyPE_PEsOnR8000(pkg)); assertNotNull(components); compRefs = ComponentReference_c.getManyCL_ICsOnR8001( PackageableElement_c.getManyPE_PEsOnR8000(pkg)); assertNotNull(compRefs); selectedElement = new NonRootModelElement[components.length + compRefs.length]; System.arraycopy(components, 0, selectedElement, 0, components.length); System.arraycopy(compRefs, 0, selectedElement, components.length, compRefs.length); } } openPerspectiveAndView( "com.mentor.nucleus.bp.debug.ui.DebugPerspective", BridgePointPerspective.ID_MGC_BP_EXPLORER); Selection.getInstance().setSelection(new StructuredSelection(components)); Menu menu = m_bp_tree.getControl().getMenu(); assertTrue( "The Launch Verifier action was not present for a component.", UITestingUtilities.checkItemStatusInContextMenu(menu, "Launch Verifier", "", false)); MenuItem launchVerifierItem = DebugUITestUtilities.getLaunchVerifierItem(menu); assertNotNull(launchVerifierItem); ComponentInstance_c[] engines = ComponentInstance_c.ComponentInstanceInstances(components[0].getModelRoot()); assertTrue( "Unexpected test state, there should be no Component Instances.", engines.length == 0); TestUtil.debugToDialog(200); launchVerifierItem.notifyListeners(SWT.Selection, null); TestingUtilities.processDisplayEvents(); menu = m_bp_tree.getControl().getMenu(); assertFalse( "The Launch Verifier action was present for an unassigned imported component.", UITestingUtilities.menuItemExists(menu, "", "Launch Verifier")); }
/* (non-Javadoc) * @see org.eclipse.ui.IActionFilter#testAttribute(java.lang.Object, java.lang.String, java.lang.String) */ public boolean testAttribute(Object target, String name, String value) { ComponentReference_c x = (ComponentReference_c) target; return x.Actionfilter(name, value); }