Examples of CayenneRuntime


Examples of org.apache.cayenne.configuration.CayenneRuntime

        CayenneFilter filter = new CayenneFilter();

        assertNull(WebUtil.getCayenneRuntime(context));
        filter.init(config);

        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
        assertNotNull(runtime);
        List<?> locations = runtime.getInjector().getInstance(
                Key.get(List.class, DataDomainProvider.LOCATIONS_LIST));

        assertEquals(Arrays.asList("cayenne-abc.xml"), locations);
        assertEquals(2, runtime.getModules().length);
        assertTrue(runtime.getModules()[0] instanceof ServerModule);
        assertTrue(runtime.getModules()[1] instanceof WebModule);

        RequestHandler handler = runtime.getInjector().getInstance(RequestHandler.class);
        assertTrue(handler instanceof SessionContextRequestHandler);
    }
View Full Code Here

Examples of org.apache.cayenne.configuration.CayenneRuntime

        config.setServletContext(context);

        ROPHessianServlet servlet = new ROPHessianServlet();
        servlet.init(config);

        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
        assertNotNull(runtime);

        List<?> locations = runtime.getInjector().getInstance(
                Key.get(List.class, DataDomainProvider.LOCATIONS_LIST));

        assertEquals(Arrays.asList(name + ".xml"), locations);
        assertEquals(2, runtime.getModules().length);
        assertTrue(runtime.getModules()[0] instanceof ServerModule);
        assertTrue(runtime.getModules()[1] instanceof ROPServerModule);

        assertTrue(RemoteService.class.equals(servlet.getAPIClass()));
    }
View Full Code Here

Examples of org.apache.cayenne.configuration.CayenneRuntime

        config.setServletContext(context);

        ROPHessianServlet servlet = new ROPHessianServlet();
        servlet.init(config);

        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
        assertNotNull(runtime);

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

        assertTrue(runtime.getModules()[0] instanceof ServerModule);
        assertTrue(runtime.getModules()[1] instanceof ROPServerModule);
        assertTrue(runtime.getModules()[2] instanceof MockModule1);
        assertTrue(runtime.getModules()[3] instanceof MockModule2);

        RequestHandler handler = runtime.getInjector().getInstance(RequestHandler.class);
        assertTrue(handler instanceof MockRequestHandler);
    }
View Full Code Here

Examples of org.apache.cayenne.configuration.CayenneRuntime

        config.setupServletContext(context);

        CayenneFilter filter = new CayenneFilter();
        filter.init(config);

        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
        assertNotNull(runtime);

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

        assertTrue(runtime.getModules()[0] instanceof ServerModule);
        assertTrue(runtime.getModules()[1] instanceof WebModule);
        assertTrue(runtime.getModules()[2] instanceof MockModule1);
        assertTrue(runtime.getModules()[3] instanceof MockModule2);

        RequestHandler handler = runtime.getInjector().getInstance(RequestHandler.class);
        assertTrue(handler instanceof MockRequestHandler);
    }
View Full Code Here

Examples of org.apache.cayenne.configuration.CayenneRuntime

                .getName());

        ROPHessianServlet servlet = new ROPHessianServlet();

        servlet.init(config);
        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
        assertTrue(runtime.getModules()[2] instanceof ROPHessianServlet_ConfigModule);

        assertTrue(RemoteService.class.equals(servlet.getAPIClass()));

        // TODO: mock servlet request to check that the right service instance is invoked
    }
View Full Code Here

Examples of org.apache.cayenne.configuration.CayenneRuntime

        config.setupServletContext(context);

        CayenneFilter filter = new CayenneFilter();
        filter.init(config);

        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
        CayenneFilter_DispatchRequestHandler handler = (CayenneFilter_DispatchRequestHandler) runtime
                .getInjector()
                .getInstance(RequestHandler.class);

        assertEquals(0, handler.getStarted());
        assertEquals(0, handler.getEnded());
View Full Code Here

Examples of org.apache.cayenne.configuration.CayenneRuntime

    public void testGetCayenneRuntime() {
        MockServletContext context = new MockServletContext();

        assertNull(WebUtil.getCayenneRuntime(context));

        CayenneRuntime runtime = new CayenneRuntime() {
        };

        WebUtil.setCayenneRuntime(context, runtime);
        assertSame(runtime, WebUtil.getCayenneRuntime(context));

        CayenneRuntime runtime1 = new CayenneRuntime() {
        };

        WebUtil.setCayenneRuntime(context, runtime1);
        assertSame(runtime1, WebUtil.getCayenneRuntime(context));
View Full Code Here

Examples of org.apache.cayenne.configuration.CayenneRuntime

        CayenneFilter filter = new CayenneFilter();

        assertNull(WebUtil.getCayenneRuntime(context));
        filter.init(config);

        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
        assertNotNull(runtime);

        List<?> locations = runtime.getInjector().getInstance(
                Key.get(List.class, Constants.SERVER_PROJECT_LOCATIONS_LIST));

        assertEquals(Arrays.asList("abc.xml"), locations);
    }
View Full Code Here

Examples of org.apache.cayenne.configuration.CayenneRuntime

        config.setupServletContext(context);

        CayenneFilter filter = new CayenneFilter();
        filter.init(config);

        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
        assertNotNull(runtime);
        List<?> locations = runtime.getInjector().getInstance(
                Key.get(List.class, Constants.SERVER_PROJECT_LOCATIONS_LIST));

        assertEquals(Arrays.asList("xyz"), locations);
    }
View Full Code Here

Examples of org.apache.cayenne.configuration.CayenneRuntime

        CayenneFilter filter = new CayenneFilter();

        assertNull(WebUtil.getCayenneRuntime(context));
        filter.init(config);

        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
        assertNotNull(runtime);
        List<?> locations = runtime.getInjector().getInstance(
                Key.get(List.class, Constants.SERVER_PROJECT_LOCATIONS_LIST));

        assertEquals(Arrays.asList("cayenne-abc.xml"), locations);
        assertEquals(2, runtime.getModules().length);
        assertTrue(runtime.getModules()[0] instanceof ServerModule);
        assertTrue(runtime.getModules()[1] instanceof WebModule);

        RequestHandler handler = runtime.getInjector().getInstance(RequestHandler.class);
        assertTrue(handler instanceof SessionContextRequestHandler);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.