Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 88543 invoked from network); 14 May 2009 18:23:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 May 2009 18:23:08 -0000 Received: (qmail 97684 invoked by uid 500); 14 May 2009 18:23:08 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 97657 invoked by uid 500); 14 May 2009 18:23:08 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 97525 invoked by uid 99); 14 May 2009 18:23:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 May 2009 18:23:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 May 2009 18:23:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6D78323888DC; Thu, 14 May 2009 18:22:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r774861 [2/2] - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/ main/activemq/commands/ main/activemq/wireformat/openwire/marshal/ test/ test/activemq/commands/ test/activemq/wireformat/openwire/marshal/ Date: Thu, 14 May 2009 18:22:41 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090514182242.6D78323888DC@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am?rev=774861&r1=774860&r2=774861&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am Thu May 14 18:22:39 2009 @@ -82,7 +82,7 @@ activemq/transport/correlator/ResponseCorrelatorTest.cpp \ activemq/transport/IOTransportTest.cpp \ activemq/wireformat/openwire/OpenWireFormatTest.cpp \ - activemq/wireformat/openwire/marshal/PrimitiveMapMarshallerTest.cpp \ + activemq/wireformat/openwire/marshal/PrimitiveTypesMarshallerTest.cpp \ activemq/wireformat/openwire/marshal/BaseDataStreamMarshallerTest.cpp \ activemq/wireformat/openwire/utils/HexTableTest.cpp \ activemq/wireformat/openwire/utils/OpenwireStringSupportTest.cpp \ @@ -121,6 +121,7 @@ activemq/commands/ActiveMQDestinationTest2.cpp \ activemq/commands/ActiveMQTempTopicTest.cpp \ activemq/commands/ActiveMQTopicTest.cpp \ + activemq/commands/ActiveMQStreamMessageTest.cpp \ activemq/commands/ActiveMQMessageTest.cpp \ activemq/commands/ActiveMQTempQueueTest.cpp \ activemq/commands/ActiveMQBytesMessageTest.cpp \ @@ -192,8 +193,8 @@ activemq/transport/correlator/ResponseCorrelatorTest.h \ activemq/transport/TransportRegistryTest.h \ activemq/wireformat/openwire/OpenWireFormatTest.h \ - activemq/wireformat/openwire/marshal/PrimitiveMapMarshallerTest.h \ activemq/wireformat/openwire/marshal/BaseDataStreamMarshallerTest.h \ + activemq/wireformat/openwire/marshal/PrimitiveTypesMarshallerTest.h \ activemq/wireformat/openwire/utils/MessagePropertyInterceptorTest.h \ activemq/wireformat/openwire/utils/OpenwireStringSupportTest.h \ activemq/wireformat/openwire/utils/HexTableTest.h \ @@ -232,6 +233,7 @@ activemq/core/ActiveMQConnectionTest.h \ activemq/core/ActiveMQSessionTest.h \ activemq/core/MessageDispatchChannelTest.h \ + activemq/commands/ActiveMQStreamMessageTest.h \ activemq/commands/ActiveMQTempTopicTest.h \ activemq/commands/ActiveMQQueueTest.h \ activemq/commands/ActiveMQBytesMessageTest.h \ Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQStreamMessageTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQStreamMessageTest.cpp?rev=774861&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQStreamMessageTest.cpp (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQStreamMessageTest.cpp Thu May 14 18:22:39 2009 @@ -0,0 +1,63 @@ +/** + * 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 "ActiveMQStreamMessageTest.h" + +#include + +using namespace std; +using namespace activemq; +using namespace activemq::commands; + +//////////////////////////////////////////////////////////////////////////////// +void ActiveMQStreamMessageTest::testSetAndGet() { + + ActiveMQStreamMessage myMessage; + + CPPUNIT_ASSERT( myMessage.getDataStructureType() == ActiveMQStreamMessage::ID_ACTIVEMQSTREAMMESSAGE ); + + std::vector data; + data.push_back( 2 ); + data.push_back( 4 ); + data.push_back( 8 ); + data.push_back( 16 ); + data.push_back( 32 ); + std::vector readData( data.size() ); + + myMessage.writeBoolean( false ); + myMessage.writeByte( 127 ); + myMessage.writeChar( 'a' ); + myMessage.writeShort( 32000 ); + myMessage.writeInt( 6789999 ); + myMessage.writeLong( 0xFFFAAA33345LL ); + myMessage.writeFloat( 0.000012f ); + myMessage.writeDouble( 64.54654 ); + myMessage.writeBytes( data ); + + myMessage.reset(); + + CPPUNIT_ASSERT( myMessage.readBoolean() == false ); + CPPUNIT_ASSERT( myMessage.readByte() == 127 ); + CPPUNIT_ASSERT( myMessage.readChar() == 'a' ); + CPPUNIT_ASSERT( myMessage.readShort() == 32000 ); + CPPUNIT_ASSERT( myMessage.readInt() == 6789999 ); + CPPUNIT_ASSERT( myMessage.readLong() == 0xFFFAAA33345LL ); + CPPUNIT_ASSERT( myMessage.readFloat() == 0.000012f ); + CPPUNIT_ASSERT( myMessage.readDouble() == 64.54654 ); + CPPUNIT_ASSERT( myMessage.readBytes( readData ) == data.size() ); +} + Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQStreamMessageTest.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQStreamMessageTest.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQStreamMessageTest.h?rev=774861&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQStreamMessageTest.h (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQStreamMessageTest.h Thu May 14 18:22:39 2009 @@ -0,0 +1,44 @@ +/** + * 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_COMMANDS_ACTIVEMQSTREAMMESSAGETEST_H_ +#define _ACTIVEMQ_COMMANDS_ACTIVEMQSTREAMMESSAGETEST_H_ + +#include +#include + +namespace activemq { +namespace commands { + + class ActiveMQStreamMessageTest : public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE( ActiveMQStreamMessageTest ); + CPPUNIT_TEST( testSetAndGet ); + CPPUNIT_TEST_SUITE_END(); + + public: + + ActiveMQStreamMessageTest() {} + virtual ~ActiveMQStreamMessageTest() {} + + void testSetAndGet(); + + }; + +}} + +#endif /* _ACTIVEMQ_COMMANDS_ACTIVEMQSTREAMMESSAGETEST_H_ */ Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQStreamMessageTest.h ------------------------------------------------------------------------------ svn:eol-style = native Copied: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshallerTest.cpp (from r774073, activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveMapMarshallerTest.cpp) URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshallerTest.cpp?p2=activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshallerTest.cpp&p1=activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveMapMarshallerTest.cpp&r1=774073&r2=774861&rev=774861&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveMapMarshallerTest.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshallerTest.cpp Thu May 14 18:22:39 2009 @@ -15,11 +15,11 @@ * limitations under the License. */ -#include "PrimitiveMapMarshallerTest.h" +#include "PrimitiveTypesMarshallerTest.h" #include #include -#include +#include using namespace std; using namespace activemq; @@ -31,7 +31,7 @@ using namespace activemq::wireformat::openwire::marshal; //////////////////////////////////////////////////////////////////////////////// -void PrimitiveMapMarshallerTest::test() { +void PrimitiveTypesMarshallerTest::test() { PrimitiveMap myMap; @@ -66,10 +66,11 @@ std::vector marshaled; // Turn it into some bytes - PrimitiveMapMarshaller::marshal( &myMap, marshaled ); + PrimitiveTypesMarshaller::marshal( &myMap, marshaled ); try { - this->unmarshaledMap = PrimitiveMapMarshaller::unmarshal( marshaled ); + this->unmarshaledMap = new PrimitiveMap(); + PrimitiveTypesMarshaller::unmarshal( this->unmarshaledMap, marshaled ); } catch(...) { CPPUNIT_ASSERT( false ); } @@ -89,7 +90,7 @@ } //////////////////////////////////////////////////////////////////////////////// -void PrimitiveMapMarshallerTest::testLists() { +void PrimitiveTypesMarshallerTest::testLists() { PrimitiveMap myMap; @@ -108,25 +109,23 @@ std::vector marshaled; // Turn it into some bytes - PrimitiveMapMarshaller::marshal( &myMap, marshaled ); + PrimitiveTypesMarshaller::marshal( &myMap, marshaled ); // Try and get it back from those bytes. - PrimitiveMap* newMap = NULL; + std::auto_ptr newMap( new PrimitiveMap ); try { - newMap = PrimitiveMapMarshaller::unmarshal( marshaled ); + PrimitiveTypesMarshaller::unmarshal( newMap.get(), marshaled ); } catch(...) { CPPUNIT_ASSERT( false ); } - CPPUNIT_ASSERT( newMap != NULL ); + CPPUNIT_ASSERT( newMap.get() != NULL ); CPPUNIT_ASSERT( newMap->size() == 3 ); - - delete newMap; } //////////////////////////////////////////////////////////////////////////////// -void PrimitiveMapMarshallerTest::testMaps() { +void PrimitiveTypesMarshallerTest::testMaps() { PrimitiveMap myMap; @@ -145,19 +144,17 @@ std::vector marshaled; // Turn it into some bytes - PrimitiveMapMarshaller::marshal( &myMap, marshaled ); + PrimitiveTypesMarshaller::marshal( &myMap, marshaled ); // Try and get it back from those bytes. - PrimitiveMap* newMap = NULL; + std::auto_ptr newMap( new PrimitiveMap ); try { - newMap = PrimitiveMapMarshaller::unmarshal( marshaled ); + PrimitiveTypesMarshaller::unmarshal( newMap.get(), marshaled ); } catch(...) { CPPUNIT_ASSERT( false ); } - CPPUNIT_ASSERT( newMap != NULL ); + CPPUNIT_ASSERT( newMap.get() != NULL ); CPPUNIT_ASSERT( newMap->size() == 3 ); - - delete newMap; } Copied: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshallerTest.h (from r774073, activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveMapMarshallerTest.h) URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshallerTest.h?p2=activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshallerTest.h&p1=activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveMapMarshallerTest.h&r1=774073&r2=774861&rev=774861&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveMapMarshallerTest.h (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/PrimitiveTypesMarshallerTest.h Thu May 14 18:22:39 2009 @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSHAL_PRIMITIVEMAPMARSHALLERTEST_H_ -#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSHAL_PRIMITIVEMAPMARSHALLERTEST_H_ +#ifndef _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSHAL_PRIMITIVETYPESMARSHALLERTEST_H_ +#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSHAL_PRIMITIVETYPESMARSHALLERTEST_H_ #include #include @@ -27,9 +27,9 @@ namespace openwire{ namespace marshal{ - class PrimitiveMapMarshallerTest : public CppUnit::TestFixture { + class PrimitiveTypesMarshallerTest : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE( PrimitiveMapMarshallerTest ); + CPPUNIT_TEST_SUITE( PrimitiveTypesMarshallerTest ); CPPUNIT_TEST( test ); CPPUNIT_TEST( testLists ); CPPUNIT_TEST( testMaps ); @@ -41,8 +41,8 @@ public: - PrimitiveMapMarshallerTest() {} - virtual ~PrimitiveMapMarshallerTest() {} + PrimitiveTypesMarshallerTest() {} + virtual ~PrimitiveTypesMarshallerTest() {} virtual void setUp() { this->unmarshaledMap = NULL; @@ -61,4 +61,4 @@ }}}} -#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSHAL_PRIMITIVEMAPMARSHALLERTEST_H_*/ +#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSHAL_PRIMITIVETYPESMARSHALLERTEST_H_*/ Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp?rev=774861&r1=774860&r2=774861&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp Thu May 14 18:22:39 2009 @@ -40,11 +40,13 @@ CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQDestinationTest ); #include CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQBytesMessageTest ); +#include +CPPUNIT_TEST_SUITE_REGISTRATION( activemq::commands::ActiveMQStreamMessageTest ); #include CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::marshal::BaseDataStreamMarshallerTest ); -#include -CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::marshal::PrimitiveMapMarshallerTest ); +#include +CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::marshal::PrimitiveTypesMarshallerTest ); #include CPPUNIT_TEST_SUITE_REGISTRATION( activemq::wireformat::openwire::utils::BooleanStreamTest );