activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject activemq git commit: address npe in intermittent failure in ci
Date Tue, 30 Aug 2016 14:40:06 GMT
Repository: activemq
Updated Branches:
  refs/heads/master de4f4e406 -> bf5b1fcfc


address npe in intermittent failure in ci


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

Branch: refs/heads/master
Commit: bf5b1fcfce6b8f5ee216ddeabc39039b04a78fb7
Parents: de4f4e4
Author: gtully <gary.tully@gmail.com>
Authored: Tue Aug 30 15:39:49 2016 +0100
Committer: gtully <gary.tully@gmail.com>
Committed: Tue Aug 30 15:39:49 2016 +0100

----------------------------------------------------------------------
 .../activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java   | 5 +----
 .../org/apache/activemq/broker/ft/JDBCQueueMasterSlaveTest.java | 2 ++
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/bf5b1fcf/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java
index fb04803..f2b176d 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/DbRestartJDBCQueueMasterSlaveTest.java
@@ -117,7 +117,7 @@ public class DbRestartJDBCQueueMasterSlaveTest extends JDBCQueueMasterSlaveTest
                         ActiveMQMessage mqMessage = (ActiveMQMessage) message;
                         MessageId id = mqMessage.getMessageId();
                         dbConnection = sharedDs.getConnection();
-                        PreparedStatement s = dbConnection.prepareStatement(((JDBCPersistenceAdapter)
connectedToBroker().getPersistenceAdapter()).getStatements().getFindMessageStatement());
+                        PreparedStatement s = dbConnection.prepareStatement(findStatement);
                         s.setString(1, id.getProducerId().toString());
                         s.setLong(2, id.getProducerSequenceId());
                         ResultSet rs = s.executeQuery();
@@ -143,7 +143,4 @@ public class DbRestartJDBCQueueMasterSlaveTest extends JDBCQueueMasterSlaveTest
         }
     }
 
-    private BrokerService connectedToBroker() {
-        return ((ActiveMQConnection)receiveConnection).getBrokerInfo().getBrokerName().equals("master")
? master : slave.get();
-    }
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/bf5b1fcf/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/JDBCQueueMasterSlaveTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/JDBCQueueMasterSlaveTest.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/JDBCQueueMasterSlaveTest.java
index 0547b7c..1d987bf 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/JDBCQueueMasterSlaveTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/ft/JDBCQueueMasterSlaveTest.java
@@ -38,11 +38,13 @@ public class JDBCQueueMasterSlaveTest extends QueueMasterSlaveTestSupport
{
     protected SyncCreateDataSource sharedDs;
     protected String MASTER_URL = "tcp://localhost:62001";
     protected String SLAVE_URL  = "tcp://localhost:62002";
+    protected String findStatement;
 
     protected void setUp() throws Exception {
         // startup db
         sharedDs = new SyncCreateDataSource((EmbeddedDataSource) DataSourceServiceSupport.createDataSource(IOHelper.getDefaultDataDirectory()));
         super.setUp();
+        findStatement = ((JDBCPersistenceAdapter) master.getPersistenceAdapter()).getStatements().getFindMessageStatement();
     }
 
     protected void tearDown() throws Exception {


Mime
View raw message