use of org.apache.jackrabbit.core.DefaultSecurityManager in project jackrabbit by apache.
the class SecurityConfigTest method testConfig2.
public void testConfig2() throws ConfigurationException {
Element xml = parseXML(new InputSource(new StringReader(CONFIG_2)), true);
SecurityConfig config = parser.parseSecurityConfig(xml);
assertNotNull(config.getAppName());
assertEquals("Jackrabbit", config.getAppName());
SecurityManagerConfig smc = config.getSecurityManagerConfig();
assertNotNull(smc);
assertTrue(smc.newInstance(JackrabbitSecurityManager.class) instanceof DefaultSecurityManager);
assertNull(smc.getWorkspaceAccessConfig());
assertEquals("security", smc.getWorkspaceName());
assertNull(smc.getUserManagerConfig());
AccessManagerConfig amc = config.getAccessManagerConfig();
assertNotNull(amc);
assertTrue(amc.newInstance(AccessManager.class) instanceof DefaultAccessManager);
LoginModuleConfig lmc = config.getLoginModuleConfig();
assertNotNull(lmc);
assertTrue(lmc.getLoginModule() instanceof DefaultLoginModule);
Properties options = lmc.getParameters();
assertNotNull(options);
assertEquals("anonymous", options.getProperty("anonymousId"));
assertEquals("admin", options.getProperty("adminId"));
assertEquals("org.apache.jackrabbit.TestPrincipalProvider", options.getProperty("principalProvider"));
}
Aggregations