Package javax.ws.rs.client

Examples of javax.ws.rs.client.Client.property()


    @Test
    public void testGetBookSpec() {
        String address = "http://localhost:" + PORT + "/bookstore/bookheaders/simple";
        Client client = ClientBuilder.newClient();
        client.register((Object)ClientFilterClientAndConfigCheck.class);
        client.property("clientproperty", "somevalue");
        Book book = client.target(address).request("application/xml").get(Book.class);
        assertEquals(124L, book.getId());
    }
   
    @Test
View Full Code Here


    }

    @Test
    public void testChunkedEncodingUsingMultiPart() {
        final Client client = client();
        client.property(ClientProperties.CHUNKED_ENCODING_SIZE, 1024);

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        for (int i = 0; i < 900 * 1024; i++)
            baos.write(65);

View Full Code Here

                        .keyStoreFile("./keystore_client")
                        .keyPassword("asdfgh");

                final Client client = ClientBuilder.newBuilder().sslContext(sslConfig.createSSLContext()).build();
                client.property(ClientProperties.CONNECT_TIMEOUT, 2000)
                        .register(new MoxyJsonFeature())
                        .register(HttpAuthenticationFeature.basic(App.getTwitterUserName(), App.getTwitterUserPassword()))
                        .register(GZipEncoder.class);

                final Response response = client.target("https://stream.twitter.com/1.1/statuses/filter.json")
View Full Code Here

        return result;
    }

    private WebTarget createNonRoutableTarget() {
        Client client = ClientBuilder.newClient();
        client.property(ClientProperties.CONNECT_TIMEOUT, TimeoutBASE);
        // the following address should not be routable, connections will timeout
        return client.target("http://10.255.255.254/");
    }
}
View Full Code Here

    @Test
    public void testPropagation() {
        Client c = ClientBuilder.newBuilder().newClient();

        c.property("a", "val");

        WebTarget w1 = c.target("http://a");
        w1.property("b", "val");

        WebTarget w2 = w1.path("c");
View Full Code Here

    @Test
    public void testGetBookSpec() {
        String address = "http://localhost:" + PORT + "/bookstore/bookheaders/simple";
        Client client = ClientBuilder.newClient();
        client.register((Object)ClientFilterClientAndConfigCheck.class);
        client.property("clientproperty", "somevalue");
        Book book = client.target(address).request("application/xml").get(Book.class);
        assertEquals(124L, book.getId());
    }
   
    @Test
View Full Code Here

   @Test
   public void testBuilder() throws Exception
   {
      String property = "prop";
      Client client = ClientBuilder.newClient();
      client.property(property, property);
      Configuration config = client.getConfiguration();
      client = ClientBuilder.newClient(config);

   }
View Full Code Here

                        .keyStoreFile("./keystore_client")
                        .keyPassword("asdfgh");

                final Client client = ClientBuilder.newBuilder().sslContext(sslConfig.createSSLContext()).build();
                client.property(ClientProperties.CONNECT_TIMEOUT, 2000)
                        .register(new MoxyJsonFeature())
                        .register(new HttpBasicAuthFilter(App.getTwitterUserName(), App.getTwitterUserPassword()))
                        .register(GZipEncoder.class);

                final Response response = client.target("https://stream.twitter.com/1.1/statuses/filter.json")
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.