You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2015/09/11 16:17:38 UTC
activemq-artemis git commit: fixing checkstyle on example
Repository: activemq-artemis
Updated Branches:
refs/heads/master 243a94176 -> 490662923
fixing checkstyle on example
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/49066292
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/49066292
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/49066292
Branch: refs/heads/master
Commit: 490662923c14014233b38850ee8968283be1dc76
Parents: 243a941
Author: Clebert Suconic <cl...@apache.org>
Authored: Fri Sep 11 10:16:28 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Sep 11 10:16:34 2015 -0400
----------------------------------------------------------------------
examples/protocols/amqp/queue/pom.xml | 2 +-
.../artemis/jms/example/AMQPQueueExample.java | 67 ++++++++++++++++++++
.../artemis/jms/example/ProtonJExample.java | 67 --------------------
.../artemis/tests/unit/util/LinkedListTest.java | 10 +--
4 files changed, 73 insertions(+), 73 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/49066292/examples/protocols/amqp/queue/pom.xml
----------------------------------------------------------------------
diff --git a/examples/protocols/amqp/queue/pom.xml b/examples/protocols/amqp/queue/pom.xml
index 8a2b028..c0ade01 100644
--- a/examples/protocols/amqp/queue/pom.xml
+++ b/examples/protocols/amqp/queue/pom.xml
@@ -78,7 +78,7 @@ under the License.
<goal>runClient</goal>
</goals>
<configuration>
- <clientClass>org.apache.activemq.artemis.jms.example.ProtonJExample</clientClass>
+ <clientClass>org.apache.activemq.artemis.jms.example.AMQPQueueExample</clientClass>
</configuration>
</execution>
<execution>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/49066292/examples/protocols/amqp/queue/src/main/java/org/apache/activemq/artemis/jms/example/AMQPQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/amqp/queue/src/main/java/org/apache/activemq/artemis/jms/example/AMQPQueueExample.java b/examples/protocols/amqp/queue/src/main/java/org/apache/activemq/artemis/jms/example/AMQPQueueExample.java
new file mode 100644
index 0000000..ea3f006
--- /dev/null
+++ b/examples/protocols/amqp/queue/src/main/java/org/apache/activemq/artemis/jms/example/AMQPQueueExample.java
@@ -0,0 +1,67 @@
+/*
+ * 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.jms.example;
+
+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 org.apache.qpid.jms.JmsConnectionFactory;
+
+public class AMQPQueueExample {
+
+ public static void main(String[] args) throws Exception {
+ Connection connection = null;
+ ConnectionFactory connectionFactory = new JmsConnectionFactory("amqp://localhost:5672");
+
+ try {
+
+ // Step 1. Create an amqp qpid 1.0 connection
+ connection = connectionFactory.createConnection();
+
+ // Step 2. Create a session
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ // Step 3. Create a sender
+ Queue queue = session.createQueue("jms.queue.exampleQueue");
+ MessageProducer sender = session.createProducer(queue);
+
+ // Step 4. send a few simple message
+ sender.send(session.createTextMessage("Hello world "));
+
+ connection.start();
+
+ // Step 5. create a moving receiver, this means the message will be removed from the queue
+ MessageConsumer consumer = session.createConsumer(queue);
+
+ // Step 7. receive the simple message
+ TextMessage m = (TextMessage) consumer.receive(5000);
+ System.out.println("message = " + m.getText());
+
+ }
+ finally {
+ if (connection != null) {
+ // Step 9. close the connection
+ connection.close();
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/49066292/examples/protocols/amqp/queue/src/main/java/org/apache/activemq/artemis/jms/example/ProtonJExample.java
----------------------------------------------------------------------
diff --git a/examples/protocols/amqp/queue/src/main/java/org/apache/activemq/artemis/jms/example/ProtonJExample.java b/examples/protocols/amqp/queue/src/main/java/org/apache/activemq/artemis/jms/example/ProtonJExample.java
deleted file mode 100644
index fa50e1a..0000000
--- a/examples/protocols/amqp/queue/src/main/java/org/apache/activemq/artemis/jms/example/ProtonJExample.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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.jms.example;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.MessageProducer;
-import javax.jms.*;
-
-
-import org.apache.qpid.jms.JmsConnectionFactory;
-
-public class ProtonJExample {
-
- public static void main(String[] args) throws Exception {
- Connection connection = null;
- ConnectionFactory connectionFactory = new JmsConnectionFactory("amqp://localhost:5672");
-
- try {
-
-
- // Step 1. Create an amqp qpid 1.0 connection
- connection = connectionFactory.createConnection();
-
- // Step 2. Create a session
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Step 3. Create a sender
- Queue queue = session.createQueue("jms.queue.exampleQueue");
- MessageProducer sender = session.createProducer(queue);
-
- // Step 4. send a few simple message
- sender.send(session.createTextMessage("Hello world "));
-
- connection.start();
-
- // Step 5. create a moving receiver, this means the message will be removed from the queue
- MessageConsumer consumer = session.createConsumer(queue);
-
-
- // Step 7. receive the simple message
- TextMessage m = (TextMessage) consumer.receive(5000);
- System.out.println("message = " + m.getText());
-
- }
- finally {
- if (connection != null) {
- // Step 9. close the connection
- connection.close();
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/49066292/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java
index 5f180e7..504d499 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/util/LinkedListTest.java
@@ -61,13 +61,13 @@ public class LinkedListTest extends ActiveMQTestBase {
LinkedListImpl<MyObject> objs = new LinkedListImpl<MyObject>();
// Initial add
- for (int i = 0; i < 1000; i++) {
+ for (int i = 0; i < 100; i++) {
objs.addTail(new MyObject());
}
LinkedListIterator<MyObject> iter = objs.iterator();
- for (int i = 0; i < 5000; i++) {
+ for (int i = 0; i < 500; i++) {
for (int add = 0; add < 1000; add++) {
objs.addTail(new MyObject());
@@ -78,12 +78,12 @@ public class LinkedListTest extends ActiveMQTestBase {
iter.remove();
}
- if (i % 1000 == 0) {
- assertCount(1000, count);
+ if (i % 100 == 0) {
+ assertCount(100, count);
}
}
- assertCount(1000, count);
+ assertCount(100, count);
while (iter.hasNext()) {
iter.next();