summaryrefslogtreecommitdiff
path: root/qpid/java/broker/src/test
diff options
context:
space:
mode:
authorAlex Rudyy <orudyy@apache.org>2013-03-29 13:27:05 +0000
committerAlex Rudyy <orudyy@apache.org>2013-03-29 13:27:05 +0000
commit2de5f1bff906ed75d6650a93d5dfc81e4d28cf28 (patch)
tree583a41534ccce4bfa3d7e622de4cd80d3856b8be /qpid/java/broker/src/test
parent9f22988ff2d01008ea0cd97d1b2fb8cb8bce96a1 (diff)
downloadqpid-python-2de5f1bff906ed75d6650a93d5dfc81e4d28cf28.tar.gz
QPID-4677: Add missing broker attributes related to store transactions
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1462472 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/VirtualHostConfigurationTest.java48
1 files changed, 48 insertions, 0 deletions
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 570bd004c5..b3b637c81e 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
@@ -357,4 +357,52 @@ public class VirtualHostConfigurationTest extends QpidTestCase
// Check, that the property stored within the <dot.in.a.name> tag has been properly loaded
assertEquals("virtual host with dots in the name has been properly loaded", TestableMemoryMessageStore.class.getName(), test.getMessageStore().getClass().getName());
}
+
+ public void testStoreTransactionIdleTimeoutClose() throws Exception
+ {
+ VirtualHost vhost = createVirtualHost(getName());
+ assertEquals("Unexpected StoreTransactionIdleTimeoutClose value", 0, vhost.getConfiguration().getTransactionTimeoutIdleClose());
+
+ when(_broker.getAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE)).thenReturn(1000l);
+ assertEquals("Unexpected StoreTransactionIdleTimeoutClose value", 1000l, vhost.getConfiguration().getTransactionTimeoutIdleClose());
+
+ vhost.getConfiguration().getConfig().setProperty("transactionTimeout.idleClose", 2000l);
+ assertEquals("Unexpected StoreTransactionIdleTimeoutClose value", 2000l, vhost.getConfiguration().getTransactionTimeoutIdleClose());
+ }
+
+ public void testStoreTransactionIdleTimeoutWarn() throws Exception
+ {
+ VirtualHost vhost = createVirtualHost(getName());
+ assertEquals("Unexpected StoreTransactionIdleTimeoutWarn value", 0, vhost.getConfiguration().getTransactionTimeoutIdleWarn());
+
+ when(_broker.getAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN)).thenReturn(1000l);
+ assertEquals("Unexpected StoreTransactionIdleTimeoutWarn value", 1000l, vhost.getConfiguration().getTransactionTimeoutIdleWarn());
+
+ vhost.getConfiguration().getConfig().setProperty("transactionTimeout.idleWarn", 2000l);
+ assertEquals("Unexpected StoreTransactionIdleTimeoutWarn value", 2000l, vhost.getConfiguration().getTransactionTimeoutIdleWarn());
+ }
+
+ public void testStoreTransactionOpenTimeoutClose() throws Exception
+ {
+ VirtualHost vhost = createVirtualHost(getName());
+ assertEquals("Unexpected StoreTransactionOpenTimeoutClose value", 0, vhost.getConfiguration().getTransactionTimeoutOpenClose());
+
+ when(_broker.getAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE)).thenReturn(1000l);
+ assertEquals("Unexpected StoreTransactionOpenTimeoutClose value", 1000l, vhost.getConfiguration().getTransactionTimeoutOpenClose());
+
+ vhost.getConfiguration().getConfig().setProperty("transactionTimeout.openClose", 2000l);
+ assertEquals("Unexpected StoreTransactionOpenTimeoutClose value", 2000l, vhost.getConfiguration().getTransactionTimeoutOpenClose());
+ }
+
+ public void testStoreTransactionOpenTimeoutWarn() throws Exception
+ {
+ VirtualHost vhost = createVirtualHost(getName());
+ assertEquals("Unexpected StoreTransactionOpenTimeoutWarn value", 0, vhost.getConfiguration().getTransactionTimeoutOpenWarn());
+
+ when(_broker.getAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN)).thenReturn(1000l);
+ assertEquals("Unexpected StoreTransactionOpenTimeoutWarn value", 1000l, vhost.getConfiguration().getTransactionTimeoutOpenWarn());
+
+ vhost.getConfiguration().getConfig().setProperty("transactionTimeout.openWarn", 2000l);
+ assertEquals("Unexpected StoreTransactionOpenTimeoutWarn value", 2000l, vhost.getConfiguration().getTransactionTimeoutOpenWarn());
+ }
}