summaryrefslogtreecommitdiff
path: root/qpid/java/systests/src
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2014-03-14 16:39:47 +0000
committerKeith Wall <kwall@apache.org>2014-03-14 16:39:47 +0000
commitec486999608568e37a55dc9c81d9be133d95ebc3 (patch)
tree87d6446e97cfdca321b1faff6f24a3010df4cdff /qpid/java/systests/src
parentdb26915f9b2edfa410c094162bec78b9d2010b24 (diff)
downloadqpid-python-ec486999608568e37a55dc9c81d9be133d95ebc3.tar.gz
QPID-5624: Introduce messageStoreSettings VH attribute and move all message store related attributes into messageStoreSettings map
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/java-broker-bdb-ha2@1577606 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests/src')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java7
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStore.java6
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java80
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java11
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java19
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java2
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java32
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java8
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java24
-rwxr-xr-xqpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java24
10 files changed, 143 insertions, 70 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java
index 9dc981a358..36e86fbe7b 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java
@@ -115,9 +115,12 @@ public class MessageStoreTest extends QpidTestCase
String hostName = getName();
_storePath = System.getProperty("QPID_WORK", TMP_FOLDER + File.separator + getTestName()) + File.separator + hostName;
+ Map<String, Object> messageStoreSettings = new HashMap<String, Object>();
+ messageStoreSettings.put(MessageStore.STORE_PATH, _storePath);
+ messageStoreSettings.put(MessageStore.STORE_TYPE, getTestProfileMessageStoreType());
+
_virtualHostModel = mock(org.apache.qpid.server.model.VirtualHost.class);
- when(_virtualHostModel.getAttribute(eq(org.apache.qpid.server.model.VirtualHost.STORE_PATH))).thenReturn(_storePath);
- when(_virtualHostModel.getAttribute(eq(org.apache.qpid.server.model.VirtualHost.STORE_TYPE))).thenReturn(getTestProfileMessageStoreType());
+ when(_virtualHostModel.getMessageStoreSettings()).thenReturn(messageStoreSettings);
when(_virtualHostModel.getAttribute(eq(org.apache.qpid.server.model.VirtualHost.TYPE))).thenReturn(StandardVirtualHostFactory.TYPE);
when(_virtualHostModel.getAttribute(eq(org.apache.qpid.server.model.VirtualHost.NAME))).thenReturn(hostName);
when(_virtualHostModel.getType()).thenReturn(StandardVirtualHostFactory.TYPE);
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStore.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStore.java
index 9bc1a57261..7017ea6d45 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStore.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStore.java
@@ -20,6 +20,7 @@
*/
package org.apache.qpid.server.store;
+import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
@@ -50,14 +51,15 @@ public class
@Override
public void configureConfigStore(VirtualHost virtualHost, ConfigurationRecoveryHandler recoveryHandler)
{
- Object overfullAttr = virtualHost.getAttribute(MessageStoreConstants.OVERFULL_SIZE_ATTRIBUTE);
+ Map<String, Object> messageStoreSettings = virtualHost.getMessageStoreSettings();
+ Object overfullAttr = messageStoreSettings.get(MessageStore.OVERFULL_SIZE);
_persistentSizeHighThreshold = overfullAttr == null
? Long.MAX_VALUE
: overfullAttr instanceof Number
? ((Number)overfullAttr).longValue()
: Long.parseLong(overfullAttr.toString());
- Object underfullAttr = virtualHost.getAttribute(MessageStoreConstants.UNDERFULL_SIZE_ATTRIBUTE);
+ Object underfullAttr = messageStoreSettings.get(MessageStore.UNDERFULL_SIZE);
_persistentSizeLowThreshold = overfullAttr == null
? _persistentSizeHighThreshold
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java
index 6b03151f29..cc3e7574b8 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java
@@ -21,54 +21,71 @@
package org.apache.qpid.server.store;
import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
import org.apache.log4j.Logger;
import org.apache.qpid.server.message.EnqueueableMessage;
-import org.apache.qpid.server.message.ServerMessage;
import org.apache.qpid.server.model.VirtualHost;
import org.apache.qpid.server.plugin.MessageStoreFactory;
-import java.nio.ByteBuffer;
-import java.util.HashMap;
-
public class SlowMessageStore implements MessageStore, DurableConfigurationStore
{
private static final Logger _logger = Logger.getLogger(SlowMessageStore.class);
+
+ public static final String TYPE = "SLOW";
+ public static final String DELAYS = "delays";
+ public static final String REAL_STORE = "realStore";
+
+ private static final String DEFAULT_DELAY = "default";
+ private static final String PRE = "pre";
+ private static final String POST = "post";
+
private HashMap<String, Long> _preDelays = new HashMap<String, Long>();
private HashMap<String, Long> _postDelays = new HashMap<String, Long>();
private long _defaultDelay = 0L;
private MessageStore _realStore = null;
private DurableConfigurationStore _durableConfigurationStore = null;
- private static final String PRE = "pre";
- private static final String POST = "post";
- public static final String TYPE = "SLOW";
- private String DEFAULT_DELAY = "default";
+
+ private Map<EventListener, Event[]> _eventListeners = new ConcurrentHashMap<EventListener, Event[]>();
// ***** MessageStore Interface.
+ @Override
public void configureConfigStore(VirtualHost virtualHost, ConfigurationRecoveryHandler recoveryHandler)
{
_logger.info("Starting SlowMessageStore on Virtualhost:" + virtualHost.getName());
- Object delaysAttr = virtualHost.getAttribute("slowMessageStoreDelays");
+ Map<String, Object> messageStoreSettings = virtualHost.getMessageStoreSettings();
+ Object delaysAttr = messageStoreSettings.get(DELAYS);
@SuppressWarnings({ "unchecked" })
Map<String,Object> delays = (delaysAttr instanceof Map) ? (Map<String,Object>) delaysAttr : Collections.<String,Object>emptyMap();
configureDelays(delays);
- final Object realStoreAttr = virtualHost.getAttribute("realStore");
+ final Object realStoreAttr = messageStoreSettings.get(REAL_STORE);
String messageStoreType = realStoreAttr == null ? MemoryMessageStore.TYPE : realStoreAttr.toString();
-
if (delays.containsKey(DEFAULT_DELAY))
{
_defaultDelay = Long.parseLong(String.valueOf(delays.get(DEFAULT_DELAY)));
}
_realStore = MessageStoreFactory.FACTORY_LOADER.get(messageStoreType).createMessageStore();
-
+
+ if (!_eventListeners.isEmpty())
+ {
+ for (Iterator<Map.Entry<EventListener, Event[]>> it = _eventListeners.entrySet().iterator(); it.hasNext();)
+ {
+ Map.Entry<EventListener, Event[]> entry = it.next();
+ _realStore.addEventListener(entry.getKey(), entry.getValue());
+ it.remove();
+ }
+ }
+
if (_realStore instanceof DurableConfigurationStore)
{
_durableConfigurationStore = (DurableConfigurationStore)_realStore;
@@ -141,13 +158,14 @@ public class SlowMessageStore implements MessageStore, DurableConfigurationStore
}
}
-
+ @Override
public void configureMessageStore(VirtualHost virtualHost, MessageStoreRecoveryHandler messageRecoveryHandler,
TransactionLogRecoveryHandler tlogRecoveryHandler)
{
_realStore.configureMessageStore(virtualHost, messageRecoveryHandler, tlogRecoveryHandler);
}
+ @Override
public void close()
{
doPreDelay("close");
@@ -155,12 +173,12 @@ public class SlowMessageStore implements MessageStore, DurableConfigurationStore
doPostDelay("close");
}
+ @Override
public <M extends StorableMessageMetaData> StoredMessage<M> addMessage(M metaData)
{
return _realStore.addMessage(metaData);
}
-
@Override
public void create(UUID id, String type, Map<String, Object> attributes) throws StoreException
{
@@ -210,6 +228,7 @@ public class SlowMessageStore implements MessageStore, DurableConfigurationStore
doPostDelay("update");
}
+ @Override
public Transaction newTransaction()
{
doPreDelay("beginTran");
@@ -218,27 +237,12 @@ public class SlowMessageStore implements MessageStore, DurableConfigurationStore
return txn;
}
-
+ @Override
public boolean isPersistent()
{
return _realStore.isPersistent();
}
- public void storeMessageHeader(Long messageNumber, ServerMessage message)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void storeContent(Long messageNumber, long offset, ByteBuffer body)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public ServerMessage getMessage(Long messageNumber)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
private class SlowTransaction implements Transaction
{
private final Transaction _underlying;
@@ -248,6 +252,7 @@ public class SlowMessageStore implements MessageStore, DurableConfigurationStore
_underlying = underlying;
}
+ @Override
public void enqueueMessage(TransactionLogResource queue, EnqueueableMessage message)
{
doPreDelay("enqueueMessage");
@@ -255,6 +260,7 @@ public class SlowMessageStore implements MessageStore, DurableConfigurationStore
doPostDelay("enqueueMessage");
}
+ @Override
public void dequeueMessage(TransactionLogResource queue, EnqueueableMessage message)
{
doPreDelay("dequeueMessage");
@@ -262,6 +268,7 @@ public class SlowMessageStore implements MessageStore, DurableConfigurationStore
doPostDelay("dequeueMessage");
}
+ @Override
public void commitTran()
{
doPreDelay("commitTran");
@@ -269,6 +276,7 @@ public class SlowMessageStore implements MessageStore, DurableConfigurationStore
doPostDelay("commitTran");
}
+ @Override
public StoreFuture commitTranAsync()
{
doPreDelay("commitTran");
@@ -277,6 +285,7 @@ public class SlowMessageStore implements MessageStore, DurableConfigurationStore
return future;
}
+ @Override
public void abortTran()
{
doPreDelay("abortTran");
@@ -284,11 +293,13 @@ public class SlowMessageStore implements MessageStore, DurableConfigurationStore
doPostDelay("abortTran");
}
+ @Override
public void removeXid(long format, byte[] globalId, byte[] branchId)
{
_underlying.removeXid(format, globalId, branchId);
}
+ @Override
public void recordXid(long format, byte[] globalId, byte[] branchId, Record[] enqueues, Record[] dequeues)
{
_underlying.recordXid(format, globalId, branchId, enqueues, dequeues);
@@ -304,7 +315,14 @@ public class SlowMessageStore implements MessageStore, DurableConfigurationStore
@Override
public void addEventListener(EventListener eventListener, Event... events)
{
- _realStore.addEventListener(eventListener, events);
+ if (_realStore == null)
+ {
+ _eventListeners .put(eventListener, events);
+ }
+ else
+ {
+ _realStore.addEventListener(eventListener, events);
+ }
}
@Override
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java
index eca91c2b5e..3dea6fd5bb 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java
@@ -20,6 +20,8 @@
*/
package org.apache.qpid.server.store;
+import java.util.HashMap;
+import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;
@@ -62,10 +64,13 @@ public class StoreOverfullTest extends QpidBrokerTestCase
public void setUp() throws Exception
{
+ Map<String, Object> messageStoreSettings = new HashMap<String, Object>();
+ messageStoreSettings.put(MessageStore.STORE_TYPE, QuotaMessageStore.TYPE);
+ messageStoreSettings.put(MessageStore.OVERFULL_SIZE, OVERFULL_SIZE);
+ messageStoreSettings.put(MessageStore.UNDERFULL_SIZE, UNDERFULL_SIZE);
+
TestBrokerConfiguration config = getBrokerConfiguration();
- config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, VirtualHost.STORE_TYPE, QuotaMessageStore.TYPE);
- config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, MessageStoreConstants.OVERFULL_SIZE_ATTRIBUTE, OVERFULL_SIZE);
- config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, MessageStoreConstants.UNDERFULL_SIZE_ATTRIBUTE, UNDERFULL_SIZE);
+ config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, VirtualHost.MESSAGE_STORE_SETTINGS, messageStoreSettings);
super.setUp();
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java
index 18774941e8..0d76f6c444 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java
@@ -31,7 +31,18 @@ import java.util.Map;
import javax.jms.JMSException;
import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.server.model.*;
+import org.apache.qpid.server.model.Binding;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.Connection;
+import org.apache.qpid.server.model.Exchange;
+import org.apache.qpid.server.model.ExclusivityPolicy;
+import org.apache.qpid.server.model.LifetimePolicy;
+import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.Protocol;
+import org.apache.qpid.server.model.Queue;
+import org.apache.qpid.server.model.State;
+import org.apache.qpid.server.model.VirtualHost;
import org.apache.qpid.server.model.adapter.AbstractConfiguredObject;
import org.apache.qpid.test.utils.TestBrokerConfiguration;
@@ -50,10 +61,10 @@ public class Asserts
ConfiguredObject.LAST_UPDATED_TIME,
ConfiguredObject.DESCRIPTION,
VirtualHost.SUPPORTED_QUEUE_TYPES,
- VirtualHost.STORE_PATH,
VirtualHost.TYPE,
VirtualHost.CONFIG_STORE_PATH,
VirtualHost.CONFIG_STORE_TYPE,
+ VirtualHost.CONFIGURATION_STORE_SETTINGS,
VirtualHost.SECURITY_ACL);
assertEquals("Unexpected value of attribute " + VirtualHost.NAME,
@@ -146,7 +157,7 @@ public class Asserts
@SuppressWarnings("unchecked")
Map<String, Object> statistics = (Map<String, Object>) queueData.get(Asserts.STATISTICS_ATTRIBUTE);
- Asserts.assertAttributesPresent(statistics,
+ Asserts.assertAttributesPresent(statistics,
"bindingCount",
"consumerCount",
"consumerCountWithCredit",
@@ -226,7 +237,7 @@ public class Asserts
@SuppressWarnings("unchecked")
Map<String, Object> statistics = (Map<String, Object>) connectionData.get(STATISTICS_ATTRIBUTE);
-
+
assertAttributesPresent(statistics,
"bytesIn",
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java
index 49e07e92e8..7050dcfc33 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java
@@ -524,7 +524,7 @@ public class RestTestHelper
String queueName = EXPECTED_QUEUES[i];
Map<String, Object> queueData = new HashMap<String, Object>();
queueData.put(Queue.NAME, queueName);
- queueData.put(Queue.DURABLE, Boolean.TRUE);
+ queueData.put(Queue.DURABLE, Boolean.FALSE);
submitRequest("/rest/queue/test/" + queueName, "PUT", queueData);
Map<String, Object> bindingData = new HashMap<String, Object>();
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java
index 6bc515dcef..1ae1be3101 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java
@@ -35,6 +35,7 @@ import org.apache.qpid.server.model.Exchange;
import org.apache.qpid.server.model.Queue;
import org.apache.qpid.server.model.VirtualHost;
import org.apache.qpid.server.queue.ConflationQueue;
+import org.apache.qpid.server.store.MessageStore;
import org.apache.qpid.server.virtualhost.StandardVirtualHostFactory;
import org.apache.qpid.util.FileUtils;
import org.codehaus.jackson.JsonGenerationException;
@@ -111,7 +112,10 @@ public class VirtualHostRestTest extends QpidRestTestCase
restartBroker();
Map<String, Object> hostDetails = getRestTestHelper().getJsonAsSingletonList("/rest/virtualhost/" + hostName);
Asserts.assertVirtualHost(hostName, hostDetails);
- assertEquals("Unexpected store type", storeType, hostDetails.get(VirtualHost.STORE_TYPE));
+
+ @SuppressWarnings("unchecked")
+ Map<String, Object> messageStoreSettings = (Map<String, Object>) hostDetails.get(VirtualHost.MESSAGE_STORE_SETTINGS);
+ assertEquals("Unexpected store type", storeType, messageStoreSettings.get(MessageStore.STORE_TYPE));
assertNewVirtualHost(hostDetails);
}
@@ -155,23 +159,30 @@ public class VirtualHostRestTest extends QpidRestTestCase
String hostToUpdate = TEST3_VIRTUALHOST;
Map<String, Object> hostDetails = getRestTestHelper().getJsonAsSingletonList("/rest/virtualhost/" + hostToUpdate);
Asserts.assertVirtualHost(hostToUpdate, hostDetails);
- String configPath = (String)hostDetails.get(VirtualHost.STORE_PATH);
+ @SuppressWarnings("unchecked")
+ Map<String, Object> attributes = (Map<String, Object>)hostDetails.get(VirtualHost.MESSAGE_STORE_SETTINGS);
+ String configPath = (String) attributes.get(MessageStore.STORE_PATH);
String storeType = getTestProfileMessageStoreType();
String storeLocation = getStoreLocation(hostToUpdate);
+ Map<String, Object> newMessageStoreSettings = new HashMap<String, Object>();
+ newMessageStoreSettings.put(MessageStore.STORE_TYPE, storeType);
+ newMessageStoreSettings.put(MessageStore.STORE_PATH, storeLocation);
+
Map<String, Object> newAttributes = new HashMap<String, Object>();
newAttributes.put(VirtualHost.NAME, hostToUpdate);
- newAttributes.put(VirtualHost.STORE_TYPE, storeType);
- newAttributes.put(VirtualHost.STORE_PATH, storeLocation);
+ newAttributes.put(VirtualHost.MESSAGE_STORE_SETTINGS, newMessageStoreSettings);
int response = getRestTestHelper().submitRequest("/rest/virtualhost/" + hostToUpdate, "PUT", newAttributes);
assertEquals("Unexpected response code", 409, response);
restartBroker();
- hostDetails = getRestTestHelper().getJsonAsSingletonList("/rest/virtualhost/" + hostToUpdate);
- Asserts.assertVirtualHost(hostToUpdate, hostDetails);
- assertEquals("Unexpected config path", configPath, hostDetails.get(VirtualHost.STORE_PATH));
+ Map<String, Object> rereadHostDetails = getRestTestHelper().getJsonAsSingletonList("/rest/virtualhost/" + hostToUpdate);
+ Asserts.assertVirtualHost(hostToUpdate, rereadHostDetails);
+ @SuppressWarnings("unchecked")
+ Map<String, Object> rereadMessageStoreSettings = (Map<String,Object>)rereadHostDetails.get(VirtualHost.MESSAGE_STORE_SETTINGS);
+ assertEquals("Unexpected config path", configPath, rereadMessageStoreSettings.get(MessageStore.STORE_PATH));
}
public void testPutCreateQueue() throws Exception
@@ -524,12 +535,15 @@ public class VirtualHostRestTest extends QpidRestTestCase
private int tryCreateVirtualHost(String hostName, String storeType, String storePath, String configPath) throws IOException,
JsonGenerationException, JsonMappingException
{
+ Map<String, Object> messageStoreSettings = new HashMap<String, Object>();
+ messageStoreSettings.put(MessageStore.STORE_PATH, storePath);
+ messageStoreSettings.put(MessageStore.STORE_TYPE, storeType);
+
Map<String, Object> hostData = new HashMap<String, Object>();
hostData.put(VirtualHost.NAME, hostName);
hostData.put(VirtualHost.TYPE, StandardVirtualHostFactory.TYPE);
- hostData.put(VirtualHost.STORE_PATH, storePath);
- hostData.put(VirtualHost.STORE_TYPE, storeType);
+ hostData.put(VirtualHost.MESSAGE_STORE_SETTINGS, messageStoreSettings);
return getRestTestHelper().submitRequest("/rest/virtualhost/" + hostName, "PUT", hostData);
}
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java
index b2119ff79f..ec389e55f1 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java
@@ -42,6 +42,7 @@ import org.apache.qpid.server.security.acl.AbstractACLTestCase;
import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory;
import org.apache.qpid.server.security.auth.manager.PlainPasswordFileAuthenticationManagerFactory;
import org.apache.qpid.server.security.group.FileGroupManagerFactory;
+import org.apache.qpid.server.store.MessageStore;
import org.apache.qpid.server.virtualhost.StandardVirtualHostFactory;
import org.apache.qpid.systest.rest.QpidRestTestCase;
import org.apache.qpid.test.utils.TestBrokerConfiguration;
@@ -976,10 +977,13 @@ public class BrokerACLTest extends QpidRestTestCase
private int createHost(String hostName) throws Exception
{
+ Map<String, Object> messageStoreSettings = new HashMap<String, Object>();
+ messageStoreSettings.put(MessageStore.STORE_PATH, getStoreLocation(hostName));
+ messageStoreSettings.put(MessageStore.STORE_TYPE, getTestProfileMessageStoreType());
+
Map<String, Object> hostData = new HashMap<String, Object>();
hostData.put(VirtualHost.NAME, hostName);
- hostData.put(VirtualHost.STORE_PATH, getStoreLocation(hostName));
- hostData.put(VirtualHost.STORE_TYPE, getTestProfileMessageStoreType());
+ hostData.put(VirtualHost.MESSAGE_STORE_SETTINGS, messageStoreSettings);
hostData.put(VirtualHost.TYPE, StandardVirtualHostFactory.TYPE);
return getRestTestHelper().submitRequest("/rest/virtualhost/" + hostName, "PUT", hostData);
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java
index 85e62f8dae..4026b7a6cb 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java
@@ -23,13 +23,6 @@ package org.apache.qpid.test.client.timeouts;
import java.util.HashMap;
import java.util.Map;
-import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.store.SlowMessageStore;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-import org.apache.qpid.test.utils.TestBrokerConfiguration;
-
import javax.jms.Connection;
import javax.jms.JMSException;
import javax.jms.Message;
@@ -38,6 +31,14 @@ import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
+import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.store.MessageStore;
+import org.apache.qpid.server.store.SlowMessageStore;
+import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* This tests that when the commit takes a long time(due to POST_COMMIT_DELAY) that the commit does not timeout
* This test must be run in conjunction with SyncWaiteTimeoutDelay or be run with POST_COMMIT_DELAY > 30s to ensure
@@ -59,9 +60,14 @@ public class SyncWaitDelayTest extends QpidBrokerTestCase
{
Map<String, Object> slowMessageStoreDelays = new HashMap<String,Object>();
slowMessageStoreDelays.put("postcommitTran", POST_COMMIT_DELAY);
+
+ Map<String, Object> messageStoreSettings = new HashMap<String, Object>();
+ messageStoreSettings.put(MessageStore.STORE_TYPE, SlowMessageStore.TYPE);
+ messageStoreSettings.put(SlowMessageStore.DELAYS, slowMessageStoreDelays);
+
TestBrokerConfiguration config = getBrokerConfiguration();
- config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, VirtualHost.STORE_TYPE, SlowMessageStore.TYPE);
- config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, "slowMessageStoreDelays", slowMessageStoreDelays);
+ config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, VirtualHost.MESSAGE_STORE_SETTINGS, messageStoreSettings);
+
super.setUp();
//Set the syncWrite timeout to be just larger than the delay on the commitTran.
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
index ace34506bd..93cf90829d 100755
--- a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
@@ -64,6 +64,8 @@ import org.apache.qpid.server.configuration.BrokerProperties;
import org.apache.qpid.server.model.Port;
import org.apache.qpid.server.model.VirtualHost;
import org.apache.qpid.server.protocol.AmqpProtocolVersion;
+import org.apache.qpid.server.store.MemoryMessageStore;
+import org.apache.qpid.server.store.MessageStore;
import org.apache.qpid.server.virtualhost.StandardVirtualHostFactory;
import org.apache.qpid.url.URLSyntaxException;
import org.apache.qpid.util.FileUtils;
@@ -233,7 +235,16 @@ public class QpidBrokerTestCase extends QpidTestCase
configuration.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_AMQP_PORT, Port.PORT, actualPort);
configuration.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_RMI_PORT, Port.PORT, getManagementPort(actualPort));
configuration.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_JMX_PORT, Port.PORT, getManagementPort(actualPort) + JMXPORT_CONNECTORSERVER_OFFSET);
+
+ String workDir = System.getProperty("QPID_WORK") + File.separator + TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST + File.separator + actualPort;
+ Map<String, Object> virtualHostSettings = configuration.getObjectAttributes(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST);
+
+ @SuppressWarnings("unchecked")
+ Map<String, Object> storeSettings = (Map<String, Object>)virtualHostSettings.get(VirtualHost.MESSAGE_STORE_SETTINGS);
+ storeSettings.put(MessageStore.STORE_PATH, workDir);
+ configuration.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, VirtualHost.MESSAGE_STORE_SETTINGS, storeSettings);
}
+
return configuration;
}
@@ -433,10 +444,10 @@ public class QpidBrokerTestCase extends QpidTestCase
}
Set<Integer> portsUsedByBroker = guessAllPortsUsedByBroker(port);
+ String testConfig = saveTestConfiguration(port, testConfiguration);
if (_brokerType.equals(BrokerType.INTERNAL) && !existingInternalBroker())
{
- String testConfig = saveTestConfiguration(port, testConfiguration);
setSystemProperty(BrokerProperties.PROPERTY_USE_CUSTOM_RMI_SOCKET_FACTORY, "false");
BrokerOptions options = new BrokerOptions();
@@ -460,9 +471,6 @@ public class QpidBrokerTestCase extends QpidTestCase
}
else if (!_brokerType.equals(BrokerType.EXTERNAL))
{
- String workDir = System.getProperty("QPID_WORK") + File.separator + "work" + File.separator + port;
- testConfiguration.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, VirtualHost.STORE_PATH, workDir);
- String testConfig = saveTestConfiguration(port, testConfiguration);
// Add the port to QPID_WORK to ensure unique working dirs for multi broker tests
final String qpidWork = getQpidWork(_brokerType, port);
@@ -834,7 +842,7 @@ public class QpidBrokerTestCase extends QpidTestCase
{
storeDir = ":memory:";
}
- else if (!"Memory".equals(storeType))
+ else if (!MemoryMessageStore.TYPE.equals(storeType))
{
storeDir = "${QPID_WORK}" + File.separator + virtualHostName + File.separator + brokerPort;
}
@@ -843,8 +851,10 @@ public class QpidBrokerTestCase extends QpidTestCase
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put(VirtualHost.NAME, virtualHostName);
attributes.put(VirtualHost.TYPE, StandardVirtualHostFactory.TYPE);
- attributes.put(VirtualHost.STORE_TYPE, storeType);
- attributes.put(VirtualHost.STORE_PATH, storeDir);
+ Map<String, Object> messageStoreSettings = new HashMap<String, Object>();
+ messageStoreSettings.put(MessageStore.STORE_TYPE, storeType);
+ messageStoreSettings.put(MessageStore.STORE_PATH, storeDir);
+ attributes.put(VirtualHost.MESSAGE_STORE_SETTINGS, messageStoreSettings );
int port = getPort(brokerPort);
getBrokerConfiguration(port).addVirtualHostConfiguration(attributes);
}