tester.assertRenderedPage(basePage.getClass());
assertEquals(3, countItmes());
assertNotNull(getSecurityNamedServiceConfig("default"));
XMLRoleServiceConfig xmlConfig=
(XMLRoleServiceConfig)
getSecurityNamedServiceConfig("default2");
assertNotNull(xmlConfig);
assertEquals("default2",xmlConfig.getName());
assertEquals(XMLRoleService.class.getName(),xmlConfig.getClassName());
assertNull(xmlConfig.getAdminRoleName());
assertEquals("abc.xml",xmlConfig.getFileName());
assertEquals(5000,xmlConfig.getCheckInterval());
assertEquals(true,xmlConfig.isValidating());
// reload from manager
xmlConfig=
(XMLRoleServiceConfig)
getSecurityManager().loadRoleServiceConfig("default2");
assertNotNull(xmlConfig);
assertEquals("default2",xmlConfig.getName());
assertEquals(XMLRoleService.class.getName(),xmlConfig.getClassName());
assertNull(xmlConfig.getAdminRoleName());
assertEquals("abc.xml",xmlConfig.getFileName());
assertEquals(5000,xmlConfig.getCheckInterval());
assertEquals(true,xmlConfig.isValidating());
// test add with name clash
clickAddNew();
//detailsPage = (RoleTabbedPage) tester.getLastRenderedPage();
newFormTester();
setSecurityConfigClassName(XMLRoleServicePanelInfo.class);
newFormTester();
setSecurityConfigName("default2");
clickSave(); // should not work
tester.assertRenderedPage(SecurityNamedServiceNewPage.class);
testErrorMessagesWithRegExp(".*default2.*");
clickCancel();
tester.assertRenderedPage(basePage.getClass());
// end test add with name clash
// start test modify
clickNamedServiceConfig("default");
tester.assertRenderedPage(SecurityNamedServiceEditPage.class);
//detailsPage = (RoleTabbedPage) tester.getLastRenderedPage();
newFormTester("panel:panel:panel:form");
tester.debugComponentTrees();
formTester.setValue("panel:adminRoleName", "ROLE_ADMINISTRATOR");
//setFileName("abcd.xml");
formTester.setValue("panel:checkInterval", "5001");
//setCheckInterval(5001);
formTester.setValue("panel:validating", true);
//setValidating(true);
clickCancel();
tester.assertRenderedPage(basePage.getClass());
xmlConfig=
(XMLRoleServiceConfig)
getSecurityNamedServiceConfig("default");
assertEquals(XMLRoleService.DEFAULT_LOCAL_ADMIN_ROLE,xmlConfig.getAdminRoleName());
assertEquals(XMLRoleService.DEFAULT_LOCAL_GROUP_ADMIN_ROLE,xmlConfig.getGroupAdminRoleName());
assertEquals("roles.xml",xmlConfig.getFileName());
assertEquals(10000,xmlConfig.getCheckInterval());
assertEquals(true,xmlConfig.isValidating());
clickNamedServiceConfig("default2");
//detailsPage = (RoleTabbedPage) tester.getLastRenderedPage();
newFormTester("panel:panel:panel:form");
formTester.setValue("panel:adminRoleName", null);
//setFileName("abcd.xml");
formTester.setValue("panel:checkInterval", "5001");
//setCheckInterval(5001);
formTester.setValue("panel:validating", false);
clickSave();
tester.assertRenderedPage(basePage.getClass());
xmlConfig=
(XMLRoleServiceConfig)
getSecurityNamedServiceConfig("default2");
assertNull(xmlConfig.getAdminRoleName());
assertEquals("abc.xml",xmlConfig.getFileName());
assertEquals(5001,xmlConfig.getCheckInterval());
assertEquals(false,xmlConfig.isValidating());
// reload from manager
xmlConfig=(XMLRoleServiceConfig)
getSecurityManager().loadRoleServiceConfig("default2");
assertNull(xmlConfig.getAdminRoleName());
assertEquals("abc.xml",xmlConfig.getFileName());
assertEquals(5001,xmlConfig.getCheckInterval());
assertEquals(false,xmlConfig.isValidating());
//doRemove("tabbedPanel:panel:removeSelected");
}