use of org.jboss.modcluster.container.Context in project wildfly by wildfly.
the class UndertowHostTestCase method findContext.
@Test
public void findContext() {
Deployment deployment = mock(Deployment.class);
DeploymentInfo info = new DeploymentInfo();
String expectedPath = "";
info.setContextPath(expectedPath);
HttpHandler handler = mock(HttpHandler.class);
when(deployment.getDeploymentInfo()).thenReturn(info);
this.undertowHost.registerDeployment(deployment, handler);
Context result = this.host.findContext(expectedPath);
assertSame(this.host, result.getHost());
assertSame(expectedPath, result.getPath());
result = this.host.findContext("unknown");
assertNull(result);
}
use of org.jboss.modcluster.container.Context in project wildfly by wildfly.
the class UndertowHostTestCase method getContexts.
@Test
public void getContexts() {
Deployment deployment = mock(Deployment.class);
DeploymentInfo info = new DeploymentInfo();
String expectedPath = "";
info.setContextPath(expectedPath);
HttpHandler handler = mock(HttpHandler.class);
when(deployment.getDeploymentInfo()).thenReturn(info);
this.undertowHost.registerDeployment(deployment, handler);
Iterator<Context> result = this.host.getContexts().iterator();
assertTrue(result.hasNext());
Context context = result.next();
assertSame(this.host, context.getHost());
assertSame(expectedPath, context.getPath());
assertFalse(result.hasNext());
}
use of org.jboss.modcluster.container.Context in project wildfly by wildfly.
the class UndertowEventHandlerAdapter method onDeploymentStart.
@Override
public synchronized void onDeploymentStart(Deployment deployment, Host host) {
Context context = this.createContext(deployment, host);
this.eventHandler.getValue().add(context);
// TODO break into onDeploymentAdd once implemented in Undertow
this.eventHandler.getValue().start(context);
contexts.add(context);
}
use of org.jboss.modcluster.container.Context in project wildfly by wildfly.
the class UndertowEventHandlerAdapter method onDeploymentStop.
@Override
public synchronized void onDeploymentStop(String deployment, Host host) {
Context context = this.createContext(deployment, host);
this.eventHandler.getValue().stop(context);
// TODO break into onDeploymentRemove once implemented in Undertow
this.eventHandler.getValue().remove(context);
contexts.remove(context);
}
use of org.jboss.modcluster.container.Context in project wildfly by wildfly.
the class UndertowEventHandlerAdapter method onDeploymentStart.
@Override
public synchronized void onDeploymentStart(String deployment, Host host) {
Context context = this.createContext(deployment, host);
this.eventHandler.getValue().add(context);
// TODO break into onDeploymentAdd once implemented in Undertow
this.eventHandler.getValue().start(context);
contexts.add(context);
}
Aggregations