Search in sources :

Example 1 with ApplicationProviderBinder

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");
}
Also used : ApplicationProviderBinder(org.everrest.core.impl.ApplicationProviderBinder) ProviderBinder(org.everrest.core.impl.ProviderBinder) DependencySupplierImpl(org.everrest.core.tools.DependencySupplierImpl) ApplicationProviderBinder(org.everrest.core.impl.ApplicationProviderBinder) EverrestConfiguration(org.everrest.core.impl.EverrestConfiguration) RequestHandlerImpl(org.everrest.core.impl.RequestHandlerImpl) ResourceBinderImpl(org.everrest.core.impl.ResourceBinderImpl) ResourceBinder(org.everrest.core.ResourceBinder) EverrestProcessor(org.everrest.core.impl.EverrestProcessor) ResourceLauncher(org.everrest.core.tools.ResourceLauncher) RequestDispatcher(org.everrest.core.impl.RequestDispatcher) BeforeTest(org.testng.annotations.BeforeTest)

Example 2 with ApplicationProviderBinder

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);
}
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 3 with ApplicationProviderBinder

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);
}
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

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