Package org.apache.wink.client

Examples of org.apache.wink.client.RestClient.resource()


            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, " ").get();
        verifyResponseNotContentEncodedForRepeatedStrings(response);

        response =
            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, "myencoding").get();
        verifyResponseNotContentEncodedForRepeatedStrings(response);

        response =
            client.resource(getBaseURI() + "/contentencode/repeatedstring")
View Full Code Here


            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, "myencoding").get();
        verifyResponseNotContentEncodedForRepeatedStrings(response);

        response =
            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, "mycustomencoding;q=0.0").get();
        verifyResponseNotContentEncodedForRepeatedStrings(response);

        response =
            client.resource(getBaseURI() + "/contentencode/repeatedstring")
View Full Code Here

            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, "mycustomencoding;q=0.0").get();
        verifyResponseNotContentEncodedForRepeatedStrings(response);

        response =
            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, "mycustomencoding,myothercustomencoding")
                .get();
        verifyResponseNotContentEncodedForRepeatedStrings(response);
    }
View Full Code Here

     */
    public void testGZIPContentEncodeRespectWildcardAcceptEncodingHeaderForGetRepeatedStringsResource()
        throws IOException {
        RestClient client = new RestClient();
        ClientResponse response =
            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, "*").get();
        verifyResponseGZIPContentEncodedForRepeatedStrings(response);

        response =
            client.resource(getBaseURI() + "/contentencode/repeatedstring")
View Full Code Here

            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, "*").get();
        verifyResponseGZIPContentEncodedForRepeatedStrings(response);

        response =
            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, "*,deflate=0.8").get();
        verifyResponseGZIPContentEncodedForRepeatedStrings(response);

        response =
            client.resource(getBaseURI() + "/contentencode/repeatedstring")
View Full Code Here

            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, "*,deflate=0.8").get();
        verifyResponseGZIPContentEncodedForRepeatedStrings(response);

        response =
            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, "gzip,deflate").get();
        verifyResponseGZIPContentEncodedForRepeatedStrings(response);

        /*
         * tests that gzip encoding is banned which is the default.
View Full Code Here

        /*
         * tests that gzip encoding is banned which is the default.
         */
        response =
            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, "*,gzip;q=0.0").get();
        verifyResponseNotContentEncodedForRepeatedStrings(response);
    }

    /**
 
View Full Code Here

     */
    public void testDeflateContentEncodeRespectAcceptEncodingQualityValuesHeaderForGetRepeatedStringsResource()
        throws IOException {
        RestClient client = new RestClient();
        ClientResponse response =
            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, "*;q=0.6,deflate").get();
        verifyResponseDeflateContentEncodedForRepeatedStrings(response);

        response =
            client.resource(getBaseURI() + "/contentencode/repeatedstring")
View Full Code Here

            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, "*;q=0.6,deflate").get();
        verifyResponseDeflateContentEncodedForRepeatedStrings(response);

        response =
            client.resource(getBaseURI() + "/contentencode/repeatedstring")
                .header(HttpHeaders.ACCEPT_ENCODING, "gzip;q=0.6,deflate;q=0.8").get();
        verifyResponseDeflateContentEncodedForRepeatedStrings(response);
    }

    /**
 
View Full Code Here

     * header comes out okay.
     */
    public void testRegularVaryHeaderCorrectlyOutput() throws IOException {
        RestClient client = new RestClient();
        ClientResponse response =
            client.resource(getBaseURI() + "/regular/varyheaderwithaccept")
                .header(HttpHeaders.ACCEPT_ENCODING, "gzip").accept(MediaType.TEXT_PLAIN).get();
        assertEquals(200, response.getStatusCode());
        assertEquals("Variant[mediaType=text/plain, language=null, encoding=null]", response
            .getEntity(String.class));
        assertEquals(HttpHeaders.ACCEPT, response.getHeaders().getFirst(HttpHeaders.VARY));
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.