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());
}
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());
}
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());
}
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());
}
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());
}
Aggregations