You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2008/12/10 23:15:26 UTC

svn commit: r725463 - in /activemq/activemq-cpp/trunk/src/test-integration: ./ activemq/test/ activemq/test/openwire/ activemq/test/stomp/

Author: tabish
Date: Wed Dec 10 14:15:25 2008
New Revision: 725463

URL: http://svn.apache.org/viewvc?rev=725463&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-213

Added initial integration tests to check that the JMSXGroupID property is transmitted and working.

Added:
    activemq/activemq-cpp/trunk/src/test-integration/activemq/test/JmsMessageGroupsTest.cpp   (with props)
    activemq/activemq-cpp/trunk/src/test-integration/activemq/test/JmsMessageGroupsTest.h   (with props)
    activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireJmsMessageGroupsTest.cpp   (with props)
    activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireJmsMessageGroupsTest.h   (with props)
    activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompJmsMessageGroupsTest.cpp   (with props)
    activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompJmsMessageGroupsTest.h   (with props)
Modified:
    activemq/activemq-cpp/trunk/src/test-integration/Makefile.am
    activemq/activemq-cpp/trunk/src/test-integration/TestRegistry.cpp

Modified: activemq/activemq-cpp/trunk/src/test-integration/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/Makefile.am?rev=725463&r1=725462&r2=725463&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/src/test-integration/Makefile.am Wed Dec 10 14:15:25 2008
@@ -27,6 +27,7 @@
   activemq/test/SimpleTest.cpp \
   activemq/test/TransactionTest.cpp \
   activemq/test/SlowListenerTest.cpp \
+  activemq/test/JmsMessageGroupsTest.cpp \
   activemq/test/stomp/StompAsyncSenderTest.cpp \
   activemq/test/stomp/StompCmsTemplateTest.cpp \
   activemq/test/stomp/StompDurableTest.cpp \
@@ -35,6 +36,7 @@
   activemq/test/stomp/StompSimpleTest.cpp \
   activemq/test/stomp/StompTransactionTest.cpp \
   activemq/test/stomp/StompSlowListenerTest.cpp \
+  activemq/test/stomp/StompJmsMessageGroupsTest.cpp \
   activemq/test/openwire/OpenwireAsyncSenderTest.cpp \
   activemq/test/openwire/OpenwireCmsTemplateTest.cpp \
   activemq/test/openwire/OpenwireDurableTest.cpp \
@@ -44,6 +46,7 @@
   activemq/test/openwire/OpenwireTransactionTest.cpp \
   activemq/test/openwire/OpenwireTempDestinationTest.cpp \
   activemq/test/openwire/OpenwireSlowListenerTest.cpp \
+  activemq/test/openwire/OpenwireJmsMessageGroupsTest.cpp \
   TestRegistry.cpp \
   main.cpp
 

Modified: activemq/activemq-cpp/trunk/src/test-integration/TestRegistry.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/TestRegistry.cpp?rev=725463&r1=725462&r2=725463&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/TestRegistry.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test-integration/TestRegistry.cpp Wed Dec 10 14:15:25 2008
@@ -24,6 +24,7 @@
 #include "activemq/test/openwire/OpenwireTransactionTest.h"
 #include "activemq/test/openwire/OpenwireTempDestinationTest.h"
 #include "activemq/test/openwire/OpenwireSlowListenerTest.h"
+#include "activemq/test/openwire/OpenwireJmsMessageGroupsTest.h"
 
 #include "activemq/test/stomp/StompAsyncSenderTest.h"
 #include "activemq/test/stomp/StompCmsTemplateTest.h"
@@ -33,6 +34,7 @@
 #include "activemq/test/stomp/StompSimpleTest.h"
 #include "activemq/test/stomp/StompSlowListenerTest.h"
 #include "activemq/test/stomp/StompTransactionTest.h"
