Package org.apache.cayenne.remote

Examples of org.apache.cayenne.remote.ClientConnection


    public void testCommitChangesPrimitives() {

        DataContext dataContext = createDataContext();

        ClientConnection connection = new LocalConnection(new ClientServerChannel(
                getDomain()));
        ClientChannel channel = new ClientChannel(connection);
        CayenneContext context = new CayenneContext(channel);
        ClientMtTableBool obj = context.newObject(ClientMtTableBool.class);
View Full Code Here


        public void prePersist(Object entity) {
        }
            });

            ClientConnection connection = new LocalConnection(csChannel);
            ClientChannel channel = new ClientChannel(connection);

            CayenneContext context = new CayenneContext(channel);

            context.newObject(ClientMtTable1.class);
View Full Code Here

            callbackRegistry.addListener(
                    LifecycleEvent.POST_ADD,
                    MtTable1.class,
                    "prePersistMethod");

            ClientConnection connection = new LocalConnection(csChannel);
            ClientChannel channel = new ClientChannel(connection);

            CayenneContext context = new CayenneContext(channel);

            Persistent clientObject = context.newObject(ClientMtTable1.class);
View Full Code Here

        public void prePersist(Object entity) {
        }
            });

            ClientConnection connection = new LocalConnection(csChannel);
            ClientChannel channel = new ClientChannel(connection);

            CayenneContext context = new CayenneContext(channel);

            ClientMtTable1 object = context.newObject(ClientMtTable1.class);
View Full Code Here

        public void prePersist(Object entity) {
        }
            });

            ClientConnection connection = new LocalConnection(csChannel);
            ClientChannel channel = new ClientChannel(connection);

            CayenneContext context = new CayenneContext(channel);

            ClientMtReflexive o1 = context.newObject(ClientMtReflexive.class);
View Full Code Here

            callbackRegistry.clear();
        }
    }

    public void testRollbackChanges() throws Exception {
        ClientConnection connection = new LocalConnection(new ClientServerChannel(
                getDomain()));
        ClientChannel channel = new ClientChannel(connection);

        CayenneContext context = new CayenneContext(channel);
View Full Code Here

    public void testCreateFault() throws Exception {
        createTestData("prepare");

        // must attach to the real channel...
        ClientConnection connection = new LocalConnection(new ClientServerChannel(
                getDomain()));
        ClientChannel channel = new ClientChannel(connection);

        CayenneContext context = new CayenneContext(channel);
        ObjectId id = new ObjectId("MtTable1", MtTable1.TABLE1_ID_PK_COLUMN, new Integer(
View Full Code Here

        };

        ClientLocalRuntime runtime = new ClientLocalRuntime(DIBootstrap
                .createInjector(serverModule), Collections.EMPTY_MAP);

        ClientConnection connection = runtime.getConnection();
        assertNotNull(connection);
        assertTrue(connection instanceof LocalConnection);

        LocalConnection localConnection = (LocalConnection) connection;
        assertTrue(localConnection.getChannel() instanceof ClientServerChannel);
View Full Code Here

        properties.put(Constants.ROP_SERVICE_URL_PROPERTY, "http://localhost/YuM");
        ClientModule module = new ClientModule(properties);

        Injector injector = DIBootstrap.createInjector(module);

        ClientConnection connection = injector.getInstance(ClientConnection.class);
        assertNotNull(connection);
        assertTrue(connection instanceof HessianConnection);

        assertSame("Connection must be a singleton", connection, injector
                .getInstance(ClientConnection.class));
View Full Code Here

        final ClientMtTable1 inflated = new ClientMtTable1();
        inflated.setPersistenceState(PersistenceState.COMMITTED);
        inflated.setObjectId(gid);
        inflated.setGlobalAttribute1("abc");

        ClientConnection connection = mock(ClientConnection.class);
        when(connection.sendMessage((ClientMessage) any())).thenAnswer(
                new Answer<Object>() {

                    public Object answer(InvocationOnMock invocation) {
                        ClientMessage arg = (ClientMessage) invocation.getArguments()[0];
View Full Code Here

TOP

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

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.