Examples of lifecycleEvent()


Examples of org.apache.catalina.startup.ContextConfig.lifecycleEvent()

        };
        // prevent it from looking ( if it finds one - it'll have dup error )
        config1.setDefaultWebXml(Constants.NoDefaultWebXml);
        listener1[1] = config1;
        // Need to init since context won't call init
        config1.lifecycleEvent(
                new LifecycleEvent(ctx, Lifecycle.AFTER_INIT_EVENT, null));
        Tomcat.addServlet(ctx, "getresource", new GetResourceServlet());
        ctx.addServletMapping("/getresource", "getresource");

        ctx.start();
View Full Code Here

Examples of org.apache.catalina.startup.HostConfig.lifecycleEvent()

        assertEquals(0, webapps().length);
        final StandardHost standardHost = StandardHost.class.cast(TomcatHelper.getServer().findService("Tomcat").getContainer().findChild("localhost"));
        final HostConfig listener = new HostConfig(); // not done in embedded but that's the way autodeploy works in normal tomcat
        standardHost.addLifecycleListener(listener);
        createWebapp(new File(WORK_DIR, "tomee/webapps/my-webapp"));
        listener.lifecycleEvent(new LifecycleEvent(standardHost, Lifecycle.START_EVENT, standardHost));
        assertEquals(1, webapps().length);
        webapps()[0].stop();
        assertEquals(1, webapps().length);
        webapps()[0].start();
        assertEquals(1, webapps().length);
View Full Code Here

Examples of org.apache.catalina.startup.HostConfig.lifecycleEvent()

        assertEquals(0, webapps().length);
        final StandardHost standardHost = StandardHost.class.cast(TomcatHelper.getServer().findService("Tomcat").getContainer().findChild("localhost"));
        final HostConfig listener = new HostConfig(); // not done in embedded but that's the way autodeploy works in normal tomcat
        standardHost.addLifecycleListener(listener);
        createWebapp(new File(WORK_DIR, "tomee/webapps/my-webapp"));
        listener.lifecycleEvent(new LifecycleEvent(standardHost, Lifecycle.START_EVENT, standardHost));
        assertEquals(1, webapps().length);
    }

    private static org.apache.catalina.Container[] webapps() {
        return TomcatHelper.getServer().findService("Tomcat").getContainer().findChild("localhost").findChildren();
View Full Code Here

Examples of org.apache.catalina.startup.HostConfig.lifecycleEvent()

        assertEquals(0, webapps().length);
        final StandardHost standardHost = StandardHost.class.cast(TomcatHelper.getServer().findService("Tomcat").getContainer().findChild("localhost"));
        final HostConfig listener = new HostConfig(); // not done in embedded but that's the way autodeploy works in normal tomcat
        standardHost.addLifecycleListener(listener);
        createWebapp(new File(WORK_DIR, "tomee/webapps/my-webapp"));
        listener.lifecycleEvent(new LifecycleEvent(standardHost, Lifecycle.START_EVENT, standardHost));
        assertEquals(1, webapps().length);
        webapps()[0].stop();
        assertEquals(1, webapps().length);
        webapps()[0].start();
        assertEquals(1, webapps().length);
View Full Code Here

Examples of org.apache.catalina.startup.HostConfig.lifecycleEvent()

        assertEquals(0, webapps().length);
        final StandardHost standardHost = StandardHost.class.cast(TomcatHelper.getServer().findService("Tomcat").getContainer().findChild("localhost"));
        final HostConfig listener = new HostConfig(); // not done in embedded but that's the way autodeploy works in normal tomcat
        standardHost.addLifecycleListener(listener);
        createWebapp(new File(WORK_DIR, "tomee/webapps/my-webapp"));
        listener.lifecycleEvent(new LifecycleEvent(standardHost, Lifecycle.START_EVENT, standardHost));
        assertEquals(1, webapps().length);
    }

    private static org.apache.catalina.Container[] webapps() {
        return TomcatHelper.getServer().findService("Tomcat").getContainer().findChild("localhost").findChildren();
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.