Package org.apache.shiro.env

Examples of org.apache.shiro.env.DefaultEnvironment


        assertSame(plugin.getAuthenticationFilter().getNext(), filter);
    }

    public void testSetEnvironment() {
        ShiroPlugin plugin = new ShiroPlugin();
        Environment env = new DefaultEnvironment();
        plugin.setEnvironment(env);
        assertSame(env, plugin.getEnvironment());
    }
View Full Code Here


        assertTrue(plugin.isAuthenticationEnabled());
    }

    public void testAuthenticationEnabledWhenInstalled() throws Exception {
        ShiroPlugin plugin = new ShiroPlugin();
        plugin.setEnvironment(new DefaultEnvironment());
        plugin.installPlugin(new MutableBrokerFilter(null));

        assertTrue(plugin.isAuthenticationEnabled());

        plugin.setAuthenticationEnabled(false);
View Full Code Here

        assertTrue(plugin.isAuthorizationEnabled());
    }

    public void testAuthorizationEnabledWhenInstalled() throws Exception {
        ShiroPlugin plugin = new ShiroPlugin();
        plugin.setEnvironment(new DefaultEnvironment());
        plugin.installPlugin(new MutableBrokerFilter(null));

        assertTrue(plugin.isAuthorizationEnabled());

        plugin.setAuthorizationEnabled(false);
View Full Code Here

*/
public class ConnectionReferenceTest {

    @Test(expected=IllegalArgumentException.class)
    public void testNoConnectionContext() {
        new ConnectionReference(null, new ConnectionInfo(), new DefaultEnvironment());
    }
View Full Code Here

        new ConnectionReference(null, new ConnectionInfo(), new DefaultEnvironment());
    }

    @Test(expected=IllegalArgumentException.class)
    public void testNoConnectionInfo() {
        new ConnectionReference(new ConnectionContext(), null, new DefaultEnvironment());
    }
View Full Code Here

            public boolean isAuthenticated() {
                return true;
            }
        };
        SubjectConnectionReference sc = new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                new DefaultEnvironment(), subject);

        assertFalse(policy.isAuthenticationRequired(sc));
    }
View Full Code Here

            public PrincipalCollection getPrincipals() {
                return new SimplePrincipalCollection("anonymous", "iniRealm");
            }
        };
        SubjectConnectionReference sc = new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                new DefaultEnvironment(), subject);

        assertFalse(policy.isAuthenticationRequired(sc));
    }
View Full Code Here

            public PrincipalCollection getPrincipals() {
                return new SimplePrincipalCollection("system", "iniRealm");
            }
        };
        SubjectConnectionReference sc = new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                new DefaultEnvironment(), subject);

        assertFalse(policy.isAuthenticationRequired(sc));
    }
View Full Code Here

            public PrincipalCollection getPrincipals() {
                return new SimplePrincipalCollection("system", "iniRealm");
            }
        };
        SubjectConnectionReference sc = new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                new DefaultEnvironment(), subject);

        assertFalse(policy.isAuthenticationRequired(sc));
    }
View Full Code Here

            public PrincipalCollection getPrincipals() {
                return new SimplePrincipalCollection("system", "iniRealm");
            }
        };
        SubjectConnectionReference sc = new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                new DefaultEnvironment(), subject);

        assertTrue(policy.isAuthenticationRequired(sc));
    }
View Full Code Here

TOP

Related Classes of org.apache.shiro.env.DefaultEnvironment

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.