Package org.apache.cxf.jaxrs.client

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


                                 FailoverFeature feature,
                                 String newReplica,
                                 boolean notAvailableOnly) throws Exception {
        WebClient bookStore = getWebClient(currentReplica, feature);
        verifyStrategy(bookStore, SequentialStrategy.class);
        bookStore.path("bookstore/webappexceptionXML");
        Response r = bookStore.get();
        assertEquals(406, r.getStatus());
        String currEndpoint = getCurrentEndpointAddress(bookStore);
        if (notAvailableOnly) {
            assertTrue(currEndpoint.equals(currentReplica));
View Full Code Here


            WebClient bookStore = getWebClient(inactiveReplica, feature);
            verifyStrategy(bookStore, expectRandom
                              ? RandomStrategy.class
                              : 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());
View Full Code Here

    public void testWebClientUnwrapBookWithXslt() throws Exception {
        XSLTJaxbProvider<Book> provider = new XSLTJaxbProvider<Book>();
        provider.setInTemplate("classpath:/org/apache/cxf/systest/jaxrs/resources/unwrapbook.xsl");
        WebClient wc = WebClient.create("http://localhost:" + PORT + "/bookstore/books/wrapper",
                             Collections.singletonList(provider));
        wc.path("{id}", 123);
        Book book = wc.get(Book.class);
        assertNotNull(book);
        assertEquals(123L, book.getId());
       
    }
View Full Code Here

        doTestUseParamBeanWebClient(address);
    }
   
    private void doTestUseParamBeanWebClient(String address) {
        WebClient wc = WebClient.create(address);
        wc.path("100");
        wc.query("id_2", "20");
        wc.query("id3", "3");
        Book book = wc.get(Book.class);
        assertEquals(123L, book.getId());
    }
View Full Code Here

   
    @Test
    public void testGetIntroChapterFromSelectedBook2() {
        String address = "http://localhost:" + PORT + "/bookstore/";
        WebClient wc = WebClient.create(address);
        wc.path("books[id=le=123]");
        wc.path("chapter");
        wc.accept("application/xml");
        Chapter chapter = wc.get(Chapter.class);
        assertEquals("chapter 1", chapter.getTitle());
    }
View Full Code Here

    @Test
    public void testGetIntroChapterFromSelectedBook2() {
        String address = "http://localhost:" + PORT + "/bookstore/";
        WebClient wc = WebClient.create(address);
        wc.path("books[id=le=123]");
        wc.path("chapter");
        wc.accept("application/xml");
        Chapter chapter = wc.get(Chapter.class);
        assertEquals("chapter 1", chapter.getTitle());
    }
   
View Full Code Here

        }

        // set the path
        if (path != null) {
            if (ObjectHelper.isNotEmpty(pathValues) && pathValues.length > 0) {
                client.path(path, pathValues);
            } else {
                client.path(path);
            }
        }
View Full Code Here

        // set the path
        if (path != null) {
            if (ObjectHelper.isNotEmpty(pathValues) && pathValues.length > 0) {
                client.path(path, pathValues);
            } else {
                client.path(path);
            }
        }

        CxfRsEndpoint cxfRsEndpoint = (CxfRsEndpoint) getEndpoint();
View Full Code Here

    public void testWebClientUnwrapBookWithXslt() throws Exception {
        XSLTJaxbProvider provider = new XSLTJaxbProvider();
        provider.setInTemplate("classpath:/org/apache/cxf/systest/jaxrs/resources/unwrapbook.xsl");
        WebClient wc = WebClient.create("http://localhost:" + PORT + "/bookstore/books/wrapper",
                             Collections.singletonList(provider));
        wc.path("{id}", 123);
        Book book = wc.get(Book.class);
        assertNotNull(book);
        assertEquals(123L, book.getId());
       
    }
View Full Code Here

    public void testWebClientUnwrapBookWithXslt() throws Exception {
        XSLTJaxbProvider provider = new XSLTJaxbProvider();
        provider.setInTemplate("classpath:/org/apache/cxf/systest/jaxrs/resources/unwrapbook.xsl");
        WebClient wc = WebClient.create("http://localhost:9080/bookstore/books/wrapper",
                             Collections.singletonList(provider));
        wc.path("{id}", 123);
        Book book = wc.get(Book.class);
        assertNotNull(book);
        assertEquals(123L, book.getId());
       
    }
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.