List attributeKeys = form.getAttributeKeys();
List attributeValues = form.getAttributeValues();
ServletContext context = getServlet().getServletContext();
ValidationConfig validationConfig = (ValidationConfig) context.getAttribute(ValidationConfig.CONFIG_KEY);
TestSuiteConfig suiteConfig = (TestSuiteConfig) request.getSession().getAttribute(TestSuiteConfig.CURRENTLY_SELECTED_KEY);
TestConfig testConfig = (TestConfig) request.getSession().getAttribute(TestConfig.CURRENTLY_SELECTED_KEY);
//this allows renaming. If they change the test's name, we just remove it add a new one
suiteConfig.removeTest(testConfig.getName());
testConfig.setName(name);
testConfig.setDescription(description);
for (int i = 0; i < attributeKeys.size(); i++) {
System.out.println((String) attributeKeys.get(i)+"="+ (String) attributeValues.get(i));
System.out.println(testConfig.getArgs());
String val = (String) attributeValues.get(i);
if(val != null && val != "")
testConfig.setArgStringValue((String) attributeKeys.get(i), val);
}
suiteConfig.addTest(testConfig);
getApplicationState().notifyConfigChanged();
request.getSession().removeAttribute(TestConfig.CURRENTLY_SELECTED_KEY);
return mapping.findForward("validationTest");