Search in sources :

Example 6 with FilterService

use of org.wildfly.extension.undertow.filters.FilterService 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 7 with FilterService

use of org.wildfly.extension.undertow.filters.FilterService 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

HttpHandler (io.undertow.server.HttpHandler)7 PathHandler (io.undertow.server.handlers.PathHandler)7 ServiceController (org.jboss.msc.service.ServiceController)7 FilterService (org.wildfly.extension.undertow.filters.FilterService)7 ArrayList (java.util.ArrayList)2 ServiceName (org.jboss.msc.service.ServiceName)2 FilterRef (org.wildfly.extension.undertow.filters.FilterRef)2 AbstractSubsystemBaseTest (org.jboss.as.subsystem.test.AbstractSubsystemBaseTest)1 KernelServices (org.jboss.as.subsystem.test.KernelServices)1 KernelServicesBuilder (org.jboss.as.subsystem.test.KernelServicesBuilder)1 Test (org.junit.Test)1