Search in sources :

Example 1 with BookInfo

use of org.apache.cxf.systest.jaxrs.BookStore.BookInfo in project cxf by apache.

the class JAXRSClientServerBookTest method testGetBookAdapterInfoProxy.

@Test
public void testGetBookAdapterInfoProxy() throws Exception {
    BookStore store = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
    BookInfo info = store.getBookAdapter();
    assertEquals(123L, info.getId());
}
Also used : BookInfo(org.apache.cxf.systest.jaxrs.BookStore.BookInfo) Test(org.junit.Test)

Example 2 with BookInfo

use of org.apache.cxf.systest.jaxrs.BookStore.BookInfo in project cxf by apache.

the class JAXRS20ClientServerBookTest method testGetBookWebTargetInjectableProvider.

@Test
public void testGetBookWebTargetInjectableProvider() {
    String address = "http://localhost:" + PORT + "/bookstore/bookheaders";
    Client client = ClientBuilder.newClient();
    client.register(new BookInfoInjectableReader());
    BookInfo book = client.target(address).path("simple").request("application/xml").get(BookInfo.class);
    assertEquals(124L, book.getId());
}
Also used : BookInfo(org.apache.cxf.systest.jaxrs.BookStore.BookInfo) Client(javax.ws.rs.client.Client) WebClient(org.apache.cxf.jaxrs.client.WebClient) Test(org.junit.Test)

Example 3 with BookInfo

use of org.apache.cxf.systest.jaxrs.BookStore.BookInfo in project cxf by apache.

the class JAXRS20ClientServerBookTest method testGetBookSpecProviderWithFeature.

@Test
public void testGetBookSpecProviderWithFeature() {
    String address = "http://localhost:" + PORT + "/bookstore/bookheaders/simple";
    Client client = ClientBuilder.newClient();
    client.register(new ClientTestFeature());
    WebTarget target = client.target(address);
    BookInfo book = target.request("application/xml").get(BookInfo.class);
    assertEquals(124L, book.getId());
    book = target.request("application/xml").get(BookInfo.class);
    assertEquals(124L, book.getId());
}
Also used : BookInfo(org.apache.cxf.systest.jaxrs.BookStore.BookInfo) WebTarget(javax.ws.rs.client.WebTarget) Client(javax.ws.rs.client.Client) WebClient(org.apache.cxf.jaxrs.client.WebClient) Test(org.junit.Test)

Example 4 with BookInfo

use of org.apache.cxf.systest.jaxrs.BookStore.BookInfo in project cxf by apache.

the class JAXRS20ClientServerBookTest method testGetBookSpecProvider.

@Test
public void testGetBookSpecProvider() {
    String address = "http://localhost:" + PORT + "/bookstore/bookheaders/simple";
    Client client = ClientBuilder.newClient();
    client.register(new BookInfoReader());
    WebTarget target = client.target(address);
    BookInfo book = target.request("application/xml").get(BookInfo.class);
    assertEquals(124L, book.getId());
    book = target.request("application/xml").get(BookInfo.class);
    assertEquals(124L, book.getId());
}
Also used : BookInfo(org.apache.cxf.systest.jaxrs.BookStore.BookInfo) WebTarget(javax.ws.rs.client.WebTarget) Client(javax.ws.rs.client.Client) WebClient(org.apache.cxf.jaxrs.client.WebClient) Test(org.junit.Test)

Example 5 with BookInfo

use of org.apache.cxf.systest.jaxrs.BookStore.BookInfo in project cxf by apache.

the class JAXRS20ClientServerBookTest method testGetBookWebTargetProvider.

@Test
public void testGetBookWebTargetProvider() {
    String address = "http://localhost:" + PORT + "/bookstore/bookheaders";
    Client client = ClientBuilder.newClient();
    client.register(new BookInfoReader());
    BookInfo book = client.target(address).path("simple").request("application/xml").get(BookInfo.class);
    assertEquals(124L, book.getId());
}
Also used : BookInfo(org.apache.cxf.systest.jaxrs.BookStore.BookInfo) Client(javax.ws.rs.client.Client) WebClient(org.apache.cxf.jaxrs.client.WebClient) Test(org.junit.Test)

Aggregations

BookInfo (org.apache.cxf.systest.jaxrs.BookStore.BookInfo)6 Test (org.junit.Test)6 Client (javax.ws.rs.client.Client)4 WebClient (org.apache.cxf.jaxrs.client.WebClient)4 WebTarget (javax.ws.rs.client.WebTarget)2