Package org.apache.openejb.test.object

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


        }
        return data;
    }

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

        try{
        InitialContext ctx = new InitialContext();

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

        } catch (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{
        InitialContext ctx = new InitialContext();

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

        } catch (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{
        InitialContext ctx = new InitialContext();

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

        } catch (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{
        InitialContext ctx = new InitialContext();

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

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

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

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

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

        }
    }

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

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

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

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

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

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

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

        }
    }

    public void test43_returnNestedEJBObject2() {
        try{
            ObjectGraph graph = ejbObject.returnNestedEJBObject();
            assertNotNull("The ObjectGraph is null", graph);

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

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

            EJBMetaData expected = home.getEJBMetaData();
            assertNotNull("The EJBMetaData returned is null", expected);

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

            EJBMetaData actual = (EJBMetaData)graph.getObject();
            assertNotNull("The EJBMetaData returned is null", actual);
            assertEquals(expected.getHomeInterfaceClass(), actual.getHomeInterfaceClass());
            assertEquals(expected.getRemoteInterfaceClass(), actual.getRemoteInterfaceClass());
        } catch (Exception e){
            fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
View Full Code Here

        }
    }

    public void test48_returnNestedEJBMetaData2() {
        try{
            ObjectGraph graph = ejbObject.returnNestedEJBMetaData();
            assertNotNull("The ObjectGraph is null", graph);

            EJBMetaData actual = (EJBMetaData)graph.getObject();
            assertNotNull("The EJBMetaData returned is null", actual);
            assertNotNull("The home interface class of the EJBMetaData is null", actual.getHomeInterfaceClass());
            assertNotNull("The remote interface class of the EJBMetaData is null", actual.getRemoteInterfaceClass());
        } catch (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.