use of com.centurylink.mdw.plugin.designer.model.AutomatedTestSuite in project mdw-designer by CenturyLinkCloud.
the class WorkflowElementActionHandler method refresh.
public void refresh(WorkflowElement element) {
if (element instanceof WorkflowProject) {
final WorkflowProject workflowProject = (WorkflowProject) element;
workflowProject.clear();
workflowProject.fireElementChangeEvent(workflowProject, ChangeType.SETTINGS_CHANGE, null);
BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
public void run() {
if (!workflowProject.isFilePersist())
syncOpenEditors(workflowProject);
}
});
} else if (element instanceof AutomatedTestSuite) {
AutomatedTestSuite testSuite = (AutomatedTestSuite) element;
testSuite.readLegacyCases();
testSuite.fireElementChangeEvent(testSuite, ChangeType.SETTINGS_CHANGE, null);
} else if (element instanceof AutomatedTestCase) {
AutomatedTestCase testCase = (AutomatedTestCase) element;
testCase.setTestCase(testCase.getTestCase());
testCase.fireElementChangeEvent(testCase, ChangeType.SETTINGS_CHANGE, null);
}
}
use of com.centurylink.mdw.plugin.designer.model.AutomatedTestSuite in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method createDebugAction.
private IAction createDebugAction() {
IAction action = new Action() {
@Override
public void run() {
if (!debugApplies(getSelection()))
return;
view.setFocus();
Object element = getSelection().getFirstElement();
if (element instanceof AutomatedTestSuite || element instanceof AutomatedTestCase)
actionHandler.debugTest(getSelection());
else
actionHandler.debug((WorkflowElement) element);
}
};
ImageDescriptor imageDesc = MdwPlugin.getImageDescriptor("icons/debug.gif");
action.setImageDescriptor(imageDesc);
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "debug");
action.setText("Debug...");
return action;
}
use of com.centurylink.mdw.plugin.designer.model.AutomatedTestSuite in project mdw-designer by CenturyLinkCloud.
the class ProcessExplorerActionGroup method createRunFromStartPageAction.
private IAction createRunFromStartPageAction() {
IAction action = new Action() {
@Override
public void run() {
if (!runFromPageApplies(getSelection()))
return;
view.setFocus();
Object element = getSelection().getFirstElement();
if (element instanceof AutomatedTestSuite || element instanceof AutomatedTestCase)
actionHandler.test(getSelection());
else if (element instanceof File && ((File) element).getParent() instanceof AutomatedTestCase && TestCase.LEGACY_TEST_CASE_FILENAMES.values().contains(((File) element).getName()))
actionHandler.test(getSelection());
else
actionHandler.runFromPage((WorkflowElement) element);
}
};
ImageDescriptor imageDesc = MdwPlugin.getImageDescriptor(ICON_RUN_GIF);
action.setImageDescriptor(imageDesc);
action.setId(MdwMenuManager.MDW_MENU_PREFIX + "run.start.page");
action.setText("Run Start Page...");
return action;
}
use of com.centurylink.mdw.plugin.designer.model.AutomatedTestSuite in project mdw-designer by CenturyLinkCloud.
the class AutomatedTestLaunchShortcut method createLaunchConfiguration.
protected ILaunchConfigurationWorkingCopy createLaunchConfiguration(WorkflowElement element, boolean debug) throws CoreException, JSONException {
String testName = null;
List<String> testCases = new ArrayList<>();
WorkflowProject workflowProject = element.getProject();
WorkflowPackage workflowPackage = null;
boolean isLegacyLaunch = false;
if (element instanceof WorkflowProject) {
testName = workflowProject.getName();
testCases = workflowProject.getTestCaseStringList();
} else if (element instanceof WorkflowPackage) {
workflowPackage = (WorkflowPackage) element;
testName = workflowPackage.getName();
testCases = workflowPackage.getTestCaseStringList();
} else if (element instanceof AutomatedTestCase) {
AutomatedTestCase testCase = (AutomatedTestCase) element;
if (testCase.isLegacy()) {
testName = workflowProject.getName() + LEGACY;
isLegacyLaunch = true;
} else {
workflowPackage = testCase.getPackage();
testName = workflowPackage.getName();
}
testCases = new ArrayList<>();
if (testCase.isPostman() && testCase.getItems() != null && workflowPackage != null) {
testCases.addAll(workflowPackage.getTestCaseItems(testCase));
} else
testCases.add(testCase.getPath());
} else if (element instanceof AutomatedTestSuite) {
testName = workflowProject.getName() + LEGACY;
isLegacyLaunch = true;
testCases = ((AutomatedTestSuite) element).getTestCaseStringList();
}
return createLaunchConfiguration(workflowProject, workflowPackage, isLegacyLaunch, testName, testCases, debug);
}
use of com.centurylink.mdw.plugin.designer.model.AutomatedTestSuite in project mdw-designer by CenturyLinkCloud.
the class AutomatedTestContentProvider method inputChanged.
/**
* Registers this content provider as a listener to changes on the new input
* (for workflow element changes), and deregisters the viewer from the old
* input. In response to these ElementChangeEvents, we update the viewer.
*/
@SuppressWarnings("unchecked")
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
this.treeViewer = (TreeViewer) viewer;
if (oldInput != null) {
List<AutomatedTestSuite> oldSuites = (List<AutomatedTestSuite>) oldInput;
for (AutomatedTestSuite oldSuite : oldSuites) {
oldSuite.removeElementChangeListener(this);
oldSuite.getProject().removeElementChangeListener(this);
}
}
if (newInput != null) {
List<AutomatedTestSuite> newSuites = (List<AutomatedTestSuite>) newInput;
for (AutomatedTestSuite newSuite : newSuites) {
newSuite.addElementChangeListener(this);
newSuite.getProject().addElementChangeListener(this);
}
}
}
Aggregations