Package org.apache.cxf.systest.jaxrs

Examples of org.apache.cxf.systest.jaxrs.Book


       
        BookStore bs = JAXRSClientFactory.create("https://localhost:9095", BookStore.class,
                                                 CLIENT_CONFIG_FILE);
        // just to verify the interface call goes through CGLIB proxy too
        assertEquals("https://localhost:9095", WebClient.client(bs).getBaseURI().toString());
        Book b = bs.getSecureBook("123");
        assertEquals(b.getId(), 123);
        b = bs.getSecureBook("123");
        assertEquals(b.getId(), 123);
    }
View Full Code Here


       
        BookStore bs = JAXRSClientFactory.create("https://localhost:9095", BookStore.class,
                                                 CLIENT_CONFIG_FILE2);
        // just to verify the interface call goes through CGLIB proxy too
        assertEquals("https://localhost:9095", WebClient.client(bs).getBaseURI().toString());
        Book b = bs.getSecureBook("123");
        assertEquals(b.getId(), 123);
        b = bs.getSecureBook("123");
        assertEquals(b.getId(), 123);
    }
View Full Code Here

    @Test
    public void testGetBook123ProxyToWebClient() throws Exception {
       
        BookStore bs = JAXRSClientFactory.create("https://localhost:9095", BookStore.class,
                                                 CLIENT_CONFIG_FILE);
        Book b = bs.getSecureBook("123");
        assertEquals(b.getId(), 123);
        WebClient wc = WebClient.fromClient(WebClient.client(bs));
        wc.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
        Book b2 = wc.get(Book.class);
        assertEquals(123, b2.getId());
    }
View Full Code Here

    @Test
    public void testGetBook123WebClientToProxy() throws Exception {
       
        WebClient wc = WebClient.create("https://localhost:9095", CLIENT_CONFIG_FILE);
        wc.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
        Book b = wc.get(Book.class);
        assertEquals(123, b.getId());
       
        wc.back(true);
       
        BookStore bs = JAXRSClientFactory.fromClient(wc, BookStore.class);
        Book b2 = bs.getSecureBook("123");
        assertEquals(b2.getId(), 123);
       
    }
View Full Code Here

       
        WebClient client = WebClient.create("https://localhost:9095", CLIENT_CONFIG_FILE);
        assertEquals("https://localhost:9095", client.getBaseURI().toString());
       
        client.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
        Book b = client.get(Book.class);
        assertEquals(123, b.getId());
       
    }
View Full Code Here

       
        WebClient client = WebClient.create("https://localhost:9095", CLIENT_CONFIG_FILE2);
        assertEquals("https://localhost:9095", client.getBaseURI().toString());
       
        client.path("/bookstore/securebooks/123").accept(MediaType.APPLICATION_XML_TYPE);
        Book b = client.get(Book.class);
        assertEquals(123, b.getId());
       
    }
View Full Code Here

   
    private void doGetBookProxyClient(String address, String username, String password, int expectedStatus)
        throws BookNotFoundFault {
        SecureBookInterface books = JAXRSClientFactory.create(address, SecureBookInterface.class,
                                                       username, password, null);
        Book b = books.getThatBook();
        assertEquals(123, b.getId());
        Response r = WebClient.client(books).getResponse();
        assertEquals(expectedStatus, r.getStatus());
           
    }
View Full Code Here

    @GET
    @Path("self")   
    @Produces("application/xml")
    @Secured("ROLE_ADMIN")
    public Book getBook() {
        return new Book(name, id);
    }
View Full Code Here

                              ? RandomStrategy.class
                              : SequentialStrategy.class);
            String bookId = expectServerException ? "9999" : "123";
            Exception ex = null;
            try {
                Book book = bookStore.getBook(bookId);
                assertNotNull("expected non-null response", book);
                assertEquals("unexpected id", 123L, book.getId());
            } catch (Exception error) {
                if (!expectServerException) {
                    //String currEndpoint = getCurrentEndpointAddress(bookStore);
                    //assertTrue(currEndpoint.equals(inactiveReplica));
                    throw error;
View Full Code Here

                              : SequentialStrategy.class);
            String bookId = expectServerException ? "9999" : "123";
            bookStore.path("bookstore/books").path(bookId);
            Exception ex = null;
            try {
                Book book = bookStore.get(Book.class);
                assertNotNull("expected non-null response", book);
                assertEquals("unexpected id", 123L, book.getId());
            } catch (Exception error) {
                if (!expectServerException) {
                    throw error;
                }
                ex = error;
View Full Code Here

TOP

Related Classes of org.apache.cxf.systest.jaxrs.Book

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.