Examples of TuscanyHost


Examples of org.apache.tuscany.tomcat.TuscanyHost

//
//        host.removeChild(ctx);
    }

    public void testServletMapping() throws Exception {
        TuscanyHost tuscanyHost = (TuscanyHost) host;
        host.addChild(ctx);

        MockServlet servlet = new MockServlet();
        tuscanyHost.registerMapping("/testContext/magicServlet", servlet);
        assertSame(ctx, host.map("/testContext/magicServlet"));
        MessageBytes uri = MessageBytes.newInstance();
        uri.setString("/testContext/magicServlet");
        MappingData mappingData = new MappingData();
        ctx.getMapper().map(uri, mappingData);
        assertTrue(mappingData.requestPath.equals("/magicServlet"));

        assertSame(servlet, tuscanyHost.getMapping("/testContext/magicServlet"));
        host.removeChild(ctx);
    }
View Full Code Here

Examples of org.apache.tuscany.tomcat.TuscanyHost

        assertSame(servlet, tuscanyHost.getMapping("/testContext/magicServlet"));
        host.removeChild(ctx);
    }

    public void testServletMappingWithWildard() throws Exception {
        TuscanyHost tuscanyHost = (TuscanyHost) host;
        host.addChild(ctx);

        MockServlet servlet = new MockServlet();
        tuscanyHost.registerMapping("/testContext/magicServlet/*", servlet);
        assertSame(ctx, host.map("/testContext/magicServlet/foo"));
        MessageBytes uri = MessageBytes.newInstance();
        uri.setString("/testContext/magicServlet/foo");
        MappingData mappingData = new MappingData();
        mappingData.recycle();
        ctx.getMapper().map(uri, mappingData);
        assertTrue(mappingData.requestPath.equals("/magicServlet/foo"));

        assertSame(servlet, tuscanyHost.getMapping("/testContext/magicServlet/bar"));
        host.removeChild(ctx);
    }
View Full Code Here

Examples of org.apache.tuscany.tomcat.TuscanyHost

    protected void setUp() throws Exception {
        super.setUp();
        app1 = new File(getClass().getResource("/app1").toURI());
        File baseDir = new File(app1, "../../tomcat").getCanonicalFile();
        setupTomcat(baseDir, new TuscanyHost());
        engine.start();

        TestClassLoader cl = new TestClassLoader(classes, new File(app1, "WEB-INF/classes").toURL(), getClass().getClassLoader());
        cl.start();
        loader = new ContainerLoader(cl);
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.