TestDTO thisTest = null;
//plugin is selected?
if (selection instanceof PlugInDTO) {
// create a new validation test object
PlugInDTO plugin = (PlugInDTO) selection;
Validation newTest = null;
try {
newTest = processor.createValidation(plugin);
} catch (Exception e1) {
// log the exception and return
MessageDialog
.openError(
PlatformUI.getWorkbench()
.getActiveWorkbenchWindow()
.getShell(),
"Exception Occurred", e1.getClass().toString() + " " + e1.getMessage()); //$NON-NLS-1$//$NON-NLS-2$
ValidationPlugin.log(e1.getMessage(), e1);
return null;
}
// determine which TestSuiteDTO to use (for now, use the default)
String testSuiteDTOKey = defaultTestSuite;
// add the validation to the processor (creates a testDTO
// and adds the validation to the appropriate lookup)
processor.addValidation(newTest, plugin, testSuiteDTOKey);
// if a defaultTypeRef exists, set any typeRefs to that value
if ((defaultTypeRef != null) && defaultTypeRef.length() > 0) {
thisTest = (TestDTO) processor.getTests().get(newTest.getName());
Map args = thisTest.getArgs();
for (Iterator i = args.keySet().iterator(); i.hasNext();) {
ArgumentDTO arg = (ArgumentDTO) args.get(i.next());
String argName = arg.getName();
//is it a typeRef?