You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2018/03/05 21:13:12 UTC

[1/2] activemq-artemis git commit: This closes #1922

Repository: activemq-artemis
Updated Branches:
  refs/heads/master c009c90cb -> a088abf9d


This closes #1922


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

Branch: refs/heads/master
Commit: a088abf9d4c387e304a1138b3ec85d69fdc4096c
Parents: c009c90 2394626
Author: Justin Bertram <jb...@apache.org>
Authored: Mon Mar 5 15:12:23 2018 -0600
Committer: Justin Bertram <jb...@apache.org>
Committed: Mon Mar 5 15:12:23 2018 -0600

----------------------------------------------------------------------
 .../src/main/resources/features.xml             |  8 ++
 tests/karaf-client-integration-tests/pom.xml    | 12 +++
 .../client/ArtemisOpenwireClientFeatureIT.java  | 92 ++++++++++++++++++++
 .../karaf/client/PaxExamOptions.java            | 10 +++
 4 files changed, 122 insertions(+)
----------------------------------------------------------------------



[2/2] activemq-artemis git commit: [ARTEMIS-1724] Create Artemis Openwire client Karaf feature

Posted by jb...@apache.org.
[ARTEMIS-1724] Create Artemis Openwire client Karaf feature


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

Branch: refs/heads/master
Commit: 239462652196facc5a56191114d3bb38615099f4
Parents: c009c90
Author: jpoth <po...@gmail.com>
Authored: Thu Mar 1 20:42:07 2018 +0100
Committer: Justin Bertram <jb...@apache.org>
Committed: Mon Mar 5 15:12:23 2018 -0600

----------------------------------------------------------------------
 .../src/main/resources/features.xml             |  8 ++
 tests/karaf-client-integration-tests/pom.xml    | 12 +++
 .../client/ArtemisOpenwireClientFeatureIT.java  | 92 ++++++++++++++++++++
 .../karaf/client/PaxExamOptions.java            | 10 +++
 4 files changed, 122 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/23946265/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 92803ec..38764e9 100644
--- a/artemis-features/src/main/resources/features.xml
+++ b/artemis-features/src/main/resources/features.xml
@@ -117,4 +117,12 @@
 		<bundle>mvn:org.apache.activemq/artemis-openwire-protocol/${pom.version}</bundle>
 	</feature>
 
+	<feature name="artemis-openwire-client" version="${pom.version}" description="ActiveMQ Artemis Openwire Client libraries">
+		<feature>transaction</feature>
+		<bundle dependency="true">mvn:org.fusesource.hawtbuf/hawtbuf/${hawtbuff.version}</bundle>
+		<bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1</bundle>
+		<bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/1.0.1</bundle>
+		<bundle>mvn:org.apache.activemq/activemq-client/${activemq5-version}</bundle>
+	</feature>
+
 </features>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/23946265/tests/karaf-client-integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/tests/karaf-client-integration-tests/pom.xml b/tests/karaf-client-integration-tests/pom.xml
index 927e122..333cb41 100644
--- a/tests/karaf-client-integration-tests/pom.xml
+++ b/tests/karaf-client-integration-tests/pom.xml
@@ -38,6 +38,18 @@
    <dependencies>
       <dependency>
          <groupId>org.apache.activemq</groupId>
+         <artifactId>activemq-client</artifactId>
+         <scope>test</scope>
+         <exclusions>
+            <exclusion>
+               <!--Let's compile against JMS 2-->
+               <groupId>org.apache.geronimo.specs</groupId>
+               <artifactId>geronimo-jms_1.1_spec</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
          <artifactId>artemis-jms-client</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/23946265/tests/karaf-client-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/client/ArtemisOpenwireClientFeatureIT.java
----------------------------------------------------------------------
diff --git a/tests/karaf-client-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/client/ArtemisOpenwireClientFeatureIT.java b/tests/karaf-client-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/client/ArtemisOpenwireClientFeatureIT.java
new file mode 100644
index 0000000..1c78489
--- /dev/null
+++ b/tests/karaf-client-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/client/ArtemisOpenwireClientFeatureIT.java
@@ -0,0 +1,92 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.tests.integration.karaf.client;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import java.io.IOException;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+
+import static org.apache.activemq.artemis.tests.integration.karaf.client.PaxExamOptions.ARTEMIS_OPENWIRE_CLIENT;
+import static org.apache.activemq.artemis.tests.integration.karaf.client.PaxExamOptions.ARTEMIS_TRANSACTION_MANAGER;
+import static org.apache.activemq.artemis.tests.integration.karaf.client.PaxExamOptions.KARAF;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.when;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.debugConfiguration;
+
+
+/**
+ * Useful docs about this test: https://ops4j1.jira.com/wiki/display/paxexam/FAQ
+ */
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class ArtemisOpenwireClientFeatureIT {
+
+   @Configuration
+   public Option[] config() throws IOException {
+      return options(
+              KARAF.option(),
+              ARTEMIS_OPENWIRE_CLIENT.option(),
+              ARTEMIS_TRANSACTION_MANAGER.option(),
+              when(false)
+                      .useOptions(
+                              debugConfiguration("5005", true))
+      );
+   }
+
+   @Test
+   public void testArtemisOpenwireClient() throws Exception {
+      ConnectionFactory cf = new ActiveMQConnectionFactory();
+      Connection connection = cf.createConnection();
+      try {
+         Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
+         Queue queue = session.createQueue("artemisOpenwireClientFeatureIT");
+         MessageProducer producer = session.createProducer(queue);
+
+         String msg = "This is a text message";
+         TextMessage message = session.createTextMessage(msg);
+
+         producer.send(message);
+
+         MessageConsumer messageConsumer = session.createConsumer(queue);
+
+         connection.start();
+
+         TextMessage messageReceived = (TextMessage) messageConsumer.receive(100);
+         assertNull(messageReceived);
+         session.commit();
+         messageReceived = (TextMessage) messageConsumer.receive(100);
+         assertEquals(msg, messageReceived.getText());
+      } finally {
+         connection.close();
+      }
+   }
+}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/23946265/tests/karaf-client-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/client/PaxExamOptions.java
----------------------------------------------------------------------
diff --git a/tests/karaf-client-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/client/PaxExamOptions.java b/tests/karaf-client-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/client/PaxExamOptions.java
index 1899b16..34229ca 100644
--- a/tests/karaf-client-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/client/PaxExamOptions.java
+++ b/tests/karaf-client-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/client/PaxExamOptions.java
@@ -75,6 +75,16 @@ public enum PaxExamOptions {
                            .versionAsInProject(),
                    "artemis-amqp-client")
    ),
+   ARTEMIS_OPENWIRE_CLIENT(
+           features(
+                   maven()
+                           .groupId("org.apache.activemq")
+                           .artifactId("artemis-features")
+                           .type("xml")
+                           .classifier("features")
+                           .versionAsInProject(),
+                   "artemis-openwire-client")
+   ),
    ARTEMIS_TRANSACTION_MANAGER(
            features(
                    maven()