Package org.apache.cayenne

Examples of org.apache.cayenne.DataChannel


        assertEquals(new Integer(1), count.get("x"));
    }

    public void testGetParentDataDomain() {
        DataDomain dd = getDomain();
        DataChannel decorator = new DataChannelDecorator(dd);
        DataContext context = new DataContext(decorator, new ObjectStore(dd
                .getSharedSnapshotCache()));

        assertSame(dd, context.getParentDataDomain());
    }
View Full Code Here


    protected void blockContextQueries() {
        context.setChannel(new BlockingDataChannel(context.getChannel()));
    }

    protected void unblockContextQueries() {
        DataChannel channel = context.getChannel();
        if (channel instanceof BlockingDataChannel) {
            context.setChannel(((BlockingDataChannel) channel).getChannel());
        }
    }
View Full Code Here

        ItestSetup.initInstance();
        InstrumentUtil.getInstrumentation().addTransformer(initEnhancer());
    }

    protected static ClassFileTransformer initEnhancer() {
        DataChannel channel = ItestSetup.getInstance().getDataDomain();
        return new Enhancer(
                new CayenneEnhancerVisitorFactory(channel.getEntityResolver()));
    }
View Full Code Here

    @Inject
    protected DbAdapter adapter;

    public DBHelper get() throws ConfigurationException {

        DataChannel channel = serverRuntimeProvider.get().getChannel();
        DataMap firstMap = channel.getEntityResolver().getDataMaps().iterator().next();
        return new FlavoredDBHelper(dataSourceFactory.getSharedDataSource(),
                adapter.getQuotingStrategy(firstMap.isQuotingSQLIdentifiers()));
    }
View Full Code Here

        super(serverInjector);
    }

    @Override
    public DataChannel get() throws ConfigurationException {
        DataChannel clientServerChannel = super.get();
        return new ClientServerDataChannelDecorator(clientServerChannel);
    }
View Full Code Here

        assertTrue(m0 instanceof ClientModule);
    }

    public void testGetConnection() {

        final DataChannel channel = new DataDomain("xMn2");

        Module serverModule = new Module() {

            public void configure(Binder binder) {
                binder.bind(ObjectContextFactory.class).toInstance(
View Full Code Here

        // create and initialize provide instance to test
        DataDomainProvider provider = new DataDomainProvider();
        injector.injectMembers(provider);

        DataChannel channel = provider.get();
        assertNotNull(channel);

        assertTrue(channel instanceof DataDomain);

        DataDomain domain = (DataDomain) channel;
View Full Code Here

            }
        };

        ClientRuntime runtime = new ClientRuntime(properties, extraModule);

        DataChannel channel = runtime.getChannel();
        assertNotNull(channel);
        assertTrue(channel instanceof ClientChannel);
    }
View Full Code Here

            }
        };

        Injector injector = DIBootstrap.createInjector(module);

        DataChannel channel = injector.getInstance(DataChannel.class);
        assertNotNull(channel);
        assertTrue(channel instanceof ClientChannel);
        assertSame("DataChannel must be a singleton", channel, injector
                .getInstance(DataChannel.class));
View Full Code Here

            }
        };

        Injector injector = DIBootstrap.createInjector(module);

        DataChannel channel = injector.getInstance(DataChannel.class);
        ClientChannel clientChannel = (ClientChannel) channel;
        assertTrue(clientChannel.isChannelEventsEnabled());
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.DataChannel

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.