summaryrefslogtreecommitdiff
path: root/qpid/java/broker/src/test
diff options
context:
space:
mode:
authorAlex Rudyy <orudyy@apache.org>2013-03-29 17:30:24 +0000
committerAlex Rudyy <orudyy@apache.org>2013-03-29 17:30:24 +0000
commitcf08e7af7ffef1cf57821d4256bb02f45937da50 (patch)
tree6e3ee7372c44928d2310ef4588e6fa97e9c65efe /qpid/java/broker/src/test
parent2de5f1bff906ed75d6650a93d5dfc81e4d28cf28 (diff)
downloadqpid-python-cf08e7af7ffef1cf57821d4256bb02f45937da50.tar.gz
QPID-4677: Rename broker and virtual host attribute constants to distiguish the global default settings for queues, connections and virtual hosts from own attributes
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1462550 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker/src/test')
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java12
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java2
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java24
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java4
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java48
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java2
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java4
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java4
8 files changed, 50 insertions, 50 deletions
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
index 0bb65479ce..7b149df191 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
@@ -69,14 +69,14 @@ public class QueueConfigurationTest extends TestCase
public void testMaxDeliveryCount() throws Exception
{
// broker MAXIMUM_DELIVERY_ATTEMPTS attribute is not set
- when(_broker.getAttribute(Broker.MAXIMUM_DELIVERY_ATTEMPTS)).thenReturn(null);
+ when(_broker.getAttribute(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS)).thenReturn(null);
// Check default value
QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
assertEquals("Unexpected default server configuration for max delivery count ", 0, qConf.getMaxDeliveryCount());
// set broker MAXIMUM_DELIVERY_ATTEMPTS attribute to 2
- when(_broker.getAttribute(Broker.MAXIMUM_DELIVERY_ATTEMPTS)).thenReturn(2);
+ when(_broker.getAttribute(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS)).thenReturn(2);
// Check that queue inherits the MAXIMUM_DELIVERY_ATTEMPTS value from broker
qConf = new QueueConfiguration("test", _emptyConf);
@@ -100,14 +100,14 @@ public class QueueConfigurationTest extends TestCase
public void testIsDeadLetterQueueEnabled() throws Exception
{
// enable dead letter queues broker wide
- when(_broker.getAttribute(Broker.DEAD_LETTER_QUEUE_ENABLED)).thenReturn(true);
+ when(_broker.getAttribute(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED)).thenReturn(true);
// Check that queue inherits the broker setting
QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
assertTrue("Unexpected queue configuration for dead letter enabled attribute", qConf.isDeadLetterQueueEnabled());
// broker DEAD_LETTER_QUEUE_ENABLED is not set
- when(_broker.getAttribute(Broker.DEAD_LETTER_QUEUE_ENABLED)).thenReturn(null);
+ when(_broker.getAttribute(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED)).thenReturn(null);
// Check that queue dead letter queue is not enabled
qConf = new QueueConfiguration("test", _emptyConf);
@@ -191,14 +191,14 @@ public class QueueConfigurationTest extends TestCase
public void testGetMinimumAlertRepeatGap() throws Exception
{
// set broker attribute ALERT_REPEAT_GAP to 10
- when(_broker.getAttribute(Broker.ALERT_REPEAT_GAP)).thenReturn(10);
+ when(_broker.getAttribute(Broker.QUEUE_ALERT_REPEAT_GAP)).thenReturn(10);
// check that broker level setting is available on queue configuration
QueueConfiguration qConf = new QueueConfiguration("test", _emptyConf);
assertEquals(10, qConf.getMinimumAlertRepeatGap());
// remove configuration for ALERT_REPEAT_GAP on broker level
- when(_broker.getAttribute(Broker.ALERT_REPEAT_GAP)).thenReturn(null);
+ when(_broker.getAttribute(Broker.QUEUE_ALERT_REPEAT_GAP)).thenReturn(null);
// Check default value
qConf = new QueueConfiguration("test", _emptyConf);
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
index b3b637c81e..de6d036f29 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
@@ -52,7 +52,7 @@ public class VirtualHostConfigurationTest extends QpidTestCase
_configXml.addProperty("virtualhosts.virtualhost(-1)."+getName()+".store.class", TestableMemoryMessageStore.class.getName());
_virtualHostRegistry = new VirtualHostRegistry();
_broker = mock(Broker.class);
- when(_broker.getAttribute(Broker.HOUSEKEEPING_CHECK_PERIOD)).thenReturn(30000l);
+ when(_broker.getAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD)).thenReturn(30000l);
}
@Override
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java
index facd4e63ef..3a41b61961 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java
@@ -90,19 +90,19 @@ public class BrokerRecovererTest extends TestCase
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
attributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, "authenticationProvider1");
- attributes.put(Broker.ALERT_THRESHOLD_MESSAGE_AGE, 9l);
- attributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 8l);
- attributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 7l);
- attributes.put(Broker.ALERT_THRESHOLD_MESSAGE_SIZE, 6l);
- attributes.put(Broker.ALERT_REPEAT_GAP, 5l);
- attributes.put(Broker.FLOW_CONTROL_SIZE_BYTES, 5l);
- attributes.put(Broker.FLOW_CONTROL_RESUME_SIZE_BYTES, 3l);
- attributes.put(Broker.MAXIMUM_DELIVERY_ATTEMPTS, 2);
- attributes.put(Broker.DEAD_LETTER_QUEUE_ENABLED, true);
- attributes.put(Broker.HOUSEKEEPING_CHECK_PERIOD, 1l);
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 9l);
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 8l);
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 7l);
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, 6l);
+ attributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, 5l);
+ attributes.put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, 5l);
+ attributes.put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, 3l);
+ attributes.put(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, 2);
+ attributes.put(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, true);
+ attributes.put(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 1l);
attributes.put(Broker.ACL_FILE, "/path/to/acl");
- attributes.put(Broker.SESSION_COUNT_LIMIT, 1000);
- attributes.put(Broker.HEART_BEAT_DELAY, 2000);
+ attributes.put(Broker.CONNECTION_SESSION_COUNT_LIMIT, 1000);
+ attributes.put(Broker.CONNECTION_HEART_BEAT_DELAY, 2000);
attributes.put(Broker.STATISTICS_REPORTING_PERIOD, 4000);
attributes.put(Broker.STATISTICS_REPORTING_RESET_ENABLED, true);
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java
index adb1f81a43..713cd25adb 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java
@@ -45,7 +45,7 @@ public class VirtualHostRecovererTest extends TestCase
SecurityManager securityManager = mock(SecurityManager.class);
ConfigurationEntry entry = mock(ConfigurationEntry.class);
Broker parent = mock(Broker.class);
- when(parent.getAttribute(Broker.HOUSEKEEPING_CHECK_PERIOD)).thenReturn(3000l);
+ when(parent.getAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD)).thenReturn(3000l);
when(parent.getSecurityManager()).thenReturn(securityManager);
VirtualHostRecoverer recoverer = new VirtualHostRecoverer(statisticsGatherer);
@@ -69,7 +69,7 @@ public class VirtualHostRecovererTest extends TestCase
SecurityManager securityManager = mock(SecurityManager.class);
ConfigurationEntry entry = mock(ConfigurationEntry.class);
Broker parent = mock(Broker.class);
- when(parent.getAttribute(Broker.HOUSEKEEPING_CHECK_PERIOD)).thenReturn(3000l);
+ when(parent.getAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD)).thenReturn(3000l);
when(parent.getSecurityManager()).thenReturn(securityManager);
VirtualHostRecoverer recoverer = new VirtualHostRecoverer(statisticsGatherer);
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java
index 013daefce4..adb4472694 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java
@@ -61,19 +61,19 @@ public abstract class ConfigurationEntryStoreTestCase extends QpidTestCase
_brokerAttributes = new HashMap<String, Object>();
_brokerAttributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
_brokerAttributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, "authenticationProvider1");
- _brokerAttributes.put(Broker.ALERT_THRESHOLD_MESSAGE_AGE, 9);
- _brokerAttributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 8);
- _brokerAttributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 7);
- _brokerAttributes.put(Broker.ALERT_THRESHOLD_MESSAGE_SIZE, 6);
- _brokerAttributes.put(Broker.ALERT_REPEAT_GAP, 5);
- _brokerAttributes.put(Broker.FLOW_CONTROL_SIZE_BYTES, 5);
- _brokerAttributes.put(Broker.FLOW_CONTROL_RESUME_SIZE_BYTES, 3);
- _brokerAttributes.put(Broker.MAXIMUM_DELIVERY_ATTEMPTS, 2);
- _brokerAttributes.put(Broker.DEAD_LETTER_QUEUE_ENABLED, true);
- _brokerAttributes.put(Broker.HOUSEKEEPING_CHECK_PERIOD, 1);
+ _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 9);
+ _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 8);
+ _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 7);
+ _brokerAttributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, 6);
+ _brokerAttributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, 5);
+ _brokerAttributes.put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, 5);
+ _brokerAttributes.put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, 3);
+ _brokerAttributes.put(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, 2);
+ _brokerAttributes.put(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, true);
+ _brokerAttributes.put(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 1);
_brokerAttributes.put(Broker.ACL_FILE, "/path/to/acl");
- _brokerAttributes.put(Broker.SESSION_COUNT_LIMIT, 1000);
- _brokerAttributes.put(Broker.HEART_BEAT_DELAY, 2000);
+ _brokerAttributes.put(Broker.CONNECTION_SESSION_COUNT_LIMIT, 1000);
+ _brokerAttributes.put(Broker.CONNECTION_HEART_BEAT_DELAY, 2000);
_brokerAttributes.put(Broker.STATISTICS_REPORTING_PERIOD, 4000);
_brokerAttributes.put(Broker.STATISTICS_REPORTING_RESET_ENABLED, true);
@@ -172,19 +172,19 @@ public abstract class ConfigurationEntryStoreTestCase extends QpidTestCase
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
attributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, "authenticationProvider1");
- attributes.put(Broker.ALERT_THRESHOLD_MESSAGE_AGE, 19);
- attributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 18);
- attributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 17);
- attributes.put(Broker.ALERT_THRESHOLD_MESSAGE_SIZE, 16);
- attributes.put(Broker.ALERT_REPEAT_GAP, 15);
- attributes.put(Broker.FLOW_CONTROL_SIZE_BYTES, 15);
- attributes.put(Broker.FLOW_CONTROL_RESUME_SIZE_BYTES, 13);
- attributes.put(Broker.MAXIMUM_DELIVERY_ATTEMPTS, 12);
- attributes.put(Broker.DEAD_LETTER_QUEUE_ENABLED, false);
- attributes.put(Broker.HOUSEKEEPING_CHECK_PERIOD, 11);
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_AGE, 19);
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 18);
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 17);
+ attributes.put(Broker.QUEUE_ALERT_THRESHOLD_MESSAGE_SIZE, 16);
+ attributes.put(Broker.QUEUE_ALERT_REPEAT_GAP, 15);
+ attributes.put(Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, 15);
+ attributes.put(Broker.QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES, 13);
+ attributes.put(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS, 12);
+ attributes.put(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED, false);
+ attributes.put(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, 11);
attributes.put(Broker.ACL_FILE, "/path/to/acl1");
- attributes.put(Broker.SESSION_COUNT_LIMIT, 11000);
- attributes.put(Broker.HEART_BEAT_DELAY, 12000);
+ attributes.put(Broker.CONNECTION_SESSION_COUNT_LIMIT, 11000);
+ attributes.put(Broker.CONNECTION_HEART_BEAT_DELAY, 12000);
attributes.put(Broker.STATISTICS_REPORTING_PERIOD, 14000);
attributes.put(Broker.STATISTICS_REPORTING_RESET_ENABLED, false);
ConfigurationEntry updatedBrokerEntry = new ConfigurationEntry(_brokerId, Broker.class.getSimpleName(), attributes,
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java
index a77a0e9fcc..1699d414ae 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/StoreConfigurationChangeListenerTest.java
@@ -61,7 +61,7 @@ public class StoreConfigurationChangeListenerTest extends QpidTestCase
{
notifyBrokerStarted();
Broker broker = mock(Broker.class);
- _listener.attributeSet(broker, Broker.FLOW_CONTROL_SIZE_BYTES, null, 1);
+ _listener.attributeSet(broker, Broker.QUEUE_FLOW_CONTROL_SIZE_BYTES, null, 1);
verify(_store).save(any(ConfigurationEntry.class));
}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
index 0f82345271..eee6f315d0 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
@@ -58,8 +58,8 @@ public class AMQQueueFactoryTest extends QpidTestCase
Broker broker = BrokerTestHelper.createBrokerMock();
if (getName().equals("testDeadLetterQueueDoesNotInheritDLQorMDCSettings"))
{
- when(broker.getAttribute(Broker.MAXIMUM_DELIVERY_ATTEMPTS)).thenReturn(5);
- when(broker.getAttribute(Broker.DEAD_LETTER_QUEUE_ENABLED)).thenReturn(true);
+ when(broker.getAttribute(Broker.QUEUE_MAXIMUM_DELIVERY_ATTEMPTS)).thenReturn(5);
+ when(broker.getAttribute(Broker.QUEUE_DEAD_LETTER_QUEUE_ENABLED)).thenReturn(true);
}
_virtualHost = BrokerTestHelper.createVirtualHost(new VirtualHostConfiguration(getName(), configXml, broker));
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java
index 3be8927224..3edbc852a0 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java
@@ -70,8 +70,8 @@ public class BrokerTestHelper
SubjectCreator subjectCreator = mock(SubjectCreator.class);
when(subjectCreator.getMechanisms()).thenReturn("");
Broker broker = mock(Broker.class);
- when(broker.getAttribute(Broker.SESSION_COUNT_LIMIT)).thenReturn(1);
- when(broker.getAttribute(Broker.HOUSEKEEPING_CHECK_PERIOD)).thenReturn(10000l);
+ when(broker.getAttribute(Broker.CONNECTION_SESSION_COUNT_LIMIT)).thenReturn(1);
+ when(broker.getAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD)).thenReturn(10000l);
when(broker.getId()).thenReturn(UUID.randomUUID());
when(broker.getSubjectCreator(any(SocketAddress.class))).thenReturn(subjectCreator);
RootMessageLogger rootMessageLogger = CurrentActor.get().getRootMessageLogger();