Search in sources :

Example 1 with JMSBookStore

use of org.apache.cxf.systest.jaxrs.JMSBookStore in project cxf by apache.

the class JAXRSJmsTest method testGetBookFromProxyClientWithQuery.

@Test
public void testGetBookFromProxyClientWithQuery() throws Exception {
    // setup the the client
    String endpointAddressUrlEncoded = "jms:jndi:dynamicQueues/test.jmstransport.text" + "?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory" + "&replyToName=dynamicQueues/test.jmstransport.response" + "&jndiURL=tcp://localhost:" + JMS_PORT + "&jndiConnectionFactoryName=ConnectionFactory";
    JMSBookStore client = JAXRSClientFactory.create(endpointAddressUrlEncoded, JMSBookStore.class);
    Book book = client.getBookByURLQuery(new String[] { "1", "2", "3" });
    assertEquals("Get a wrong response code.", 200, WebClient.client(client).getResponse().getStatus());
    assertEquals("Get a wrong book id.", 123, book.getId());
}
Also used : JMSBookStore(org.apache.cxf.systest.jaxrs.JMSBookStore) Book(org.apache.cxf.systest.jaxrs.Book) Test(org.junit.Test)

Example 2 with JMSBookStore

use of org.apache.cxf.systest.jaxrs.JMSBookStore in project cxf by apache.

the class JAXRSJmsTest method testGetBookFromSubresourceProxyClientWithTextJMSMessage.

@Test
public void testGetBookFromSubresourceProxyClientWithTextJMSMessage() throws Exception {
    // setup the the client
    String endpointAddressUrlEncoded = "jms:jndi:dynamicQueues/test.jmstransport.text" + "?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory" + "&replyToName=dynamicQueues/test.jmstransport.response" + "&jndiURL=tcp://localhost:" + JMS_PORT + "&jndiConnectionFactoryName=ConnectionFactory" + "&messageType=text";
    JMSBookStore client = JAXRSClientFactory.create(endpointAddressUrlEncoded, JMSBookStore.class);
    Book bookProxy = client.getBookSubResource("123");
    Book book = bookProxy.retrieveState();
    assertEquals("Get a wrong response code.", 200, WebClient.client(bookProxy).getResponse().getStatus());
    assertEquals("Get a wrong book id.", 123, book.getId());
}
Also used : JMSBookStore(org.apache.cxf.systest.jaxrs.JMSBookStore) Book(org.apache.cxf.systest.jaxrs.Book) Test(org.junit.Test)

Example 3 with JMSBookStore

use of org.apache.cxf.systest.jaxrs.JMSBookStore in project cxf by apache.

the class JAXRSJmsTest method testGetBookFromSubresourceProxyClient.

@Test
public void testGetBookFromSubresourceProxyClient() throws Exception {
    // setup the the client
    String endpointAddressUrlEncoded = "jms:jndi:dynamicQueues/test.jmstransport.text" + "?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory" + "&replyToName=dynamicQueues/test.jmstransport.response" + "&jndiURL=tcp://localhost:" + JMS_PORT + "&jndiConnectionFactoryName=ConnectionFactory";
    JMSBookStore client = JAXRSClientFactory.create(endpointAddressUrlEncoded, JMSBookStore.class);
    Book bookProxy = client.getBookSubResource("123");
    Book book = bookProxy.retrieveState();
    assertEquals("Get a wrong response code.", 200, WebClient.client(bookProxy).getResponse().getStatus());
    assertEquals("Get a wrong book id.", 123, book.getId());
}
Also used : JMSBookStore(org.apache.cxf.systest.jaxrs.JMSBookStore) Book(org.apache.cxf.systest.jaxrs.Book) Test(org.junit.Test)

Example 4 with JMSBookStore

use of org.apache.cxf.systest.jaxrs.JMSBookStore in project cxf by apache.

the class JAXRSJmsTest method testGetBookFromProxyClient.

@Test
public void testGetBookFromProxyClient() throws Exception {
    // setup the the client
    String endpointAddressUrlEncoded = "jms:jndi:dynamicQueues/test.jmstransport.text" + "?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory" + "&replyToName=dynamicQueues/test.jmstransport.response" + "&jndiURL=tcp://localhost:" + JMS_PORT + "&jndiConnectionFactoryName=ConnectionFactory";
    JMSBookStore client = JAXRSClientFactory.create(endpointAddressUrlEncoded, JMSBookStore.class);
    Book book = client.getBook("123");
    assertEquals("Get a wrong response code.", 200, WebClient.client(client).getResponse().getStatus());
    assertEquals("Get a wrong book id.", 123, book.getId());
}
Also used : JMSBookStore(org.apache.cxf.systest.jaxrs.JMSBookStore) Book(org.apache.cxf.systest.jaxrs.Book) Test(org.junit.Test)

Example 5 with JMSBookStore

use of org.apache.cxf.systest.jaxrs.JMSBookStore in project cxf by apache.

the class JAXRSJmsTest method testGetBookFromProxyClientWithTextJMSMessage.

@Test
public void testGetBookFromProxyClientWithTextJMSMessage() throws Exception {
    // setup the the client
    String endpointAddressUrlEncoded = "jms:jndi:dynamicQueues/test.jmstransport.text" + "?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory" + "&replyToName=dynamicQueues/test.jmstransport.response" + "&jndiURL=tcp://localhost:" + JMS_PORT + "&jndiConnectionFactoryName=ConnectionFactory" + "&messageType=text";
    JMSBookStore client = JAXRSClientFactory.create(endpointAddressUrlEncoded, JMSBookStore.class);
    Book book = client.getBook("123");
    assertEquals("Get a wrong response code.", 200, WebClient.client(client).getResponse().getStatus());
    assertEquals("Get a wrong book id.", 123, book.getId());
}
Also used : JMSBookStore(org.apache.cxf.systest.jaxrs.JMSBookStore) Book(org.apache.cxf.systest.jaxrs.Book) Test(org.junit.Test)

Aggregations

Book (org.apache.cxf.systest.jaxrs.Book)6 JMSBookStore (org.apache.cxf.systest.jaxrs.JMSBookStore)6 Test (org.junit.Test)6