summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java2
-rw-r--r--java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java2
-rw-r--r--java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BindingRestTest.java2
-rw-r--r--java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerRestTest.java6
-rw-r--r--java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ExchangeRestTest.java2
-rw-r--r--java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/QpidRestTestCase.java20
-rw-r--r--java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/StructureRestTest.java2
-rw-r--r--java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/VirtualHostRestTest.java4
-rw-r--r--java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java94
-rw-r--r--java/systests/etc/virtualhosts-systests-bdb-settings.xml26
-rw-r--r--java/systests/etc/virtualhosts-systests-derby-mem-settings.xml25
-rw-r--r--java/systests/etc/virtualhosts-systests-derby-settings.xml25
-rw-r--r--java/systests/etc/virtualhosts-systests-settings.xml125
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java50
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java8
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java7
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/stats/StatisticsReportingTest.java41
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/client/RollbackOrderTest.java20
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java47
-rw-r--r--java/test-profiles/JavaTransientExcludes2
20 files changed, 146 insertions, 364 deletions
diff --git a/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java b/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java
index 342c185b99..7c04d83e79 100644
--- a/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java
+++ b/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java
@@ -63,7 +63,7 @@ public class BDBBackupTest extends QpidBrokerTestCase
// It would be preferable to lookup the store path using #getConfigurationStringProperty("virtualhosts...")
// but the config as known to QBTC does not pull-in the virtualhost section from its separate source file
- _backupFromDir = new File(qpidWork + "/bdbstore/" + TEST_VHOST + "-store");
+ _backupFromDir = new File(qpidWork + File.separator + TEST_VHOST + "-store");
boolean fromDirExistsAndIsDir = _backupFromDir.isDirectory();
assertTrue("backupFromDir " + _backupFromDir + " should already exist", fromDirExistsAndIsDir);
}
diff --git a/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java b/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
index 4e201d5473..cec86e25ac 100644
--- a/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
+++ b/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
@@ -70,7 +70,7 @@ public class BDBUpgradeTest extends QpidBrokerTestCase
public void setUp() throws Exception
{
assertNotNull("QPID_WORK must be set", QPID_WORK_ORIG);
- _storeLocation = getWorkDirBaseDir() + "/bdbstore/test-store";
+ _storeLocation = getWorkDirBaseDir() + File.separator + "test-store";
//Clear the two target directories if they exist.
File directory = new File(_storeLocation);
diff --git a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BindingRestTest.java b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BindingRestTest.java
index c2f11ed237..207c62ae72 100644
--- a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BindingRestTest.java
+++ b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BindingRestTest.java
@@ -34,7 +34,7 @@ public class BindingRestTest extends QpidRestTestCase
{
List<Map<String, Object>> bindings = getRestTestHelper().getJsonAsList("/rest/binding");
assertNotNull("Bindings cannot be null", bindings);
- assertTrue("Unexpected number of bindings", bindings.size() >= EXPECTED_HOSTS.length * EXPECTED_QUEUES.length);
+ assertTrue("Unexpected number of bindings", bindings.size() >= EXPECTED_VIRTUALHOSTS.length * EXPECTED_QUEUES.length);
for (Map<String, Object> binding : bindings)
{
Asserts.assertBinding((String) binding.get(Binding.NAME), (String) binding.get(Binding.EXCHANGE), binding);
diff --git a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerRestTest.java b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerRestTest.java
index c4cd00416b..4cabe7ef2c 100644
--- a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerRestTest.java
+++ b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerRestTest.java
@@ -55,9 +55,9 @@ public class BrokerRestTest extends QpidRestTestCase
List<Map<String, Object>> virtualhosts = (List<Map<String, Object>>) brokerDetails.get(BROKER_VIRTUALHOSTS_ATTRIBUTE);
assertEquals("Unexpected number of virtual hosts", 3, virtualhosts.size());
- Asserts.assertVirtualHost("development", getRestTestHelper().find(VirtualHost.NAME, "development", virtualhosts));
- Asserts.assertVirtualHost("localhost", getRestTestHelper().find(VirtualHost.NAME, "localhost", virtualhosts));
- Asserts.assertVirtualHost("test", getRestTestHelper().find(VirtualHost.NAME, "test", virtualhosts));
+ Asserts.assertVirtualHost(TEST3_VIRTUALHOST, getRestTestHelper().find(VirtualHost.NAME, TEST3_VIRTUALHOST, virtualhosts));
+ Asserts.assertVirtualHost(TEST2_VIRTUALHOST, getRestTestHelper().find(VirtualHost.NAME, TEST2_VIRTUALHOST, virtualhosts));
+ Asserts.assertVirtualHost(TEST1_VIRTUALHOST, getRestTestHelper().find(VirtualHost.NAME, TEST1_VIRTUALHOST, virtualhosts));
@SuppressWarnings("unchecked")
List<Map<String, Object>> ports = (List<Map<String, Object>>) brokerDetails.get(BROKER_PORTS_ATTRIBUTE);
diff --git a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ExchangeRestTest.java b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ExchangeRestTest.java
index 7910c17b32..317cb17b86 100644
--- a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ExchangeRestTest.java
+++ b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ExchangeRestTest.java
@@ -33,7 +33,7 @@ public class ExchangeRestTest extends QpidRestTestCase
{
List<Map<String, Object>> exchanges = getRestTestHelper().getJsonAsList("/rest/exchange");
assertNotNull("Exchanges cannot be null", exchanges);
- assertTrue("Unexpected number of exchanges", exchanges.size() >= EXPECTED_HOSTS.length * EXPECTED_EXCHANGES.length);
+ assertTrue("Unexpected number of exchanges", exchanges.size() >= EXPECTED_VIRTUALHOSTS.length * EXPECTED_EXCHANGES.length);
for (Map<String, Object> exchange : exchanges)
{
Asserts.assertExchange((String) exchange.get(Exchange.NAME), (String) exchange.get(Exchange.TYPE), exchange);
diff --git a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/QpidRestTestCase.java b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/QpidRestTestCase.java
index 997a4053a5..bb90f52739 100644
--- a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/QpidRestTestCase.java
+++ b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/QpidRestTestCase.java
@@ -27,16 +27,30 @@ import org.apache.qpid.test.utils.QpidBrokerTestCase;
public class QpidRestTestCase extends QpidBrokerTestCase
{
- public static final String[] EXPECTED_HOSTS = { "development", "test", "localhost" };
+ public static final String TEST1_VIRTUALHOST = "test";
+ public static final String TEST2_VIRTUALHOST = "test2";
+ public static final String TEST3_VIRTUALHOST = "test3";
+
+ public static final String[] EXPECTED_VIRTUALHOSTS = { TEST1_VIRTUALHOST, TEST2_VIRTUALHOST, TEST3_VIRTUALHOST};
public static final String[] EXPECTED_QUEUES = { "queue", "ping" };
- public static final String[] EXPECTED_EXCHANGES = { "amq.fanout", "amq.match", "amq.direct", "amq.topic",
- "<<default>>" };
+ public static final String[] EXPECTED_EXCHANGES = { "amq.fanout", "amq.match", "amq.direct","amq.topic","<<default>>" };
private RestTestHelper _restTestHelper = new RestTestHelper(findFreePort());
@Override
public void setUp() throws Exception
{
+ // Set up virtualhost config with queues and bindings to the amq.direct
+ for (String virtualhost : EXPECTED_VIRTUALHOSTS)
+ {
+ createTestVirtualHost(virtualhost);
+ for (String queue : EXPECTED_QUEUES)
+ {
+ setConfigurationProperty("virtualhosts.virtualhost." + virtualhost + ".queues.exchange", "amq.direct");
+ setConfigurationProperty("virtualhosts.virtualhost." + virtualhost + ".queues.queue(-1).name", queue);
+ }
+ }
+
customizeConfiguration();
super.setUp();
}
diff --git a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/StructureRestTest.java b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/StructureRestTest.java
index c72dcfc8ab..31f5551a45 100644
--- a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/StructureRestTest.java
+++ b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/StructureRestTest.java
@@ -44,7 +44,7 @@ public class StructureRestTest extends QpidRestTestCase
List<Map<String, Object>> providers = (List<Map<String, Object>>) structure.get("authenticationproviders");
assertEquals("Unexpected number of authentication providers", 1, providers.size());
- for (String hostName : EXPECTED_HOSTS)
+ for (String hostName : EXPECTED_VIRTUALHOSTS)
{
Map<String, Object> host = getRestTestHelper().find("name", hostName, virtualhosts);
assertNotNull("Host " + hostName + " is not found ", host);
diff --git a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/VirtualHostRestTest.java b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/VirtualHostRestTest.java
index cafba7c62a..c7f9b81d58 100644
--- a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/VirtualHostRestTest.java
+++ b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/VirtualHostRestTest.java
@@ -49,8 +49,8 @@ public class VirtualHostRestTest extends QpidRestTestCase
{
List<Map<String, Object>> hosts = getRestTestHelper().getJsonAsList("/rest/virtualhost/");
assertNotNull("Hosts data cannot be null", hosts);
- assertEquals("Unexpected number of hosts", EXPECTED_HOSTS.length, hosts.size());
- for (String hostName : EXPECTED_HOSTS)
+ assertEquals("Unexpected number of hosts", EXPECTED_VIRTUALHOSTS.length, hosts.size());
+ for (String hostName : EXPECTED_VIRTUALHOSTS)
{
Map<String, Object> host = getRestTestHelper().find("name", hostName, hosts);
Asserts.assertVirtualHost(hostName, host);
diff --git a/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java b/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java
index c3fff94923..49207e2d7a 100644
--- a/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java
+++ b/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java
@@ -36,42 +36,48 @@ import org.apache.qpid.test.utils.QpidBrokerTestCase;
public class StatisticsTest extends QpidBrokerTestCase
{
+ private static final String TEST_VIRTUALHOST1 = "test1";
+ private static final String TEST_VIRTUALHOST2 = "test2";
+
private static final String TEST_USER = "admin";
private static final String TEST_PASSWORD = "admin";
private static final int MESSAGE_COUNT_TEST = 5;
private static final int MESSAGE_COUNT_DEV = 9;
private JMXTestUtils _jmxUtils;
- private Connection _test1, _dev;
- private Session _testSession, _developmentSession;
- private Queue _developmentQueue, _testQueue;
+ private Connection _vhost1Connection, _vhost2Connection;
+ private Session _vhost1Session, _vhost2Session;
+ private Queue _vhost1Queue, _vhost2Queue;
protected String _brokerUrl;
@Override
public void setUp() throws Exception
{
+ createTestVirtualHost(TEST_VIRTUALHOST1);
+ createTestVirtualHost(TEST_VIRTUALHOST2);
+
_jmxUtils = new JMXTestUtils(this, TEST_USER, TEST_PASSWORD);
_jmxUtils.setUp();
super.setUp();
_brokerUrl = getBroker().toString();
- _test1 = new AMQConnection(_brokerUrl, TEST_USER, TEST_PASSWORD, "clientid", "test");
- _dev = new AMQConnection(_brokerUrl, TEST_USER, TEST_PASSWORD, "clientid", "development");
- _test1.start();
- _dev.start();
+ _vhost1Connection = new AMQConnection(_brokerUrl, TEST_USER, TEST_PASSWORD, "clientid", TEST_VIRTUALHOST1);
+ _vhost2Connection = new AMQConnection(_brokerUrl, TEST_USER, TEST_PASSWORD, "clientid", TEST_VIRTUALHOST2);
+ _vhost1Connection.start();
+ _vhost2Connection.start();
- _testSession = _test1.createSession(true, Session.SESSION_TRANSACTED);
- _developmentSession = _dev.createSession(true, Session.SESSION_TRANSACTED);
+ _vhost1Session = _vhost1Connection.createSession(true, Session.SESSION_TRANSACTED);
+ _vhost2Session = _vhost2Connection.createSession(true, Session.SESSION_TRANSACTED);
- _developmentQueue = _developmentSession.createQueue(getTestQueueName());
- _testQueue = _testSession.createQueue(getTestQueueName());
+ _vhost1Queue = _vhost2Session.createQueue(getTestQueueName());
+ _vhost2Queue = _vhost1Session.createQueue(getTestQueueName());
//Create queues by opening and closing consumers
- final MessageConsumer testConsumer = _testSession.createConsumer(_testQueue);
- testConsumer.close();
- final MessageConsumer developmentConsumer = _developmentSession.createConsumer(_developmentQueue);
- developmentConsumer.close();
+ final MessageConsumer vhost1Consumer = _vhost1Session.createConsumer(_vhost2Queue);
+ vhost1Consumer.close();
+ final MessageConsumer vhost2Consumer = _vhost2Session.createConsumer(_vhost1Queue);
+ vhost2Consumer.close();
_jmxUtils.open();
}
@@ -87,63 +93,63 @@ public class StatisticsTest extends QpidBrokerTestCase
public void testInitialStatisticValues() throws Exception
{
//Check initial values
- checkSingleConnectionOnVHostStatistics("test", 0, 0, 0, 0);
- checkVHostStatistics("test", 0, 0, 0, 0);
- checkSingleConnectionOnVHostStatistics("development", 0, 0, 0, 0);
- checkVHostStatistics("development", 0, 0, 0, 0);
+ checkSingleConnectionOnVHostStatistics(TEST_VIRTUALHOST1, 0, 0, 0, 0);
+ checkVHostStatistics(TEST_VIRTUALHOST1, 0, 0, 0, 0);
+ checkSingleConnectionOnVHostStatistics(TEST_VIRTUALHOST2, 0, 0, 0, 0);
+ checkVHostStatistics(TEST_VIRTUALHOST2, 0, 0, 0, 0);
checkBrokerStatistics(0, 0, 0, 0);
}
public void testSendOnSingleVHost() throws Exception
{
- sendMessagesAndSync(_testSession, _testQueue, MESSAGE_COUNT_TEST);
+ sendMessagesAndSync(_vhost1Session, _vhost2Queue, MESSAGE_COUNT_TEST);
//Check values
- checkSingleConnectionOnVHostStatistics("test", MESSAGE_COUNT_TEST, 0, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, 0);
- checkVHostStatistics("test", MESSAGE_COUNT_TEST, 0, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, 0);
- checkSingleConnectionOnVHostStatistics("development", 0, 0, 0, 0);
- checkVHostStatistics("development", 0, 0, 0, 0);
+ checkSingleConnectionOnVHostStatistics(TEST_VIRTUALHOST1, MESSAGE_COUNT_TEST, 0, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, 0);
+ checkVHostStatistics(TEST_VIRTUALHOST1, MESSAGE_COUNT_TEST, 0, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, 0);
+ checkSingleConnectionOnVHostStatistics(TEST_VIRTUALHOST2, 0, 0, 0, 0);
+ checkVHostStatistics(TEST_VIRTUALHOST2, 0, 0, 0, 0);
checkBrokerStatistics(MESSAGE_COUNT_TEST, 0, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, 0);
}
public void testSendOnTwoVHosts() throws Exception
{
- sendMessagesAndSync(_testSession, _testQueue, MESSAGE_COUNT_TEST);
- sendMessagesAndSync(_developmentSession, _developmentQueue, MESSAGE_COUNT_DEV);
+ sendMessagesAndSync(_vhost1Session, _vhost2Queue, MESSAGE_COUNT_TEST);
+ sendMessagesAndSync(_vhost2Session, _vhost1Queue, MESSAGE_COUNT_DEV);
//Check values
- checkSingleConnectionOnVHostStatistics("test", MESSAGE_COUNT_TEST, 0, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, 0);
- checkVHostStatistics("test", MESSAGE_COUNT_TEST, 0, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, 0);
- checkSingleConnectionOnVHostStatistics("development", MESSAGE_COUNT_DEV, 0, MESSAGE_COUNT_DEV * DEFAULT_MESSAGE_SIZE, 0);
- checkVHostStatistics("development", MESSAGE_COUNT_DEV, 0, MESSAGE_COUNT_DEV * DEFAULT_MESSAGE_SIZE, 0);
+ checkSingleConnectionOnVHostStatistics(TEST_VIRTUALHOST1, MESSAGE_COUNT_TEST, 0, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, 0);
+ checkVHostStatistics(TEST_VIRTUALHOST1, MESSAGE_COUNT_TEST, 0, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, 0);
+ checkSingleConnectionOnVHostStatistics(TEST_VIRTUALHOST2, MESSAGE_COUNT_DEV, 0, MESSAGE_COUNT_DEV * DEFAULT_MESSAGE_SIZE, 0);
+ checkVHostStatistics(TEST_VIRTUALHOST2, MESSAGE_COUNT_DEV, 0, MESSAGE_COUNT_DEV * DEFAULT_MESSAGE_SIZE, 0);
checkBrokerStatistics(MESSAGE_COUNT_TEST + MESSAGE_COUNT_DEV, 0, (MESSAGE_COUNT_TEST + MESSAGE_COUNT_DEV) * DEFAULT_MESSAGE_SIZE, 0);
}
public void testSendAndConsumeOnSingleVHost() throws Exception
{
- sendMessagesAndSync(_testSession, _testQueue, MESSAGE_COUNT_TEST);
- consumeMessages(_testSession, _testQueue, MESSAGE_COUNT_TEST);
+ sendMessagesAndSync(_vhost1Session, _vhost2Queue, MESSAGE_COUNT_TEST);
+ consumeMessages(_vhost1Session, _vhost2Queue, MESSAGE_COUNT_TEST);
//Check values
- checkSingleConnectionOnVHostStatistics("test", MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE);
- checkVHostStatistics("test", MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE);
- checkSingleConnectionOnVHostStatistics("development", 0, 0, 0, 0);
- checkVHostStatistics("development", 0, 0, 0, 0);
+ checkSingleConnectionOnVHostStatistics(TEST_VIRTUALHOST1, MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE);
+ checkVHostStatistics(TEST_VIRTUALHOST1, MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE);
+ checkSingleConnectionOnVHostStatistics(TEST_VIRTUALHOST2, 0, 0, 0, 0);
+ checkVHostStatistics(TEST_VIRTUALHOST2, 0, 0, 0, 0);
checkBrokerStatistics(MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE);
}
public void testSendAndConsumeOnTwoVHosts() throws Exception
{
- sendMessagesAndSync(_testSession, _testQueue, MESSAGE_COUNT_TEST);
- sendMessagesAndSync(_developmentSession, _developmentQueue, MESSAGE_COUNT_DEV);
- consumeMessages(_testSession, _testQueue, MESSAGE_COUNT_TEST);
- consumeMessages(_developmentSession, _developmentQueue, MESSAGE_COUNT_DEV);
+ sendMessagesAndSync(_vhost1Session, _vhost2Queue, MESSAGE_COUNT_TEST);
+ sendMessagesAndSync(_vhost2Session, _vhost1Queue, MESSAGE_COUNT_DEV);
+ consumeMessages(_vhost1Session, _vhost2Queue, MESSAGE_COUNT_TEST);
+ consumeMessages(_vhost2Session, _vhost1Queue, MESSAGE_COUNT_DEV);
//Check values
- checkSingleConnectionOnVHostStatistics("test", MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE);
- checkVHostStatistics("test", MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE);
- checkSingleConnectionOnVHostStatistics("development", MESSAGE_COUNT_DEV, MESSAGE_COUNT_DEV, MESSAGE_COUNT_DEV * DEFAULT_MESSAGE_SIZE, MESSAGE_COUNT_DEV * DEFAULT_MESSAGE_SIZE);
- checkVHostStatistics("development", MESSAGE_COUNT_DEV, MESSAGE_COUNT_DEV, MESSAGE_COUNT_DEV * DEFAULT_MESSAGE_SIZE, MESSAGE_COUNT_DEV * DEFAULT_MESSAGE_SIZE);
+ checkSingleConnectionOnVHostStatistics(TEST_VIRTUALHOST1, MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE);
+ checkVHostStatistics(TEST_VIRTUALHOST1, MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE, MESSAGE_COUNT_TEST * DEFAULT_MESSAGE_SIZE);
+ checkSingleConnectionOnVHostStatistics(TEST_VIRTUALHOST2, MESSAGE_COUNT_DEV, MESSAGE_COUNT_DEV, MESSAGE_COUNT_DEV * DEFAULT_MESSAGE_SIZE, MESSAGE_COUNT_DEV * DEFAULT_MESSAGE_SIZE);
+ checkVHostStatistics(TEST_VIRTUALHOST2, MESSAGE_COUNT_DEV, MESSAGE_COUNT_DEV, MESSAGE_COUNT_DEV * DEFAULT_MESSAGE_SIZE, MESSAGE_COUNT_DEV * DEFAULT_MESSAGE_SIZE);
checkBrokerStatistics(MESSAGE_COUNT_TEST + MESSAGE_COUNT_DEV, MESSAGE_COUNT_TEST + MESSAGE_COUNT_DEV, (MESSAGE_COUNT_TEST + MESSAGE_COUNT_DEV) * DEFAULT_MESSAGE_SIZE, (MESSAGE_COUNT_TEST + MESSAGE_COUNT_DEV) * DEFAULT_MESSAGE_SIZE);
}
diff --git a/java/systests/etc/virtualhosts-systests-bdb-settings.xml b/java/systests/etc/virtualhosts-systests-bdb-settings.xml
index ce16523f13..350f05c178 100644
--- a/java/systests/etc/virtualhosts-systests-bdb-settings.xml
+++ b/java/systests/etc/virtualhosts-systests-bdb-settings.xml
@@ -20,37 +20,13 @@
-
-->
<virtualhosts>
- <work>${QPID_WORK}</work>
-
- <virtualhost>
- <name>localhost</name>
- <localhost>
- <store>
- <class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
- <environment-path>${work}/bdbstore/localhost-store</environment-path>
- </store>
- </localhost>
- </virtualhost>
-
- <virtualhost>
- <name>development</name>
- <development>
- <store>
- <class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
- <environment-path>${work}/bdbstore/development-store</environment-path>
- </store>
- </development>
- </virtualhost>
-
<virtualhost>
<name>test</name>
<test>
<store>
<class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
- <environment-path>${work}/bdbstore/test-store</environment-path>
+ <environment-path>${QPID_WORK}/test-store</environment-path>
</store>
</test>
</virtualhost>
</virtualhosts>
-
-
diff --git a/java/systests/etc/virtualhosts-systests-derby-mem-settings.xml b/java/systests/etc/virtualhosts-systests-derby-mem-settings.xml
index 74189ad5e9..4e28f6d330 100644
--- a/java/systests/etc/virtualhosts-systests-derby-mem-settings.xml
+++ b/java/systests/etc/virtualhosts-systests-derby-mem-settings.xml
@@ -20,35 +20,12 @@
-
-->
<virtualhosts>
- <directory>${QPID_HOME}/virtualhosts</directory>
- <default>test</default>
-
- <virtualhost>
- <localhost>
- <store>
- <factoryclass>org.apache.qpid.server.store.derby.DerbyMessageStoreFactory</factoryclass>
- <environment-path>:memory:</environment-path>
- </store>
- </localhost>
- </virtualhost>
-
- <virtualhost>
- <development>
- <store>
- <factoryclass>org.apache.qpid.server.store.derby.DerbyMessageStoreFactory</factoryclass>
- <environment-path>:memory:</environment-path>
- </store>
- </development>
- </virtualhost>
-
<virtualhost>
<test>
<store>
- <factoryclass>org.apache.qpid.server.store.derby.DerbyMessageStoreFactory</factoryclass>
+ <class>org.apache.qpid.server.store.derby.DerbyMessageStore</class>
<environment-path>:memory:</environment-path>
</store>
</test>
</virtualhost>
</virtualhosts>
-
-
diff --git a/java/systests/etc/virtualhosts-systests-derby-settings.xml b/java/systests/etc/virtualhosts-systests-derby-settings.xml
index 08a40ca812..f9cc3d2336 100644
--- a/java/systests/etc/virtualhosts-systests-derby-settings.xml
+++ b/java/systests/etc/virtualhosts-systests-derby-settings.xml
@@ -20,35 +20,12 @@
-
-->
<virtualhosts>
- <directory>${QPID_HOME}/virtualhosts</directory>
- <default>test</default>
-
- <virtualhost>
- <localhost>
- <store>
- <class>org.apache.qpid.server.store.derby.DerbyMessageStore</class>
- <environment-path>${QPID_WORK}/derbyDB/localhost-store</environment-path>
- </store>
- </localhost>
- </virtualhost>
-
- <virtualhost>
- <development>
- <store>
- <class>org.apache.qpid.server.store.derby.DerbyMessageStore</class>
- <environment-path>${QPID_WORK}/derbyDB/development-store</environment-path>
- </store>
- </development>
- </virtualhost>
-
<virtualhost>
<test>
<store>
<class>org.apache.qpid.server.store.derby.DerbyMessageStore</class>
- <environment-path>${QPID_WORK}/derbyDB/test-store</environment-path>
+ <environment-path>${QPID_WORK}/test-store</environment-path>
</store>
</test>
</virtualhost>
</virtualhosts>
-
-
diff --git a/java/systests/etc/virtualhosts-systests-settings.xml b/java/systests/etc/virtualhosts-systests-settings.xml
index 0ec16b31ef..5d4ec28b71 100644
--- a/java/systests/etc/virtualhosts-systests-settings.xml
+++ b/java/systests/etc/virtualhosts-systests-settings.xml
@@ -22,136 +22,11 @@
<virtualhosts>
<default>test</default>
<virtualhost>
- <name>localhost</name>
- <localhost>
- <store>
- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
- </store>
-
- <housekeeping>
- <threadCount>2</threadCount>
- <checkPeriod>20000</checkPeriod>
- </housekeeping>
-
- <exchanges>
- <exchange>
- <type>direct</type>
- <name>test.direct</name>
- <durable>true</durable>
- </exchange>
- <exchange>
- <type>topic</type>
- <name>test.topic</name>
- </exchange>
- </exchanges>
- <queues>
- <exchange>amq.direct</exchange>
- <maximumQueueDepth>4235264</maximumQueueDepth>
- <!-- 4Mb -->
- <maximumMessageSize>2117632</maximumMessageSize>
- <!-- 2Mb -->
- <maximumMessageAge>600000</maximumMessageAge>
- <!-- 10 mins -->
- <maximumMessageCount>50</maximumMessageCount>
- <!-- 50 messages -->
-
- <queue>
- <name>queue</name>
- </queue>
- <queue>
- <name>ping</name>
- </queue>
- <queue>
- <name>test-queue</name>
- <test-queue>
- <exchange>test.direct</exchange>
- <durable>true</durable>
- </test-queue>
- </queue>
- <queue>
- <name>test-ping</name>
- <test-ping>
- <exchange>test.direct</exchange>
- </test-ping>
- </queue>
-
- </queues>
- </localhost>
- </virtualhost>
-
-
- <virtualhost>
- <name>development</name>
- <development>
- <store>
- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
- </store>
-
- <queues>
- <minimumAlertRepeatGap>30000</minimumAlertRepeatGap>
- <maximumMessageCount>50</maximumMessageCount>
- <queue>
- <name>queue</name>
- <queue>
- <exchange>amq.direct</exchange>
- <maximumQueueDepth>4235264</maximumQueueDepth>
- <!-- 4Mb -->
- <maximumMessageSize>2117632</maximumMessageSize>
- <!-- 2Mb -->
- <maximumMessageAge>600000</maximumMessageAge>
- <!-- 10 mins -->
- </queue>
- </queue>
- <queue>
- <name>ping</name>
- <ping>
- <exchange>amq.direct</exchange>
- <maximumQueueDepth>4235264</maximumQueueDepth>
- <!-- 4Mb -->
- <maximumMessageSize>2117632</maximumMessageSize>
- <!-- 2Mb -->
- <maximumMessageAge>600000</maximumMessageAge>
- <!-- 10 mins -->
- </ping>
- </queue>
- </queues>
- </development>
- </virtualhost>
- <virtualhost>
<name>test</name>
<test>
<store>
<class>org.apache.qpid.server.store.MemoryMessageStore</class>
</store>
-
- <queues>
- <minimumAlertRepeatGap>30000</minimumAlertRepeatGap>
- <maximumMessageCount>50</maximumMessageCount>
- <queue>
- <name>queue</name>
- <queue>
- <exchange>amq.direct</exchange>
- <maximumQueueDepth>4235264</maximumQueueDepth>
- <!-- 4Mb -->
- <maximumMessageSize>2117632</maximumMessageSize>
- <!-- 2Mb -->
- <maximumMessageAge>600000</maximumMessageAge>
- <!-- 10 mins -->
- </queue>
- </queue>
- <queue>
- <name>ping</name>
- <ping>
- <exchange>amq.direct</exchange>
- <maximumQueueDepth>4235264</maximumQueueDepth>
- <!-- 4Mb -->
- <maximumMessageSize>2117632</maximumMessageSize>
- <!-- 2Mb -->
- <maximumMessageAge>600000</maximumMessageAge>
- <!-- 10 mins -->
- </ping>
- </queue>
- </queues>
</test>
</virtualhost>
</virtualhosts>
diff --git a/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java b/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
index 02c41e14c0..7c676ad01d 100644
--- a/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
@@ -22,10 +22,6 @@ package org.apache.qpid.server.logging;
import org.apache.qpid.client.AMQDestination;
import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.configuration.ServerConfiguration;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.util.FileUtils;
import javax.jms.Connection;
import javax.jms.Queue;
@@ -44,29 +40,19 @@ public class AlertingTest extends AbstractTestLogging
public void setUp() throws Exception
{
- // Update the configuration to make our virtualhost Persistent.
- makeVirtualHostPersistent(VIRTUALHOST);
- setConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".housekeeping.checkPeriod", "5000");
-
_numMessages = 50;
+ setConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".housekeeping.checkPeriod", String.valueOf(ALERT_LOG_WAIT_PERIOD));
+ setConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".queues.maximumMessageCount", String.valueOf(_numMessages));
+
// Then we do the normal setup stuff like starting the broker, getting a connection etc.
super.setUp();
setupConnection();
}
- @Override
- public void tearDown() throws Exception
- {
- // Ensure queue is clean for next run.
- drainQueue(_destination);
- super.tearDown();
- }
-
-
/**
- * Create a new connection and ensure taht our destination queue is created
+ * Create a new connection and ensure that our destination queue is created
* and bound.
*
* Note that the tests here that restart the broker rely on persistence.
@@ -102,20 +88,6 @@ public class AlertingTest extends AbstractTestLogging
if (!waitForMessage(MESSAGE_COUNT_ALERT, ALERT_LOG_WAIT_PERIOD))
{
StringBuffer message = new StringBuffer("Could not find 'MESSAGE_COUNT_ALERT' in log file: " + _monitor.getMonitoredFile().getAbsolutePath());
- message.append("\n");
-
- // Add the current contents of the log file to test output
- message.append(_monitor.readFile());
-
- // Write the test config file to test output
- message.append("Server configuration overrides in use:\n");
- message.append(FileUtils.readFileAsString(getTestConfigFile()));
-
- message.append("\nVirtualhost maxMessageCount:\n");
- ServerConfiguration config = new ServerConfiguration(_configFile);
- config.initialise();
- message.append(config.getVirtualHostConfig(VIRTUALHOST).getMaximumMessageCount());
-
fail(message.toString());
}
}
@@ -148,9 +120,6 @@ public class AlertingTest extends AbstractTestLogging
* Test sends two messages to the broker then restarts the broker with new
* configuration.
*
- * If the test is running inVM the test validates that the new configuration
- * has been applied.
- *
* Validates that we only have two messages on the queue and then sends
* enough messages to trigger the alert.
*
@@ -176,27 +145,20 @@ public class AlertingTest extends AbstractTestLogging
startBroker();
- if (isInternalBroker())
- {
- assertEquals("Alert Max Msg Count is not correct", 5, ApplicationRegistry.getInstance().getVirtualHostRegistry().
- getVirtualHost(VIRTUALHOST).getQueueRegistry().getQueue(new AMQShortString(_destination.getQueueName())).
- getMaximumMessageCount());
- }
-
setupConnection();
// Validate the queue depth is as expected
long messageCount = ((AMQSession<?, ?>) _session).getQueueDepth((AMQDestination) _destination);
assertEquals("Broker has invalid message count for test", 2, messageCount);
- // Ensure the alert has not occured yet
+ // Ensure the alert has not occurred yet
assertLoggingNotYetOccured(MESSAGE_COUNT_ALERT);
// Trigger the new value
sendMessage(_session, _destination, 3);
_session.commit();
- // Validate that the alert occured.
+ // Validate that the alert occurred.
wasAlertFired();
}
}
diff --git a/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java b/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java
index 236202f323..9f532ec5f7 100644
--- a/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java
@@ -66,8 +66,8 @@ public class SubscriptionLoggingTest extends AbstractTestLogging
_session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- _queue = (Queue) getInitialContext().lookup(QUEUE);
- _topic = (Topic) getInitialContext().lookup(TOPIC);
+ _queue = _session.createQueue(getTestQueueName() + "Queue");
+ _topic = _session.createTopic(getTestQueueName() + "Topic");
}
/**
@@ -434,10 +434,6 @@ public class SubscriptionLoggingTest extends AbstractTestLogging
throw afe;
}
_connection.close();
-
- //Ensure the queue is drained before the test ends
- drainQueue(_queue);
-
}
/**
diff --git a/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java b/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java
index a5aa3d39df..52229316be 100644
--- a/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java
@@ -33,14 +33,19 @@ import java.lang.management.RuntimeMXBean;
*/
public class ExternalACLJMXTest extends AbstractACLTestCase
{
+
private JMXTestUtils _jmx;
private static final String TEST_QUEUE_OWNER = "admin";
private static final String TEST_VHOST = "test";
+ private static final String TEST2_VHOST = "test2";
@Override
public void setUp() throws Exception
{
+ createTestVirtualHost(TEST_VHOST);
+ createTestVirtualHost(TEST2_VHOST);
+
_jmx = new JMXTestUtils(this);
_jmx.setUp();
super.setUp();
@@ -128,7 +133,7 @@ public class ExternalACLJMXTest extends AbstractACLTestCase
//try a vhost-level method on a different vhost
try
{
- _jmx.createQueue("development", getTestQueueName(), TEST_QUEUE_OWNER, true);
+ _jmx.createQueue(TEST2_VHOST, getTestQueueName(), TEST_QUEUE_OWNER, true);
fail("Exception not thrown");
}
catch (SecurityException e)
diff --git a/java/systests/src/main/java/org/apache/qpid/server/stats/StatisticsReportingTest.java b/java/systests/src/main/java/org/apache/qpid/server/stats/StatisticsReportingTest.java
index c38fcd9199..1e61ff9382 100644
--- a/java/systests/src/main/java/org/apache/qpid/server/stats/StatisticsReportingTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/server/stats/StatisticsReportingTest.java
@@ -45,10 +45,14 @@ import javax.jms.TextMessage;
*/
public class StatisticsReportingTest extends QpidBrokerTestCase
{
+ private static final String VHOST_NAME1 = "vhost1";
+ private static final String VHOST_NAME2 = "vhost2";
+ private static final String VHOST_NAME3 = "vhost3";
+
protected LogMonitor _monitor;
protected static final String USER = "admin";
- protected Connection _test, _dev, _local;
+ protected Connection _conToVhost1, _conToVhost2, _conToVhost3;
protected String _queueName = "statistics";
protected Destination _queue;
protected String _brokerUrl;
@@ -56,6 +60,10 @@ public class StatisticsReportingTest extends QpidBrokerTestCase
@Override
public void setUp() throws Exception
{
+ createTestVirtualHost(VHOST_NAME1);
+ createTestVirtualHost(VHOST_NAME2);
+ createTestVirtualHost(VHOST_NAME3);
+
setConfigurationProperty("statistics.generation.broker", "true");
setConfigurationProperty("statistics.generation.virtualhosts", "true");
@@ -69,22 +77,21 @@ public class StatisticsReportingTest extends QpidBrokerTestCase
super.setUp();
_brokerUrl = getBroker().toString();
- _test = new AMQConnection(_brokerUrl, USER, USER, "clientid", "test");
- _dev = new AMQConnection(_brokerUrl, USER, USER, "clientid", "development");
- _local = new AMQConnection(_brokerUrl, USER, USER, "clientid", "localhost");
-
- _test.start();
- _dev.start();
- _local.start();
+ _conToVhost1 = new AMQConnection(_brokerUrl, USER, USER, "clientid", VHOST_NAME1);
+ _conToVhost2 = new AMQConnection(_brokerUrl, USER, USER, "clientid", VHOST_NAME2);
+ _conToVhost3 = new AMQConnection(_brokerUrl, USER, USER, "clientid", VHOST_NAME3);
+ _conToVhost1.start();
+ _conToVhost2.start();
+ _conToVhost3.start();
}
@Override
public void tearDown() throws Exception
{
- _test.close();
- _dev.close();
- _local.close();
+ _conToVhost1.close();
+ _conToVhost2.close();
+ _conToVhost3.close();
super.tearDown();
}
@@ -94,9 +101,9 @@ public class StatisticsReportingTest extends QpidBrokerTestCase
*/
public void testEnabledStatisticsReporting() throws Exception
{
- sendUsing(_test, 10, 100);
- sendUsing(_dev, 20, 100);
- sendUsing(_local, 15, 100);
+ sendUsing(_conToVhost1, 10, 100);
+ sendUsing(_conToVhost2, 20, 100);
+ sendUsing(_conToVhost3, 15, 100);
Thread.sleep(10 * 1000); // 15s
@@ -116,9 +123,9 @@ public class StatisticsReportingTest extends QpidBrokerTestCase
*/
public void testNotEnabledStatisticsReporting() throws Exception
{
- sendUsing(_test, 10, 100);
- sendUsing(_dev, 20, 100);
- sendUsing(_local, 15, 100);
+ sendUsing(_conToVhost1, 10, 100);
+ sendUsing(_conToVhost2, 20, 100);
+ sendUsing(_conToVhost3, 15, 100);
Thread.sleep(10 * 1000); // 15s
diff --git a/java/systests/src/main/java/org/apache/qpid/test/client/RollbackOrderTest.java b/java/systests/src/main/java/org/apache/qpid/test/client/RollbackOrderTest.java
index a53c3d3ee0..2ed3f356d3 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/client/RollbackOrderTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/test/client/RollbackOrderTest.java
@@ -40,19 +40,19 @@ import java.util.concurrent.atomic.AtomicBoolean;
* Description:
*
* The problem that this test is exposing is that the dispatcher used to be capable
- * of holding on to a message when stopped. This ment that when the rollback was
+ * of holding on to a message when stopped. This meant that when the rollback was
* called and the dispatcher stopped it may have hold of a message. So after all
* the local queues(preDeliveryQueue, SynchronousQueue, PostDeliveryTagQueue)
* have been cleared the client still had a single message, the one the
* dispatcher was holding on to.
*
* As a result the TxRollback operation would run and then release the dispatcher.
- * Whilst the dispatcher would then proceed to reject the message it was holiding
+ * Whilst the dispatcher would then proceed to reject the message it was holding
* the Broker would already have resent that message so the rejection would silently
* fail.
*
- * And the client would receieve that single message 'early', depending on the
- * number of messages already recevied when rollback was called.
+ * And the client would receive that single message 'early', depending on the
+ * number of messages already received when rollback was called.
*
*
* Aims:
@@ -78,7 +78,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
* as expected.
*
* We are testing a race condition here but we can check through the log file if
- * the race condition occured. However, performing that check will only validate
+ * the race condition occurred. However, performing that check will only validate
* the problem exists and will not be suitable as part of a system test.
*
*/
@@ -183,18 +183,8 @@ public class RollbackOrderTest extends QpidBrokerTestCase
}
}
-// _consumer.close();
_connection.close();
assertFalse("Exceptions thrown during test run, Check Std.err.", failed.get());
}
-
- @Override public void tearDown() throws Exception
- {
-
- drainQueue(_queue);
-
- super.tearDown();
- }
-
}
diff --git a/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java b/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
index aa909a6674..ec2607a621 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
+++ b/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
@@ -19,10 +19,8 @@ package org.apache.qpid.test.utils;
import java.io.File;
import java.io.FileOutputStream;
-import java.io.IOException;
import java.io.PrintStream;
import java.net.MalformedURLException;
-import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -818,34 +816,33 @@ public class QpidBrokerTestCase extends QpidTestCase
}
/**
- * Attempt to set the Java Broker to use the BDBMessageStore for persistence
- * Falling back to the DerbyMessageStore if
+ * Creates a new virtual host within the test virtualhost file.
*
- * @param virtualhost - The virtualhost to modify
- *
- * @throws ConfigurationException - when reading/writing existing configuration
- * @throws IOException - When creating a temporary file.
+ * @param virtualHostName virtual host name
+ * @throws ConfigurationException
*/
- protected void makeVirtualHostPersistent(String virtualhost)
- throws ConfigurationException, IOException
+ protected void createTestVirtualHost(String virtualHostName) throws ConfigurationException
{
- Class<?> storeClass = null;
- try
+ String storeClassName = getTestProfileMessageStoreClassName();
+
+ _testVirtualhosts.setProperty("virtualhost.name(-1)", virtualHostName);
+ _testVirtualhosts.setProperty("virtualhost." + virtualHostName + ".store.class", storeClassName);
+
+ String storeDir = null;
+
+ if (System.getProperty("profile", "").startsWith("java-dby-mem"))
{
- // Try and lookup the BDB class
- storeClass = Class.forName("org.apache.qpid.server.store.berkeleydb.BDBMessageStore");
+ storeDir = DerbyMessageStore.MEMORY_STORE_LOCATION;
}
- catch (ClassNotFoundException e)
+ else if (!MEMORY_STORE_CLASS_NAME.equals(storeClassName))
{
- // No BDB store, we'll use Derby instead.
- storeClass = DerbyMessageStore.class;
+ storeDir = "${QPID_WORK}" + File.separator + virtualHostName + "-store";
}
-
- setConfigurationProperty("virtualhosts.virtualhost." + virtualhost + ".store.class",
- storeClass.getName());
- setConfigurationProperty("virtualhosts.virtualhost." + virtualhost + ".store." + MessageStoreConstants.ENVIRONMENT_PATH_PROPERTY,
- "${QPID_WORK}/" + virtualhost);
+ if (storeDir != null)
+ {
+ _testVirtualhosts.setProperty("virtualhost." + virtualHostName + ".store." + MessageStoreConstants.ENVIRONMENT_PATH_PROPERTY, storeDir);
+ }
}
/**
@@ -884,10 +881,8 @@ public class QpidBrokerTestCase extends QpidTestCase
* @param value the new value
*
* @throws ConfigurationException when loading the current config file
- * @throws IOException when writing the new config file
*/
- public void setConfigurationProperty(String property, String value)
- throws ConfigurationException, IOException
+ public void setConfigurationProperty(String property, String value) throws ConfigurationException
{
// Choose which file to write the property to based on prefix.
if (property.startsWith("virtualhosts"))
@@ -1092,7 +1087,7 @@ public class QpidBrokerTestCase extends QpidTestCase
*
* @return A connection factory
*
- * @throws Exception if there is an error getting the tactory
+ * @throws Exception if there is an error getting the factory
*/
public AMQConnectionFactory getConnectionFactory(String factoryName) throws NamingException
{
diff --git a/java/test-profiles/JavaTransientExcludes b/java/test-profiles/JavaTransientExcludes
index e7b423ef34..2f96584589 100644
--- a/java/test-profiles/JavaTransientExcludes
+++ b/java/test-profiles/JavaTransientExcludes
@@ -20,6 +20,8 @@
//These tests require a persistent store
org.apache.qpid.server.persistent.NoLocalAfterRecoveryTest#*
org.apache.qpid.server.store.PersistentStoreTest#*
+org.apache.qpid.server.logging.AlertingTest#testAlertingReallyWorksWithRestart
+org.apache.qpid.server.logging.AlertingTest#testAlertingReallyWorksWithChanges
org.apache.qpid.test.unit.ack.ClientAcknowledgeTest#testClientAckWithLargeFlusherPeriod
org.apache.qpid.test.unit.ct.DurableSubscriberTest#*