Package org.apache.cayenne.di

Examples of org.apache.cayenne.di.Module


            }
        };

        final EventManager eventManager = new MockEventManager();

        Module testModule = new Module() {

            public void configure(Binder binder) {
                final AdhocObjectFactory objectFactory = new DefaultAdhocObjectFactory();
                binder.bind(AdhocObjectFactory.class).toInstance(objectFactory);
               
View Full Code Here


        MockConnection connection = new MockConnection();

        MockDataSource dataSource = new MockDataSource();
        dataSource.setupConnection(connection);

        Module testModule = new Module() {

            public void configure(Binder binder) {
                binder.bind(JdbcEventLogger.class).to(CommonsJdbcEventLogger.class);
                binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
            }
View Full Code Here

    public void testCreatedAdapter_Generic() throws Exception {

        List<DbAdapterDetector> detectors = new ArrayList<DbAdapterDetector>();

        Module testModule = new Module() {

            public void configure(Binder binder) {
                binder.bindMap(Constants.PROPERTIES_MAP);
                binder.bindList(Constants.SERVER_DEFAULT_TYPES_LIST);
                binder.bindList(Constants.SERVER_USER_TYPES_LIST);
View Full Code Here

        DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
        nodeDescriptor.setAdapterType(SybaseAdapter.class.getName());

        List<DbAdapterDetector> detectors = new ArrayList<DbAdapterDetector>();

        Module testModule = new Module() {

            public void configure(Binder binder) {
                binder.bindMap(Constants.PROPERTIES_MAP);
                binder.bindList(Constants.SERVER_DEFAULT_TYPES_LIST);
                binder.bindList(Constants.SERVER_USER_TYPES_LIST);
View Full Code Here

        MockConnection connection = new MockConnection();

        MockDataSource dataSource = new MockDataSource();
        dataSource.setupConnection(connection);

        Module testModule = new Module() {

            public void configure(Binder binder) {
                binder.bind(JdbcEventLogger.class).to(CommonsJdbcEventLogger.class);
                binder.bind(AdhocObjectFactory.class).to(DefaultAdhocObjectFactory.class);
            }
View Full Code Here

        final Transaction tx = mock(Transaction.class);
        final DataDomain domain = mock(DataDomain.class);
        when(domain.createTransaction()).thenReturn(tx);

        Module module = new Module() {

            public void configure(Binder binder) {
                binder.bind(DataDomain.class).toInstance(domain);
            }
        };
View Full Code Here

        assertEquals(Arrays.asList("xxxx"), locations);

        assertEquals(1, runtime.getModules().length);

        Module m0 = runtime.getModules()[0];
        assertTrue(m0 instanceof ServerModule);
        assertEquals("xxxx", ((ServerModule) m0).configurationLocations[0]);
    }
View Full Code Here

        assertEquals(Arrays.asList("xxxx", "yyyy"), locations);

        assertEquals(1, runtime.getModules().length);

        Module m0 = runtime.getModules()[0];
        assertTrue(m0 instanceof ServerModule);
        assertEquals("xxxx", ((ServerModule) m0).configurationLocations[0]);
        assertEquals("yyyy", ((ServerModule) m0).configurationLocations[1]);
    }
View Full Code Here

    public void testConstructor_Modules() {

        final boolean[] configured = new boolean[2];

        Module m1 = new Module() {

            public void configure(Binder binder) {
                configured[0] = true;
            }
        };

        Module m2 = new Module() {

            public void configure(Binder binder) {
                configured[1] = true;
            }
        };
View Full Code Here

            public GraphDiff onSync(ObjectContext originatingContext, GraphDiff changes, int syncType) {
                return null;
            }
        };

        Module module = new Module() {

            public void configure(Binder binder) {
                binder.bind(DataChannel.class).toInstance(channel);
            }
        };
View Full Code Here

TOP

Related Classes of org.apache.cayenne.di.Module

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.