use of org.everrest.core.impl.ApplicationProviderBinder in project che by eclipse.
the class ServiceDescriptorTest method setUp.
@BeforeTest
public void setUp() throws Exception {
DependencySupplierImpl dependencies = new DependencySupplierImpl();
ResourceBinder resources = new ResourceBinderImpl();
ProviderBinder providers = new ApplicationProviderBinder();
EverrestProcessor processor = new EverrestProcessor(new EverrestConfiguration(), dependencies, new RequestHandlerImpl(new RequestDispatcher(resources), providers), null);
launcher = new ResourceLauncher(processor);
processor.addApplication(new Deployer());
ApplicationContext.setCurrent(anApplicationContext().withProviders(providers).build());
System.out.println("initialized");
}
use of org.everrest.core.impl.ApplicationProviderBinder 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);
}
use of org.everrest.core.impl.ApplicationProviderBinder 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);
}
Aggregations