diff options
| author | Andrea Gazzarini <agazzarini@apache.org> | 2009-02-14 10:49:38 +0000 |
|---|---|---|
| committer | Andrea Gazzarini <agazzarini@apache.org> | 2009-02-14 10:49:38 +0000 |
| commit | 38c742e89e98588c8434e875c5d6c5d99fd26dc2 (patch) | |
| tree | 7c8c955fd9087b17a3483c123d83309c7fe0d7be /qpid/java/management/client/src/test | |
| parent | 7f949e5b55e35a772732dd5de81900f3510a37ee (diff) | |
| download | qpid-python-38c742e89e98588c8434e875c5d6c5d99fd26dc2.tar.gz | |
QPID-1664 : QMan Asynchronous notification capability
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@744478 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/management/client/src/test')
| -rw-r--r-- | qpid/java/management/client/src/test/java/log4j.xml | 7 | ||||
| -rw-r--r-- | qpid/java/management/client/src/test/java/org/apache/qpid/management/wsdm/capabilities/QManAdapterCapabilityTest.java | 81 |
2 files changed, 87 insertions, 1 deletions
diff --git a/qpid/java/management/client/src/test/java/log4j.xml b/qpid/java/management/client/src/test/java/log4j.xml index 6624f23aa1..34634b7738 100644 --- a/qpid/java/management/client/src/test/java/log4j.xml +++ b/qpid/java/management/client/src/test/java/log4j.xml @@ -12,7 +12,12 @@ </layout> </appender> <category name="org.apache.qpid.management">
- <priority value="ERROR" />
+ <priority value="INFO" />
+ <appender-ref ref="CONSOLE" />
+ </category>
+
+ <category name="org.mortbay">
+ <priority value="INFO" />
<appender-ref ref="CONSOLE" />
</category>
diff --git a/qpid/java/management/client/src/test/java/org/apache/qpid/management/wsdm/capabilities/QManAdapterCapabilityTest.java b/qpid/java/management/client/src/test/java/org/apache/qpid/management/wsdm/capabilities/QManAdapterCapabilityTest.java new file mode 100644 index 0000000000..648c7b2f60 --- /dev/null +++ b/qpid/java/management/client/src/test/java/org/apache/qpid/management/wsdm/capabilities/QManAdapterCapabilityTest.java @@ -0,0 +1,81 @@ +/*
+ *
+ * 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.management.wsdm.capabilities;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import org.apache.muse.ws.notification.NotificationProducer;
+import org.apache.qpid.management.Names;
+
+import junit.framework.TestCase;
+
+/**
+ * Test case for QMan adapter capability.
+ *
+ * @author Andrea Gazzarini
+ */
+public class QManAdapterCapabilityTest extends TestCase
+{
+ /**
+ * Tests the execution of the getTopicName() method.
+ *
+ * <br>precondition : an object type is given to the method (null is allowed).
+ * <br>postcondition : according to getTopicName() specs, the name of the
+ * topic associated with the given object type must be returned.
+ */
+ public void testGetTopicName()
+ {
+ final InvocationHandler invocationHandler = new InvocationHandler(){
+
+ public Object invoke(Object proxy, Method method, Object[] args)
+ {
+ return null;
+ }
+ };
+
+ QManAdapterCapability capability = new QManAdapterCapability(){
+ @Override
+ NotificationProducer getPublisherCapability()
+ {
+ return (NotificationProducer) Proxy.newProxyInstance(
+ getClass().getClassLoader(),
+ new Class[]{NotificationProducer.class},
+ invocationHandler);
+ }
+ };
+
+ capability.createLifeCycleTopics();
+
+ assertEquals(
+ Names.EVENTS_LIFECYLE_TOPIC_NAME,
+ capability.getTopicName(Names.EVENT));
+
+ assertEquals(
+ Names.OBJECTS_LIFECYLE_TOPIC_NAME,
+ capability.getTopicName(Names.CLASS));
+
+ assertEquals(
+ Names.UNKNOWN_OBJECT_TYPE_LIFECYLE_TOPIC_NAME,
+ capability.getTopicName("This is an unknown object Type @#!--!!@#"));
+ }
+}
\ No newline at end of file |
