Examples of RealmConfigXMLProcessor


Examples of org.wso2.carbon.user.core.config.RealmConfigXMLProcessor

        realm = new DefaultRealm();

        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(UserCoreConstants.DATA_SOURCE, ds);

        RealmConfigXMLProcessor xmlProcessor = new RealmConfigXMLProcessor();
        InputStream stream = new FileInputStream("target/clear-resources/user-mgt-clear.xml");
        RealmConfiguration configuration = xmlProcessor.buildRealmConfiguration(stream);

        JDBCAuthorizationManager jdbcAuthnManager = new JDBCAuthorizationManager(configuration, properties, null, null, realm, 0);

        String[] roles = jdbcAuthnManager.getAllowedRolesForResource("/permission/admin", "ui.execute");
        assertEquals(roles.length,1);
View Full Code Here

Examples of org.wso2.carbon.user.core.config.RealmConfigXMLProcessor

    public void doUserRoleStuff() throws Exception {
           UserStoreManager admin = realm.getUserStoreManager();

           InputStream inStream = this.getClass().getClassLoader().getResource(JDBCRealmTest.
                                  JDBC_TEST_USERMGT_XML).openStream();
           RealmConfigXMLProcessor realmConfigProcessor = new RealmConfigXMLProcessor();
           RealmConfiguration realmConfig = realmConfigProcessor.buildRealmConfiguration(inStream);

           admin.addRole("role2", null, null);
           admin.addRole("role3", null, null);
           admin.addRole("role4", null, null);
           assertEquals(7, admin.getRoleNames().length);//admin,everyone,role1,role2,role3,role4
View Full Code Here

Examples of org.wso2.carbon.user.core.config.RealmConfigXMLProcessor

        DatabaseCreator creator = new DatabaseCreator(ds);
        creator.createRegistryDatabase();
       
        this.addIntialData(ds);
        RealmConfigXMLProcessor builder = new RealmConfigXMLProcessor();
        InputStream inStream = this.getClass().getClassLoader().getResource(
                "adv-jdbc-readonly-test.xml").openStream();
        RealmConfiguration realmConfig = builder.buildRealmConfiguration(inStream);
        inStream.close();
        realm = new DefaultRealm();
        realm.init(realmConfig, ClaimTestUtil.getClaimTestData(), ClaimTestUtil
                .getProfileTestData(), 0);
        assertTrue(realm.getUserStoreManager().isExistingRole("adminx"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.