Author: kwall
Date: Mon Sep 17 21:55:27 2012
New Revision: 1386864
URL: http://svn.apache.org/viewvc?rev=1386864&view=rev
Log:
QPID-4284: Remove system test dependencies on development and localhost virtual
hosts
Modified:
qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java
qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BindingRestTest.java
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerRestTest.java
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ExchangeRestTest.java
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/QpidRestTestCase.java
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/StructureRestTest.java
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/VirtualHostRestTest.java
qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java
qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-bdb-settings.xml
qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-derby-mem-settings.xml
qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-derby-settings.xml
qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-settings.xml
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/stats/StatisticsReportingTest.java
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/RollbackOrderTest.java
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes
Modified:
qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java
(original)
+++
qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java
Mon Sep 17 21:55:27 2012
@@ -63,7 +63,7 @@ public class BDBBackupTest extends QpidB
// 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);
}
Modified:
qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
(original)
+++
qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
Mon Sep 17 21:55:27 2012
@@ -70,7 +70,7 @@ public class BDBUpgradeTest extends Qpid
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);
Modified:
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BindingRestTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BindingRestTest.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BindingRestTest.java
(original)
+++
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BindingRestTest.java
Mon Sep 17 21:55:27 2012
@@ -34,7 +34,7 @@ public class BindingRestTest extends Qpi
{
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);
Modified:
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerRestTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerRestTest.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerRestTest.java
(original)
+++
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/BrokerRestTest.java
Mon Sep 17 21:55:27 2012
@@ -55,9 +55,9 @@ public class BrokerRestTest extends Qpid
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);
Modified:
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ExchangeRestTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ExchangeRestTest.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ExchangeRestTest.java
(original)
+++
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/ExchangeRestTest.java
Mon Sep 17 21:55:27 2012
@@ -33,7 +33,7 @@ public class ExchangeRestTest extends Qp
{
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);
Modified:
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/QpidRestTestCase.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/QpidRestTestCase.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/QpidRestTestCase.java
(original)
+++
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/QpidRestTestCase.java
Mon Sep 17 21:55:27 2012
@@ -27,16 +27,30 @@ import org.apache.qpid.test.utils.QpidBr
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();
}
Modified:
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/StructureRestTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/StructureRestTest.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/StructureRestTest.java
(original)
+++
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/StructureRestTest.java
Mon Sep 17 21:55:27 2012
@@ -44,7 +44,7 @@ public class StructureRestTest extends Q
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);
Modified:
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/VirtualHostRestTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/VirtualHostRestTest.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/VirtualHostRestTest.java
(original)
+++
qpid/trunk/qpid/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/servlet/rest/VirtualHostRestTest.java
Mon Sep 17 21:55:27 2012
@@ -49,8 +49,8 @@ public class VirtualHostRestTest extends
{
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);
Modified:
qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java
(original)
+++
qpid/trunk/qpid/java/broker-plugins/management-jmx/src/test/java/org/apache/qpid/systest/management/jmx/StatisticsTest.java
Mon Sep 17 21:55:27 2012
@@ -36,42 +36,48 @@ import org.apache.qpid.test.utils.QpidBr
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 Qpid
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);
}
Modified:
qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-bdb-settings.xml
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-bdb-settings.xml?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-bdb-settings.xml
(original)
+++ qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-bdb-settings.xml
Mon Sep 17 21:55:27 2012
@@ -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>
-
-
Modified:
qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-derby-mem-settings.xml
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-derby-mem-settings.xml?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-derby-mem-settings.xml
(original)
+++
qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-derby-mem-settings.xml
Mon Sep 17 21:55:27 2012
@@ -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>
-
-
Modified:
qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-derby-settings.xml
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-derby-settings.xml?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-derby-settings.xml
(original)
+++ qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-derby-settings.xml
Mon Sep 17 21:55:27 2012
@@ -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>
-
-
Modified: qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-settings.xml
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-settings.xml?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-settings.xml
(original)
+++ qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-settings.xml Mon
Sep 17 21:55:27 2012
@@ -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>
Modified:
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
(original)
+++
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
Mon Sep 17 21:55:27 2012
@@ -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 Abstra
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 Abstra
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 Abstra
* 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 Abstra
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();
}
}
Modified:
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java
(original)
+++
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/SubscriptionLoggingTest.java
Mon Sep 17 21:55:27 2012
@@ -66,8 +66,8 @@ public class SubscriptionLoggingTest ext
_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 ext
throw afe;
}
_connection.close();
-
- //Ensure the queue is drained before the test ends
- drainQueue(_queue);
-
}
/**
Modified:
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java
(original)
+++
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/ExternalACLJMXTest.java
Mon Sep 17 21:55:27 2012
@@ -33,14 +33,19 @@ import java.lang.management.RuntimeMXBea
*/
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
//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)
Modified:
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/stats/StatisticsReportingTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/stats/StatisticsReportingTest.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/stats/StatisticsReportingTest.java
(original)
+++
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/stats/StatisticsReportingTest.java
Mon Sep 17 21:55:27 2012
@@ -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 ext
@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 ext
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 ext
*/
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 ext
*/
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
Modified:
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/RollbackOrderTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/RollbackOrderTest.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/RollbackOrderTest.java
(original)
+++
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/RollbackOrderTest.java
Mon Sep 17 21:55:27 2012
@@ -40,19 +40,19 @@ import java.util.concurrent.atomic.Atomi
* 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.Atomi
* 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 Q
}
}
-// _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();
- }
-
}
Modified:
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
---
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
(original)
+++
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
Mon Sep 17 21:55:27 2012
@@ -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
}
/**
- * 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
* @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
*
* @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
{
Modified: qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes?rev=1386864&r1=1386863&r2=1386864&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes (original)
+++ qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes Mon Sep 17
21:55:27 2012
@@ -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#*
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]