+#include "activemq/test/stomp/StompJmsMessageGroupsTest.h"
 
 // Openwire Tests
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireAsyncSenderTest );
@@ -44,6 +46,7 @@
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireTransactionTest );
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireSlowListenerTest );
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireTempDestinationTest );
+CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireJmsMessageGroupsTest );
 
 // Stomp Tests
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::stomp::StompAsyncSenderTest );
@@ -54,3 +57,4 @@
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::stomp::StompSimpleTest );
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::stomp::StompTransactionTest );
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::stomp::StompSlowListenerTest );
+CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::stomp::StompJmsMessageGroupsTest );

Added: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/JmsMessageGroupsTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/activemq/test/JmsMessageGroupsTest.cpp?rev=725463&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/activemq/test/JmsMessageGroupsTest.cpp (added)
+++ activemq/activemq-cpp/trunk/src/test-integration/activemq/test/JmsMessageGroupsTest.cpp Wed Dec 10 14:15:25 2008
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "JmsMessageGroupsTest.h"
+
+#include <activemq/exceptions/ActiveMQException.h>
+
+#include <decaf/lang/Thread.h>
+#include <decaf/util/UUID.h>
+
+using namespace std;
+using namespace cms;
+using namespace activemq;
+using namespace activemq::test;
+using namespace activemq::util;
+using namespace activemq::exceptions;
+using namespace decaf;
+using namespace decaf::lang;
+using namespace decaf::util;
+
+////////////////////////////////////////////////////////////////////////////////
+void JmsMessageGroupsTest::testMessageSend() {
+
+    try {
+
+        std::string GROUPID = "TEST-GROUP-ID";
+
+        // Create CMS Object for Comms
+        cms::Session* session( cmsProvider->getSession() );
+        cms::MessageConsumer* consumer = cmsProvider->getConsumer();
+        cms::MessageProducer* producer = cmsProvider->getProducer();
+        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
+
+        auto_ptr<cms::TextMessage> txtMessage( session->createTextMessage( "TEST MESSAGE" ) );
+        txtMessage->setStringProperty( "JMSXGroupID", GROUPID );
+
+        // Send some text messages
+        producer->send( txtMessage.get() );
+
+        auto_ptr<cms::Message> message( consumer->receive( 2000 ) );
+        CPPUNIT_ASSERT( message.get() != NULL );
+        CPPUNIT_ASSERT( message->getStringProperty( "JMSXGroupID") == GROUPID );
+    }
+    AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCHALL_THROW( ActiveMQException )
+}

Propchange: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/JmsMessageGroupsTest.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/JmsMessageGroupsTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/activemq/test/JmsMessageGroupsTest.h?rev=725463&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/activemq/test/JmsMessageGroupsTest.h (added)
+++ activemq/activemq-cpp/trunk/src/test-integration/activemq/test/JmsMessageGroupsTest.h Wed Dec 10 14:15:25 2008
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACTIVEMQ_TEST_JMSMESSAGEGROUPSTEST_H_
+#define _ACTIVEMQ_TEST_JMSMESSAGEGROUPSTEST_H_
+
+#include <activemq/test/CMSTestFixture.h>
+#include <activemq/util/IntegrationCommon.h>
+
+namespace activemq {
+namespace test {
+
+    class JmsMessageGroupsTest : public CMSTestFixture {
+    public:
+
+        JmsMessageGroupsTest() {}
+        virtual ~JmsMessageGroupsTest() {}
+
+        void testMessageSend();
+
+    };
+
+}}
+
+#endif /* _ACTIVEMQ_TEST_JMSMESSAGEGROUPSTEST_H_ */

Propchange: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/JmsMessageGroupsTest.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireJmsMessageGroupsTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireJmsMessageGroupsTest.cpp?rev=725463&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireJmsMessageGroupsTest.cpp (added)
+++ activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireJmsMessageGroupsTest.cpp Wed Dec 10 14:15:25 2008
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "OpenwireJmsMessageGroupsTest.h"
+
+using namespace activemq;
+using namespace activemq::test;
+using namespace activemq::test::openwire;
+
+////////////////////////////////////////////////////////////////////////////////
+OpenwireJmsMessageGroupsTest::OpenwireJmsMessageGroupsTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+OpenwireJmsMessageGroupsTest::~OpenwireJmsMessageGroupsTest() {
+}

