Search in sources :

Example 1 with ContainerRequest

use of org.everrest.core.impl.ContainerRequest in project che by eclipse.

the class DownloadFileResponseFilterTest method before.

/**
     * Setup env for launching requests
     * @throws Exception
     */
@BeforeMethod
public void before() throws Exception {
    //set up launcher
    final ResourceBinderImpl resources = new ResourceBinderImpl();
    resources.addResource(MyJaxRSService.class, null);
    final DependencySupplierImpl dependencies = new DependencySupplierImpl();
    final ApplicationProviderBinder providers = new ApplicationProviderBinder();
    providers.addExceptionMapper(ApiExceptionMapper.class);
    providers.addResponseFilter(EverrestDownloadFileResponseFilter.class);
    final URI uri = new URI(BASE_URI);
    final ContainerRequest req = new ContainerRequest(null, uri, uri, null, null, null);
    final ApplicationContext context = anApplicationContext().withRequest(req).withProviders(providers).withDependencySupplier(dependencies).build();
    ApplicationContext.setCurrent(context);
    final EverrestProcessor processor = new EverrestProcessor(new EverrestConfiguration(), dependencies, new RequestHandlerImpl(new RequestDispatcher(resources), providers), null);
    resourceLauncher = new ResourceLauncher(processor);
}
Also used : DependencySupplierImpl(org.everrest.core.tools.DependencySupplierImpl) ApplicationProviderBinder(org.everrest.core.impl.ApplicationProviderBinder) ApplicationContext.anApplicationContext(org.everrest.core.ApplicationContext.anApplicationContext) ApplicationContext(org.everrest.core.ApplicationContext) EverrestConfiguration(org.everrest.core.impl.EverrestConfiguration) RequestHandlerImpl(org.everrest.core.impl.RequestHandlerImpl) ResourceBinderImpl(org.everrest.core.impl.ResourceBinderImpl) ContainerRequest(org.everrest.core.impl.ContainerRequest) URI(java.net.URI) EverrestProcessor(org.everrest.core.impl.EverrestProcessor) ResourceLauncher(org.everrest.core.tools.ResourceLauncher) RequestDispatcher(org.everrest.core.impl.RequestDispatcher) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with ContainerRequest

use of org.everrest.core.impl.ContainerRequest in project che by eclipse.

the class ETagResponseFilterTest method before.

/**
     * Setup env for launching requests
     * @throws Exception
     */
@BeforeMethod
public void before() throws Exception {
    //set up launcher
    final ResourceBinderImpl resources = new ResourceBinderImpl();
    resources.addResource(MyJaxRSService.class, null);
    final DependencySupplierImpl dependencies = new DependencySupplierImpl();
    final ApplicationProviderBinder providers = new ApplicationProviderBinder();
    providers.addExceptionMapper(ApiExceptionMapper.class);
    providers.addResponseFilter(ETagResponseFilter.class);
    final URI uri = new URI(BASE_URI);
    final ContainerRequest req = new ContainerRequest(null, uri, uri, null, null, null);
    final ApplicationContext contextImpl = anApplicationContext().withRequest(req).withProviders(providers).build();
    contextImpl.setDependencySupplier(dependencies);
    ApplicationContext.setCurrent(contextImpl);
    final EverrestProcessor processor = new EverrestProcessor(new EverrestConfiguration(), dependencies, new RequestHandlerImpl(new RequestDispatcher(resources), providers), null);
    resourceLauncher = new ResourceLauncher(processor);
}
Also used : DependencySupplierImpl(org.everrest.core.tools.DependencySupplierImpl) ApplicationProviderBinder(org.everrest.core.impl.ApplicationProviderBinder) ApplicationContext.anApplicationContext(org.everrest.core.ApplicationContext.anApplicationContext) ApplicationContext(org.everrest.core.ApplicationContext) EverrestConfiguration(org.everrest.core.impl.EverrestConfiguration) RequestHandlerImpl(org.everrest.core.impl.RequestHandlerImpl) ResourceBinderImpl(org.everrest.core.impl.ResourceBinderImpl) ContainerRequest(org.everrest.core.impl.ContainerRequest) URI(java.net.URI) EverrestProcessor(org.everrest.core.impl.EverrestProcessor) ResourceLauncher(org.everrest.core.tools.ResourceLauncher) RequestDispatcher(org.everrest.core.impl.RequestDispatcher) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

URI (java.net.URI)2 ApplicationContext (org.everrest.core.ApplicationContext)2 ApplicationContext.anApplicationContext (org.everrest.core.ApplicationContext.anApplicationContext)2 ApplicationProviderBinder (org.everrest.core.impl.ApplicationProviderBinder)2 ContainerRequest (org.everrest.core.impl.ContainerRequest)2 EverrestConfiguration (org.everrest.core.impl.EverrestConfiguration)2 EverrestProcessor (org.everrest.core.impl.EverrestProcessor)2 RequestDispatcher (org.everrest.core.impl.RequestDispatcher)2 RequestHandlerImpl (org.everrest.core.impl.RequestHandlerImpl)2 ResourceBinderImpl (org.everrest.core.impl.ResourceBinderImpl)2 DependencySupplierImpl (org.everrest.core.tools.DependencySupplierImpl)2 ResourceLauncher (org.everrest.core.tools.ResourceLauncher)2 BeforeMethod (org.testng.annotations.BeforeMethod)2