use of org.apache.activemq.artemis.tests.integration.rest.util.RestMessageContext in project activemq-artemis by apache.
the class RestDeserializationTest method testBlackWhiteListTopicPull.
@Test
public void testBlackWhiteListTopicPull() throws Exception {
deployAndconfigureRESTService("rest-test-bwlist.war");
RestMessageContext topicContext = restConnection.createTopicContext("ordersTopic");
topicContext.initPullConsumers();
Order order = new Order();
order.setName("Bill");
order.setItem("iPhone4");
order.setAmount("$199.99");
jmsSendMessage(order, "ordersTopic", false);
try {
String received = topicContext.pullMessage();
fail("object should have been rejected but: " + received);
} catch (IllegalStateException e) {
String error = e.getMessage();
assertTrue(error, error.contains("ClassNotFoundException"));
}
}
use of org.apache.activemq.artemis.tests.integration.rest.util.RestMessageContext in project activemq-artemis by apache.
the class RestDeserializationTest method testWithoutBlackWhiteListTopic.
@Test
public void testWithoutBlackWhiteListTopic() throws Exception {
jmsServer.getActiveMQServer().addAddressInfo(new AddressInfo(SimpleString.toSimpleString("ordersTopic"), RoutingType.MULTICAST));
deployAndconfigureRESTService("rest-test.war");
RestMessageContext topicContext = restConnection.createTopicContext("ordersTopic");
topicContext.initPullConsumers();
Order order = new Order();
order.setName("Bill");
order.setItem("iPhone4");
order.setAmount("$199.99");
jmsSendMessage(order, "ordersTopic", false);
String received = topicContext.pullMessage();
Object object = xmlToObject(received);
assertEquals(order, object);
}
use of org.apache.activemq.artemis.tests.integration.rest.util.RestMessageContext in project activemq-artemis by apache.
the class RestDeserializationTest method restReceiveQueueMessage.
private String restReceiveQueueMessage(String destName) throws Exception {
RestMessageContext restContext = restConnection.createQueueContext(destName);
String val = restContext.pullMessage();
return val;
}
Aggregations