Package org.apache.cayenne.di

Examples of org.apache.cayenne.di.Module


public class ServletContextHandlerTest extends TestCase {

    public void testRequestStart_bindContext() {

        Module module = new Module() {

            public void configure(Binder binder) {

                binder.bind(DataChannel.class).to(MockDataChannel.class);
                binder.bind(ObjectContextFactory.class).toInstance(
View Full Code Here


    public void testDefaultConstructor() {
        ClientRuntime runtime = new ClientRuntime(Collections.EMPTY_MAP);
        assertEquals(1, runtime.getModules().length);

        Module m0 = runtime.getModules()[0];
        assertTrue(m0 instanceof ClientModule);
    }
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

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

        Collection<Module> modules = new ArrayList<Module>();

        modules.add(new Module() {

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

        modules.add(new Module() {

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

    public void testGetDataChannel() {

        Map<String, String> properties = new HashMap<String, String>();

        Module extraModule = new Module() {

            public void configure(Binder binder) {

                // use a noop connection to prevent hessian startup errors...
                binder.bind(ClientConnection.class).to(MockClientConnection.class);
View Full Code Here

            }
        };

        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

    public void testFilterCreateModules_Standard() throws Exception {

        MockFilterConfig config = new MockFilterConfig();
        WebConfiguration configuration = new WebConfiguration(config);

        Module m1 = new Module() {

            public void configure(Binder binder) {
            }
        };

        Module m2 = new Module() {

            public void configure(Binder binder) {
            }
        };
View Full Code Here

                MockModule2.class.getName());
        config.setInitParameter(WebConfiguration.EXTRA_MODULES_PARAMETER, exra);

        WebConfiguration configuration = new WebConfiguration(config);

        Module m1 = new Module() {

            public void configure(Binder binder) {
            }
        };

        Module m2 = new Module() {

            public void configure(Binder binder) {
            }
        };
View Full Code Here

                MockModule2.class.getName());
        config.setInitParameter(WebConfiguration.EXTRA_MODULES_PARAMETER, exra);

        WebConfiguration configuration = new WebConfiguration(config);

        Module m1 = new Module() {

            public void configure(Binder binder) {
            }
        };

        Module m2 = new Module() {

            public void configure(Binder binder) {
            }
        };
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

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.