Package org.apache.cayenne

Examples of org.apache.cayenne.MockDataChannel


    }

    public void testOnQuery() {

        final boolean[] genericDone = new boolean[1];
        MockDataChannel parent = new MockDataChannel(new EntityResolver()) {

            @Override
            public QueryResponse onQuery(ObjectContext context, Query query) {
                genericDone[0] = true;
                return super.onQuery(context, query);
View Full Code Here


    }

    public void testOnQuery() {

        final boolean[] genericDone = new boolean[1];
        MockDataChannel parent = new MockDataChannel(new EntityResolver()) {

            @Override
            public QueryResponse onQuery(ObjectContext context, Query query) {
                genericDone[0] = true;
                return super.onQuery(context, query);
View Full Code Here

    }

    public void testOnQuery() {

        final boolean[] genericDone = new boolean[1];
        MockDataChannel parent = new MockDataChannel(new EntityResolver()) {

            @Override
            public QueryResponse onQuery(ObjectContext context, Query query) {
                genericDone[0] = true;
                return super.onQuery(context, query);
View Full Code Here

public class TestLocalConnectionTest extends TestCase {

    public void testBlockUnblock() {

        UnitLocalConnection c = new UnitLocalConnection(new MockDataChannel());
        assertFalse(c.isBlockingMessages());

        c.setBlockingMessages(true);
        assertTrue(c.isBlockingMessages());
View Full Code Here

    }

    public void testOnQuery() {

        final boolean[] genericDone = new boolean[1];
        MockDataChannel parent = new MockDataChannel(new EntityResolver()) {

            @Override
            public QueryResponse onQuery(ObjectContext context, Query query) {
                genericDone[0] = true;
                return super.onQuery(context, query);
View Full Code Here

public class DispatchHelperTest extends TestCase {

    public void testBootstrapMessage() {
        EntityResolver resolver = new EntityResolver();
        MockDataChannel channel = new MockDataChannel(resolver);
        assertSame(resolver.getClientEntityResolver(), DispatchHelper.dispatch(
                channel,
                new BootstrapMessage()));
    }
View Full Code Here

                new BootstrapMessage()));
    }

    public void testUnknownMessage() {
        try {
            DispatchHelper.dispatch(new MockDataChannel(), new MockMessage());
            fail("Unknown message must have failed");
        }
        catch (CayenneRuntimeException e) {
            // expected
        }
View Full Code Here

/**
*/
public class LocalConnectionTest extends TestCase {

    public void testConstructors() {
        DataChannel handler1 = new MockDataChannel();
        LocalConnection connector1 = new LocalConnection(handler1);
        assertFalse(connector1.isSerializingMessages());
        assertSame(handler1, connector1.getChannel());

        DataChannel handler2 = new MockDataChannel();
        LocalConnection connector2 = new LocalConnection(
                handler2,
                LocalConnection.JAVA_SERIALIZATION);
        assertTrue(connector2.isSerializingMessages());
        assertSame(handler2, connector2.getChannel());
View Full Code Here

TOP

Related Classes of org.apache.cayenne.MockDataChannel

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.