mirror of https://github.com/apache/activemq.git
address npe in intermittent failure in ci
This commit is contained in:
parent
de4f4e406f
commit
bf5b1fcfce
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue