activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michaelandrepearce <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #1307: [ARTEMIS-1196] Fix missing JSON support
Date Wed, 31 May 2017 13:22:34 GMT
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1307#discussion_r119352351
  
    --- Diff: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java
---
    @@ -146,11 +155,26 @@ public Boolean call() throws Exception {
              connection = factory.createConnection(USER, PASSWORD);
              connection.start();
     
    -         javax.jms.Session sess = connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
    +         QueueSession sess = (QueueSession) connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
              Queue queue = sess.createQueue("exampleQueue");
              MessageProducer producer = sess.createProducer(queue);
              producer.send(sess.createTextMessage("TEST"));
     
    +         // Test management
    +         Queue managementQueue = sess.createQueue("activemq.management");
    +         QueueRequestor requestor = new QueueRequestor(sess, managementQueue);
    +         connection.start();
    +         TextMessage m = sess.createTextMessage();
    +         m.setStringProperty("_AMQ_ResourceName", "broker");
    +         m.setStringProperty("_AMQ_OperationName", "getQueueNames");
    +         m.setText("[\"ANYCAST\"]");
    +         Message reply = requestor.request(m);
    +         String json = ((TextMessage) reply).getText();
    +         JsonArray array = Json.createReader(new StringReader(json)).readArray();
    +         List<JsonString> queues = (List<JsonString>) array.get(0);
    +         assertNotNull(queues);
    +         System.out.println(queues.stream().map(JsonString::getString).collect(Collectors.joining(",
", "Queues: ", "")));
    --- End diff --
    
    If we could let's not add to the noise


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message