MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),"Problem Occurred", errorMsg); //$NON-NLS-1$
ValidationPlugin.log(errorMsg, new ValidationException());
return;
}
//create a testDTO containing the new validation test and args
TestDTO newTest = new TestDTO();
//set the name, desc, plugin, and args
newTest.setName(validation.getName());
newTest.setDescription(validation.getDescription());
newTest.setPlugIn(plugin);
//create a copy of the map and args
//note: this copies the args from the PlugInDTO
//Map oldArgs = plugin.getArgs();
Map<String, ArgumentDTO> oldArgs = allArgs;
Map<String, ArgumentDTO> newArgs = new HashMap<String, ArgumentDTO>();
for (Iterator i = oldArgs.keySet().iterator(); i.hasNext();) {
ArgumentDTO oldArg = (ArgumentDTO) oldArgs.get(i.next());
ArgumentDTO newArg = (ArgumentDTO) oldArg.clone();
newArgs.put(newArg.getName(), newArg);
}
//store the new args
newTest.setArgs(newArgs);
//add the new test to the appropriate testSuite
Map<String, TestDTO> tests = ((TestSuiteDTO) testSuiteDTOs.get(testSuiteDTOKey)).getTests();
tests.put(newTest.getName(), newTest);
((TestSuiteDTO) testSuiteDTOs.get(testSuiteDTOKey)).setTests(tests);
}