Examples of ObjectGraph


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

        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

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

        }
    }

    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

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

            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

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

        }
    }

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

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

Examples of org.eclipse.persistence.jaxb.ObjectGraph

     * @param entity An entity to create object graph for.
     * @param fields A list of entity attributes.
     * @return Object graph
     */
    private ObjectGraph createObjectGraph(final Object entity, final List<String> fields) {
        ObjectGraph objectGraph = getJAXBContext().createObjectGraph(entity.getClass());
        objectGraph.addAttributeNodes("_persistence_links", "_persistence_relationshipInfo");
        for (String field : fields) {
            objectGraph.addAttributeNodes(field);
        }
        return objectGraph;
    }
View Full Code Here

Examples of org.glassfish.jersey.message.filtering.spi.ObjectGraph

                                 final Class<?> entityClass, final Map<String, ObjectGraph> entitySubgraphs) {
        final Set<String> processed = Sets.newHashSet();

        for (final Map.Entry<String, ObjectGraph> entry : entitySubgraphs.entrySet()) {
            final Subgraph subgraph = graph.addSubgraph(entry.getKey());
            final ObjectGraph entityGraph = entry.getValue();

            final Set<String> fields = entityGraph.getFields(entry.getKey());
            if (!fields.isEmpty()) {
                subgraph.addAttributeNodes(fields.toArray(new String[fields.size()]));
            }

            final Map<String, ObjectGraph> subgraphs = entityGraph.getSubgraphs(entry.getKey());
            if (!subgraphs.isEmpty()) {
                final Class<?> subEntityClass = entityGraph.getEntityClass();

                processed.add(getProcessedSubgraph(entityClass, entry.getKey(), subEntityClass));
                createSubgraphs(entry.getKey(), subgraph, subEntityClass, subgraphs, processed);
            }
        }
View Full Code Here

Examples of org.openejb.test.object.ObjectGraph

        try {
            Object obj = initialContext.lookup("client/tests/stateless/EncBean");
            EncStatelessHome expected = (EncStatelessHome) obj;
            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) graph.getObject();
            assertNotNull("The EJBHome returned is null", actual);
        } catch (Exception e) {
            fail("Received Exception " + e.getClass() + " : " + e.getMessage());
        }
    }
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.