Package org.apache.harmony.auth.login

Examples of org.apache.harmony.auth.login.DefaultConfiguration


       
        String oldp = System.getProperty(LOGIN_CONFIG);
        try {
        System.setProperty(LOGIN_CONFIG,
                new File(otherConfFile).getCanonicalPath());
        DefaultConfiguration dc = new DefaultConfiguration();
        assertNotNull(dc);
       
        ents = dc.getAppConfigurationEntry("Login2");
        assertNotNull(ents);
        ents = dc.getAppConfigurationEntry("other");
        assertNotNull(ents);
        ents = dc.getAppConfigurationEntry("Login1");
        assertNotNull(ents);
        Map<String, String> m = new HashMap<String, String>();
        for (AppConfigurationEntry element : ents) {
            assertEquals("com.intel.security.auth.module.LoginModule1",
                    element.getLoginModuleName());
            m.clear();
            m.put("debug1", "true");
            m.put("test1", "false");
            assertEquals(m, element.getOptions());
            assertEquals("LoginModuleControlFlag: required", element
                    .getControlFlag().toString());
        }
       
        ents = dc.getAppConfigurationEntry("Login7");
        assertNotNull(ents);

       
        assertEquals("com.intel.security.auth.module.LoginModule1", ents[0].getLoginModuleName());
        assertEquals("com.intel.security.auth.module.LoginModule2", ents[1].getLoginModuleName());
View Full Code Here


        String oldp = System.getProperty(LOGIN_CONFIG);
        try {
            System.setProperty(LOGIN_CONFIG,
                    new File(otherConfFile).getCanonicalPath());

        DefaultConfiguration dc = new DefaultConfiguration();
        MySecurityManager checker = new MySecurityManager(new AuthPermission(
                "refreshLoginConfiguration"), true);
        System.setSecurityManager(checker);
        dc.refresh();
        assertTrue(checker.checkAsserted);
        checker.reset();
        checker.enableAccess = false;
        try {
            dc.refresh();
            fail("No expected SecurityException");
        } catch (SecurityException ex) {
        }
        } finally {
            TestUtils.setSystemProperty(LOGIN_CONFIG, oldp);
View Full Code Here

       
        String oldp = System.getProperty(LOGIN_CONFIG);
        try {
        System.setProperty(LOGIN_CONFIG,
                new File(otherConfFile).getCanonicalPath());
        DefaultConfiguration dc = new DefaultConfiguration();
        assertNotNull(dc);
       
        ents = dc.getAppConfigurationEntry("Login2");
        assertNotNull(ents);
        ents = dc.getAppConfigurationEntry("other");
        assertNotNull(ents);
        ents = dc.getAppConfigurationEntry("Login1");
        assertNotNull(ents);
        Map<String, String> m = new HashMap<String, String>();
        for (AppConfigurationEntry element : ents) {
            assertEquals("com.intel.security.auth.module.LoginModule1",
                    element.getLoginModuleName());
            m.clear();
            m.put("debug1", "true");
            m.put("test1", "false");
            assertEquals(m, element.getOptions());
            assertEquals("LoginModuleControlFlag: required", element
                    .getControlFlag().toString());
        }
       
        ents = dc.getAppConfigurationEntry("Login7");
        assertNotNull(ents);

       
        assertEquals("com.intel.security.auth.module.LoginModule1", ents[0].getLoginModuleName());
        assertEquals("com.intel.security.auth.module.LoginModule2", ents[1].getLoginModuleName());
View Full Code Here

        String oldp = System.getProperty(LOGIN_CONFIG);
        try {
            System.setProperty(LOGIN_CONFIG,
                    new File(otherConfFile).getCanonicalPath());

        DefaultConfiguration dc = new DefaultConfiguration();
        MySecurityManager checker = new MySecurityManager(new AuthPermission(
                "refreshLoginConfiguration"), true);
        System.setSecurityManager(checker);
        dc.refresh();
        assertTrue(checker.checkAsserted);
        checker.reset();
        checker.enableAccess = false;
        try {
            dc.refresh();
            fail("No expected SecurityException");
        } catch (SecurityException ex) {
        }
        } finally {
            TestUtils.setSystemProperty(LOGIN_CONFIG, oldp);
View Full Code Here

TOP

Related Classes of org.apache.harmony.auth.login.DefaultConfiguration

Copyright © 2018 www.massapicom. 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.