Package org.apache.cxf.jaxrs.client

Examples of org.apache.cxf.jaxrs.client.WebClient.post()


    public void testBookDepthExceededXMLDom() throws Exception {
        String endpointAddress =
            "http://localhost:" + PORT + "/the/thebooks9/depth-dom";
        WebClient wc = WebClient.create(endpointAddress);
        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(1000000L);
        Response r = wc.post(new Book("CXF", 123L));
        assertEquals(413, r.getStatus());
    }
   
    @Test
    public void testBookDepthExceededJettison() throws Exception {
View Full Code Here


    public void testBookDepthExceededJettison() throws Exception {
        String endpointAddress =
            "http://localhost:" + PORT + "/the/thebooks10/depth";
        WebClient wc = WebClient.create(endpointAddress);
        wc.accept("application/json").type("application/json");
        Response r = wc.post(new Book("CXF", 123L));
        assertEquals(413, r.getStatus());
    }
   
    @Test
    public void testTooManyFormParams() throws Exception {
View Full Code Here

    public void testAddInvalidBookDuplicateElementJson() throws Exception {
        WebClient wc = WebClient.create("http://localhost:" + PORT + "/the/bookstore/books/convert");
        wc.type("application/json");
        InputStream is = getClass().getResourceAsStream("resources/add_book2json_duplicate.txt");
        assertNotNull(is);
        Response r = wc.post(is);
        assertEquals(400, r.getStatus());
        String content = IOUtils.readStringFromStream((InputStream)r.getEntity());
        assertTrue(content.contains("Invalid content was found starting with element 'id'"));
    }
   
View Full Code Here

    public void testGetBookWithRequestScope() {
        // the BookStore method which will handle this request depends on the injected HttpHeaders
        WebClient wc = WebClient.create("http://localhost:" + PORT + "/test/request/bookstore/booksecho2");
        wc.type("text/plain").accept("text/plain");
        wc.header("CustomHeader", "custom-header");
        String value = wc.post("CXF", String.class);
        assertEquals("CXF", value);
        assertEquals("custom-header", wc.getResponse().getMetadata().getFirst("CustomHeader"));
    }
   
    private String getStringFromInputStream(InputStream in) throws Exception {       
View Full Code Here

    @Test
    public void testBookDepthExceededXML() throws Exception {
        String endpointAddress =
            "http://localhost:" + PORT + "/the/thebooks9/depth";
        WebClient wc = WebClient.create(endpointAddress);
        Response r = wc.post(new Book("CXF", 123L));
        assertEquals(413, r.getStatus());
    }
   
    @Test
    public void testBookDepthExceededXMLStax() throws Exception {
View Full Code Here

    @Test
    public void testBookDepthExceededXMLStax() throws Exception {
        String endpointAddress =
            "http://localhost:" + PORT + "/the/thebooks9stax/depth";
        WebClient wc = WebClient.create(endpointAddress);
        Response r = wc.post(new Book("CXF", 123L));
        assertEquals(413, r.getStatus());
    }
   
    @Test
    public void testBookDepthExceededXMLSource() throws Exception {
View Full Code Here

    public void testBookDepthExceededXMLSource() throws Exception {
        String endpointAddress =
            "http://localhost:" + PORT + "/the/thebooks9/depth-source";
        WebClient wc = WebClient.create(endpointAddress);
        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(1000000L);
        Response r = wc.post(new Book("CXF", 123L));
        assertEquals(413, r.getStatus());
    }
   
    @Test
    public void testBookDepthExceededXMLSourceStax() throws Exception {
View Full Code Here

    @Test
    public void testBookDepthExceededXMLSourceStax() throws Exception {
        String endpointAddress =
            "http://localhost:" + PORT + "/the/thebooks9stax/depth-source";
        WebClient wc = WebClient.create(endpointAddress);
        Response r = wc.post(new Book("CXF", 123L));
        assertEquals(413, r.getStatus());
    }
   
    @Test
    public void testBookDepthExceededXMLDom() throws Exception {
View Full Code Here

    @Test
    public void testBookDepthExceededXMLDom() throws Exception {
        String endpointAddress =
            "http://localhost:" + PORT + "/the/thebooks9/depth-dom";
        WebClient wc = WebClient.create(endpointAddress);
        Response r = wc.post(new Book("CXF", 123L));
        assertEquals(413, r.getStatus());
    }
   
    @Test
    public void testBookDepthExceededXMLDomStax() throws Exception {
View Full Code Here

    @Test
    public void testBookDepthExceededXMLDomStax() throws Exception {
        String endpointAddress =
            "http://localhost:" + PORT + "/the/thebooks9stax/depth-dom";
        WebClient wc = WebClient.create(endpointAddress);
        Response r = wc.post(new Book("CXF", 123L));
        assertEquals(413, r.getStatus());
    }
   
    @Test
    public void testBookDepthExceededJettison() throws Exception {
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.