activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1334474 - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/activemq/util/ActiveMQMessageTransformation.cpp main/activemq/util/AdvisorySupport.cpp main/activemq/util/AdvisorySupport.h test/activemq/util/AdvisorySupportTest.cpp
Date Sat, 05 May 2012 19:57:34 GMT
Author: tabish
Date: Sat May  5 19:57:34 2012
New Revision: 1334474

URL: http://svn.apache.org/viewvc?rev=1334474&view=rev
Log:
Complete unit test coverage of AdvisorySupport and some fixes.

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

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ActiveMQMessageTransformation.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ActiveMQMessageTransformation.cpp?rev=1334474&r1=1334473&r2=1334474&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ActiveMQMessageTransformation.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ActiveMQMessageTransformation.cpp Sat May  5 19:57:34 2012
@@ -41,11 +41,15 @@
 #include <activemq/commands/ActiveMQObjectMessage.h>
 #include <activemq/commands/Message.h>
 
+#include <decaf/lang/exceptions/NullPointerException.h>
+
 using namespace activemq;
 using namespace activemq::util;
 using namespace activemq::core;
 using namespace activemq::commands;
 
+using namespace decaf::lang::exceptions;
+
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQMessageTransformation::ActiveMQMessageTransformation() {
 }
@@ -57,8 +61,12 @@ ActiveMQMessageTransformation::~ActiveMQ
 ////////////////////////////////////////////////////////////////////////////////
 bool ActiveMQMessageTransformation::transformDestination(const cms::Destination* destination, const ActiveMQDestination** amqDestination) {
 
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "Provided source cms::Destination pointer was NULL");
+    }
+
     if (amqDestination == NULL) {
-        throw cms::CMSException("Provided target ActiveMQMessage pointer was NULL");
+        throw NullPointerException(__FILE__, __LINE__, "Provided target ActiveMQDestination pointer was NULL");
     }
 
     *amqDestination = dynamic_cast<const ActiveMQDestination*>(destination);
@@ -88,8 +96,12 @@ bool ActiveMQMessageTransformation::tran
 ////////////////////////////////////////////////////////////////////////////////
 bool ActiveMQMessageTransformation::transformMessage(cms::Message* message, ActiveMQConnection* connection, Message** amqMessage) {
 
+    if (message == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "Provided source cms::Message pointer was NULL");
+    }
+
     if (amqMessage == NULL) {
-        throw cms::CMSException("Provided target ActiveMQMessage pointer was NULL");
+        throw NullPointerException(__FILE__, __LINE__, "Provided target commands::Message pointer was NULL");
     }
 
     *amqMessage = dynamic_cast<Message*>(message);
@@ -170,6 +182,14 @@ bool ActiveMQMessageTransformation::tran
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQMessageTransformation::copyProperties(const cms::Message* fromMessage, cms::Message* toMessage) {
 
+    if (fromMessage == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "Provided source cms::Message pointer was NULL");
+    }
+
+    if (toMessage == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "Provided destination cms::Message pointer was NULL");
+    }
+
     toMessage->setCMSMessageID(fromMessage->getCMSMessageID());
     toMessage->setCMSCorrelationID(fromMessage->getCMSCorrelationID());
 //    toMessage->setCMSReplyTo(transformDestination(fromMessage->getCMSReplyTo()));

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/AdvisorySupport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/AdvisorySupport.cpp?rev=1334474&r1=1334473&r2=1334474&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/AdvisorySupport.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/AdvisorySupport.cpp Sat May  5 19:57:34 2012
@@ -175,6 +175,10 @@ ActiveMQDestination* AdvisorySupport::ge
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getConsumerAdvisoryTopic(const ActiveMQDestination* destination) {
 
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isQueue()) {
         return new ActiveMQTopic(QUEUE_CONSUMER_ADVISORY_TOPIC_PREFIX + destination->getPhysicalName());
     } else {
@@ -200,6 +204,10 @@ ActiveMQDestination* AdvisorySupport::ge
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getProducerAdvisoryTopic(const ActiveMQDestination* destination) {
 
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isQueue()) {
         return new ActiveMQTopic(QUEUE_PRODUCER_ADVISORY_TOPIC_PREFIX + destination->getPhysicalName());
     } else {
@@ -225,6 +233,10 @@ ActiveMQDestination* AdvisorySupport::ge
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getExpiredMessageTopic(const ActiveMQDestination* destination) {
 
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isQueue()) {
         return getExpiredQueueMessageAdvisoryTopic(destination);
     }
@@ -249,6 +261,10 @@ ActiveMQDestination* AdvisorySupport::ge
 
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getExpiredTopicMessageAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     return new ActiveMQTopic(EXPIRED_TOPIC_MESSAGES_TOPIC_PREFIX + destination->getPhysicalName());
 }
 
@@ -269,6 +285,10 @@ ActiveMQDestination* AdvisorySupport::ge
 
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getExpiredQueueMessageAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     return new ActiveMQTopic(EXPIRED_QUEUE_MESSAGES_TOPIC_PREFIX + destination->getPhysicalName());
 }
 
@@ -290,6 +310,10 @@ ActiveMQDestination* AdvisorySupport::ge
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getNoConsumersAdvisoryTopic(const ActiveMQDestination* destination) {
 
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isQueue()) {
         return getNoQueueConsumersAdvisoryTopic(destination);
     }
@@ -313,6 +337,10 @@ ActiveMQDestination* AdvisorySupport::ge
 
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getNoTopicConsumersAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     return new ActiveMQTopic(NO_TOPIC_CONSUMERS_TOPIC_PREFIX + destination->getPhysicalName());
 }
 
@@ -333,6 +361,10 @@ ActiveMQDestination* AdvisorySupport::ge
 
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getNoQueueConsumersAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     return new ActiveMQTopic(NO_QUEUE_CONSUMERS_TOPIC_PREFIX + destination->getPhysicalName());
 }
 
@@ -353,6 +385,10 @@ ActiveMQDestination* AdvisorySupport::ge
 
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getSlowConsumerAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     std::string name = SLOW_CONSUMER_TOPIC_PREFIX +
         destination->getDestinationTypeAsString() + "." + destination->getPhysicalName();
     return new ActiveMQTopic(name);
@@ -375,6 +411,10 @@ ActiveMQDestination* AdvisorySupport::ge
 
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getFastProducerAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     std::string name = FAST_PRODUCER_TOPIC_PREFIX +
         destination->getDestinationTypeAsString() + "." + destination->getPhysicalName();
     return new ActiveMQTopic(name);
@@ -397,6 +437,10 @@ ActiveMQDestination* AdvisorySupport::ge
 
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getMessageDiscardedAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     std::string name = MESSAGE_DISCAREDED_TOPIC_PREFIX +
         destination->getDestinationTypeAsString() + "." + destination->getPhysicalName();
     return new ActiveMQTopic(name);
@@ -419,6 +463,10 @@ ActiveMQDestination* AdvisorySupport::ge
 
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getMessageDeliveredAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     std::string name = MESSAGE_DELIVERED_TOPIC_PREFIX +
         destination->getDestinationTypeAsString() + "." + destination->getPhysicalName();
     return new ActiveMQTopic(name);
@@ -441,13 +489,36 @@ ActiveMQDestination* AdvisorySupport::ge
 
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getMessageConsumedAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     std::string name = MESSAGE_CONSUMED_TOPIC_PREFIX +
         destination->getDestinationTypeAsString() + "." + destination->getPhysicalName();
     return new ActiveMQTopic(name);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+ActiveMQDestination* AdvisorySupport::getMessageDLQdAdvisoryTopic(const cms::Destination* destination) {
+
+    const ActiveMQDestination* transformed = NULL;
+
+    bool doDelete = ActiveMQMessageTransformation::transformDestination(destination, &transformed);
+    ActiveMQDestination* advisoryDest = getMessageDLQdAdvisoryTopic(transformed);
+
+    if (doDelete) {
+        delete transformed;
+    }
+
+    return advisoryDest;
+}
+
+////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getMessageDLQdAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     std::string name = MESSAGE_DLQ_TOPIC_PREFIX + destination->getDestinationTypeAsString() + "."
             + destination->getPhysicalName();
     return new ActiveMQTopic(name);
@@ -480,6 +551,10 @@ ActiveMQDestination* AdvisorySupport::ge
 
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getFullAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     std::string name = FULL_TOPIC_PREFIX +
         destination->getDestinationTypeAsString() + "." + destination->getPhysicalName();
     return new ActiveMQTopic(name);
