Package org.apache.catalina.startup

Examples of org.apache.catalina.startup.Tomcat


        assertEcho(result, "01-Hello world</p>#{foo2");
    }

    @Test
    public void testBug49297NoSpaceStrict() throws Exception {
        Tomcat tomcat = getTomcatInstance();

        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/bug49297NoSpace.jsp", new ByteChunk(),
                new HashMap<String,List<String>>());
View Full Code Here


        assertEquals(500, sc);
    }

    @Test
    public void testBug49297DuplicateAttr() throws Exception {
        Tomcat tomcat = getTomcatInstance();

        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

    }

    @Test
    public void testBug49297MultipleImport1() throws Exception {

        Tomcat tomcat = getTomcatInstance();

        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

    }

    @Test
    public void testBug49297MultipleImport2() throws Exception {

        Tomcat tomcat = getTomcatInstance();

        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

    }

    @Test
    public void testBug49297MultiplePageEncoding1() throws Exception {

        Tomcat tomcat = getTomcatInstance();

        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

        initFramework = false;
    }

    @Override
    protected int run(CommandLine cmd) throws Exception {
        tomcat = new Tomcat();

        Connector httpsConnector = new Connector();
        httpsConnector.setPort(super.getHttpsPort());
        httpsConnector.setSecure(true);
        httpsConnector.setScheme("https");
View Full Code Here

    @BeforeClass
    public static void startServer() throws Exception {
        servletContext = "";

        tomcat = new Tomcat();
        tomcat.setBaseDir(new File(".").getCanonicalPath() + File.separatorChar + "tomcat" + (servletContext.length() > 0 ? "_" + servletContext : ""));

        // add http port
        tomcat.setPort(SERVER_HTTP_PORT);
View Full Code Here

    @BeforeClass
    public static void startServer() throws Exception {
        servletContext = "mockserver";

        tomcat = new Tomcat();
        tomcat.setBaseDir(new File(".").getCanonicalPath() + File.separatorChar + "tomcat" + (servletContext.length() > 0 ? "_" + servletContext : ""));

        // add http port
        tomcat.setPort(SERVER_HTTP_PORT);
View Full Code Here

        // wait for server to start up
        TimeUnit.MILLISECONDS.sleep(500);

        // start proxy (in tomcat)
        tomcat = new Tomcat();
        tomcat.setBaseDir(new File(".").getCanonicalPath() + File.separatorChar + "tomcat");

        // add http port
        tomcat.setPort(PROXY_PORT);
View Full Code Here

public class TestJspServlet  extends TomcatBaseTest {

    @Test
    public void testBug56568a() throws Exception {
        Tomcat tomcat = getTomcatInstance();

        // 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");
        Context context = tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());

        // Create a servlet that always throws an exception for a PUT request
        Tomcat.addServlet(context, "Bug56568Servlet", new Bug56568aServlet());
        context.addServletMapping("/bug56568", "Bug56568Servlet");

        // Configure a JSP page to handle the 500 error response
        // The JSP page will see the same method as the original request (PUT)
        // PUT requests are normally blocked for JSPs
        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

TOP

Related Classes of org.apache.catalina.startup.Tomcat

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.