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 2016/07/28 21:27:08 UTC

[01/11] activemq-artemis git commit: Fix NPE with null session in MQTTConnectionManager.disconnect()

Repository: activemq-artemis
Updated Branches:
  refs/heads/master fc35f6128 -> c530ce103


Fix NPE with null session in MQTTConnectionManager.disconnect()


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

Branch: refs/heads/master
Commit: 9963f96033418107f5caa5eb86f16ce74ac28312
Parents: a6a03d4
Author: Ville Skytt� <vi...@iki.fi>
Authored: Thu Jul 28 23:23:40 2016 +0300
Committer: Ville Skytt� <vi...@iki.fi>
Committed: Thu Jul 28 23:30:02 2016 +0300

----------------------------------------------------------------------
 .../artemis/core/protocol/mqtt/MQTTConnectionManager.java       | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9963f960/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java
index a3b8b78..a05ecb5 100644
--- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java
+++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTConnectionManager.java
@@ -106,8 +106,11 @@ public class MQTTConnectionManager {
    }
 
    void disconnect() {
+      if (session == null) {
+         return;
+      }
       try {
-         if (session != null && session.getSessionState() != null) {
+         if (session.getSessionState() != null) {
             String clientId = session.getSessionState().getClientId();
             if (clientId != null)
                CONNECTED_CLIENTS.remove(clientId);


[10/11] activemq-artemis git commit: Fix Netty topology factory class test

Posted by cl...@apache.org.
Fix Netty topology factory class test


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

Branch: refs/heads/master
Commit: 0aa7dd1905c0fb1b9fa449849024aaaf58154611
Parents: 8562b8b
Author: Ville Skytt� <vi...@iki.fi>
Authored: Thu Jul 28 23:05:08 2016 +0300
Committer: Ville Skytt� <vi...@iki.fi>
Committed: Thu Jul 28 23:30:02 2016 +0300

----------------------------------------------------------------------
 .../cluster/topology/NonHATopologyTest.java           | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0aa7dd19/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java
index b6eed8a..c039b11 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/NonHATopologyTest.java
@@ -82,14 +82,12 @@ public class NonHATopologyTest extends ActiveMQTestBase {
 
          factory.close();
 
-         if (!isNetty) {
-            TopologyMemberImpl member = topology.getMembers().iterator().next();
-            if (isNetty) {
-               assertEquals(NettyConnectorFactory.class.getName(), member.getLive().getFactoryClassName());
-            }
-            else {
-               assertEquals(InVMConnectorFactory.class.getName(), member.getLive().getFactoryClassName());
-            }
+         TopologyMemberImpl member = topology.getMembers().iterator().next();
+         if (isNetty) {
+            assertEquals(NettyConnectorFactory.class.getName(), member.getLive().getFactoryClassName());
+         }
+         else {
+            assertEquals(InVMConnectorFactory.class.getName(), member.getLive().getFactoryClassName());
          }
 
       }


[02/11] activemq-artemis git commit: Fix journal compact test slow appender loop counters

Posted by cl...@apache.org.
Fix journal compact test slow appender loop counters


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

Branch: refs/heads/master
Commit: a6a03d498505adf226fea49b0266a33e74488fb9
Parents: fa191ba
Author: Ville Skytt� <vi...@iki.fi>
Authored: Thu Jul 28 23:20:07 2016 +0300
Committer: Ville Skytt� <vi...@iki.fi>
Committed: Thu Jul 28 23:30:02 2016 +0300

----------------------------------------------------------------------
 .../tests/stress/journal/JournalCleanupCompactStressTest.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a6a03d49/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalCleanupCompactStressTest.java
----------------------------------------------------------------------
diff --git a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalCleanupCompactStressTest.java b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalCleanupCompactStressTest.java
index ae2b2f1..849e285 100644
--- a/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalCleanupCompactStressTest.java
+++ b/tests/stress-tests/src/test/java/org/apache/activemq/artemis/tests/stress/journal/JournalCleanupCompactStressTest.java
@@ -486,7 +486,7 @@ public class JournalCleanupCompactStressTest extends ActiveMQTestBase {
             while (running) {
                long[] ids = new long[5];
                // Append
-               for (int i = 0; running & i < ids.length; i++) {
+               for (int i = 0; running && i < ids.length; i++) {
                   System.out.println("append slow");
                   ids[i] = JournalCleanupCompactStressTest.idGen.generateID();
                   maxRecords.acquire();
@@ -500,7 +500,7 @@ public class JournalCleanupCompactStressTest extends ActiveMQTestBase {
                   rwLock.readLock().lock();
                }
                // Delete
-               for (int i = 0; running & i < ids.length; i++) {
+               for (int i = 0; running && i < ids.length; i++) {
                   System.out.println("Deleting");
                   maxRecords.release();
                   journal.appendDeleteRecord(ids[i], false);


[03/11] activemq-artemis git commit: Fix nonexistent property test for bytes

Posted by cl...@apache.org.
Fix nonexistent property test for bytes


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

Branch: refs/heads/master
Commit: 83adee59b23e2ea985d1e2f4906a2f8beea102ba
Parents: 04eed1b
Author: Ville Skytt� <vi...@iki.fi>
Authored: Thu Jul 28 22:52:11 2016 +0300
Committer: Ville Skytt� <vi...@iki.fi>
Committed: Thu Jul 28 23:30:02 2016 +0300

----------------------------------------------------------------------
 .../activemq/artemis/tests/integration/jms/JmsProducerTest.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/83adee59/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/JmsProducerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/JmsProducerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/JmsProducerTest.java
index 7cf4f18..2aba1c4 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/JmsProducerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/JmsProducerTest.java
@@ -161,7 +161,7 @@ public class JmsProducerTest extends JMSTestBase {
             byte value1 = producer.getByteProperty("testGetNonExistentProperties");
 
             if (expected == null) {
-               assertEquals("value0: " + value0 + " value1: " + value1, value1 == value0);
+               assertTrue("value0: " + value0 + " value1: " + value1, value1 == value0);
             }
             else {
                fail("non existent byte property expects exception, but got value: " + value1);


[05/11] activemq-artemis git commit: Fix CCE in UnaryExpression.equals

Posted by cl...@apache.org.
Fix CCE in UnaryExpression.equals


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

Branch: refs/heads/master
Commit: d09209936a3185bd89e30a0983ff171741b0e0e8
Parents: 2ec6a6d
Author: Ville Skytt� <vi...@iki.fi>
Authored: Thu Jul 28 21:29:57 2016 +0300
Committer: Ville Skytt� <vi...@iki.fi>
Committed: Thu Jul 28 23:30:02 2016 +0300

----------------------------------------------------------------------
 .../selector/filter/UnaryExpression.java        |  2 +-
 .../selector/filter/UnaryExpressionTest.java    | 33 ++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d0920993/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java
----------------------------------------------------------------------
diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java
index 3121ac2..e0853c6 100755
--- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java
+++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java
@@ -262,7 +262,7 @@ public abstract class UnaryExpression implements Expression {
          return false;
       }
 
-      final BinaryExpression that = (BinaryExpression) o;
+      final UnaryExpression that = (UnaryExpression) o;
 
       if (!this.getExpressionSymbol().equals(that.getExpressionSymbol())) {
          return false;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d0920993/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/filter/UnaryExpressionTest.java
----------------------------------------------------------------------
diff --git a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/filter/UnaryExpressionTest.java b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/filter/UnaryExpressionTest.java
new file mode 100755
index 0000000..6e6ab43
--- /dev/null
+++ b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/filter/UnaryExpressionTest.java
@@ -0,0 +1,33 @@
+/*
+ * 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.selector.filter;
+
+import org.apache.activemq.artemis.selector.impl.SelectorParser;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class UnaryExpressionTest {
+
+   @Test
+   public void testEquals() throws Exception {
+      BooleanExpression expr1 = UnaryExpression.createNOT(SelectorParser.parse("x = 1"));
+      BooleanExpression expr2 = UnaryExpression.createNOT(SelectorParser.parse("x = 1"));
+      Assert.assertTrue("Created unary expression 1", expr1 instanceof UnaryExpression);
+      Assert.assertTrue("Created unary expression 2", expr2 instanceof UnaryExpression);
+      Assert.assertEquals("Unary expressions are equal", expr1, expr2);
+   }
+}


[04/11] activemq-artemis git commit: Fix JDBCSequentialFileFactory build on 1.7

Posted by cl...@apache.org.
Fix JDBCSequentialFileFactory build on 1.7


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

Branch: refs/heads/master
Commit: 2ec6a6d45d020ed3b9bbcbb812ddc27ecfa3969e
Parents: fc35f61
Author: Ville Skytt� <vi...@iki.fi>
Authored: Thu Jul 28 21:24:55 2016 +0300
Committer: Ville Skytt� <vi...@iki.fi>
Committed: Thu Jul 28 23:30:02 2016 +0300

----------------------------------------------------------------------
 .../artemis/jdbc/store/file/JDBCSequentialFileFactory.java       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2ec6a6d4/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactory.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactory.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactory.java
index 3454757..cf45a8a 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactory.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactory.java
@@ -81,7 +81,9 @@ public class JDBCSequentialFileFactory implements SequentialFileFactory, ActiveM
    @Override
    public SequentialFile createSequentialFile(String fileName) {
       try {
-         fileLocks.putIfAbsent(fileName, new Object());
+         if (fileLocks.get(fileName) == null) {
+            fileLocks.put(fileName, new Object());
+         }
          JDBCSequentialFile file = new JDBCSequentialFile(this, fileName, executor, dbDriver, fileLocks.get(fileName));
          files.add(file);
          return file;


[11/11] activemq-artemis git commit: This closes #683

Posted by cl...@apache.org.
This closes #683


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

Branch: refs/heads/master
Commit: c530ce10343137d09a7a85ee9abcbd3b90fed649
Parents: fc35f61 9963f96
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Jul 28 17:27:01 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Jul 28 17:27:01 2016 -0400

----------------------------------------------------------------------
 .../store/file/JDBCSequentialFileFactory.java   |  4 ++-
 .../protocol/mqtt/MQTTConnectionManager.java    |  5 ++-
 .../selector/filter/UnaryExpression.java        |  2 +-
 .../selector/filter/UnaryExpressionTest.java    | 33 ++++++++++++++++++++
 .../ldap/InMemoryDirectoryServiceFactory.java   |  2 +-
 .../transport/tcp/SslTransportFactoryTest.java  |  2 +-
 .../extras/jms/xa/JMSXDeliveryCountTest.java    |  6 ++--
 .../integration/client/JournalCrashTest.java    | 23 +++-----------
 .../tests/integration/client/PagingTest.java    |  2 +-
 .../cluster/topology/NonHATopologyTest.java     | 14 ++++-----
 .../tests/integration/jms/JmsProducerTest.java  |  2 +-
 .../integration/stomp/v11/StompV11Test.java     |  5 +--
 .../integration/stomp/v12/StompV12Test.java     |  5 +--
 .../message/JMSCorrelationIDHeaderTest.java     |  2 +-
 .../message/foreign/ForeignMessageTest.java     |  2 +-
 .../JournalCleanupCompactStressTest.java        |  4 +--
 16 files changed, 67 insertions(+), 46 deletions(-)
----------------------------------------------------------------------



[09/11] activemq-artemis git commit: Fix some potential NPEs in examples and tests

Posted by cl...@apache.org.
Fix some potential NPEs in examples and tests


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

Branch: refs/heads/master
Commit: 04eed1b7f4c5551746c883aa640ef5279ba9f30e
Parents: 6122223
Author: Ville Skytt� <vi...@iki.fi>
Authored: Thu Jul 28 22:50:55 2016 +0300
Committer: Ville Skytt� <vi...@iki.fi>
Committed: Thu Jul 28 23:30:02 2016 +0300

----------------------------------------------------------------------
 .../ldap/InMemoryDirectoryServiceFactory.java   |  2 +-
 .../extras/jms/xa/JMSXDeliveryCountTest.java    |  6 ++---
 .../integration/client/JournalCrashTest.java    | 23 ++++----------------
 .../integration/stomp/v11/StompV11Test.java     |  5 +++--
 .../integration/stomp/v12/StompV12Test.java     |  5 +++--
 5 files changed, 13 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/04eed1b7/examples/features/standard/security-ldap/src/main/java/org/apache/activemq/artemis/jms/example/ldap/InMemoryDirectoryServiceFactory.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/security-ldap/src/main/java/org/apache/activemq/artemis/jms/example/ldap/InMemoryDirectoryServiceFactory.java b/examples/features/standard/security-ldap/src/main/java/org/apache/activemq/artemis/jms/example/ldap/InMemoryDirectoryServiceFactory.java
index ce48693..d7ebde4 100644
--- a/examples/features/standard/security-ldap/src/main/java/org/apache/activemq/artemis/jms/example/ldap/InMemoryDirectoryServiceFactory.java
+++ b/examples/features/standard/security-ldap/src/main/java/org/apache/activemq/artemis/jms/example/ldap/InMemoryDirectoryServiceFactory.java
@@ -89,7 +89,7 @@ public class InMemoryDirectoryServiceFactory implements DirectoryServiceFactory
     */
    @Override
    public void init(String name) throws Exception {
-      if ((directoryService != null) && directoryService.isStarted()) {
+      if ((directoryService == null) || directoryService.isStarted()) {
          return;
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/04eed1b7/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/xa/JMSXDeliveryCountTest.java
----------------------------------------------------------------------
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/xa/JMSXDeliveryCountTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/xa/JMSXDeliveryCountTest.java
index 1d71598..3c1c0b5 100644
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/xa/JMSXDeliveryCountTest.java
+++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/xa/JMSXDeliveryCountTest.java
@@ -671,12 +671,10 @@ public class JMSXDeliveryCountTest extends JMSTestBase {
                   if (tm == null) {
                      failed = true;
                   }
-
-                  if (!tm.getText().equals("testing" + i)) {
+                  else if (!tm.getText().equals("testing" + i)) {
                      failed = true;
                   }
-
-                  if (tm.getIntProperty("JMSXDeliveryCount") != j + 1) {
+                  else if (tm.getIntProperty("JMSXDeliveryCount") != j + 1) {
                      failed = true;
                   }
                }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/04eed1b7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JournalCrashTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JournalCrashTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JournalCrashTest.java
index 774fb1b..e340d38 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JournalCrashTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JournalCrashTest.java
@@ -108,10 +108,7 @@ public class JournalCrashTest extends ActiveMQTestBase {
    }
 
    public void sendMessages(final int start, final int end) throws Exception {
-      ClientSession session = null;
-      try {
-
-         session = factory.createSession(false, false);
+      try (ClientSession session = factory.createSession(false, false)) {
 
          try {
             session.createQueue(QUEUE, QUEUE, true);
@@ -132,9 +129,6 @@ public class JournalCrashTest extends ActiveMQTestBase {
          session.close();
          // server.stop(); -- this test was not supposed to stop the server, it should crash
       }
-      finally {
-         session.close();
-      }
    }
 
    @Test
@@ -146,11 +140,10 @@ public class JournalCrashTest extends ActiveMQTestBase {
 
       printJournal();
 
-      ClientSession session = null;
-      try {
-         startServer();
+      startServer();
+
+      try (ClientSession session = factory.createSession(true, true)) {
 
-         session = factory.createSession(true, true);
          ClientConsumer consumer = session.createConsumer(QUEUE);
          session.start();
 
@@ -165,14 +158,6 @@ public class JournalCrashTest extends ActiveMQTestBase {
          }
          session.close();
       }
-      finally {
-         try {
-            session.close();
-         }
-         catch (Throwable ignored) {
-         }
-      }
-
    }
 
    /**

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/04eed1b7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
index b3d1461..f539cd6 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v11/StompV11Test.java
@@ -64,8 +64,9 @@ public class StompV11Test extends StompV11TestBase {
    @After
    public void tearDown() throws Exception {
       try {
-         log.debug("Connection 11 : " + connV11.isConnected());
-         if (connV11 != null && connV11.isConnected()) {
+         boolean connected = connV11 != null && connV11.isConnected();
+         log.debug("Connection 11 : " + connected);
+         if (connected) {
             connV11.disconnect();
          }
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/04eed1b7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
index 3b9c991..adebae6 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/stomp/v12/StompV12Test.java
@@ -67,8 +67,9 @@ public class StompV12Test extends StompV11TestBase {
    @After
    public void tearDown() throws Exception {
       try {
-         log.debug("Connection 1.2 : " + connV12.isConnected());
-         if (connV12 != null && connV12.isConnected()) {
+         boolean connected = connV12 != null && connV12.isConnected();
+         log.debug("Connection 1.2 : " + connected);
+         if (connected) {
             connV12.disconnect();
          }
       }


[07/11] activemq-artemis git commit: Fix check for cursor complete in page cleanup test

Posted by cl...@apache.org.
Fix check for cursor complete in page cleanup test


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

Branch: refs/heads/master
Commit: 8562b8b44836dc7abe4e5a8646fc5fb2bb1f1bbe
Parents: 83adee5
Author: Ville Skytt� <vi...@iki.fi>
Authored: Thu Jul 28 23:00:34 2016 +0300
Committer: Ville Skytt� <vi...@iki.fi>
Committed: Thu Jul 28 23:30:02 2016 +0300

----------------------------------------------------------------------
 .../activemq/artemis/tests/integration/client/PagingTest.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8562b8b4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingTest.java
index 91f5b2f..b93afb7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/PagingTest.java
@@ -323,7 +323,7 @@ public class PagingTest extends ActiveMQTestBase {
 
       HashMap<Integer, AtomicInteger> counts = countJournalLivingRecords(server.getConfiguration());
 
-      AtomicInteger pgComplete = counts.get(JournalRecordIds.PAGE_CURSOR_COMPLETE);
+      AtomicInteger pgComplete = counts.get((int) JournalRecordIds.PAGE_CURSOR_COMPLETE);
 
       assertTrue(pgComplete == null || pgComplete.get() == 0);
 


[08/11] activemq-artemis git commit: Fix JMS message null byte array equality tests

Posted by cl...@apache.org.
Fix JMS message null byte array equality tests


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

Branch: refs/heads/master
Commit: fa191ba4c6db418452284cc6a752228de8c64421
Parents: 0aa7dd1
Author: Ville Skytt� <vi...@iki.fi>
Authored: Thu Jul 28 23:12:53 2016 +0300
Committer: Ville Skytt� <vi...@iki.fi>
Committed: Thu Jul 28 23:30:02 2016 +0300

----------------------------------------------------------------------
 .../artemis/jms/tests/message/JMSCorrelationIDHeaderTest.java      | 2 +-
 .../artemis/jms/tests/message/foreign/ForeignMessageTest.java      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fa191ba4/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSCorrelationIDHeaderTest.java
----------------------------------------------------------------------
diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSCorrelationIDHeaderTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSCorrelationIDHeaderTest.java
index 34606b6..9f691ac 100644
--- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSCorrelationIDHeaderTest.java
+++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/JMSCorrelationIDHeaderTest.java
@@ -71,7 +71,7 @@ public class JMSCorrelationIDHeaderTest extends MessageHeaderTestBase {
    // Private -------------------------------------------------------
 
    private void assertByteArraysEqual(final byte[] bytes1, final byte[] bytes2) {
-      if (bytes1 == null | bytes2 == null) {
+      if (bytes1 == null || bytes2 == null) {
          ProxyAssertSupport.fail();
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fa191ba4/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignMessageTest.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignMessageTest.java
index bacf8d9..2a43dc0 100644
--- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignMessageTest.java
+++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/message/foreign/ForeignMessageTest.java
@@ -114,7 +114,7 @@ public class ForeignMessageTest extends MessageTestBase {
    }
 
    private void assertByteArraysEqual(final byte[] bytes1, final byte[] bytes2) {
-      if (bytes1 == null | bytes2 == null) {
+      if (bytes1 == null || bytes2 == null) {
          ProxyAssertSupport.fail();
       }
 


[06/11] activemq-artemis git commit: Fix SslTransportFactoryTest bind want/need auth test combinations

Posted by cl...@apache.org.
Fix SslTransportFactoryTest bind want/need auth test combinations


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

Branch: refs/heads/master
Commit: 61222233ca9846cb3bc4219a3f6e27ceef663a9b
Parents: d092099
Author: Ville Skytt� <vi...@iki.fi>
Authored: Thu Jul 28 22:33:01 2016 +0300
Committer: Ville Skytt� <vi...@iki.fi>
Committed: Thu Jul 28 23:30:02 2016 +0300

----------------------------------------------------------------------
 .../org/apache/activemq/transport/tcp/SslTransportFactoryTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/61222233/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java
index 8d3ff30..a03dcd1 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java
@@ -51,7 +51,7 @@ public class SslTransportFactoryTest extends TestCase {
 
       for (int i = 0; i < 4; ++i) {
          final boolean wantClientAuth = (i & 0x1) == 1;
-         final boolean needClientAuth = (i & 0x2) == 1;
+         final boolean needClientAuth = (i & 0x2) == 2;
 
          String options = "wantClientAuth=" + (wantClientAuth ? "true" : "false") + "&needClientAuth=" + (needClientAuth ? "true" : "false");