@@ -503,6 +578,10 @@ ActiveMQDestination* AdvisorySupport::ge
 ////////////////////////////////////////////////////////////////////////////////
 ActiveMQDestination* AdvisorySupport::getDestinationAdvisoryTopic(const ActiveMQDestination* destination) {
 
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     switch (destination->getDestinationType()) {
         case cms::Destination::QUEUE:
             return getQueueAdvisoryTopic();
@@ -535,6 +614,10 @@ bool AdvisorySupport::isDestinationAdvis
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isDestinationAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isComposite()) {
         ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
         for (int i = 0; i < compositeDestinations.size(); i++) {
@@ -567,6 +650,10 @@ bool AdvisorySupport::isTempDestinationA
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isTempDestinationAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isComposite()) {
         ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
         for (int i = 0; i < compositeDestinations.size(); i++) {
@@ -598,20 +685,23 @@ bool AdvisorySupport::isAdvisoryTopic(co
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isAdvisoryTopic(const ActiveMQDestination* destination) {
-    if (destination != NULL) {
-        if (destination->isComposite()) {
-            ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
-            for (int i = 0; i < compositeDestinations.size(); i++) {
-                if (isAdvisoryTopic(compositeDestinations.get(i).get())) {
-                    return true;
-                }
-            }
-            return false;
-        } else {
-            return destination->isTopic() &&
-                   destination->getPhysicalName().find(ADVISORY_TOPIC_PREFIX) == 0;
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
+    if (destination->isComposite()) {
+        ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
+        for (int i = 0; i < compositeDestinations.size(); i++) {
+            if (isAdvisoryTopic(compositeDestinations.get(i).get())) {
+                return true;
+            }
         }
+        return false;
+    } else {
+        return destination->isTopic() &&
+               destination->getPhysicalName().find(ADVISORY_TOPIC_PREFIX) == 0;
     }
+
     return false;
 }
 
@@ -632,6 +722,10 @@ bool AdvisorySupport::isConnectionAdviso
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isConnectionAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isComposite()) {
         ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
         for (int i = 0; i < compositeDestinations.size(); i++) {
@@ -662,6 +756,10 @@ bool AdvisorySupport::isProducerAdvisory
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isProducerAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isComposite()) {
         ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
         for (int i = 0; i < compositeDestinations.size(); i++) {
@@ -693,6 +791,10 @@ bool AdvisorySupport::isConsumerAdvisory
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isConsumerAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isComposite()) {
         ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
         for (int i = 0; i < compositeDestinations.size(); i++) {
@@ -724,6 +826,10 @@ bool AdvisorySupport::isSlowConsumerAdvi
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isSlowConsumerAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isComposite()) {
         ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
         for (int i = 0; i < compositeDestinations.size(); i++) {
@@ -755,6 +861,10 @@ bool AdvisorySupport::isFastProducerAdvi
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isFastProducerAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isComposite()) {
         ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
         for (int i = 0; i < compositeDestinations.size(); i++) {
@@ -786,6 +896,10 @@ bool AdvisorySupport::isMessageConsumedA
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isMessageConsumedAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isComposite()) {
         ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
         for (int i = 0; i < compositeDestinations.size(); i++) {
@@ -817,6 +931,10 @@ bool AdvisorySupport::isMasterBrokerAdvi
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isMasterBrokerAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isComposite()) {
         ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
         for (int i = 0; i < compositeDestinations.size(); i++) {
@@ -848,6 +966,10 @@ bool AdvisorySupport::isMessageDelivered
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isMessageDeliveredAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isComposite()) {
         ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
         for (int i = 0; i < compositeDestinations.size(); i++) {
@@ -879,6 +1001,10 @@ bool AdvisorySupport::isMessageDiscarded
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isMessageDiscardedAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isComposite()) {
         ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
         for (int i = 0; i < compositeDestinations.size(); i++) {
@@ -910,6 +1036,10 @@ bool AdvisorySupport::isMessageDLQdAdvis
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isMessageDLQdAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isComposite()) {
         ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
         for (int i = 0; i < compositeDestinations.size(); i++) {
@@ -941,6 +1071,10 @@ bool AdvisorySupport::isFullAdvisoryTopi
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isFullAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isComposite()) {
         ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
         for (int i = 0; i < compositeDestinations.size(); i++) {
@@ -972,6 +1106,10 @@ bool AdvisorySupport::isNetworkBridgeAdv
 
 ////////////////////////////////////////////////////////////////////////////////
 bool AdvisorySupport::isNetworkBridgeAdvisoryTopic(const ActiveMQDestination* destination) {
+    if (destination == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "The passed ActiveMQDestination cannot be NULL");
+    }
+
     if (destination->isComposite()) {
         ArrayList< Pointer<ActiveMQDestination> > compositeDestinations = destination->getCompositeDestinations();
         for (int i = 0; i < compositeDestinations.size(); i++) {

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/AdvisorySupport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/AdvisorySupport.h?rev=1334474&r1=1334473&r2=1334474&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/AdvisorySupport.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/AdvisorySupport.h Sat May  5 19:57:34 2012
@@ -360,6 +360,14 @@ namespace util {
          *
          * @return Pointer to the requested Advisory Topic destination.
          */
+        static commands::ActiveMQDestination* getMessageDLQdAdvisoryTopic(const cms::Destination* destination);
+
+        /**
+         * Returns a new Pointer to an Destination that will consume advisory messages when a message is
+         * sent to the DLQ from the specified destination
+         *
+         * @return Pointer to the requested Advisory Topic destination.
+         */
         static commands::ActiveMQDestination* getMessageDLQdAdvisoryTopic(const commands::ActiveMQDestination* destination);
 
         /**

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=1334474&r1=1334473&r2=1334474&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 Sat May  5 19:57:34 2012
@@ -21,14 +21,18 @@
 #include <activemq/commands/ActiveMQDestination.h>
 #include <activemq/commands/ActiveMQTopic.h>
 #include <activemq/commands/ActiveMQQueue.h>
+#include <activemq/commands/ActiveMQTempTopic.h>
+#include <activemq/commands/ActiveMQTempQueue.h>
 
 #include <decaf/lang/Pointer.h>
+#include <decaf/lang/exceptions/NullPointerException.h>
 
 using namespace activemq;
 using namespace activemq::util;
 using namespace activemq::commands;
 using namespace decaf;
 using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 AdvisorySupportTest::AdvisorySupportTest() {
@@ -46,6 +50,7 @@ void AdvisorySupportTest::testGetTempDes
     CPPUNIT_ASSERT(topic->isComposite());
     CPPUNIT_ASSERT(topic->isTopic());
     CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
 
     CPPUNIT_ASSERT(topic->getPhysicalName().find(".TempTopic") != std::string::npos);
     CPPUNIT_ASSERT(topic->getPhysicalName().find(".TempQueue") != std::string::npos);
@@ -59,6 +64,7 @@ void AdvisorySupportTest::testGetAllDest
     CPPUNIT_ASSERT(topic->isComposite());
     CPPUNIT_ASSERT(topic->isTopic());
     CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
 
     CPPUNIT_ASSERT(topic->getPhysicalName().find(".TempTopic") != std::string::npos);
     CPPUNIT_ASSERT(topic->getPhysicalName().find(".TempQueue") != std::string::npos);
@@ -78,6 +84,7 @@ void AdvisorySupportTest::testGetAllDest
     for (; iter != topics.end(); ++iter) {
         Pointer<ActiveMQDestination> topic(*iter);
         CPPUNIT_ASSERT(topic->isTopic());
+        CPPUNIT_ASSERT(topic->isAdvisory() == true);
         CPPUNIT_ASSERT(topic->isTemporary() == false);
         CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX) == 0);
     }
@@ -91,11 +98,21 @@ void AdvisorySupportTest::testGetAllDest
     for (; iter2 != topics2.end(); ++iter2) {
         Pointer<ActiveMQDestination> topic(*iter2);
         CPPUNIT_ASSERT(topic->isTopic());
+        CPPUNIT_ASSERT(topic->isAdvisory() == true);
         CPPUNIT_ASSERT(topic->isTemporary() == false);
         CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX) == 0);
     }
 
     CPPUNIT_ASSERT_EQUAL(topics.size(), topics2.size());
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getAllDestinationAdvisoryTopics((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getAllDestinationAdvisoryTopics((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -103,7 +120,8 @@ void AdvisorySupportTest::testGetConnect
 
     Pointer<ActiveMQDestination> topic(AdvisorySupport::getConnectionAdvisoryTopic());
     CPPUNIT_ASSERT(topic != NULL);
-    CPPUNIT_ASSERT(topic->isComposite());
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
     CPPUNIT_ASSERT(topic->isTopic());
     CPPUNIT_ASSERT(topic->isTemporary() == false);
     CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX) == 0);
@@ -115,7 +133,8 @@ void AdvisorySupportTest::testGetQueueAd
 
     Pointer<ActiveMQDestination> topic(AdvisorySupport::getQueueAdvisoryTopic());
     CPPUNIT_ASSERT(topic != NULL);
-    CPPUNIT_ASSERT(topic->isComposite());
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
     CPPUNIT_ASSERT(topic->isTopic());
     CPPUNIT_ASSERT(topic->isTemporary() == false);
     CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX) == 0);
@@ -127,8 +146,9 @@ void AdvisorySupportTest::testGetTopicAd
 
     Pointer<ActiveMQDestination> topic(AdvisorySupport::getTopicAdvisoryTopic());
     CPPUNIT_ASSERT(topic != NULL);
-    CPPUNIT_ASSERT(topic->isComposite());
+    CPPUNIT_ASSERT(topic->isComposite() == false);
     CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
     CPPUNIT_ASSERT(topic->isTemporary() == false);
     CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX) == 0);
     CPPUNIT_ASSERT(topic->getPhysicalName().find(".Topic") != std::string::npos);
@@ -139,7 +159,8 @@ void AdvisorySupportTest::testGetTempQue
 
     Pointer<ActiveMQDestination> topic(AdvisorySupport::getTempQueueAdvisoryTopic());
     CPPUNIT_ASSERT(topic != NULL);
-    CPPUNIT_ASSERT(topic->isComposite());
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
     CPPUNIT_ASSERT(topic->isTopic());
     CPPUNIT_ASSERT(topic->isTemporary() == false);
     CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX) == 0);
@@ -151,7 +172,8 @@ void AdvisorySupportTest::testGetTempTop
 
     Pointer<ActiveMQDestination> topic(AdvisorySupport::getTempTopicAdvisoryTopic());
     CPPUNIT_ASSERT(topic != NULL);
-    CPPUNIT_ASSERT(topic->isComposite());
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
     CPPUNIT_ASSERT(topic->isTopic());
     CPPUNIT_ASSERT(topic->isTemporary() == false);
     CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX) == 0);
@@ -161,164 +183,978 @@ void AdvisorySupportTest::testGetTempTop
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetConsumerAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getConsumerAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::CONSUMER_ADVISORY_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getConsumerAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(cmstopic != NULL);
+    CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+    CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+    CPPUNIT_ASSERT(cmstopic->isTopic());
+    CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::CONSUMER_ADVISORY_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getConsumerAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getConsumerAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetProducerAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getProducerAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::PRODUCER_ADVISORY_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getProducerAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(cmstopic != NULL);
+    CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+    CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+    CPPUNIT_ASSERT(cmstopic->isTopic());
+    CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::PRODUCER_ADVISORY_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getProducerAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getProducerAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetExpiredMessageTopic() {
 
+    {
+        Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+        Pointer<ActiveMQDestination> topic(AdvisorySupport::getExpiredMessageTopic(target.get()));
+        CPPUNIT_ASSERT(topic != NULL);
+        CPPUNIT_ASSERT(topic->isComposite() == false);
+        CPPUNIT_ASSERT(topic->isAdvisory() == true);
+        CPPUNIT_ASSERT(topic->isTopic());
+        CPPUNIT_ASSERT(topic->isTemporary() == false);
+        CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::EXPIRED_TOPIC_MESSAGES_TOPIC_PREFIX) == 0);
+        CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+        Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+        Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getExpiredMessageTopic(cmsDest.get()));
+        CPPUNIT_ASSERT(cmstopic != NULL);
+        CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+        CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+        CPPUNIT_ASSERT(cmstopic->isTopic());
+        CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+        CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::EXPIRED_TOPIC_MESSAGES_TOPIC_PREFIX) == 0);
+        CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+    }
+    {
+        Pointer<ActiveMQDestination> target(new ActiveMQQueue("Test.Queue"));
+
+        Pointer<ActiveMQDestination> topic(AdvisorySupport::getExpiredMessageTopic(target.get()));
+        CPPUNIT_ASSERT(topic != NULL);
+        CPPUNIT_ASSERT(topic->isComposite() == false);
+        CPPUNIT_ASSERT(topic->isAdvisory() == true);
+        CPPUNIT_ASSERT(topic->isTopic());
+        CPPUNIT_ASSERT(topic->isTemporary() == false);
+        CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::EXPIRED_QUEUE_MESSAGES_TOPIC_PREFIX) == 0);
+        CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Queue") != std::string::npos);
+
+        Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+        Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getExpiredMessageTopic(cmsDest.get()));
+        CPPUNIT_ASSERT(cmstopic != NULL);
+        CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+        CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+        CPPUNIT_ASSERT(cmstopic->isTopic());
+        CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+        CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::EXPIRED_QUEUE_MESSAGES_TOPIC_PREFIX) == 0);
+        CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Queue") != std::string::npos);
+    }
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getExpiredMessageTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getExpiredMessageTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetExpiredTopicMessageAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getExpiredTopicMessageAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::EXPIRED_TOPIC_MESSAGES_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getExpiredTopicMessageAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(cmstopic != NULL);
+    CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+    CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+    CPPUNIT_ASSERT(cmstopic->isTopic());
+    CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::EXPIRED_TOPIC_MESSAGES_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getExpiredTopicMessageAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getExpiredTopicMessageAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetExpiredQueueMessageAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQQueue("Test.Queue"));
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getExpiredQueueMessageAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::EXPIRED_QUEUE_MESSAGES_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Queue") != std::string::npos);
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getExpiredQueueMessageAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(cmstopic != NULL);
+    CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+    CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+    CPPUNIT_ASSERT(cmstopic->isTopic());
+    CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::EXPIRED_QUEUE_MESSAGES_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Queue") != std::string::npos);
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getExpiredQueueMessageAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getExpiredQueueMessageAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetNoConsumersAdvisoryTopic() {
 
+    {
+        Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+        Pointer<ActiveMQDestination> topic(AdvisorySupport::getNoConsumersAdvisoryTopic(target.get()));
+        CPPUNIT_ASSERT(topic != NULL);
+        CPPUNIT_ASSERT(topic->isComposite() == false);
+        CPPUNIT_ASSERT(topic->isAdvisory() == true);
+        CPPUNIT_ASSERT(topic->isTopic());
+        CPPUNIT_ASSERT(topic->isTemporary() == false);
+        CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::NO_TOPIC_CONSUMERS_TOPIC_PREFIX) == 0);
+        CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+        Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+        Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getNoConsumersAdvisoryTopic(cmsDest.get()));
+        CPPUNIT_ASSERT(cmstopic != NULL);
+        CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+        CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+        CPPUNIT_ASSERT(cmstopic->isTopic());
+        CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+        CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::NO_TOPIC_CONSUMERS_TOPIC_PREFIX) == 0);
+        CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+    }
+    {
+        Pointer<ActiveMQDestination> target(new ActiveMQQueue("Test.Queue"));
+
+        Pointer<ActiveMQDestination> topic(AdvisorySupport::getNoConsumersAdvisoryTopic(target.get()));
+        CPPUNIT_ASSERT(topic != NULL);
+        CPPUNIT_ASSERT(topic->isComposite() == false);
+        CPPUNIT_ASSERT(topic->isAdvisory() == true);
+        CPPUNIT_ASSERT(topic->isTopic());
+        CPPUNIT_ASSERT(topic->isTemporary() == false);
+        CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::NO_QUEUE_CONSUMERS_TOPIC_PREFIX) == 0);
+        CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Queue") != std::string::npos);
+
+        Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+        Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getNoConsumersAdvisoryTopic(cmsDest.get()));
+        CPPUNIT_ASSERT(cmstopic != NULL);
+        CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+        CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+        CPPUNIT_ASSERT(cmstopic->isTopic());
+        CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+        CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::NO_QUEUE_CONSUMERS_TOPIC_PREFIX) == 0);
+        CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Queue") != std::string::npos);
+    }
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getNoConsumersAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getNoConsumersAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetNoTopicConsumersAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getNoTopicConsumersAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::NO_TOPIC_CONSUMERS_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getNoTopicConsumersAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(cmstopic != NULL);
+    CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+    CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+    CPPUNIT_ASSERT(cmstopic->isTopic());
+    CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::NO_TOPIC_CONSUMERS_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getNoTopicConsumersAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getNoTopicConsumersAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetNoQueueConsumersAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQQueue("Test.Queue"));
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getNoQueueConsumersAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::NO_QUEUE_CONSUMERS_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Queue") != std::string::npos);
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getNoQueueConsumersAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(cmstopic != NULL);
+    CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+    CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+    CPPUNIT_ASSERT(cmstopic->isTopic());
+    CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::NO_QUEUE_CONSUMERS_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Queue") != std::string::npos);
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getNoQueueConsumersAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getNoQueueConsumersAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetSlowConsumerAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getSlowConsumerAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::SLOW_CONSUMER_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getSlowConsumerAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(cmstopic != NULL);
+    CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+    CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+    CPPUNIT_ASSERT(cmstopic->isTopic());
+    CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::SLOW_CONSUMER_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getSlowConsumerAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getSlowConsumerAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetFastProducerAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getFastProducerAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::FAST_PRODUCER_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getFastProducerAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(cmstopic != NULL);
+    CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+    CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+    CPPUNIT_ASSERT(cmstopic->isTopic());
+    CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::FAST_PRODUCER_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getFastProducerAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getFastProducerAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetMessageDiscardedAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getMessageDiscardedAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::MESSAGE_DISCAREDED_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getMessageDiscardedAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(cmstopic != NULL);
+    CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+    CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+    CPPUNIT_ASSERT(cmstopic->isTopic());
+    CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::MESSAGE_DISCAREDED_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getMessageDiscardedAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getMessageDiscardedAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetMessageDeliveredAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getMessageDeliveredAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::MESSAGE_DELIVERED_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getMessageDeliveredAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(cmstopic != NULL);
+    CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+    CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+    CPPUNIT_ASSERT(cmstopic->isTopic());
+    CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::MESSAGE_DELIVERED_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getMessageDeliveredAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getMessageDeliveredAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetMessageConsumedAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getMessageConsumedAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::MESSAGE_CONSUMED_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getMessageConsumedAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(cmstopic != NULL);
+    CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+    CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+    CPPUNIT_ASSERT(cmstopic->isTopic());
+    CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::MESSAGE_CONSUMED_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getMessageConsumedAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getMessageConsumedAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetMessageDLQdAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getMessageDLQdAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::MESSAGE_DLQ_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getMessageDLQdAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(cmstopic != NULL);
+    CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+    CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+    CPPUNIT_ASSERT(cmstopic->isTopic());
+    CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::MESSAGE_DLQ_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getMessageDLQdAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getMessageDLQdAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetMasterBrokerAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getMasterBrokerAdvisoryTopic());
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::MASTER_BROKER_TOPIC_PREFIX) == 0);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetNetworkBridgeAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getNetworkBridgeAdvisoryTopic());
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::NETWORK_BRIDGE_TOPIC_PREFIX) == 0);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetFullAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getFullAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    CPPUNIT_ASSERT(topic->isTopic());
+    CPPUNIT_ASSERT(topic->isTemporary() == false);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(AdvisorySupport::FULL_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(topic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getFullAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(cmstopic != NULL);
+    CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+    CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+    CPPUNIT_ASSERT(cmstopic->isTopic());
+    CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::FULL_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Test.Topic") != std::string::npos);
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getFullAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getFullAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testGetDestinationAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getDestinationAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(topic != NULL);
+    CPPUNIT_ASSERT(topic->isComposite() == false);
+    CPPUNIT_ASSERT(topic->isAdvisory() == true);
+    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);
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getDestinationAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(cmstopic != NULL);
+    CPPUNIT_ASSERT(cmstopic->isComposite() == false);
+    CPPUNIT_ASSERT(cmstopic->isAdvisory() == true);
+    CPPUNIT_ASSERT(cmstopic->isTopic());
+    CPPUNIT_ASSERT(cmstopic->isTemporary() == false);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(AdvisorySupport::ADVISORY_TOPIC_PREFIX) == 0);
+    CPPUNIT_ASSERT(cmstopic->getPhysicalName().find(".Topic") != std::string::npos);
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getDestinationAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::getDestinationAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsDestinationAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getDestinationAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isDestinationAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isDestinationAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getDestinationAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isDestinationAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isDestinationAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isDestinationAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isDestinationAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsTempDestinationAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTempTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getDestinationAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isTempDestinationAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isTempDestinationAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getDestinationAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isTempDestinationAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isTempDestinationAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isTempDestinationAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isTempDestinationAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTempTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getConsumerAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getConsumerAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsConnectionAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTempTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getConnectionAdvisoryTopic());
+    CPPUNIT_ASSERT(!AdvisorySupport::isConnectionAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isConnectionAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getConnectionAdvisoryTopic());
+    CPPUNIT_ASSERT(!AdvisorySupport::isConnectionAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isConnectionAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isConnectionAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isConnectionAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsProducerAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTempTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getProducerAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isProducerAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isProducerAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getProducerAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isProducerAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isProducerAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isProducerAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isProducerAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsConsumerAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTempTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getConsumerAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isConsumerAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isConsumerAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getConsumerAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isConsumerAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isConsumerAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isConsumerAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isConsumerAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsSlowConsumerAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTempTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getSlowConsumerAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isSlowConsumerAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isSlowConsumerAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getSlowConsumerAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isSlowConsumerAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isSlowConsumerAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isSlowConsumerAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isSlowConsumerAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsFastProducerAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTempTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getFastProducerAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isFastProducerAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isFastProducerAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getFastProducerAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isFastProducerAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isFastProducerAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isFastProducerAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isFastProducerAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsMessageConsumedAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTempTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getMessageConsumedAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isMessageConsumedAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isMessageConsumedAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getMessageConsumedAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isMessageConsumedAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isMessageConsumedAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isMessageConsumedAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isMessageConsumedAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsMasterBrokerAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTempTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getMasterBrokerAdvisoryTopic());
+    CPPUNIT_ASSERT(!AdvisorySupport::isMasterBrokerAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isMasterBrokerAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getMasterBrokerAdvisoryTopic());
+    CPPUNIT_ASSERT(!AdvisorySupport::isMasterBrokerAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isMasterBrokerAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isMasterBrokerAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isMasterBrokerAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsMessageDeliveredAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTempTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getMessageDeliveredAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isMessageDeliveredAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isMessageDeliveredAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getMessageDeliveredAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isMessageDeliveredAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isMessageDeliveredAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isMessageDeliveredAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isMessageDeliveredAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsMessageDiscardedAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTempTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getMessageDiscardedAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isMessageDiscardedAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isMessageDiscardedAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getMessageDiscardedAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isMessageDiscardedAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isMessageDiscardedAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isMessageDiscardedAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isMessageDiscardedAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsMessageDLQdAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTempTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getMessageDLQdAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isMessageDLQdAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isMessageDLQdAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getMessageDLQdAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isMessageDLQdAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isMessageDLQdAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isMessageDLQdAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isMessageDLQdAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsFullAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTempTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getFullAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isFullAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isFullAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getFullAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(!AdvisorySupport::isFullAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isFullAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isFullAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isFullAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void AdvisorySupportTest::testIsNetworkBridgeAdvisoryTopic() {
 
+    Pointer<ActiveMQDestination> target(new ActiveMQTempTopic("Test.Topic"));
+    Pointer<ActiveMQDestination> topic(AdvisorySupport::getNetworkBridgeAdvisoryTopic());
+    CPPUNIT_ASSERT(!AdvisorySupport::isNetworkBridgeAdvisoryTopic(target.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isNetworkBridgeAdvisoryTopic(topic.get()));
+
+    Pointer<cms::Destination> cmsDest = target.dynamicCast<cms::Destination>();
+    Pointer<ActiveMQDestination> cmstopic(AdvisorySupport::getNetworkBridgeAdvisoryTopic());
+    CPPUNIT_ASSERT(!AdvisorySupport::isNetworkBridgeAdvisoryTopic(cmsDest.get()));
+    CPPUNIT_ASSERT(AdvisorySupport::isNetworkBridgeAdvisoryTopic(cmstopic.get()));
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isNetworkBridgeAdvisoryTopic((ActiveMQDestination*)NULL),
+        NullPointerException);
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should throw a NullPointerException when passed a NULL destination",
+        AdvisorySupport::isNetworkBridgeAdvisoryTopic((cms::Destination*)NULL),
+        NullPointerException);
 }



Mime
View raw message