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 2010/06/15 23:54:21 UTC
svn commit: r955066 [18/21] - in /activemq/activemq-cpp/trunk/activemq-cpp:
./ src/main/ src/main/activemq/wireformat/openwire/
src/main/activemq/wireformat/openwire/marshal/universal/
src/main/activemq/wireformat/openwire/marshal/v1/ src/main/activemq...
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchMarshallerTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchMarshallerTest.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchMarshallerTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchMarshallerTest.h Tue Jun 15 21:54:15 2010
@@ -0,0 +1,66 @@
+/*
+ * 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_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_MESSAGEDISPATCHMARSHALLERTEST_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_MESSAGEDISPATCHMARSHALLERTEST_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace activemq{
+namespace wireformat{
+namespace openwire{
+namespace marshal{
+namespace universal{
+
+ /**
+ * Marshalling Test code for Open Wire Format for MessageDispatchMarshallerTest
+ *
+ * NOTE!: This file is autogenerated - do not modify!
+ * if you need to make a change, please see the Java Classes
+ * in the activemq-openwire-generator module
+ */
+ class MessageDispatchMarshallerTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( MessageDispatchMarshallerTest );
+ CPPUNIT_TEST( test );
+ CPPUNIT_TEST( testLooseMarshal );
+ CPPUNIT_TEST( testTightMarshal );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ MessageDispatchMarshallerTest() {}
+ virtual ~MessageDispatchMarshallerTest() {}
+
+ /**
+ * Test the marshaller and its marshalled type.
+ */
+ virtual void test();
+ virtual void testLooseMarshal();
+ virtual void testTightMarshal();
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_MESSAGEDISPATCHMARSHALLERTEST_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchMarshallerTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchNotificationMarshallerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchNotificationMarshallerTest.cpp?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchNotificationMarshallerTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchNotificationMarshallerTest.cpp Tue Jun 15 21:54:15 2010
@@ -0,0 +1,157 @@
+/*
+ * 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 <activemq/wireformat/openwire/marshal/universal/MessageDispatchNotificationMarshallerTest.h>
+
+#include <activemq/wireformat/openwire/marshal/universal/MessageDispatchNotificationMarshaller.h>
+#include <activemq/commands/MessageDispatchNotification.h>
+
+#include <activemq/wireformat/openwire/OpenWireFormat.h>
+#include <activemq/commands/DataStructure.h>
+#include <activemq/commands/MessageId.h>
+#include <activemq/commands/ProducerId.h>
+#include <activemq/wireformat/openwire/utils/BooleanStream.h>
+#include <decaf/io/DataInputStream.h>
+#include <decaf/io/DataOutputStream.h>
+#include <decaf/io/IOException.h>
+#include <decaf/io/ByteArrayOutputStream.h>
+#include <decaf/io/ByteArrayInputStream.h>
+#include <decaf/util/Properties.h>
+#include <decaf/lang/Pointer.h>
+//
+// NOTE!: This file is autogenerated - do not modify!
+// if you need to make a change, please see the Java Classes in the
+// activemq-core module
+//
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::util;
+using namespace activemq::exceptions;
+using namespace activemq::commands;
+using namespace activemq::wireformat;
+using namespace activemq::wireformat::openwire;
+using namespace activemq::wireformat::openwire::marshal;
+using namespace activemq::wireformat::openwire::utils;
+using namespace activemq::wireformat::openwire::marshal::universal;
+using namespace decaf::io;
+using namespace decaf::lang;
+using namespace decaf::util;
+
+///////////////////////////////////////////////////////////////////////////////
+void MessageDispatchNotificationMarshallerTest::test() {
+
+ MessageDispatchNotificationMarshaller myMarshaller;
+ MessageDispatchNotification myCommand;
+ MessageDispatchNotification* myCommand2;
+
+ CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() );
+ myCommand2 = dynamic_cast<MessageDispatchNotification*>( myMarshaller.createObject() );
+ CPPUNIT_ASSERT( myCommand2 != NULL );
+ delete myCommand2;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void MessageDispatchNotificationMarshallerTest::testLooseMarshal() {
+
+ MessageDispatchNotificationMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( false );
+
+ MessageDispatchNotification outCommand;
+ MessageDispatchNotification inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ marshaller.looseUnmarshal( &openWireFormat, &inCommand, &dataIn );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void MessageDispatchNotificationMarshallerTest::testTightMarshal() {
+
+ MessageDispatchNotificationMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( true );
+
+ MessageDispatchNotification outCommand;
+ MessageDispatchNotification inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ // Phase 1 - count the size
+ int size = 1;
+ BooleanStream bs;
+ size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs );
+ size += bs.marshalledSize();
+ // Phase 2 - marshal
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ bs.marshal( &dataOut );
+ marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ bs.clear();
+ bs.unmarshal( &dataIn );
+ marshaller.tightUnmarshal( &openWireFormat, &inCommand, &dataIn, &bs );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchNotificationMarshallerTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchNotificationMarshallerTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchNotificationMarshallerTest.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchNotificationMarshallerTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchNotificationMarshallerTest.h Tue Jun 15 21:54:15 2010
@@ -0,0 +1,66 @@
+/*
+ * 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_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_MESSAGEDISPATCHNOTIFICATIONMARSHALLERTEST_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_MESSAGEDISPATCHNOTIFICATIONMARSHALLERTEST_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace activemq{
+namespace wireformat{
+namespace openwire{
+namespace marshal{
+namespace universal{
+
+ /**
+ * Marshalling Test code for Open Wire Format for MessageDispatchNotificationMarshallerTest
+ *
+ * NOTE!: This file is autogenerated - do not modify!
+ * if you need to make a change, please see the Java Classes
+ * in the activemq-openwire-generator module
+ */
+ class MessageDispatchNotificationMarshallerTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( MessageDispatchNotificationMarshallerTest );
+ CPPUNIT_TEST( test );
+ CPPUNIT_TEST( testLooseMarshal );
+ CPPUNIT_TEST( testTightMarshal );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ MessageDispatchNotificationMarshallerTest() {}
+ virtual ~MessageDispatchNotificationMarshallerTest() {}
+
+ /**
+ * Test the marshaller and its marshalled type.
+ */
+ virtual void test();
+ virtual void testLooseMarshal();
+ virtual void testTightMarshal();
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_MESSAGEDISPATCHNOTIFICATIONMARSHALLERTEST_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageDispatchNotificationMarshallerTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageIdMarshallerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageIdMarshallerTest.cpp?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageIdMarshallerTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageIdMarshallerTest.cpp Tue Jun 15 21:54:15 2010
@@ -0,0 +1,157 @@
+/*
+ * 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 <activemq/wireformat/openwire/marshal/universal/MessageIdMarshallerTest.h>
+
+#include <activemq/wireformat/openwire/marshal/universal/MessageIdMarshaller.h>
+#include <activemq/commands/MessageId.h>
+
+#include <activemq/wireformat/openwire/OpenWireFormat.h>
+#include <activemq/commands/DataStructure.h>
+#include <activemq/commands/MessageId.h>
+#include <activemq/commands/ProducerId.h>
+#include <activemq/wireformat/openwire/utils/BooleanStream.h>
+#include <decaf/io/DataInputStream.h>
+#include <decaf/io/DataOutputStream.h>
+#include <decaf/io/IOException.h>
+#include <decaf/io/ByteArrayOutputStream.h>
+#include <decaf/io/ByteArrayInputStream.h>
+#include <decaf/util/Properties.h>
+#include <decaf/lang/Pointer.h>
+//
+// NOTE!: This file is autogenerated - do not modify!
+// if you need to make a change, please see the Java Classes in the
+// activemq-core module
+//
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::util;
+using namespace activemq::exceptions;
+using namespace activemq::commands;
+using namespace activemq::wireformat;
+using namespace activemq::wireformat::openwire;
+using namespace activemq::wireformat::openwire::marshal;
+using namespace activemq::wireformat::openwire::utils;
+using namespace activemq::wireformat::openwire::marshal::universal;
+using namespace decaf::io;
+using namespace decaf::lang;
+using namespace decaf::util;
+
+///////////////////////////////////////////////////////////////////////////////
+void MessageIdMarshallerTest::test() {
+
+ MessageIdMarshaller myMarshaller;
+ MessageId myCommand;
+ MessageId* myCommand2;
+
+ CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() );
+ myCommand2 = dynamic_cast<MessageId*>( myMarshaller.createObject() );
+ CPPUNIT_ASSERT( myCommand2 != NULL );
+ delete myCommand2;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void MessageIdMarshallerTest::testLooseMarshal() {
+
+ MessageIdMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( false );
+
+ MessageId outCommand;
+ MessageId inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ marshaller.looseUnmarshal( &openWireFormat, &inCommand, &dataIn );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void MessageIdMarshallerTest::testTightMarshal() {
+
+ MessageIdMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( true );
+
+ MessageId outCommand;
+ MessageId inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ // Phase 1 - count the size
+ int size = 1;
+ BooleanStream bs;
+ size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs );
+ size += bs.marshalledSize();
+ // Phase 2 - marshal
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ bs.marshal( &dataOut );
+ marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ bs.clear();
+ bs.unmarshal( &dataIn );
+ marshaller.tightUnmarshal( &openWireFormat, &inCommand, &dataIn, &bs );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageIdMarshallerTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageIdMarshallerTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageIdMarshallerTest.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageIdMarshallerTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageIdMarshallerTest.h Tue Jun 15 21:54:15 2010
@@ -0,0 +1,66 @@
+/*
+ * 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_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_MESSAGEIDMARSHALLERTEST_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_MESSAGEIDMARSHALLERTEST_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace activemq{
+namespace wireformat{
+namespace openwire{
+namespace marshal{
+namespace universal{
+
+ /**
+ * Marshalling Test code for Open Wire Format for MessageIdMarshallerTest
+ *
+ * NOTE!: This file is autogenerated - do not modify!
+ * if you need to make a change, please see the Java Classes
+ * in the activemq-openwire-generator module
+ */
+ class MessageIdMarshallerTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( MessageIdMarshallerTest );
+ CPPUNIT_TEST( test );
+ CPPUNIT_TEST( testLooseMarshal );
+ CPPUNIT_TEST( testTightMarshal );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ MessageIdMarshallerTest() {}
+ virtual ~MessageIdMarshallerTest() {}
+
+ /**
+ * Test the marshaller and its marshalled type.
+ */
+ virtual void test();
+ virtual void testLooseMarshal();
+ virtual void testTightMarshal();
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_MESSAGEIDMARSHALLERTEST_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessageIdMarshallerTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessagePullMarshallerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessagePullMarshallerTest.cpp?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessagePullMarshallerTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessagePullMarshallerTest.cpp Tue Jun 15 21:54:15 2010
@@ -0,0 +1,157 @@
+/*
+ * 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 <activemq/wireformat/openwire/marshal/universal/MessagePullMarshallerTest.h>
+
+#include <activemq/wireformat/openwire/marshal/universal/MessagePullMarshaller.h>
+#include <activemq/commands/MessagePull.h>
+
+#include <activemq/wireformat/openwire/OpenWireFormat.h>
+#include <activemq/commands/DataStructure.h>
+#include <activemq/commands/MessageId.h>
+#include <activemq/commands/ProducerId.h>
+#include <activemq/wireformat/openwire/utils/BooleanStream.h>
+#include <decaf/io/DataInputStream.h>
+#include <decaf/io/DataOutputStream.h>
+#include <decaf/io/IOException.h>
+#include <decaf/io/ByteArrayOutputStream.h>
+#include <decaf/io/ByteArrayInputStream.h>
+#include <decaf/util/Properties.h>
+#include <decaf/lang/Pointer.h>
+//
+// NOTE!: This file is autogenerated - do not modify!
+// if you need to make a change, please see the Java Classes in the
+// activemq-core module
+//
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::util;
+using namespace activemq::exceptions;
+using namespace activemq::commands;
+using namespace activemq::wireformat;
+using namespace activemq::wireformat::openwire;
+using namespace activemq::wireformat::openwire::marshal;
+using namespace activemq::wireformat::openwire::utils;
+using namespace activemq::wireformat::openwire::marshal::universal;
+using namespace decaf::io;
+using namespace decaf::lang;
+using namespace decaf::util;
+
+///////////////////////////////////////////////////////////////////////////////
+void MessagePullMarshallerTest::test() {
+
+ MessagePullMarshaller myMarshaller;
+ MessagePull myCommand;
+ MessagePull* myCommand2;
+
+ CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() );
+ myCommand2 = dynamic_cast<MessagePull*>( myMarshaller.createObject() );
+ CPPUNIT_ASSERT( myCommand2 != NULL );
+ delete myCommand2;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void MessagePullMarshallerTest::testLooseMarshal() {
+
+ MessagePullMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( false );
+
+ MessagePull outCommand;
+ MessagePull inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ marshaller.looseUnmarshal( &openWireFormat, &inCommand, &dataIn );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void MessagePullMarshallerTest::testTightMarshal() {
+
+ MessagePullMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( true );
+
+ MessagePull outCommand;
+ MessagePull inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ // Phase 1 - count the size
+ int size = 1;
+ BooleanStream bs;
+ size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs );
+ size += bs.marshalledSize();
+ // Phase 2 - marshal
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ bs.marshal( &dataOut );
+ marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ bs.clear();
+ bs.unmarshal( &dataIn );
+ marshaller.tightUnmarshal( &openWireFormat, &inCommand, &dataIn, &bs );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessagePullMarshallerTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessagePullMarshallerTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessagePullMarshallerTest.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessagePullMarshallerTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessagePullMarshallerTest.h Tue Jun 15 21:54:15 2010
@@ -0,0 +1,66 @@
+/*
+ * 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_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_MESSAGEPULLMARSHALLERTEST_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_MESSAGEPULLMARSHALLERTEST_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace activemq{
+namespace wireformat{
+namespace openwire{
+namespace marshal{
+namespace universal{
+
+ /**
+ * Marshalling Test code for Open Wire Format for MessagePullMarshallerTest
+ *
+ * NOTE!: This file is autogenerated - do not modify!
+ * if you need to make a change, please see the Java Classes
+ * in the activemq-openwire-generator module
+ */
+ class MessagePullMarshallerTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( MessagePullMarshallerTest );
+ CPPUNIT_TEST( test );
+ CPPUNIT_TEST( testLooseMarshal );
+ CPPUNIT_TEST( testTightMarshal );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ MessagePullMarshallerTest() {}
+ virtual ~MessagePullMarshallerTest() {}
+
+ /**
+ * Test the marshaller and its marshalled type.
+ */
+ virtual void test();
+ virtual void testLooseMarshal();
+ virtual void testTightMarshal();
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_MESSAGEPULLMARSHALLERTEST_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/MessagePullMarshallerTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/NetworkBridgeFilterMarshallerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/NetworkBridgeFilterMarshallerTest.cpp?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/NetworkBridgeFilterMarshallerTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/NetworkBridgeFilterMarshallerTest.cpp Tue Jun 15 21:54:15 2010
@@ -0,0 +1,157 @@
+/*
+ * 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 <activemq/wireformat/openwire/marshal/universal/NetworkBridgeFilterMarshallerTest.h>
+
+#include <activemq/wireformat/openwire/marshal/universal/NetworkBridgeFilterMarshaller.h>
+#include <activemq/commands/NetworkBridgeFilter.h>
+
+#include <activemq/wireformat/openwire/OpenWireFormat.h>
+#include <activemq/commands/DataStructure.h>
+#include <activemq/commands/MessageId.h>
+#include <activemq/commands/ProducerId.h>
+#include <activemq/wireformat/openwire/utils/BooleanStream.h>
+#include <decaf/io/DataInputStream.h>
+#include <decaf/io/DataOutputStream.h>
+#include <decaf/io/IOException.h>
+#include <decaf/io/ByteArrayOutputStream.h>
+#include <decaf/io/ByteArrayInputStream.h>
+#include <decaf/util/Properties.h>
+#include <decaf/lang/Pointer.h>
+//
+// NOTE!: This file is autogenerated - do not modify!
+// if you need to make a change, please see the Java Classes in the
+// activemq-core module
+//
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::util;
+using namespace activemq::exceptions;
+using namespace activemq::commands;
+using namespace activemq::wireformat;
+using namespace activemq::wireformat::openwire;
+using namespace activemq::wireformat::openwire::marshal;
+using namespace activemq::wireformat::openwire::utils;
+using namespace activemq::wireformat::openwire::marshal::universal;
+using namespace decaf::io;
+using namespace decaf::lang;
+using namespace decaf::util;
+
+///////////////////////////////////////////////////////////////////////////////
+void NetworkBridgeFilterMarshallerTest::test() {
+
+ NetworkBridgeFilterMarshaller myMarshaller;
+ NetworkBridgeFilter myCommand;
+ NetworkBridgeFilter* myCommand2;
+
+ CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() );
+ myCommand2 = dynamic_cast<NetworkBridgeFilter*>( myMarshaller.createObject() );
+ CPPUNIT_ASSERT( myCommand2 != NULL );
+ delete myCommand2;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void NetworkBridgeFilterMarshallerTest::testLooseMarshal() {
+
+ NetworkBridgeFilterMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( false );
+
+ NetworkBridgeFilter outCommand;
+ NetworkBridgeFilter inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ marshaller.looseUnmarshal( &openWireFormat, &inCommand, &dataIn );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void NetworkBridgeFilterMarshallerTest::testTightMarshal() {
+
+ NetworkBridgeFilterMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( true );
+
+ NetworkBridgeFilter outCommand;
+ NetworkBridgeFilter inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ // Phase 1 - count the size
+ int size = 1;
+ BooleanStream bs;
+ size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs );
+ size += bs.marshalledSize();
+ // Phase 2 - marshal
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ bs.marshal( &dataOut );
+ marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ bs.clear();
+ bs.unmarshal( &dataIn );
+ marshaller.tightUnmarshal( &openWireFormat, &inCommand, &dataIn, &bs );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/NetworkBridgeFilterMarshallerTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/NetworkBridgeFilterMarshallerTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/NetworkBridgeFilterMarshallerTest.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/NetworkBridgeFilterMarshallerTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/NetworkBridgeFilterMarshallerTest.h Tue Jun 15 21:54:15 2010
@@ -0,0 +1,66 @@
+/*
+ * 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_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_NETWORKBRIDGEFILTERMARSHALLERTEST_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_NETWORKBRIDGEFILTERMARSHALLERTEST_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace activemq{
+namespace wireformat{
+namespace openwire{
+namespace marshal{
+namespace universal{
+
+ /**
+ * Marshalling Test code for Open Wire Format for NetworkBridgeFilterMarshallerTest
+ *
+ * NOTE!: This file is autogenerated - do not modify!
+ * if you need to make a change, please see the Java Classes
+ * in the activemq-openwire-generator module
+ */
+ class NetworkBridgeFilterMarshallerTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( NetworkBridgeFilterMarshallerTest );
+ CPPUNIT_TEST( test );
+ CPPUNIT_TEST( testLooseMarshal );
+ CPPUNIT_TEST( testTightMarshal );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ NetworkBridgeFilterMarshallerTest() {}
+ virtual ~NetworkBridgeFilterMarshallerTest() {}
+
+ /**
+ * Test the marshaller and its marshalled type.
+ */
+ virtual void test();
+ virtual void testLooseMarshal();
+ virtual void testTightMarshal();
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_NETWORKBRIDGEFILTERMARSHALLERTEST_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/NetworkBridgeFilterMarshallerTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/PartialCommandMarshallerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/PartialCommandMarshallerTest.cpp?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/PartialCommandMarshallerTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/PartialCommandMarshallerTest.cpp Tue Jun 15 21:54:15 2010
@@ -0,0 +1,157 @@
+/*
+ * 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 <activemq/wireformat/openwire/marshal/universal/PartialCommandMarshallerTest.h>
+
+#include <activemq/wireformat/openwire/marshal/universal/PartialCommandMarshaller.h>
+#include <activemq/commands/PartialCommand.h>
+
+#include <activemq/wireformat/openwire/OpenWireFormat.h>
+#include <activemq/commands/DataStructure.h>
+#include <activemq/commands/MessageId.h>
+#include <activemq/commands/ProducerId.h>
+#include <activemq/wireformat/openwire/utils/BooleanStream.h>
+#include <decaf/io/DataInputStream.h>
+#include <decaf/io/DataOutputStream.h>
+#include <decaf/io/IOException.h>
+#include <decaf/io/ByteArrayOutputStream.h>
+#include <decaf/io/ByteArrayInputStream.h>
+#include <decaf/util/Properties.h>
+#include <decaf/lang/Pointer.h>
+//
+// NOTE!: This file is autogenerated - do not modify!
+// if you need to make a change, please see the Java Classes in the
+// activemq-core module
+//
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::util;
+using namespace activemq::exceptions;
+using namespace activemq::commands;
+using namespace activemq::wireformat;
+using namespace activemq::wireformat::openwire;
+using namespace activemq::wireformat::openwire::marshal;
+using namespace activemq::wireformat::openwire::utils;
+using namespace activemq::wireformat::openwire::marshal::universal;
+using namespace decaf::io;
+using namespace decaf::lang;
+using namespace decaf::util;
+
+///////////////////////////////////////////////////////////////////////////////
+void PartialCommandMarshallerTest::test() {
+
+ PartialCommandMarshaller myMarshaller;
+ PartialCommand myCommand;
+ PartialCommand* myCommand2;
+
+ CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() );
+ myCommand2 = dynamic_cast<PartialCommand*>( myMarshaller.createObject() );
+ CPPUNIT_ASSERT( myCommand2 != NULL );
+ delete myCommand2;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void PartialCommandMarshallerTest::testLooseMarshal() {
+
+ PartialCommandMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( false );
+
+ PartialCommand outCommand;
+ PartialCommand inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ marshaller.looseUnmarshal( &openWireFormat, &inCommand, &dataIn );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void PartialCommandMarshallerTest::testTightMarshal() {
+
+ PartialCommandMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( true );
+
+ PartialCommand outCommand;
+ PartialCommand inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ // Phase 1 - count the size
+ int size = 1;
+ BooleanStream bs;
+ size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs );
+ size += bs.marshalledSize();
+ // Phase 2 - marshal
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ bs.marshal( &dataOut );
+ marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ bs.clear();
+ bs.unmarshal( &dataIn );
+ marshaller.tightUnmarshal( &openWireFormat, &inCommand, &dataIn, &bs );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/PartialCommandMarshallerTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/PartialCommandMarshallerTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/PartialCommandMarshallerTest.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/PartialCommandMarshallerTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/PartialCommandMarshallerTest.h Tue Jun 15 21:54:15 2010
@@ -0,0 +1,66 @@
+/*
+ * 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_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_PARTIALCOMMANDMARSHALLERTEST_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_PARTIALCOMMANDMARSHALLERTEST_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace activemq{
+namespace wireformat{
+namespace openwire{
+namespace marshal{
+namespace universal{
+
+ /**
+ * Marshalling Test code for Open Wire Format for PartialCommandMarshallerTest
+ *
+ * NOTE!: This file is autogenerated - do not modify!
+ * if you need to make a change, please see the Java Classes
+ * in the activemq-openwire-generator module
+ */
+ class PartialCommandMarshallerTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( PartialCommandMarshallerTest );
+ CPPUNIT_TEST( test );
+ CPPUNIT_TEST( testLooseMarshal );
+ CPPUNIT_TEST( testTightMarshal );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ PartialCommandMarshallerTest() {}
+ virtual ~PartialCommandMarshallerTest() {}
+
+ /**
+ * Test the marshaller and its marshalled type.
+ */
+ virtual void test();
+ virtual void testLooseMarshal();
+ virtual void testTightMarshal();
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_PARTIALCOMMANDMARSHALLERTEST_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/PartialCommandMarshallerTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerAckMarshallerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerAckMarshallerTest.cpp?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerAckMarshallerTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerAckMarshallerTest.cpp Tue Jun 15 21:54:15 2010
@@ -0,0 +1,157 @@
+/*
+ * 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 <activemq/wireformat/openwire/marshal/universal/ProducerAckMarshallerTest.h>
+
+#include <activemq/wireformat/openwire/marshal/universal/ProducerAckMarshaller.h>
+#include <activemq/commands/ProducerAck.h>
+
+#include <activemq/wireformat/openwire/OpenWireFormat.h>
+#include <activemq/commands/DataStructure.h>
+#include <activemq/commands/MessageId.h>
+#include <activemq/commands/ProducerId.h>
+#include <activemq/wireformat/openwire/utils/BooleanStream.h>
+#include <decaf/io/DataInputStream.h>
+#include <decaf/io/DataOutputStream.h>
+#include <decaf/io/IOException.h>
+#include <decaf/io/ByteArrayOutputStream.h>
+#include <decaf/io/ByteArrayInputStream.h>
+#include <decaf/util/Properties.h>
+#include <decaf/lang/Pointer.h>
+//
+// NOTE!: This file is autogenerated - do not modify!
+// if you need to make a change, please see the Java Classes in the
+// activemq-core module
+//
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::util;
+using namespace activemq::exceptions;
+using namespace activemq::commands;
+using namespace activemq::wireformat;
+using namespace activemq::wireformat::openwire;
+using namespace activemq::wireformat::openwire::marshal;
+using namespace activemq::wireformat::openwire::utils;
+using namespace activemq::wireformat::openwire::marshal::universal;
+using namespace decaf::io;
+using namespace decaf::lang;
+using namespace decaf::util;
+
+///////////////////////////////////////////////////////////////////////////////
+void ProducerAckMarshallerTest::test() {
+
+ ProducerAckMarshaller myMarshaller;
+ ProducerAck myCommand;
+ ProducerAck* myCommand2;
+
+ CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() );
+ myCommand2 = dynamic_cast<ProducerAck*>( myMarshaller.createObject() );
+ CPPUNIT_ASSERT( myCommand2 != NULL );
+ delete myCommand2;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void ProducerAckMarshallerTest::testLooseMarshal() {
+
+ ProducerAckMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( false );
+
+ ProducerAck outCommand;
+ ProducerAck inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ marshaller.looseUnmarshal( &openWireFormat, &inCommand, &dataIn );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void ProducerAckMarshallerTest::testTightMarshal() {
+
+ ProducerAckMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( true );
+
+ ProducerAck outCommand;
+ ProducerAck inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ // Phase 1 - count the size
+ int size = 1;
+ BooleanStream bs;
+ size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs );
+ size += bs.marshalledSize();
+ // Phase 2 - marshal
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ bs.marshal( &dataOut );
+ marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ bs.clear();
+ bs.unmarshal( &dataIn );
+ marshaller.tightUnmarshal( &openWireFormat, &inCommand, &dataIn, &bs );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerAckMarshallerTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerAckMarshallerTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerAckMarshallerTest.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerAckMarshallerTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerAckMarshallerTest.h Tue Jun 15 21:54:15 2010
@@ -0,0 +1,66 @@
+/*
+ * 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_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_PRODUCERACKMARSHALLERTEST_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_PRODUCERACKMARSHALLERTEST_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace activemq{
+namespace wireformat{
+namespace openwire{
+namespace marshal{
+namespace universal{
+
+ /**
+ * Marshalling Test code for Open Wire Format for ProducerAckMarshallerTest
+ *
+ * NOTE!: This file is autogenerated - do not modify!
+ * if you need to make a change, please see the Java Classes
+ * in the activemq-openwire-generator module
+ */
+ class ProducerAckMarshallerTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( ProducerAckMarshallerTest );
+ CPPUNIT_TEST( test );
+ CPPUNIT_TEST( testLooseMarshal );
+ CPPUNIT_TEST( testTightMarshal );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ ProducerAckMarshallerTest() {}
+ virtual ~ProducerAckMarshallerTest() {}
+
+ /**
+ * Test the marshaller and its marshalled type.
+ */
+ virtual void test();
+ virtual void testLooseMarshal();
+ virtual void testTightMarshal();
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_PRODUCERACKMARSHALLERTEST_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerAckMarshallerTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerIdMarshallerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerIdMarshallerTest.cpp?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerIdMarshallerTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerIdMarshallerTest.cpp Tue Jun 15 21:54:15 2010
@@ -0,0 +1,157 @@
+/*
+ * 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 <activemq/wireformat/openwire/marshal/universal/ProducerIdMarshallerTest.h>
+
+#include <activemq/wireformat/openwire/marshal/universal/ProducerIdMarshaller.h>
+#include <activemq/commands/ProducerId.h>
+
+#include <activemq/wireformat/openwire/OpenWireFormat.h>
+#include <activemq/commands/DataStructure.h>
+#include <activemq/commands/MessageId.h>
+#include <activemq/commands/ProducerId.h>
+#include <activemq/wireformat/openwire/utils/BooleanStream.h>
+#include <decaf/io/DataInputStream.h>
+#include <decaf/io/DataOutputStream.h>
+#include <decaf/io/IOException.h>
+#include <decaf/io/ByteArrayOutputStream.h>
+#include <decaf/io/ByteArrayInputStream.h>
+#include <decaf/util/Properties.h>
+#include <decaf/lang/Pointer.h>
+//
+// NOTE!: This file is autogenerated - do not modify!
+// if you need to make a change, please see the Java Classes in the
+// activemq-core module
+//
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::util;
+using namespace activemq::exceptions;
+using namespace activemq::commands;
+using namespace activemq::wireformat;
+using namespace activemq::wireformat::openwire;
+using namespace activemq::wireformat::openwire::marshal;
+using namespace activemq::wireformat::openwire::utils;
+using namespace activemq::wireformat::openwire::marshal::universal;
+using namespace decaf::io;
+using namespace decaf::lang;
+using namespace decaf::util;
+
+///////////////////////////////////////////////////////////////////////////////
+void ProducerIdMarshallerTest::test() {
+
+ ProducerIdMarshaller myMarshaller;
+ ProducerId myCommand;
+ ProducerId* myCommand2;
+
+ CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() );
+ myCommand2 = dynamic_cast<ProducerId*>( myMarshaller.createObject() );
+ CPPUNIT_ASSERT( myCommand2 != NULL );
+ delete myCommand2;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void ProducerIdMarshallerTest::testLooseMarshal() {
+
+ ProducerIdMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( false );
+
+ ProducerId outCommand;
+ ProducerId inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ marshaller.looseUnmarshal( &openWireFormat, &inCommand, &dataIn );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void ProducerIdMarshallerTest::testTightMarshal() {
+
+ ProducerIdMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( true );
+
+ ProducerId outCommand;
+ ProducerId inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ // Phase 1 - count the size
+ int size = 1;
+ BooleanStream bs;
+ size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs );
+ size += bs.marshalledSize();
+ // Phase 2 - marshal
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ bs.marshal( &dataOut );
+ marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ bs.clear();
+ bs.unmarshal( &dataIn );
+ marshaller.tightUnmarshal( &openWireFormat, &inCommand, &dataIn, &bs );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerIdMarshallerTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerIdMarshallerTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerIdMarshallerTest.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerIdMarshallerTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerIdMarshallerTest.h Tue Jun 15 21:54:15 2010
@@ -0,0 +1,66 @@
+/*
+ * 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_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_PRODUCERIDMARSHALLERTEST_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_PRODUCERIDMARSHALLERTEST_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace activemq{
+namespace wireformat{
+namespace openwire{
+namespace marshal{
+namespace universal{
+
+ /**
+ * Marshalling Test code for Open Wire Format for ProducerIdMarshallerTest
+ *
+ * NOTE!: This file is autogenerated - do not modify!
+ * if you need to make a change, please see the Java Classes
+ * in the activemq-openwire-generator module
+ */
+ class ProducerIdMarshallerTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( ProducerIdMarshallerTest );
+ CPPUNIT_TEST( test );
+ CPPUNIT_TEST( testLooseMarshal );
+ CPPUNIT_TEST( testTightMarshal );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ ProducerIdMarshallerTest() {}
+ virtual ~ProducerIdMarshallerTest() {}
+
+ /**
+ * Test the marshaller and its marshalled type.
+ */
+ virtual void test();
+ virtual void testLooseMarshal();
+ virtual void testTightMarshal();
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_PRODUCERIDMARSHALLERTEST_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerIdMarshallerTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerInfoMarshallerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerInfoMarshallerTest.cpp?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerInfoMarshallerTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerInfoMarshallerTest.cpp Tue Jun 15 21:54:15 2010
@@ -0,0 +1,157 @@
+/*
+ * 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 <activemq/wireformat/openwire/marshal/universal/ProducerInfoMarshallerTest.h>
+
+#include <activemq/wireformat/openwire/marshal/universal/ProducerInfoMarshaller.h>
+#include <activemq/commands/ProducerInfo.h>
+
+#include <activemq/wireformat/openwire/OpenWireFormat.h>
+#include <activemq/commands/DataStructure.h>
+#include <activemq/commands/MessageId.h>
+#include <activemq/commands/ProducerId.h>
+#include <activemq/wireformat/openwire/utils/BooleanStream.h>
+#include <decaf/io/DataInputStream.h>
+#include <decaf/io/DataOutputStream.h>
+#include <decaf/io/IOException.h>
+#include <decaf/io/ByteArrayOutputStream.h>
+#include <decaf/io/ByteArrayInputStream.h>
+#include <decaf/util/Properties.h>
+#include <decaf/lang/Pointer.h>
+//
+// NOTE!: This file is autogenerated - do not modify!
+// if you need to make a change, please see the Java Classes in the
+// activemq-core module
+//
+
+using namespace std;
+using namespace activemq;
+using namespace activemq::util;
+using namespace activemq::exceptions;
+using namespace activemq::commands;
+using namespace activemq::wireformat;
+using namespace activemq::wireformat::openwire;
+using namespace activemq::wireformat::openwire::marshal;
+using namespace activemq::wireformat::openwire::utils;
+using namespace activemq::wireformat::openwire::marshal::universal;
+using namespace decaf::io;
+using namespace decaf::lang;
+using namespace decaf::util;
+
+///////////////////////////////////////////////////////////////////////////////
+void ProducerInfoMarshallerTest::test() {
+
+ ProducerInfoMarshaller myMarshaller;
+ ProducerInfo myCommand;
+ ProducerInfo* myCommand2;
+
+ CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() );
+ myCommand2 = dynamic_cast<ProducerInfo*>( myMarshaller.createObject() );
+ CPPUNIT_ASSERT( myCommand2 != NULL );
+ delete myCommand2;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void ProducerInfoMarshallerTest::testLooseMarshal() {
+
+ ProducerInfoMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( false );
+
+ ProducerInfo outCommand;
+ ProducerInfo inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ marshaller.looseUnmarshal( &openWireFormat, &inCommand, &dataIn );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void ProducerInfoMarshallerTest::testTightMarshal() {
+
+ ProducerInfoMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( true );
+
+ ProducerInfo outCommand;
+ ProducerInfo inCommand;
+
+ try {
+
+ // Marshal the dataStructure to a byte array.
+ ByteArrayOutputStream baos;
+ DataOutputStream dataOut( &baos );
+ // Phase 1 - count the size
+ int size = 1;
+ BooleanStream bs;
+ size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs );
+ size += bs.marshalledSize();
+ // Phase 2 - marshal
+ dataOut.writeByte( outCommand.getDataStructureType() );
+ bs.marshal( &dataOut );
+ marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs );
+
+ // Now read it back in and make sure it's all right.
+ std::pair<const unsigned char*, int> array = baos.toByteArray();
+ ByteArrayInputStream bais( array.first, array.second, true );
+ DataInputStream dataIn( &bais );
+
+ unsigned char dataType = dataIn.readByte();
+ CPPUNIT_ASSERT( dataType == outCommand.getDataStructureType() );
+ bs.clear();
+ bs.unmarshal( &dataIn );
+ marshaller.tightUnmarshal( &openWireFormat, &inCommand, &dataIn, &bs );
+
+ CPPUNIT_ASSERT( inCommand.equals( &outCommand ) == true );
+
+ } catch( ActiveMQException& e ) {
+ e.printStackTrace();
+ CPPUNIT_ASSERT( false );
+ } catch( ... ) {
+ CPPUNIT_ASSERT( false );
+ }
+}
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerInfoMarshallerTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerInfoMarshallerTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerInfoMarshallerTest.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerInfoMarshallerTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerInfoMarshallerTest.h Tue Jun 15 21:54:15 2010
@@ -0,0 +1,66 @@
+/*
+ * 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_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_PRODUCERINFOMARSHALLERTEST_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_PRODUCERINFOMARSHALLERTEST_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace activemq{
+namespace wireformat{
+namespace openwire{
+namespace marshal{
+namespace universal{
+
+ /**
+ * Marshalling Test code for Open Wire Format for ProducerInfoMarshallerTest
+ *
+ * NOTE!: This file is autogenerated - do not modify!
+ * if you need to make a change, please see the Java Classes
+ * in the activemq-openwire-generator module
+ */
+ class ProducerInfoMarshallerTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( ProducerInfoMarshallerTest );
+ CPPUNIT_TEST( test );
+ CPPUNIT_TEST( testLooseMarshal );
+ CPPUNIT_TEST( testTightMarshal );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ ProducerInfoMarshallerTest() {}
+ virtual ~ProducerInfoMarshallerTest() {}
+
+ /**
+ * Test the marshaller and its marshalled type.
+ */
+ virtual void test();
+ virtual void testLooseMarshal();
+ virtual void testTightMarshal();
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_PRODUCERINFOMARSHALLERTEST_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ProducerInfoMarshallerTest.h
------------------------------------------------------------------------------
svn:eol-style = native