use of org.glassfish.jersey.server.ApplicationHandler in project jersey by jersey.
the class FilterSetMethodTest method testPostMatchingFilter.
@Test
public void testPostMatchingFilter() throws ExecutionException, InterruptedException {
ApplicationHandler handler = new ApplicationHandler(new ResourceConfig(Resource.class, PostMatchFilter.class));
ContainerResponse res = handler.apply(RequestContextBuilder.from("", "/resource/setMethod", "GET").build()).get();
assertEquals(200, res.getStatus());
}
use of org.glassfish.jersey.server.ApplicationHandler in project jersey by jersey.
the class FilterSetMethodTest method testResourceUri.
@Test
public void testResourceUri() throws ExecutionException, InterruptedException {
ApplicationHandler handler = new ApplicationHandler(new ResourceConfig(ResourceChangeUri.class, PreMatchChangingUriFilter.class));
ContainerResponse res = handler.apply(RequestContextBuilder.from("", "/resourceChangeUri/first", "GET").build()).get();
assertEquals(200, res.getStatus());
assertEquals("ok", res.getEntity());
}
use of org.glassfish.jersey.server.ApplicationHandler in project jersey by jersey.
the class JettyHttpContainer method reload.
@Override
public void reload(final ResourceConfig configuration) {
appHandler.onShutdown(this);
appHandler = new ApplicationHandler(configuration.register(new JettyBinder()));
appHandler.onReload(this);
appHandler.onStartup(this);
cacheConfigSetStatusOverSendError();
}
use of org.glassfish.jersey.server.ApplicationHandler in project jersey by jersey.
the class NettyHttpContainer method reload.
@Override
public void reload(ResourceConfig configuration) {
appHandler.onShutdown(this);
appHandler = new ApplicationHandler(configuration);
appHandler.onReload(this);
appHandler.onStartup(this);
}
use of org.glassfish.jersey.server.ApplicationHandler in project jersey by jersey.
the class ContextBasedInjectionTest method setupApplication.
@Before
public void setupApplication() {
ResourceConfig rc = new ResourceConfig();
Resource.Builder rb;
rb = Resource.builder("a/b/c");
rb.addMethod("GET").handledBy(new AsyncInflector("A-B-C"));
rc.registerResources(rb.build());
rb = Resource.builder("a/b/d");
rb.addMethod("GET").handledBy(new AsyncInflector("A-B-D"));
rc.registerResources(rb.build());
app = new ApplicationHandler(rc);
}
Aggregations