Propchange: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireJmsMessageGroupsTest.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireJmsMessageGroupsTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireJmsMessageGroupsTest.h?rev=725463&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireJmsMessageGroupsTest.h (added)
+++ activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireJmsMessageGroupsTest.h Wed Dec 10 14:15:25 2008
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACTIVEMQ_TEST_OPENWIRE_OPENWIREJMSMESSAGEGROUPSTEST_H_
+#define _ACTIVEMQ_TEST_OPENWIRE_OPENWIREJMSMESSAGEGROUPSTEST_H_
+
+#include <activemq/test/JmsMessageGroupsTest.h>
+
+namespace activemq {
+namespace test {
+namespace openwire {
+
+    class OpenwireJmsMessageGroupsTest : public JmsMessageGroupsTest {
+
+        CPPUNIT_TEST_SUITE( OpenwireJmsMessageGroupsTest );
+        CPPUNIT_TEST( testMessageSend );
+        CPPUNIT_TEST_SUITE_END();
+
+    public:
+
+        OpenwireJmsMessageGroupsTest();
+        virtual ~OpenwireJmsMessageGroupsTest();
+
+        virtual std::string getBrokerURL() const {
+            return activemq::util::IntegrationCommon::getInstance().getOpenwireURL();
+        }
+
+    };
+
+}}}
+
+#endif /* _ACTIVEMQ_TEST_OPENWIRE_OPENWIREJMSMESSAGEGROUPSTEST_H_ */

Propchange: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireJmsMessageGroupsTest.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompJmsMessageGroupsTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompJmsMessageGroupsTest.cpp?rev=725463&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompJmsMessageGroupsTest.cpp (added)
+++ activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompJmsMessageGroupsTest.cpp Wed Dec 10 14:15:25 2008
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "StompJmsMessageGroupsTest.h"
+
+using namespace activemq;
+using namespace activemq::test;
+using namespace activemq::test::stomp;
+
+////////////////////////////////////////////////////////////////////////////////
+StompJmsMessageGroupsTest::StompJmsMessageGroupsTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+StompJmsMessageGroupsTest::~StompJmsMessageGroupsTest() {
+}

Propchange: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompJmsMessageGroupsTest.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompJmsMessageGroupsTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompJmsMessageGroupsTest.h?rev=725463&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompJmsMessageGroupsTest.h (added)
+++ activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompJmsMessageGroupsTest.h Wed Dec 10 14:15:25 2008
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACTIVEMQ_TEST_STOMP_STOMPJMSMESSAGEGROUPSTEST_H_
+#define _ACTIVEMQ_TEST_STOMP_STOMPJMSMESSAGEGROUPSTEST_H_
+
+#include <activemq/test/JmsMessageGroupsTest.h>
+
+namespace activemq {
+namespace test {
+namespace stomp {
+
+    class StompJmsMessageGroupsTest : public JmsMessageGroupsTest {
+
+        CPPUNIT_TEST_SUITE( StompJmsMessageGroupsTest );
+        CPPUNIT_TEST( testMessageSend );
+        CPPUNIT_TEST_SUITE_END();
+
+    public:
+
+        StompJmsMessageGroupsTest();
+        virtual ~StompJmsMessageGroupsTest();
+
+        virtual std::string getBrokerURL() const {
+            return activemq::util::IntegrationCommon::getInstance().getOpenwireURL();
+        }
+
+    };
+
+}}}
+
+#endif /* _ACTIVEMQ_TEST_STOMP_STOMPJMSMESSAGEGROUPSTEST_H_ */

Propchange: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompJmsMessageGroupsTest.h
------------------------------------------------------------------------------
    svn:eol-style = native