Package org.apache.cayenne.remote

Examples of org.apache.cayenne.remote.ClientChannel


        // cached object instead of the one fetched
        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);
        assertEquals(1, response.size());
        List list = response.firstList();
        assertNotNull(list);
        assertEquals(1, list.size());
View Full Code Here


            }
        };

        // default constructor must fail
        try {
            new ClientChannel(connection);
            fail("Channel didn't throw on broken EventBridge");
        }
        catch (CayenneRuntimeException e) {
            // expected
        }

        try {
            new ClientChannel(connection, false, new EventManager(2), false);
            fail("Channel didn't throw on broken EventBridge");
        }
        catch (CayenneRuntimeException e) {
            // expected
        }

        try {
            new ClientChannel(connection, false, new EventManager(2), true);
        }
        catch (CayenneRuntimeException e) {
            fail("Channel threw on broken EventBridge");
        }
    }
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

    public void testMultipleSimpleProperties() {
        DiffCounter serverChannel = new DiffCounter(getDomain());
        LocalConnection connection = new LocalConnection(
                serverChannel,
                LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel channel = new ClientChannel(connection);
        CayenneContext context = new CayenneContext(channel);

        ClientMtTable1 o1 = context.newObject(ClientMtTable1.class);
        o1.setGlobalAttribute1("v1");
        o1.setGlobalAttribute1("v2");
View Full Code Here

    public void testComplimentaryArcs() {
        DiffCounter serverChannel = new DiffCounter(getDomain());
        LocalConnection connection = new LocalConnection(
                serverChannel,
                LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel channel = new ClientChannel(connection);
        CayenneContext context = new CayenneContext(channel);

        ClientMtTable1 o1 = context.newObject(ClientMtTable1.class);
        ClientMtTable2 o2 = context.newObject(ClientMtTable2.class);
        o2.setTable1(o1);
View Full Code Here

    public void testDelete() {
        DiffCounter serverChannel = new DiffCounter(getDomain());
        LocalConnection connection = new LocalConnection(
                serverChannel,
                LocalConnection.HESSIAN_SERIALIZATION);
        ClientChannel channel = new ClientChannel(connection);
        CayenneContext context = new CayenneContext(channel);

        ClientMtTable1 o1 = context.newObject(ClientMtTable1.class);
        o1.setGlobalAttribute1("v1");
        context.deleteObject(o1);
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

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

    public void testValidate() throws Exception {

        deleteTestData();
        DataChannel serverChannel = new ClientServerChannel(getDomain());
        ClientChannel clientChannel = new ClientChannel(
                new LocalConnection(serverChannel),
                true);

        CayenneContext c = 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);

        SelectQuery query = new SelectQuery(ClientMtTable1.class);
        query.setCachePolicy(QueryMetadata.LOCAL_CACHE);
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.