activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: [ARTEMIS-1196] Fix missing JSON support
Date Thu, 22 Jun 2017 16:41:55 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master a970b41eb -> 9f25013c5


[ARTEMIS-1196] Fix missing JSON support


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/b6dcff03
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/b6dcff03
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/b6dcff03

Branch: refs/heads/master
Commit: b6dcff039f6c735d7ce89aa29ac001e91b88383d
Parents: a970b41
Author: Guillaume Nodet <gnodet@apache.org>
Authored: Fri May 19 10:01:53 2017 +0200
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Thu Jun 22 12:16:25 2017 -0400

----------------------------------------------------------------------
 .../src/main/resources/features.xml             |  4 ++--
 pom.xml                                         |  1 +
 .../integration/karaf/ArtemisFeatureTest.java   | 25 +++++++++++++++++++-
 3 files changed, 27 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b6dcff03/artemis-features/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/artemis-features/src/main/resources/features.xml b/artemis-features/src/main/resources/features.xml
index b547140..fc9bb78 100644
--- a/artemis-features/src/main/resources/features.xml
+++ b/artemis-features/src/main/resources/features.xml
@@ -54,8 +54,8 @@
 		<bundle dependency="true">mvn:org.jboss.logging/jboss-logging/${jboss.logging.version}</bundle>
 		<bundle dependency="true">mvn:org.jgroups/jgroups/${jgroups.version}</bundle>
 
-		<bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-json_1.0_spec/${json-p.spec.version}</bundle>
-		<bundle dependency="true">mvn:org.apache.johnzon/johnzon-core/${johnzon.version}</bundle>
+		<bundle dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.json-api-1.1/${servicemix.json-1.1.spec.version}</bundle>
+		<bundle>mvn:org.apache.johnzon/johnzon-core/${johnzon.version}</bundle>
 
 		<bundle>mvn:org.apache.activemq/artemis-native/${pom.version}</bundle>
 		<bundle>mvn:org.apache.activemq/artemis-server-osgi/${pom.version}</bundle>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b6dcff03/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a437fa0..840dda1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,6 +104,7 @@
       <arquillian-weld-embedded.version>2.0.0.Beta3</arquillian-weld-embedded.version>
       <owb.version>1.7.0</owb.version>
       <arquillian.version>1.1.11.Final</arquillian.version>
+      <servicemix.json-1.1.spec.version>2.9.0</servicemix.json-1.1.spec.version>
 
       <owasp.version>1.4.3</owasp.version>
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b6dcff03/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java
index 50566f1..aab6b24 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java
@@ -23,14 +23,22 @@ import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.QueueBrowser;
+import javax.jms.QueueRequestor;
+import javax.jms.QueueSession;
+import javax.jms.TextMessage;
+import javax.json.Json;
+import javax.json.JsonArray;
+import javax.json.JsonString;
 import javax.security.auth.Subject;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.PrintStream;
+import java.io.StringReader;
 import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Enumeration;
+import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -148,7 +156,7 @@ public class ArtemisFeatureTest extends Assert {
          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"));
@@ -161,6 +169,21 @@ public class ArtemisFeatureTest extends Assert {
             }
          }
 
+         // 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);
+         assertFalse(queues.isEmpty());
+
          MessageConsumer consumer = sess.createConsumer(queue);
          Message msg = consumer.receive(5000);
          assertNotNull(msg);


Mime
View raw message