Package org.apache.cayenne.remote

Examples of org.apache.cayenne.remote.ClientChannel


        inflated.setObjectId(gid);
        inflated.setGlobalAttribute1("abc");

        MockClientConnection connection = new MockClientConnection(new GenericResponse(
                Arrays.asList(inflated)));
        ClientChannel channel = new ClientChannel(connection);

        // check that a HOLLOW object is infalted on "beforePropertyRead"
        ClientMtTable1 hollow = new ClientMtTable1();
        hollow.setPersistenceState(PersistenceState.HOLLOW);
        hollow.setObjectId(gid);
View Full Code Here


        inflated.setObjectId(gid);
        inflated.setGlobalAttribute1("abc");

        MockClientConnection connection = new MockClientConnection(new GenericResponse(
                Arrays.asList(inflated)));
        ClientChannel channel = new ClientChannel(connection);

        CayenneContext context = new CayenneContext(channel);
        context.setEntityResolver(getDomain()
                .getEntityResolver()
                .getClientEntityResolver());
View Full Code Here

            // create with this test case DataContext to allow callers to poke on the
            // server side as well as the client
            ClientServerChannel clientServerChannel = new ClientServerChannel(
                    (DataContext) getContext());
            LocalConnection connection = new LocalConnection(clientServerChannel);
            ClientChannel channel = new ClientChannel(connection);
            clientContext = new CayenneContext(channel);
        }

        return clientContext;
    }
View Full Code Here

        ClientServerChannel serverChannel = new ClientServerChannel(getDomain());
        connection = new UnitLocalConnection(
                serverChannel,
                LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel clientChannel = new ClientChannel(connection);
        context = new CayenneContext(clientChannel);
    }
View Full Code Here

    }
   
    private CayenneContext createClientContext() {
        ClientServerChannel serverChannel = new ClientServerChannel(getDomain());
        LocalConnection connection = new LocalConnection(serverChannel);
        ClientChannel clientChannel = new ClientChannel(connection);
        return new CayenneContext(clientChannel);
    }
View Full Code Here

        DataContext context = createDataContext();
        ClientServerChannel clientServerChannel = new ClientServerChannel(context);
        UnitLocalConnection connection = new UnitLocalConnection(
                clientServerChannel,
                LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel channel = new ClientChannel(connection);
        CayenneContext clientContext = new CayenneContext(channel);

        EJBQLQuery query = new EJBQLQuery("SELECT a FROM MtTable1 a");

        List<ClientMtTable1> results = clientContext.performQuery(query);
View Full Code Here

        DataContext context = createDataContext();
        ClientServerChannel clientServerChannel = new ClientServerChannel(context);
        UnitLocalConnection connection = new UnitLocalConnection(
                clientServerChannel,
                LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel channel = new ClientChannel(connection);
        CayenneContext clientContext = new CayenneContext(channel);

        EJBQLQuery query = new EJBQLQuery("SELECT COUNT(a) FROM MtTable1 a");

        List<Long> results = clientContext.performQuery(query);
View Full Code Here

        DataContext context = createDataContext();
        ClientServerChannel clientServerChannel = new ClientServerChannel(context);
        UnitLocalConnection connection = new UnitLocalConnection(
                clientServerChannel,
                LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel channel = new ClientChannel(connection);
        CayenneContext clientContext = new CayenneContext(channel);

        EJBQLQuery query = new EJBQLQuery(
                "SELECT COUNT(a), a, a.serverAttribute1 FROM MtTable1 a Group By a ORDER BY a.serverAttribute1");
View Full Code Here

        o1.setObjectId(oid1);

        MockClientConnection connection = new MockClientConnection(new GenericResponse(
                Arrays.asList(o1)));

        ClientChannel channel = new ClientChannel(connection);

        CayenneContext context = new CayenneContext(channel);
        ObjEntity entity = new ObjEntity("test_entity");
        entity.setClassName(MockPersistentObject.class.getName());

        DataMap dataMap = new DataMap("test");
        dataMap.addObjEntity(entity);
        Collection entities = Collections.singleton(dataMap);
        context.setEntityResolver(new EntityResolver(entities));

        QueryResponse response = channel.onQuery(context, new SelectQuery("test_entity"));
        assertNotNull(response);
        List list = response.firstList();
        assertNotNull(list);
        assertEquals(1, list.size());
        Persistent o1_1 = (Persistent) list.get(0);
View Full Code Here

        MockPersistentObject o2 = new MockPersistentObject(oid);

        MockClientConnection connection = new MockClientConnection(new GenericResponse(
                Arrays.asList(o2)));

        ClientChannel channel = new ClientChannel(connection);

        context.setChannel(channel);
        QueryResponse response = channel.onQuery(context, new SelectQuery("test_entity"));
        assertNotNull(response);

        List list = response.firstList();
        assertNotNull(list);
        assertEquals(1, list.size());
View Full Code Here

TOP

Related Classes of org.apache.cayenne.remote.ClientChannel

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.