Package org.apache.shiro.env

Examples of org.apache.shiro.env.DefaultEnvironment


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

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


        };

        ctx.setConnection(connection);

        SubjectConnectionReference sc = new SubjectConnectionReference(ctx, new ConnectionInfo(),
                new DefaultEnvironment(), new SubjectAdapter());

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

            public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception {
                invoked[0] = true;
            }
        };

        DefaultEnvironment env = new DefaultEnvironment();

        filter.setNext(broker);
        filter.setEnvironment(env);

        Subject subject = new SubjectAdapter() {
View Full Code Here

    SubjectSecurityContext ctx;

    @Before
    public void setUp() {
        SubjectConnectionReference conn = new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                new DefaultEnvironment(), new SubjectAdapter());
        ctx = new SubjectSecurityContext(conn);
    }
View Full Code Here

    @Test(expected = IllegalArgumentException.class)
    public void testNullSecurityContext() {
        SubjectConnectionReference reference =
                new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                        new DefaultEnvironment(), new SubjectAdapter());

        new ConnectionSubjectResolver(reference);
    }
View Full Code Here

    @Test(expected = IllegalArgumentException.class)
    public void testNonSubjectSecurityContext() {
        SubjectConnectionReference reference =
                new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                        new DefaultEnvironment(), new SubjectAdapter());
        reference.getConnectionContext().setSecurityContext(new SecurityContext("") {
            @Override
            public Set<Principal> getPrincipals() {
                return null;
            }
View Full Code Here

    @Test(expected = IllegalStateException.class)
    public void testNullSubject() {

        SubjectConnectionReference reference =
                new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
                        new DefaultEnvironment(), new SubjectAdapter());
        reference.getConnectionContext().setSecurityContext(new SubjectSecurityContext(reference) {
            @Override
            public Subject getSubject() {
                return null;
            }
View Full Code Here

*/
public class SubjectConnectionReferenceTest {

    @Test(expected=IllegalArgumentException.class)
    public void testNullSubject() {
        new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(), new DefaultEnvironment(), null);
    }
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.