Package javax.ws.rs.core

Examples of javax.ws.rs.core.Application


        new HttpHeaderTest().runServerUntilKeyPressed();
    }

    @Override
    protected Application getApplication() {
        return new Application() {
            @Override
            @SuppressWarnings({ "unchecked", "rawtypes" })
            public Set<Class<?>> getClasses() {
                return (Set) Collections.singleton(HttpHeaderTestService.class);
            }
View Full Code Here


*/
public class ResponseBuilderTest extends JaxRsTestCase {

    @Override
    protected Application getApplication() {
        final Application appConfig = new Application() {
            @Override
            @SuppressWarnings({ "unchecked", "rawtypes" })
            public Set<Class<?>> getClasses() {
                return (Set) Collections.singleton(ResponseBuilderService.class);
            }
View Full Code Here

                            classes.add(clazz);
                        } catch (ClassNotFoundException e) {
                            throw new OpenEJBException("Unable to load Application class: " + application, e);
                        }
                        try {
                            Application app = Application.class.cast(clazz.newInstance());
                            classes.addAll(app.getClasses());
                        } catch (InstantiationException e) {
                            throw new OpenEJBException("Unable to instantiate Application class: " + application, e);
                        } catch (IllegalAccessException e) {
                            throw new OpenEJBException("Unable to access Application class: " + application, e);
                        }
View Full Code Here

  }

  @Test
  public void testOptions() throws Exception {
   
    final Application applicationConfig = new Application() {

      @Override
      public Set<Class<?>> getClasses() {
        Set<Class<?>> result = new HashSet<Class<?>>();
        return result;
View Full Code Here

    }
    Assert.assertEquals("Graph writer", baos.toString());
  }

  private TestWebServer createTestWebServer() {
    return new TestWebServer(new Application() {

      @Override
      public Set<Class<?>> getClasses() {
        Set<Class<?>> result = new HashSet<Class<?>>();
        return result;
View Full Code Here

    }
  }

  @Test
  public void testWebServerRuns() throws IOException {
    TestWebServer testWebServer = new TestWebServer(new Application() {

      @Override
      public Set<Class<?>> getClasses() {
        Set<Class<?>> result = new HashSet<Class<?>>();
        result.add(MyResource.class);
View Full Code Here

  private void registerApplicationConfig(ServiceReference serviceReference) {
    String bundlePathPrefix = prefixManager.getPrefix(serviceReference
        .getBundle());

        Application applicationConfigToRegister = (Application) componentContext
        .locateService("applicationConfig", serviceReference);
    if(applicationConfigToRegister == null) {
      return;
    }
View Full Code Here

   * @param clazzes
   */
  public static JaxRsHandler getHandler(final String pathPrefix,
      final Object components[], final Class<?>... clazzes) {

    final Application applicationConfig = new Application() {

      @Override
      public Set<Class<?>> getClasses() {
        Set<Class<?>> result = new HashSet<Class<?>>();
        for (Class<?> clazz : clazzes) {
View Full Code Here

    Assert.assertEquals("{\"name\":\""+param+"\"}", line);
    testWebServer.stop();
  }

  private TestWebServer createTestWebServer(final Object resource) {
    return new TestWebServer(new Application() {

      @Override
      public Set<Class<?>> getClasses() {
        Set<Class<?>> result = new HashSet<Class<?>>();
        return result;
View Full Code Here

  }

  public static JaxRsHandler getJaxRsHandlerUsingApplConfig(
      final String pathPrefix1, final String pathPrefix2) {

    final Application applicationConfig = new Application() {

      @Override
      public Set<Class<?>> getClasses() {
        Set<Class<?>> result = new HashSet<Class<?>>();
View Full Code Here

TOP

Related Classes of javax.ws.rs.core.Application

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.