Search in sources :

Example 91 with PathHandler

use of io.undertow.server.handlers.PathHandler in project wildfly by wildfly.

the class UndertowSubsystemTestCase method testCustomFilters.

private void testCustomFilters(KernelServices mainServices) {
    ServiceController<FilterService> customFilter = (ServiceController<FilterService>) mainServices.getContainer().getService(UndertowService.FILTER.append("custom-filter"));
    customFilter.setMode(ServiceController.Mode.ACTIVE);
    FilterService connectionLimiterService = customFilter.getService().getValue();
    HttpHandler result = connectionLimiterService.createHttpHandler(Predicates.truePredicate(), new PathHandler());
    Assert.assertNotNull("handler should have been created", result);
}
Also used : HttpHandler(io.undertow.server.HttpHandler) FilterService(org.wildfly.extension.undertow.filters.FilterService) PathHandler(io.undertow.server.handlers.PathHandler) ServiceController(org.jboss.msc.service.ServiceController)

Example 92 with PathHandler

use of io.undertow.server.handlers.PathHandler in project wildfly by wildfly.

the class UndertowSubsystem20TestCase method testCustomFilters.

private void testCustomFilters(KernelServices mainServices) {
    ServiceController<FilterService> customFilter = (ServiceController<FilterService>) mainServices.getContainer().getService(UndertowService.FILTER.append("custom-filter"));
    customFilter.setMode(ServiceController.Mode.ACTIVE);
    FilterService connectionLimiterService = customFilter.getService().getValue();
    HttpHandler result = connectionLimiterService.createHttpHandler(Predicates.truePredicate(), new PathHandler());
    Assert.assertNotNull("handler should have been created", result);
}
Also used : HttpHandler(io.undertow.server.HttpHandler) FilterService(org.wildfly.extension.undertow.filters.FilterService) PathHandler(io.undertow.server.handlers.PathHandler) ServiceController(org.jboss.msc.service.ServiceController)

Aggregations

PathHandler (io.undertow.server.handlers.PathHandler)92 DeploymentInfo (io.undertow.servlet.api.DeploymentInfo)58 ServletContainer (io.undertow.servlet.api.ServletContainer)58 DeploymentManager (io.undertow.servlet.api.DeploymentManager)57 ServletInfo (io.undertow.servlet.api.ServletInfo)49 BeforeClass (org.junit.BeforeClass)48 Test (org.junit.Test)30 TestHttpClient (io.undertow.testutils.TestHttpClient)28 HttpResponse (org.apache.http.HttpResponse)25 HttpGet (org.apache.http.client.methods.HttpGet)24 PathResourceManager (io.undertow.server.handlers.resource.PathResourceManager)22 CanonicalPathHandler (io.undertow.server.handlers.CanonicalPathHandler)21 ResourceHandler (io.undertow.server.handlers.resource.ResourceHandler)21 Path (java.nio.file.Path)21 SimpleServletTestCase (io.undertow.servlet.test.SimpleServletTestCase)17 HttpHandler (io.undertow.server.HttpHandler)15 FilterInfo (io.undertow.servlet.api.FilterInfo)14 LoginConfig (io.undertow.servlet.api.LoginConfig)12 Header (org.apache.http.Header)12 TestResourceLoader (io.undertow.servlet.test.util.TestResourceLoader)11