summaryrefslogtreecommitdiff
path: root/qpid/java/broker-plugins/experimental
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2010-05-21 21:08:23 +0000
committerMartin Ritchie <ritchiem@apache.org>2010-05-21 21:08:23 +0000
commit3e882a6fdc6852f0023f2f8547413c252e270a03 (patch)
tree9391ead1a8b4f93eb231c1029562faea676b23cd /qpid/java/broker-plugins/experimental
parent5afdc67935d07852c7c166741401ec4a77604d9b (diff)
downloadqpid-python-3e882a6fdc6852f0023f2f8547413c252e270a03.tar.gz
QPID-2585 : Prevent NPE if plugins are not enabled but requested
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@947174 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins/experimental')
-rw-r--r--qpid/java/broker-plugins/experimental/slowconsumerdetection/src/test/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetectionQueueConfigurationTest.java66
1 files changed, 66 insertions, 0 deletions
diff --git a/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/test/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetectionQueueConfigurationTest.java b/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/test/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetectionQueueConfigurationTest.java
new file mode 100644
index 0000000000..180573d625
--- /dev/null
+++ b/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/test/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetectionQueueConfigurationTest.java
@@ -0,0 +1,66 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.virtualhost.plugin;
+
+import junit.framework.TestCase;
+import org.apache.commons.configuration.CompositeConfiguration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.XMLConfiguration;
+import org.apache.qpid.server.configuration.plugin.SlowConsumerDetectionQueueConfiguration;
+
+
+public class SlowConsumerDetectionQueueConfigurationTest extends TestCase
+{
+ public void setUp()
+ {
+
+ }
+
+
+ public void testConfigLoadingValidConfig()
+ {
+ SlowConsumerDetectionQueueConfiguration config = new SlowConsumerDetectionQueueConfiguration();
+
+ XMLConfiguration xmlconfig = new XMLConfiguration();
+
+ xmlconfig.addProperty("messageAge", "60000");
+ xmlconfig.addProperty("depth", "1024");
+ xmlconfig.addProperty("messageCount", "10");
+ xmlconfig.addProperty("policy.name", "TopicDelete");
+ xmlconfig.addProperty("policy.topicdelete", "");
+
+
+ // Create a CompositeConfiguration as this is what the broker uses
+ CompositeConfiguration composite = new CompositeConfiguration();
+ composite.addConfiguration(xmlconfig);
+
+ try
+ {
+ config.setConfiguration("", composite);
+ }
+ catch (ConfigurationException e)
+ {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ }
+
+}