Search in sources :

Example 11 with HostConfig

use of org.apache.catalina.startup.HostConfig in project tomee by apache.

the class TomEEUndeployTest method tomcatLifecycle.

@Test
public void tomcatLifecycle() throws Exception {
    container.start();
    assertEquals(0, webapps().length);
    final StandardHost standardHost = StandardHost.class.cast(TomcatHelper.getServer().findService("Tomcat").getContainer().findChild("localhost"));
    // not done in embedded but that's the way autodeploy works in normal tomcat
    final HostConfig listener = new HostConfig();
    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);
}
Also used : StandardHost(org.apache.catalina.core.StandardHost) HostConfig(org.apache.catalina.startup.HostConfig) LifecycleEvent(org.apache.catalina.LifecycleEvent) File(java.io.File) Test(org.junit.Test)

Aggregations

HostConfig (org.apache.catalina.startup.HostConfig)11 StandardHost (org.apache.catalina.core.StandardHost)9 File (java.io.File)6 StandardContext (org.apache.catalina.core.StandardContext)3 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 StringTokenizer (java.util.StringTokenizer)2 InstanceNotFoundException (javax.management.InstanceNotFoundException)2 MBeanException (javax.management.MBeanException)2 ObjectName (javax.management.ObjectName)2 Container (org.apache.catalina.Container)2 Engine (org.apache.catalina.Engine)2 Host (org.apache.catalina.Host)2 LifecycleEvent (org.apache.catalina.LifecycleEvent)2 LifecycleException (org.apache.catalina.LifecycleException)2 Service (org.apache.catalina.Service)2 ContainerBase (org.apache.catalina.core.ContainerBase)2 StandardEngine (org.apache.catalina.core.StandardEngine)2 StandardService (org.apache.catalina.core.StandardService)2 ContextConfig (org.apache.catalina.startup.ContextConfig)2