Package org.apache.cxf.systest.jaxrs

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


                              : 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


        books.put(book.getId(), book);
        return books.get(book.getId());
    }
   
    private void init() {
        Book book = new Book();
        book.setId(new Long(123));
        book.setName("CXF in Action");
        books.put(book.getId(), book);
    }
View Full Code Here

    public Book addFastinfoBook(Book book) {
        return book;
    }
   
    public Book getFastinfoBook() {
        return new Book("CXF2", 2L);
    }
View Full Code Here

@Path("/bookstorestorage/")
public class SecureBookStoreNoInterface {
    private Map<Long, Book> books = new HashMap<Long, Book>();
 
    public SecureBookStoreNoInterface() {
        Book book = new Book();
        book.setId(123L);
        book.setName("CXF in Action");
        books.put(book.getId(), book);
    }
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

        for (int i = 0; i < 20; i++) {
            BookStore bookStore = getBookStore(initialAddress, feature);
            verifyStrategy(bookStore, SequentialStrategy.class);
            String bookId = "123";
           
            Book book = bookStore.getBook(bookId);
            assertNotNull("expected non-null response", book);
            assertEquals("unexpected id", 123L, book.getId());
           
            String address = getCurrentEndpointAddress(bookStore);
            if (Server.ADDRESS2.equals(address)) {
                address2Count++;
            } else if (Server.ADDRESS3.equals(address)) {
View Full Code Here

    private void doTestGetBook123Proxy(String configFile) throws Exception {
        BookStore bs = JAXRSClientFactory.create("https://localhost:" + PORT, BookStore.class,
                configFile);
        // just to verify the interface call goes through CGLIB proxy too
        assertEquals("https://localhost:" + PORT, 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

        assertNotNull(bean);
        JAXRSClientFactoryBean cfb = (JAXRSClientFactoryBean) bean;
       
        BookStore bs = cfb.create(BookStore.class);
        assertEquals("https://localhost:" + PORT, 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:" + PORT, BookStore.class,
                                                 CLIENT_CONFIG_FILE1);
        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

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.