Package org.apache.openejb.test.object

Examples of org.apache.openejb.test.object.ObjectGraph


        }
        return data;
    }

    public ObjectGraph returnNestedEJBMetaData() throws javax.ejb.EJBException {
        ObjectGraph data = null;

        try {
            final InitialContext ctx = new InitialContext();

            final EncStatelessHome home = (EncStatelessHome) ctx.lookup("java:comp/env/stateless/rmi-iiop/home");
            final EJBMetaData object = home.getEJBMetaData();
            data = new ObjectGraph(object);

        } catch (final Exception e) {
            throw new javax.ejb.EJBException(e);
        }
        return data;
View Full Code Here


        }
        return data;
    }

    public ObjectGraph returnNestedHandle() throws javax.ejb.EJBException {
        ObjectGraph data = null;

        try {
            final InitialContext ctx = new InitialContext();

            final EncStatelessHome home = (EncStatelessHome) ctx.lookup("java:comp/env/stateless/rmi-iiop/home");
            final EncStatelessObject object = home.create();
            data = new ObjectGraph(object.getHandle());

        } catch (final Exception e) {
            throw new javax.ejb.EJBException(e);
        }
        return data;
View Full Code Here

    public Color returnColor() {
        return Color.GREEN;
    }

    public ObjectGraph returnNestedColor() {
        return new ObjectGraph(Color.GREEN);
    }
View Full Code Here

        }
        return data;
    }

    public ObjectGraph returnNestedEJBHome() throws javax.ejb.EJBException {
        ObjectGraph data = null;

        try {
            final InitialContext ctx = new InitialContext();

            final Object object = ctx.lookup("java:comp/env/stateful/rmi-iiop/home");
            data = new ObjectGraph(object);

        } catch (final Exception e) {
            throw new javax.ejb.EJBException(e);
        }
        return data;
View Full Code Here

        }
        return data;
    }

    public ObjectGraph returnNestedEJBObject() throws javax.ejb.EJBException {
        ObjectGraph data = null;

        try {
            final InitialContext ctx = new InitialContext();

            final EncStatefulHome home = (EncStatefulHome) ctx.lookup("java:comp/env/stateful/rmi-iiop/home");
            final EncStatefulObject object = home.create("Test02 StatefulBean");
            data = new ObjectGraph(object);

        } catch (final Exception e) {
            throw new javax.ejb.EJBException(e);
        }
        return data;
View Full Code Here

        }
        return data;
    }

    public ObjectGraph returnNestedEJBMetaData() throws javax.ejb.EJBException {
        ObjectGraph data = null;

        try {
            final InitialContext ctx = new InitialContext();

            final EncStatefulHome home = (EncStatefulHome) ctx.lookup("java:comp/env/stateful/rmi-iiop/home");
            final EJBMetaData object = home.getEJBMetaData();
            data = new ObjectGraph(object);

        } catch (final Exception e) {
            throw new javax.ejb.EJBException(e);
        }
        return data;
View Full Code Here

        }
        return data;
    }

    public ObjectGraph returnNestedHandle() throws javax.ejb.EJBException {
        ObjectGraph data = null;

        try {
            final InitialContext ctx = new InitialContext();

            final EncStatefulHome home = (EncStatefulHome) ctx.lookup("java:comp/env/stateful/rmi-iiop/home");
            final EncStatefulObject object = home.create("Test04 StatefulBean");
            data = new ObjectGraph(object.getHandle());

        } catch (final Exception e) {
            throw new javax.ejb.EJBException(e);
        }
        return data;
View Full Code Here

        try{
            final Object obj = initialContext.lookup("client/tests/singleton/EncBean");
            final EncSingletonHome expected = (EncSingletonHome)javax.rmi.PortableRemoteObject.narrow( obj, EncSingletonHome.class);
            assertNotNull("The EJBHome returned from JNDI is null", expected);

            final ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
            assertNotNull("The ObjectGraph is null", graph);

            final EncSingletonHome actual = (EncSingletonHome)PortableRemoteObject.narrow(graph.getObject(), EncSingletonHome.class);
            assertNotNull("The EJBHome returned is null", actual);
        } catch (final Exception e){
            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
        }
    }
View Full Code Here

        }
    }

    public void test38_returnNestedEJBHome2() {
        try{
            final ObjectGraph graph = ejbObject.returnNestedEJBHome();
            assertNotNull("The ObjectGraph is null", graph);

            final EncSingletonHome actual = (EncSingletonHome)PortableRemoteObject.narrow(graph.getObject(), EncSingletonHome.class);
            assertNotNull("The EJBHome returned is null", actual);
        } catch (final Exception e){
            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
        }
    }
View Full Code Here

            assertNotNull("The EJBHome returned from JNDI is null", home);

            final EncSingletonObject expected = home.create();
            assertNotNull("The EJBObject created is null", expected);

            final ObjectGraph graph = ejbObject.returnObjectGraph(new ObjectGraph(expected));
            assertNotNull("The ObjectGraph is null", graph);

            final EncSingletonObject actual = (EncSingletonObject)PortableRemoteObject.narrow(graph.getObject(), EncSingletonObject.class);
            assertNotNull("The EJBObject returned is null", actual);

            assertTrue("The EJBObejcts are not identical", expected.isIdentical(actual));
        } catch (final Exception e){
            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
View Full Code Here

TOP

Related Classes of org.apache.openejb.test.object.ObjectGraph

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.