activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1334243 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util: AdvisorySupportTest.cpp AdvisorySupportTest.h
Date Fri, 04 May 2012 22:37:48 GMT
Author: tabish
Date: Fri May  4 22:37:48 2012
New Revision: 1334243

URL: http://svn.apache.org/viewvc?rev=1334243&view=rev
Log:
Working on Unit Test coverage of AdvisorySupport API

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/AdvisorySupportTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/AdvisorySupportTest.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/AdvisorySupportTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/AdvisorySupportTest.cpp?rev=1334243&r1=1334242&r2=1334243&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/AdvisorySupportTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/AdvisorySupportTest.cpp
Fri May  4 22:37:48 2012
@@ -19,6 +19,8 @@
 
 #include <activemq/util/AdvisorySupport.h>
 #include <activemq/commands/ActiveMQDestination.h>
+#include <activemq/commands/ActiveMQTopic.h>
+#include <activemq/commands/ActiveMQQueue.h>
 
 #include <decaf/lang/Pointer.h>
 
@@ -49,3 +51,274 @@ void AdvisorySupportTest::testGetTempDes
     CPPUNIT_ASSERT(topic->getPhysicalName().find(".TempQueue") != std::string::npos);
 }
 
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetAllDestinationsCompositeAdvisoryTopic() {
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getAllDestinationsCompositeAdvisoryTopic());
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite());
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".TempTopic") != std::string::npos);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".TempQueue") != std::string::npos);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Topic") != std::string::npos);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Queue") != std::string::npos);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetAllDestinationAdvisoryTopics() {
+
+    Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+    std::vector<ActiveMQDestination*> topics = AdvisorySupport::getAllDestinationAdvisoryTopics(target.get());
+    CPPUNIT_ASSERT(topics.size() > 0);
+
+    std::vector<ActiveMQDestination*>::iterator iter = topics.begin();
+    for (; iter != topics.end(); ++iter) {
+        Pointer<ActiveMQDestination> topic(*iter);
+        CPPUNIT_ASSERT(topic->isTopic());
+        CPPUNIT_ASSERT(topic->isTemporary() == false);
+        CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX)
== 0);
+    }
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    std::vector<ActiveMQDestination*> topics2 = AdvisorySupport::getAllDestinationAdvisoryTopics(cmsDest.get());
+    CPPUNIT_ASSERT(topics2.size() > 0);
+
+    std::vector<ActiveMQDestination*>::iterator iter2 = topics2.begin();
+    for (; iter2 != topics2.end(); ++iter2) {
+        Pointer<ActiveMQDestination> topic(*iter2);
+        CPPUNIT_ASSERT(topic->isTopic());
+        CPPUNIT_ASSERT(topic->isTemporary() == false);
+        CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX)
== 0);
+    }
+
+    CPPUNIT_ASSERT_EQUAL(topics.size(), topics2.size());
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetConnectionAdvisoryTopic() {
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getConnectionAdvisoryTopic());
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite());
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX)
== 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Connection") != std::string::npos);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetQueueAdvisoryTopic() {
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getQueueAdvisoryTopic());
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite());
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX)
== 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Queue") != std::string::npos);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetTopicAdvisoryTopic() {
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getTopicAdvisoryTopic());
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite());
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX)
== 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Topic") != std::string::npos);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetTempQueueAdvisoryTopic() {
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getTempQueueAdvisoryTopic());
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite());
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX)
== 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".TempQueue") != std::string::npos);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetTempTopicAdvisoryTopic() {
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getTempTopicAdvisoryTopic());
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite());
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX)
== 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".TempTopic") != std::string::npos);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetConsumerAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetProducerAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetExpiredMessageTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetExpiredTopicMessageAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetExpiredQueueMessageAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetNoConsumersAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetNoTopicConsumersAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetNoQueueConsumersAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetSlowConsumerAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetFastProducerAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetMessageDiscardedAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetMessageDeliveredAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetMessageConsumedAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetMessageDLQdAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetMasterBrokerAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetNetworkBridgeAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetFullAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testGetDestinationAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsDestinationAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsTempDestinationAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsConnectionAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsProducerAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsConsumerAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsSlowConsumerAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsFastProducerAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsMessageConsumedAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsMasterBrokerAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsMessageDeliveredAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsMessageDiscardedAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsMessageDLQdAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsFullAdvisoryTopic() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void AdvisorySupportTest::testIsNetworkBridgeAdvisoryTopic() {
+
+}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/AdvisorySupportTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/AdvisorySupportTest.h?rev=1334243&r1=1334242&r2=1334243&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/AdvisorySupportTest.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/AdvisorySupportTest.h
Fri May  4 22:37:48 2012
@@ -29,6 +29,46 @@ namespace util {
 
         CPPUNIT_TEST_SUITE( AdvisorySupportTest );
         CPPUNIT_TEST( testGetTempDestinationCompositeAdvisoryTopic );
+        CPPUNIT_TEST( testGetAllDestinationsCompositeAdvisoryTopic );
+        CPPUNIT_TEST( testGetAllDestinationAdvisoryTopics );
+        CPPUNIT_TEST( testGetConnectionAdvisoryTopic );
+        CPPUNIT_TEST( testGetQueueAdvisoryTopic );
+        CPPUNIT_TEST( testGetTopicAdvisoryTopic );
+        CPPUNIT_TEST( testGetTempQueueAdvisoryTopic );
+        CPPUNIT_TEST( testGetTempTopicAdvisoryTopic );
+        CPPUNIT_TEST( testGetConsumerAdvisoryTopic );
+        CPPUNIT_TEST( testGetProducerAdvisoryTopic );
+        CPPUNIT_TEST( testGetExpiredMessageTopic );
+        CPPUNIT_TEST( testGetExpiredTopicMessageAdvisoryTopic );
+        CPPUNIT_TEST( testGetExpiredQueueMessageAdvisoryTopic );
+        CPPUNIT_TEST( testGetNoConsumersAdvisoryTopic );
+        CPPUNIT_TEST( testGetNoTopicConsumersAdvisoryTopic );
+        CPPUNIT_TEST( testGetNoQueueConsumersAdvisoryTopic );
+        CPPUNIT_TEST( testGetSlowConsumerAdvisoryTopic );
+        CPPUNIT_TEST( testGetFastProducerAdvisoryTopic );
+        CPPUNIT_TEST( testGetMessageDiscardedAdvisoryTopic );
+        CPPUNIT_TEST( testGetMessageDeliveredAdvisoryTopic );
+        CPPUNIT_TEST( testGetMessageConsumedAdvisoryTopic );
+        CPPUNIT_TEST( testGetMessageDLQdAdvisoryTopic );
+        CPPUNIT_TEST( testGetMasterBrokerAdvisoryTopic );
+        CPPUNIT_TEST( testGetNetworkBridgeAdvisoryTopic );
+        CPPUNIT_TEST( testGetFullAdvisoryTopic );
+        CPPUNIT_TEST( testGetDestinationAdvisoryTopic );
+        CPPUNIT_TEST( testIsDestinationAdvisoryTopic );
+        CPPUNIT_TEST( testIsTempDestinationAdvisoryTopic );
+        CPPUNIT_TEST( testIsAdvisoryTopic );
+        CPPUNIT_TEST( testIsConnectionAdvisoryTopic );
+        CPPUNIT_TEST( testIsProducerAdvisoryTopic );
+        CPPUNIT_TEST( testIsConsumerAdvisoryTopic );
+        CPPUNIT_TEST( testIsSlowConsumerAdvisoryTopic );
+        CPPUNIT_TEST( testIsFastProducerAdvisoryTopic );
+        CPPUNIT_TEST( testIsMessageConsumedAdvisoryTopic );
+        CPPUNIT_TEST( testIsMasterBrokerAdvisoryTopic );
+        CPPUNIT_TEST( testIsMessageDeliveredAdvisoryTopic );
+        CPPUNIT_TEST( testIsMessageDiscardedAdvisoryTopic );
+        CPPUNIT_TEST( testIsMessageDLQdAdvisoryTopic );
+        CPPUNIT_TEST( testIsFullAdvisoryTopic );
+        CPPUNIT_TEST( testIsNetworkBridgeAdvisoryTopic );
         CPPUNIT_TEST_SUITE_END();
 
     public:
@@ -37,6 +77,47 @@ namespace util {
         virtual ~AdvisorySupportTest();
 
         void testGetTempDestinationCompositeAdvisoryTopic();
+        void testGetAllDestinationsCompositeAdvisoryTopic();
+        void testGetAllDestinationAdvisoryTopics();
+        void testGetConnectionAdvisoryTopic();
+        void testGetQueueAdvisoryTopic();
+        void testGetTopicAdvisoryTopic();
+        void testGetTempQueueAdvisoryTopic();
+        void testGetTempTopicAdvisoryTopic();
+        void testGetConsumerAdvisoryTopic();
+        void testGetProducerAdvisoryTopic();
+        void testGetExpiredMessageTopic();
+        void testGetExpiredTopicMessageAdvisoryTopic();
+        void testGetExpiredQueueMessageAdvisoryTopic();
+        void testGetNoConsumersAdvisoryTopic();
+        void testGetNoTopicConsumersAdvisoryTopic();
+        void testGetNoQueueConsumersAdvisoryTopic();
+        void testGetSlowConsumerAdvisoryTopic();
+        void testGetFastProducerAdvisoryTopic();
+        void testGetMessageDiscardedAdvisoryTopic();
+        void testGetMessageDeliveredAdvisoryTopic();
+        void testGetMessageConsumedAdvisoryTopic();
+        void testGetMessageDLQdAdvisoryTopic();
+        void testGetMasterBrokerAdvisoryTopic();
+        void testGetNetworkBridgeAdvisoryTopic();
+        void testGetFullAdvisoryTopic();
+        void testGetDestinationAdvisoryTopic();
+
+        void testIsDestinationAdvisoryTopic();
+        void testIsTempDestinationAdvisoryTopic();
+        void testIsAdvisoryTopic();
+        void testIsConnectionAdvisoryTopic();
+        void testIsProducerAdvisoryTopic();
+        void testIsConsumerAdvisoryTopic();
+        void testIsSlowConsumerAdvisoryTopic();
+        void testIsFastProducerAdvisoryTopic();
+        void testIsMessageConsumedAdvisoryTopic();
+        void testIsMasterBrokerAdvisoryTopic();
+        void testIsMessageDeliveredAdvisoryTopic();
+        void testIsMessageDiscardedAdvisoryTopic();
+        void testIsMessageDLQdAdvisoryTopic();
+        void testIsFullAdvisoryTopic();
+        void testIsNetworkBridgeAdvisoryTopic();
 
     };
 



Mime
View raw message