summaryrefslogtreecommitdiff
path: root/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
commitbe2eb0f1a11aea2b190229dea3f25bf6b48d746c (patch)
tree5e750ef61c61a68126560ca646b0ab4412e877d1 /java/broker-plugins/experimental
parenta3462820c7f5af8bbb7300334c49d47b239fe901 (diff)
downloadqpid-python-be2eb0f1a11aea2b190229dea3f25bf6b48d746c.tar.gz
QPID-2585 : Prevent NPE if plugins are not enabled but requested
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@947174 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker-plugins/experimental')
-rw-r--r--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/java/broker-plugins/experimental/slowconsumerdetection/src/test/java/org/apache/qpid/server/virtualhost/plugin/SlowConsumerDetectionQueueConfigurationTest.java b/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/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());
+ }
+ }
+
+}