Examples of postCollection()


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

        Book b1 = new Book("CXF in Action", 123L);
        Book b2 = new Book("CXF Rocks", 124L);
        List<Book> books = new ArrayList<Book>();
        books.add(b1);
        books.add(b2);
        Book book = wc.postCollection(books, Book.class, Book.class);
        assertEquals(200, wc.getResponse().getStatus());
        assertNotSame(b1, book);
        assertEquals(b1.getName(), book.getName());
    }
   
View Full Code Here

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

        Book b1 = new Book("CXF in Action", 123L);
        Book b2 = new Book("CXF Rocks", 124L);
        List<Book> books = new ArrayList<Book>();
        books.add(b1);
        books.add(b2);
        Book book = wc.postCollection(books, Book.class, Book.class);
        assertEquals(200, wc.getResponse().getStatus());
        assertNotSame(b1, book);
        assertEquals(b1.getName(), book.getName());
    }
   
View Full Code Here

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

        Book b1 = new Book("CXF in Action", 123L);
        Book b2 = new Book("CXF Rocks", 124L);
        List<Book> books = new ArrayList<Book>();
        books.add(b1);
        books.add(b2);
        Book book = wc.postCollection(books, Book.class, Book.class);
        assertEquals(200, wc.getResponse().getStatus());
        assertNotSame(b1, book);
        assertEquals(b1.getName(), book.getName());
    }
   
View Full Code Here

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

        WebClient client = WebClient.create(address);
        WebClient.getConfig(client).getHttpConduit().getClient().setReceiveTimeout(10000000);
        client.type("multipart/form-data").accept("text/plain");
        List<Attachment> atts = new LinkedList<Attachment>();
        atts.add(new Attachment("somepart", "text/plain", "hello there"));
        Response r = client.postCollection(atts, Attachment.class);
        assertEquals(Response.Status.OK.getStatusCode(), r.getStatus());
        assertEquals("nobody home", IOUtils.readStringFromStream((InputStream)r.getEntity()));
    }
   
    @Test
View Full Code Here

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

    private void doTestNullPart(String address) throws Exception {
        WebClient client = WebClient.create(address);
        client.type("multipart/form-data").accept("text/plain");
        List<Attachment> atts = new LinkedList<Attachment>();
        atts.add(new Attachment("somepart", "text/plain", "hello there"));
        Response r = client.postCollection(atts, Attachment.class);
        assertEquals(Response.Status.OK.getStatusCode(), r.getStatus());
        assertEquals("nobody home", IOUtils.readStringFromStream((InputStream)r.getEntity()));
    }
   
    @Test
View Full Code Here

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

        String address = "http://localhost:" + PORT + "/bookstore/books/testnullpartprimitive";
        WebClient client = WebClient.create(address);
        client.type("multipart/form-data").accept("text/plain");
        List<Attachment> atts = new LinkedList<Attachment>();
        atts.add(new Attachment("somepart", "text/plain", "hello there"));
        Response r = client.postCollection(atts, Attachment.class);
        assertEquals(Response.Status.OK.getStatusCode(), r.getStatus());
        assertEquals((Integer)0, Integer.valueOf(IOUtils.readStringFromStream((InputStream)r.getEntity())));
    }
   
   
View Full Code Here

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

        Book b1 = new Book("CXF in Action", 123L);
        Book b2 = new Book("CXF Rocks", 124L);
        List<Book> books = new ArrayList<Book>();
        books.add(b1);
        books.add(b2);
        Book book = wc.postCollection(books, Book.class, Book.class);
        assertEquals(200, wc.getResponse().getStatus());
        assertNotSame(b1, book);
        assertEquals(b1.getName(), book.getName());
    }
   
View Full Code Here

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

        WebClient client = WebClient.create(address);
        WebClient.getConfig(client).getHttpConduit().getClient().setReceiveTimeout(10000000);
        client.type("multipart/form-data").accept("text/plain");
        List<Attachment> atts = new LinkedList<Attachment>();
        atts.add(new Attachment("somepart", "text/plain", "hello there"));
        Response r = client.postCollection(atts, Attachment.class);
        assertEquals(Response.Status.OK.getStatusCode(), r.getStatus());
        assertEquals("nobody home", IOUtils.readStringFromStream((InputStream)r.getEntity()));
    }
   
    @Test
View Full Code Here

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

        Book b1 = new Book("CXF in Action", 123L);
        Book b2 = new Book("CXF Rocks", 124L);
        List<Book> books = new ArrayList<Book>();
        books.add(b1);
        books.add(b2);
        Book book = wc.postCollection(books, Book.class, Book.class);
        assertEquals(200, wc.getResponse().getStatus());
        assertNotSame(b1, book);
        assertEquals(b1.getName(), book.getName());
    }
   
View Full Code Here

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

        WebClient client = WebClient.create(address);
        WebClient.getConfig(client).getHttpConduit().getClient().setReceiveTimeout(10000000);
        client.type("multipart/form-data").accept("text/plain");
        List<Attachment> atts = new LinkedList<Attachment>();
        atts.add(new Attachment("somepart", "text/plain", "hello there"));
        Response r = client.postCollection(atts, Attachment.class);
        assertEquals(Response.Status.OK.getStatusCode(), r.getStatus());
        assertEquals("nobody home", IOUtils.readStringFromStream((InputStream)r.getEntity()));
    }
   
    @Test
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.