Search in sources :

Example 66 with ILaunchConfigurationType

use of org.eclipse.debug.core.ILaunchConfigurationType in project mdw-designer by CenturyLinkCloud.

the class AutomatedTestLaunchShortcut method findExistingLaunchConfiguration.

private ILaunchConfiguration findExistingLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy) throws CoreException {
    String wcWorkflowProject = workingCopy.getAttribute(AutomatedTestLaunchConfiguration.WORKFLOW_PROJECT, "");
    String wcWorkflowPackage = workingCopy.getAttribute(AutomatedTestLaunchConfiguration.WORKFLOW_PACKAGE, "");
    boolean wcIsLegacyLaunch = workingCopy.getAttribute(AutomatedTestLaunchConfiguration.IS_LEGACY_LAUNCH, false);
    ILaunchConfigurationType configType = workingCopy.getType();
    ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(configType);
    for (ILaunchConfiguration launchConfig : configs) {
        String workflowProject = launchConfig.getAttribute(AutomatedTestLaunchConfiguration.WORKFLOW_PROJECT, "");
        String workflowPackage = launchConfig.getAttribute(AutomatedTestLaunchConfiguration.WORKFLOW_PACKAGE, "");
        boolean isLegacyLaunch = launchConfig.getAttribute(AutomatedTestLaunchConfiguration.IS_LEGACY_LAUNCH, false);
        if (wcIsLegacyLaunch != isLegacyLaunch || !wcWorkflowPackage.equals(workflowPackage) || !wcWorkflowProject.equals(workflowProject))
            continue;
        return launchConfig;
    }
    return null;
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) ILaunchConfigurationType(org.eclipse.debug.core.ILaunchConfigurationType)

Example 67 with ILaunchConfigurationType

use of org.eclipse.debug.core.ILaunchConfigurationType in project mdw-designer by CenturyLinkCloud.

the class CucumberLaunchShortcut method createLaunchConfiguration.

protected ILaunchConfigurationWorkingCopy createLaunchConfiguration(IProject project, IFolder folder, String launchName, List<String> testCases) throws CoreException {
    ILaunchConfigurationType configType = getLaunchManager().getLaunchConfigurationType(TYPE_ID);
    ILaunchConfigurationWorkingCopy wc = configType.newInstance(project, getLaunchManager().generateLaunchConfigurationName(launchName));
    wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
    if (folder != null)
        wc.setAttribute(CucumberLaunchConfiguration.FOLDER, folder.getProjectRelativePath().toString());
    wc.setAttribute(CucumberLaunchConfiguration.FEATURES, testCases);
    wc.setAttribute(CucumberLaunchConfiguration.GLUE, CucumberLaunchConfiguration.DEFAULT_GLUE);
    wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, CucumberLaunchConfiguration.DEFAULT_ARGS);
    return wc;
}
Also used : ILaunchConfigurationType(org.eclipse.debug.core.ILaunchConfigurationType) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)

Example 68 with ILaunchConfigurationType

use of org.eclipse.debug.core.ILaunchConfigurationType in project mdw-designer by CenturyLinkCloud.

the class ProcessLaunchShortcut method createLaunchConfiguration.

protected ILaunchConfigurationWorkingCopy createLaunchConfiguration(String typeId, WorkflowProcess processVersion, boolean debug) throws CoreException {
    WorkflowProject workflowProject = processVersion.getProject();
    ILaunchConfigurationType configType = getLaunchManager().getLaunchConfigurationType(typeId);
    String launchConfigName = getUniqueLaunchConfigName(processVersion);
    ILaunchConfigurationWorkingCopy wc = configType.newInstance(workflowProject.getSourceProject(), launchConfigName);
    wc.setAttribute(ProcessLaunchConfiguration.WORKFLOW_PROJECT, workflowProject.getName());
    wc.setAttribute(ProcessLaunchConfiguration.PROCESS_NAME, processVersion.getName());
    wc.setAttribute(ProcessLaunchConfiguration.PROCESS_VERSION, processVersion.getVersionString());
    if (debug) {
        wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, workflowProject.getSourceProject().getName());
        wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_CONNECTOR, "org.eclipse.jdt.launching.socketAttachConnector");
        wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CONNECT_MAP, getDefaultConnectArgs(workflowProject));
    }
    wc.setContainer(null);
    return wc;
}
Also used : ILaunchConfigurationType(org.eclipse.debug.core.ILaunchConfigurationType) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)

Example 69 with ILaunchConfigurationType

use of org.eclipse.debug.core.ILaunchConfigurationType in project mdw-designer by CenturyLinkCloud.

the class ProcessLaunchShortcut method getUniqueLaunchConfigName.

protected String getUniqueLaunchConfigName(WorkflowProcess processVersion) throws CoreException {
    String name = processVersion.getName();
    ILaunchConfigurationType configType = getLaunchManager().getLaunchConfigurationType(PROCESS_LAUNCH_CONFIG_TYPE);
    ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(configType);
    for (ILaunchConfiguration launchConfig : configs) {
        if (launchConfig.getName().equals(name)) {
            name = processVersion.getName() + " (" + processVersion.getProject().getName() + ")";
            break;
        }
    }
    return getLaunchManager().generateLaunchConfigurationName(name);
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) ILaunchConfigurationType(org.eclipse.debug.core.ILaunchConfigurationType)

Example 70 with ILaunchConfigurationType

use of org.eclipse.debug.core.ILaunchConfigurationType in project mdw-designer by CenturyLinkCloud.

the class ExternalEventLaunchShortcut method findExistingLaunchConfiguration.

private ILaunchConfiguration findExistingLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy) throws CoreException {
    String wcWorkflowProject = workingCopy.getAttribute(ExternalEventLaunchConfiguration.WORKFLOW_PROJECT, "");
    String wcMessagePattern = workingCopy.getAttribute(ExternalEventLaunchConfiguration.EVENT_NAME, "");
    ILaunchConfigurationType configType = workingCopy.getType();
    ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(configType);
    for (ILaunchConfiguration launchConfig : configs) {
        String workflowProject = launchConfig.getAttribute(ExternalEventLaunchConfiguration.WORKFLOW_PROJECT, "");
        String messagePattern = launchConfig.getAttribute(ExternalEventLaunchConfiguration.EVENT_NAME, "");
        if (!wcWorkflowProject.equals(workflowProject) || !wcMessagePattern.equals(messagePattern))
            continue;
        return launchConfig;
    }
    return null;
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) ILaunchConfigurationType(org.eclipse.debug.core.ILaunchConfigurationType)

Aggregations

ILaunchConfigurationType (org.eclipse.debug.core.ILaunchConfigurationType)91 ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)62 ILaunchManager (org.eclipse.debug.core.ILaunchManager)54 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)50 CoreException (org.eclipse.core.runtime.CoreException)43 ArrayList (java.util.ArrayList)19 HashMap (java.util.HashMap)8 IPath (org.eclipse.core.runtime.IPath)8 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)6 Path (org.eclipse.core.runtime.Path)6 ILaunch (org.eclipse.debug.core.ILaunch)6 File (java.io.File)5 IOException (java.io.IOException)5 Map (java.util.Map)5 IProject (org.eclipse.core.resources.IProject)5 IResource (org.eclipse.core.resources.IResource)4 IStatus (org.eclipse.core.runtime.IStatus)4 List (java.util.List)3 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)3 WorkflowProject (com.centurylink.mdw.plugin.project.model.WorkflowProject)2