Package org.apache.cxf.jaxrs.client

Examples of org.apache.cxf.jaxrs.client.ResponseReader


        }
    }
   
    @Test
    public void testServerWebApplicationExceptionXML() throws Exception {
        ResponseReader reader = new ResponseReader();
        reader.setEntityClass(Book.class);
        WebClient wc = WebClient.create("http://localhost:" + PORT + "/bookstore/webappexceptionXML",
                                        Collections.singletonList(reader));
        wc.accept("application/xml");
        try {
            wc.get(Book.class);
View Full Code Here


        }
    }
   
    @Test
    public void testServerWebApplicationExceptionXMLWithProxy() throws Exception {
        ResponseReader reader = new ResponseReader();
        reader.setEntityClass(Book.class);
        BookStore proxy = JAXRSClientFactory.create("http://localhost:" + PORT,
                                                    BookStore.class, Collections.singletonList(reader));
        try {
            proxy.throwExceptionXML();
            fail("Exception expected");
View Full Code Here

        assertEquals(200, r.getStatus());
    }
   
    @Test
    public void testGetBookFromResponseWithProxy() throws Exception {
        ResponseReader reader = new ResponseReader();
        reader.setEntityClass(Book.class);
       
        BookStore bs = JAXRSClientFactory.create("http://localhost:" + PORT,
                                                 BookStore.class,
                                                 Collections.singletonList(reader));
        Response r = bs.getGenericResponseBook("123");
View Full Code Here

    @Test
    public void testGetBookFromResponseWithWebClient() throws Exception {
        String address = "http://localhost:" + PORT + "/bookstore/genericresponse/123";
        WebClient wc = WebClient.create(address,
                                        Collections.singletonList(
                                        new ResponseReader(Book.class)));
        Response r = wc.accept("application/xml").get();
        assertEquals(200, r.getStatus());
        Book book = (Book)r.getEntity();
        assertEquals(123L, book.getId());
    }
View Full Code Here

        }
    }
   
    @Test
    public void testServerWebApplicationExceptionXML() throws Exception {
        ResponseReader reader = new ResponseReader();
        reader.setEntityClass(Book.class);
        WebClient wc = WebClient.create("http://localhost:" + PORT + "/bookstore/webappexceptionXML",
                                        Collections.singletonList(reader));
        wc.accept("application/xml");
        try {
            wc.get(Book.class);
View Full Code Here

        }
    }
   
    @Test
    public void testServerWebApplicationExceptionXMLWithProxy() throws Exception {
        ResponseReader reader = new ResponseReader();
        reader.setEntityClass(Book.class);
        BookStore proxy = JAXRSClientFactory.create("http://localhost:" + PORT,
                                                    BookStore.class, Collections.singletonList(reader));
        try {
            proxy.throwExceptionXML();
            fail("Exception expected");
View Full Code Here

        assertEquals(200, r.getStatus());
    }
   
    @Test
    public void testGetBookFromResponseWithProxy() throws Exception {
        ResponseReader reader = new ResponseReader();
        reader.setEntityClass(Book.class);
       
        BookStore bs = JAXRSClientFactory.create("http://localhost:" + PORT,
                                                 BookStore.class,
                                                 Collections.singletonList(reader));
        Response r = bs.getGenericResponseBook("123");
View Full Code Here

    @Test
    public void testGetBookFromResponseWithWebClient() throws Exception {
        String address = "http://localhost:" + PORT + "/bookstore/genericresponse/123";
        WebClient wc = WebClient.create(address,
                                        Collections.singletonList(
                                        new ResponseReader(Book.class)));
        Response r = wc.accept("application/xml").get();
        assertEquals(200, r.getStatus());
        Book book = (Book)r.getEntity();
        assertEquals(123L, book.getId());
    }
View Full Code Here

        }
    }
   
    @Test
    public void testServerWebApplicationExceptionXML() throws Exception {
        ResponseReader reader = new ResponseReader();
        reader.setEntityClass(Book.class);
        WebClient wc = WebClient.create("http://localhost:" + PORT + "/bookstore/webappexceptionXML",
                                        Collections.singletonList(reader));
        wc.accept("application/xml");
        try {
            wc.get(Book.class);
View Full Code Here

        }
    }
   
    @Test
    public void testServerWebApplicationExceptionXMLWithProxy() throws Exception {
        ResponseReader reader = new ResponseReader();
        reader.setEntityClass(Book.class);
        BookStore proxy = JAXRSClientFactory.create("http://localhost:" + PORT,
                                                    BookStore.class, Collections.singletonList(reader));
        try {
            proxy.throwExceptionXML();
            fail("Exception expected");
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxrs.client.ResponseReader

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.