Package javax.security.auth.login

Examples of javax.security.auth.login.LoginContext.logout()


        try {
            Map<String, String> result = entryBean.testStatefulBean();
            verifyResult(result, BaseBean.DEPENDENCY_INJECTION, ILLEGAL_STATE, UNSUPPORTED_OPERATION, ILLEGAL_STATE, ILLEGAL_STATE,
                    failureMessages);
        } finally {
            lc.logout();
        }

        if (failureMessages.length() > 0) {
            fail(failureMessages.toString());
        }
View Full Code Here


            for (String current : result.keySet()) {
                log.info(current + " = " + result.get(current));
            }
            verifyResult(result, BaseBean.BUSINESS, USER1, UNSUPPORTED_OPERATION, TRUE, ILLEGAL_STATE, failureMessages);
        } finally {
            lc.logout();
        }

        if (failureMessages.length() > 0) {
            fail(failureMessages.toString());
        }
View Full Code Here

                log.info(current + " = " + result.get(current));
            }
            verifyResult(result, BaseBean.DEPENDENCY_INJECTION, ILLEGAL_STATE, UNSUPPORTED_OPERATION, ILLEGAL_STATE, ILLEGAL_STATE,
                    failureMessages);
        } finally {
            lc.logout();
        }

        if (failureMessages.length() > 0) {
            fail(failureMessages.toString());
        }
View Full Code Here

                log.info(current + " = " + result.get(current));
            }
            verifyResult(result, BaseBean.LIFECYCLE_CALLBACK, ILLEGAL_STATE, UNSUPPORTED_OPERATION, ILLEGAL_STATE, ILLEGAL_STATE,
                    failureMessages);
        } finally {
            lc.logout();
        }

        if (failureMessages.length() > 0) {
            fail(failureMessages.toString());
        }
View Full Code Here

                rolesAllowedOverridenBean.role2Echo("4");
                fail("Expected EJBAccessException not thrown");
            } catch (EJBAccessException ignored) {
            }
        } finally {
            lc.logout();
        }
    }

    @Test
    public void testRolesAllowedOverriden_User2() throws Exception {
View Full Code Here

            response = rolesAllowedOverridenBean.role2Echo("4");
            assertEquals("4", response);

        } finally {
            lc.logout();
        }
    }

    /*
     * Test overrides of bean annotated at bean level with @PermitAll
View Full Code Here

            }

            response = permitAllOverrideBean.role1Echo("3");
            assertEquals("3", response);
        } finally {
            lc.logout();
        }
    }

    /*
     * Test overrides of ben annotated at bean level with @DenyAll
View Full Code Here

            assertEquals("2", response);

            response = denyAllOverrideBean.role1Echo("3");
            assertEquals("3", response);
        } finally {
            lc.logout();
        }
    }

}
View Full Code Here

        lc.login();
        try {
            String response = entryBean.whoAmI();
            assertEquals("user1", response);
        } finally {
            lc.logout();
        }
    }

    @Test
    public void testAuthentication_BadPwd() throws Exception {
View Full Code Here

        try {
            entryBean.whoAmI();
            fail("Expected EJBAccessException due to bad password not thrown. (EJB 3.1 FR 17.6.9)");
        } catch (EJBAccessException ignored) {
        } finally {
            lc.logout();
        }
    }

    @Test
    public void testAuthentication_TwoBeans() throws Exception {
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.