Search in sources :

Example 6 with JMSBookStore

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

the class JAXRSJmsTest method testGetBookFromProxyClientWithQueryWithTextJMSMessage.

@Test
public void testGetBookFromProxyClientWithQueryWithTextJMSMessage() 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.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)

Aggregations

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