Package org.jboss.as.test.integration.security.common.ejb3

Examples of org.jboss.as.test.integration.security.common.ejb3.HelloBean


        resp.setContentType("text/plain");
        final PrintWriter writer = resp.getWriter();
        final String jndiName = req.getParameter(PARAM_JNDI_NAME);
        try {
            final Context ctx = new InitialContext();
            final Hello ejbObject = (Hello) ctx.lookup(jndiName);
            final String msg = ejbObject.sayHello();
            LOGGER.info(msg);
            writer.append(msg);
            ctx.close();
        } catch (NamingException ex) {
            LOGGER.warn("Unable to get EJB.", ex);
View Full Code Here


     */
    @Test
    public void testAuthorizedClient() throws Exception {
        final Properties env = configureEjbClient(CLIENT_AUTHORIZED_NAME);
        InitialContext ctx = new InitialContext(env);
        final Hello helloBean = (Hello) ctx.lookup(HELLOBEAN_LOOKUP_NAME);
        assertEquals(HelloBean.HELLO_WORLD, helloBean.sayHelloWorld());
        ctx.close();
    }
View Full Code Here

     */
    @Test
    public void testNotAuthorizedClient() throws Exception {
        final Properties env = configureEjbClient(CLIENT_NOT_AUTHORIZED_NAME);
        InitialContext ctx = new InitialContext(env);
        final Hello helloBean = (Hello) ctx.lookup(HELLOBEAN_LOOKUP_NAME);
        try {
            helloBean.sayHelloWorld();
            fail("The EJB call should fail for unauthorized client.");
        } catch (EJBAccessException e) {
            //OK
        }
        ctx.close();
View Full Code Here

TOP

Related Classes of org.jboss.as.test.integration.security.common.ejb3.HelloBean

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.