Search in sources :

Example 16 with AutomatedTestSuite

use of com.centurylink.mdw.plugin.designer.model.AutomatedTestSuite in project mdw-designer by CenturyLinkCloud.

the class ProcessExplorerActionGroup method debugApplies.

public boolean debugApplies(IStructuredSelection selection) {
    if (selection.size() != 1 || !(selection.getFirstElement() instanceof WorkflowElement))
        return false;
    WorkflowElement workflowElement = (WorkflowElement) selection.getFirstElement();
    if (workflowElement instanceof AutomatedTestSuite || workflowElement instanceof AutomatedTestCase) {
        WorkflowProject prj = workflowElement.getProject();
        if (prj == null || !prj.checkRequiredVersion(6, 0) || !prj.isUserAuthorizedInAnyGroup(UserRoleVO.PROCESS_EXECUTION))
            return false;
        WorkflowPackage pkg = workflowElement.getPackage();
        if (pkg != null && !pkg.isUserAuthorized(UserRoleVO.PROCESS_EXECUTION))
            return false;
        try {
            AutomatedTestView testView = (AutomatedTestView) MdwPlugin.getActivePage().showView("mdw.views.launch.automatedTest");
            return !testView.isLocked();
        } catch (PartInitException ex) {
            PluginMessages.uiError(ex, "Menu", workflowElement.getProject());
        }
    }
    if (workflowElement instanceof WorkflowProcess || workflowElement instanceof ExternalEvent)
        return !MdwPlugin.isRcp() && workflowElement.isUserAuthorized(UserRoleVO.PROCESS_EXECUTION);
    else
        return false;
}
Also used : WorkflowPackage(com.centurylink.mdw.plugin.designer.model.WorkflowPackage) ExternalEvent(com.centurylink.mdw.plugin.designer.model.ExternalEvent) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) AutomatedTestCase(com.centurylink.mdw.plugin.designer.model.AutomatedTestCase) PartInitException(org.eclipse.ui.PartInitException) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) WorkflowElement(com.centurylink.mdw.plugin.designer.model.WorkflowElement) AutomatedTestSuite(com.centurylink.mdw.plugin.designer.model.AutomatedTestSuite)

Aggregations

AutomatedTestSuite (com.centurylink.mdw.plugin.designer.model.AutomatedTestSuite)16 AutomatedTestCase (com.centurylink.mdw.plugin.designer.model.AutomatedTestCase)14 WorkflowElement (com.centurylink.mdw.plugin.designer.model.WorkflowElement)7 WorkflowProject (com.centurylink.mdw.plugin.project.model.WorkflowProject)7 ArrayList (java.util.ArrayList)7 WorkflowPackage (com.centurylink.mdw.plugin.designer.model.WorkflowPackage)6 List (java.util.List)4 PartInitException (org.eclipse.ui.PartInitException)4 WebLaunchAction (com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction)3 Folder (com.centurylink.mdw.plugin.designer.model.Folder)3 LegacyExpectedResults (com.centurylink.mdw.plugin.designer.model.LegacyExpectedResults)3 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)3 Action (org.eclipse.jface.action.Action)3 IAction (org.eclipse.jface.action.IAction)3 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)3 IWorkbenchAction (org.eclipse.ui.actions.ActionFactory.IWorkbenchAction)3 TestFile (com.centurylink.mdw.designer.testing.TestFile)2 ExternalEvent (com.centurylink.mdw.plugin.designer.model.ExternalEvent)2 File (com.centurylink.mdw.plugin.designer.model.File)2 JarFile (com.centurylink.mdw.plugin.designer.model.JarFile)2