Package org.apache.catalina.startup

Examples of org.apache.catalina.startup.Tomcat.start()


        File appDir = new File("test/webapp");
        // app dir is relative to server home
        tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());

        tomcat.start();

        int sc = getUrl("http://localhost:" + getPort() +
                "/test/bug49nnn/bug49297DuplicateAttr.jsp", new ByteChunk(),
                new HashMap<String,List<String>>());
View Full Code Here


        File appDir = new File("test/webapp");
        // app dir is relative to server home
        tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());

        tomcat.start();

        ByteChunk res = new ByteChunk();
        int sc = getUrl("http://localhost:" + getPort() +
                "/test/bug49nnn/bug49297MultipleImport1.jsp", res,
                new HashMap<String,List<String>>());
View Full Code Here

        File appDir = new File("test/webapp");
        // app dir is relative to server home
        tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());

        tomcat.start();

        ByteChunk res = new ByteChunk();
        int sc = getUrl("http://localhost:" + getPort() +
                "/test/bug49nnn/bug49297MultipleImport2.jsp", res,
                new HashMap<String,List<String>>());
View Full Code Here

        File appDir = new File("test/webapp");
        // app dir is relative to server home
        tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());

        tomcat.start();

        ByteChunk res = new ByteChunk();
        int sc = getUrl("http://localhost:" + getPort() +
                "/test/bug49nnn/bug49297MultiplePageEncoding1.jsp", res,
                new HashMap<String,List<String>>());
View Full Code Here

        ErrorPage ep = new ErrorPage();
        ep.setErrorCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        ep.setLocation("/WEB-INF/jsp/error.jsp");
        context.addErrorPage(ep);

        tomcat.start();

        int rc = methodUrl("http://localhost:" + getPort() + "/test/bug56568",
                new ByteChunk(), 5000, null, null, "PUT");

        // Make sure we get the original 500 response and not a 405 response
View Full Code Here

        // Use the test web application so JSP support is available and the
        // default JSP error page can be used.
        File appDir = new File("test/webapp");
        tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());

        tomcat.start();

        int rc = methodUrl("http://localhost:" + getPort() + "/test/jsp/error.jsp",
                new ByteChunk(), 500000, null, null, "PUT");

        // Make sure we get a 200 response and not a 405 response
View Full Code Here

        // Use the test web application so JSP support is available and the
        // default JSP error page can be used.
        File appDir = new File("test/webapp");
        tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());

        tomcat.start();

        int rc = methodUrl("http://localhost:" + getPort() + "/test/jsp/test.jsp",
                new ByteChunk(), 500000, null, null, "PUT");

        // Make sure we get a 405 response which indicates that test.jsp is
View Full Code Here

            tomcat.addContext("", System.getProperty("java.io.tmpdir"));

        Tomcat.addServlet(ctx, "Bug53356", new Bug53356Servlet());
        ctx.addServletMapping("", "Bug53356");

        tomcat.start();

        ByteChunk body = getUrl("http://localhost:" + getPort());

        Assert.assertEquals("OK", body.toString());
    }
View Full Code Here

        File appDir = new File(getBuildDirectory(), "webapps/examples");
        // app dir is relative to server home
        org.apache.catalina.Context ctxt  = tomcat.addWebapp(
                null, "/examples", appDir.getAbsolutePath());
        ctxt.addApplicationListener(WsContextListener.class.getName());
        tomcat.start();

        // The tests are from TestTomcat#testSingleWebapp(), #testJsps()
        // We reload the context and verify that the pages are still accessible
        ByteChunk res;
        String text;
View Full Code Here

        ctxt.setReplaceWelcomeFiles(true);
        ctxt.addWelcomeFile("index.jsp");
        // Mapping for *.do is defined in web.xml
        ctxt.addWelcomeFile("index.do");

        tomcat.start();
        ByteChunk bc = new ByteChunk();
        int rc = getUrl("http://localhost:" + getPort() +
                "/test/welcome-files", bc, new HashMap<String,List<String>>());
        Assert.assertEquals(HttpServletResponse.SC_OK, rc);
        Assert.assertTrue(bc.toString().contains("JSP"));
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.