Package org.jboss.resteasy.client.jaxrs

Examples of org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder


  private String getTableName(EntityKeyMetadata entityKeyMetadata) {
    return entityKeyMetadata.getTable();
  }

  private static ResteasyClient createRestClient(DatabaseIdentifier database) {
    ResteasyClientBuilder clientBuilder = new ResteasyClientBuilder();

    if ( database.getUserName() != null ) {
      clientBuilder.register( new BasicAuthentication( database.getUserName(), database.getPassword() ) );
    }

    // using a connection pool size > 1 causes a thread-safe pool implementation to be used under the hoods
    return clientBuilder
        .connectionPoolSize( CONNECTION_POOL_SIZE )
        .build();
  }
View Full Code Here


        );

    BasicHttpContext localContext = new BasicHttpContext();
    localContext.setAttribute( ClientContext.AUTH_CACHE, authCache );

    return new ResteasyClientBuilder()
    .httpEngine( new ApacheHttpClient4Engine( httpClient, localContext ) )
    .build();
  }
View Full Code Here

  private String getTableName(EntityKeyMetadata entityKeyMetadata) {
    return entityKeyMetadata.getTable();
  }

  private static ResteasyClient createRestClient(DatabaseIdentifier database) {
    ResteasyClientBuilder clientBuilder = new ResteasyClientBuilder();

    if ( database.getUserName() != null ) {
      clientBuilder.register( new BasicAuthentication( database.getUserName(), database.getPassword() ) );
    }

    // using a connection pool size > 1 causes a thread-safe pool implementation to be used under the hoods
    return clientBuilder
        .connectionPoolSize( CONNECTION_POOL_SIZE )
        .build();
  }
View Full Code Here

  private String getTableName(EntityKeyMetadata entityKeyMetadata) {
    return entityKeyMetadata.getTable();
  }

  private static ResteasyClient createRestClient(DatabaseIdentifier database) {
    ResteasyClientBuilder clientBuilder = new ResteasyClientBuilder();

    if ( database.getUserName() != null ) {
      clientBuilder.register( new BasicAuthentication( database.getUserName(), database.getPassword() ) );
    }

    // using a connection pool size > 1 causes a thread-safe pool implementation to be used under the hoods
    return clientBuilder
        .connectionPoolSize( CONNECTION_POOL_SIZE )
        .build();
  }
View Full Code Here

   public static Client client;

   @BeforeClass
   public static void initClient()
   {
      client = new ResteasyClientBuilder().connectionPoolSize(10).build();
   }
View Full Code Here

      }
      finally
      {
         Thread.currentThread().setContextClassLoader(old);
      }
      ResteasyClient client = new ResteasyClientBuilder()
              .providerFactory(providerFactory)
              .connectionPoolSize(size)
              .hostnameVerification(policy)
              .trustStore(resourceMetadata.getTruststore())
              .keyStore(resourceMetadata.getClientKeystore(), resourceMetadata.getClientKeyPassword())
View Full Code Here

   }

   @Test
   public void testBasic() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      ResteasyWebTarget target = client.target(generateURL("/test"));
      String val = target.request().get(String.class);
      Assert.assertEquals("hello world", val);
   }
View Full Code Here

   }

   @Test
   public void testUnhandledException() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      ResteasyWebTarget target = client.target(generateURL("/exception"));
      Response resp = target.request().get();
      Assert.assertEquals(500, resp.getStatus());
   }
View Full Code Here

      Assert.assertEquals(500, resp.getStatus());
   }

    @Test
    public void testChannelContext() throws Exception {
      ResteasyClient client = new ResteasyClientBuilder().build();
      ResteasyWebTarget target = client.target(generateURL("/context"));
      String val = target.request().get(String.class);
      Assert.assertNotNull(val);
      Assert.assertFalse(val.isEmpty());
    }
View Full Code Here

   @BeforeClass
   public static void setup() throws Exception
   {
      NettyContainer.start().getRegistry().addPerRequestResource(Resteasy1029Netty4StreamingOutput.class);
      client = new ResteasyClientBuilder().connectionPoolSize(10).build();
   }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder

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.