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 [13/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/main/activemq/wireformat/openwire/marshal/universal/TransactionInfoMarshaller.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/TransactionInfoMarshaller.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/TransactionInfoMarshaller.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/TransactionInfoMarshaller.h Tue Jun 15 21:54:15 2010
@@ -0,0 +1,144 @@
+/*
+ * 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_TRANSACTIONINFOMARSHALLER_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_TRANSACTIONINFOMARSHALLER_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <activemq/wireformat/openwire/marshal/universal/BaseCommandMarshaller.h>
+
+#include <decaf/io/DataInputStream.h>
+#include <decaf/io/DataOutputStream.h>
+#include <decaf/io/IOException.h>
+#include <activemq/util/Config.h>
+#include <activemq/commands/DataStructure.h>
+#include <activemq/wireformat/openwire/OpenWireFormat.h>
+#include <activemq/wireformat/openwire/utils/BooleanStream.h>
+
+namespace activemq{
+namespace wireformat{
+namespace openwire{
+namespace marshal{
+namespace universal{
+
+ /**
+ * Marshaling code for Open Wire Format for TransactionInfoMarshaller
+ *
+ * NOTE!: This file is auto generated - do not modify!
+ * if you need to make a change, please see the Java Classes
+ * in the activemq-openwire-generator module
+ */
+ class AMQCPP_API TransactionInfoMarshaller : public BaseCommandMarshaller {
+ public:
+
+ TransactionInfoMarshaller() {}
+ virtual ~TransactionInfoMarshaller() {}
+
+ /**
+ * Creates a new instance of this marshalable type.
+ *
+ * @return new DataStructure object pointer caller owns it.
+ */
+ virtual commands::DataStructure* createObject() const;
+
+ /**
+ * Get the Data Structure Type that identifies this Marshaler
+ *
+ * @return byte holding the data structure type value
+ */
+ virtual unsigned char getDataStructureType() const;
+
+ /**
+ * Un-marshal an object instance from the data input stream.
+ *
+ * @param wireFormat - describes the wire format of the broker.
+ * @param dataStructure - Object to be un-marshaled.
+ * @param dataIn - BinaryReader that provides that data.
+ * @param bs - BooleanStream stream used to unpack bits from the wire.
+ *
+ * @throws IOException if an error occurs during the unmarshal.
+ */
+ virtual void tightUnmarshal( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ decaf::io::DataInputStream* dataIn,
+ utils::BooleanStream* bs ) throw( decaf::io::IOException );
+
+ /**
+ * Write the booleans that this object uses to a BooleanStream
+ *
+ * @param wireFormat - describes the wire format of the broker
+ * @param dataStructure - Object to be marshaled
+ * @param bs - BooleanStream stream used to pack bits from the wire.
+ * @returns int value indicating the size of the marshaled object.
+ *
+ * @throws IOException if an error occurs during the marshal.
+ */
+ virtual int tightMarshal1( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ utils::BooleanStream* bs ) throw( decaf::io::IOException );
+
+ /**
+ * Write a object instance to data output stream
+ *
+ * @param wireFormat - describes the wire format of the broker
+ * @param dataStructure - Object to be marshaled
+ * @param dataOut - BinaryReader that provides that data sink
+ * @param bs - BooleanStream stream used to pack bits from the wire.
+ *
+ * @throws IOException if an error occurs during the marshal.
+ */
+ virtual void tightMarshal2( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ decaf::io::DataOutputStream* dataOut,
+ utils::BooleanStream* bs ) throw( decaf::io::IOException );
+
+ /**
+ * Un-marshal an object instance from the data input stream
+ *
+ * @param wireFormat - describes the wire format of the broker
+ * @param dataStructure - Object to be marshaled
+ * @param dataIn - BinaryReader that provides that data source
+ *
+ * @throws IOException if an error occurs during the unmarshal.
+ */
+ virtual void looseUnmarshal( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ decaf::io::DataInputStream* dataIn ) throw( decaf::io::IOException );
+
+ /**
+ * Write a object instance to data output stream
+ *
+ * @param wireFormat - describs the wire format of the broker
+ * @param dataStructure - Object to be marshaled
+ * @param dataOut - BinaryWriter that provides that data sink
+ *
+ * @throws IOException if an error occurs during the marshal.
+ */
+ virtual void looseMarshal( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ decaf::io::DataOutputStream* dataOut ) throw( decaf::io::IOException );
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_TRANSACTIONINFOMARSHALLER_H_*/
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/TransactionInfoMarshaller.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/WireFormatInfoMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/WireFormatInfoMarshaller.cpp?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/WireFormatInfoMarshaller.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/WireFormatInfoMarshaller.cpp Tue Jun 15 21:54:15 2010
@@ -0,0 +1,158 @@
+/*
+ * 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/WireFormatInfoMarshaller.h>
+
+#include <activemq/commands/WireFormatInfo.h>
+#include <activemq/exceptions/ActiveMQException.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::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;
+using namespace decaf::io;
+using namespace decaf::lang;
+
+///////////////////////////////////////////////////////////////////////////////
+DataStructure* WireFormatInfoMarshaller::createObject() const {
+ return new WireFormatInfo();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+unsigned char WireFormatInfoMarshaller::getDataStructureType() const {
+ return WireFormatInfo::ID_WIREFORMATINFO;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void WireFormatInfoMarshaller::tightUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn, BooleanStream* bs ) throw( decaf::io::IOException ) {
+
+ try {
+
+ BaseDataStreamMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+
+ WireFormatInfo* info =
+ dynamic_cast<WireFormatInfo*>( dataStructure );
+ info->beforeUnmarshal( wireFormat );
+
+ info->setMagic( tightUnmarshalConstByteArray( dataIn, bs, 8 ) );
+ info->setVersion( dataIn->readInt() );
+ info->setMarshalledProperties( tightUnmarshalByteArray( dataIn, bs ) );
+
+ info->afterUnmarshal( wireFormat );
+ }
+ AMQ_CATCH_RETHROW( decaf::io::IOException )
+ AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
+ AMQ_CATCHALL_THROW( decaf::io::IOException )
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int WireFormatInfoMarshaller::tightMarshal1( OpenWireFormat* wireFormat, DataStructure* dataStructure, BooleanStream* bs ) throw( decaf::io::IOException ) {
+
+ try {
+
+ WireFormatInfo* info =
+ dynamic_cast<WireFormatInfo*>( dataStructure );
+
+ info->beforeMarshal( wireFormat );
+ int rc = BaseDataStreamMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
+ bs->writeBoolean( info->getMarshalledProperties().size() != 0 );
+ rc += info->getMarshalledProperties().size() == 0 ? 0 : (int)info->getMarshalledProperties().size() + 4;
+
+ return rc + 12;
+ }
+ AMQ_CATCH_RETHROW( decaf::io::IOException )
+ AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
+ AMQ_CATCHALL_THROW( decaf::io::IOException )
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void WireFormatInfoMarshaller::tightMarshal2( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut, BooleanStream* bs ) throw( decaf::io::IOException ) {
+
+ try {
+
+ BaseDataStreamMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+
+ WireFormatInfo* info =
+ dynamic_cast<WireFormatInfo*>( dataStructure );
+ dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 8, 0, 8 );
+ dataOut->writeInt( info->getVersion() );
+ if( bs->readBoolean() ) {
+ dataOut->writeInt( (int)info->getMarshalledProperties().size() );
+ dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), (int)info->getMarshalledProperties().size(), 0, (int)info->getMarshalledProperties().size() );
+ }
+ info->afterMarshal( wireFormat );
+ }
+ AMQ_CATCH_RETHROW( decaf::io::IOException )
+ AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
+ AMQ_CATCHALL_THROW( decaf::io::IOException )
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void WireFormatInfoMarshaller::looseUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn ) throw( decaf::io::IOException ) {
+
+ try {
+
+ BaseDataStreamMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
+ WireFormatInfo* info =
+ dynamic_cast<WireFormatInfo*>( dataStructure );
+ info->beforeUnmarshal( wireFormat );
+ info->setMagic( looseUnmarshalConstByteArray( dataIn, 8 ) );
+ info->setVersion( dataIn->readInt() );
+ info->setMarshalledProperties( looseUnmarshalByteArray( dataIn ) );
+ info->afterUnmarshal( wireFormat );
+ }
+ AMQ_CATCH_RETHROW( decaf::io::IOException )
+ AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
+ AMQ_CATCHALL_THROW( decaf::io::IOException )
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void WireFormatInfoMarshaller::looseMarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut ) throw( decaf::io::IOException ) {
+
+ try {
+
+ WireFormatInfo* info =
+ dynamic_cast<WireFormatInfo*>( dataStructure );
+ info->beforeMarshal( wireFormat );
+ BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
+ dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 8, 0, 8 );
+ dataOut->writeInt( info->getVersion() );
+ dataOut->write( info->getMarshalledProperties().size() != 0 );
+ if( info->getMarshalledProperties().size() != 0 ) {
+ dataOut->writeInt( (int)info->getMarshalledProperties().size() );
+ dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), (int)info->getMarshalledProperties().size(), 0, (int)info->getMarshalledProperties().size() );
+ }
+ info->afterMarshal( wireFormat );
+ }
+ AMQ_CATCH_RETHROW( decaf::io::IOException )
+ AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
+ AMQ_CATCHALL_THROW( decaf::io::IOException )
+}
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/WireFormatInfoMarshaller.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/WireFormatInfoMarshaller.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/WireFormatInfoMarshaller.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/WireFormatInfoMarshaller.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/WireFormatInfoMarshaller.h Tue Jun 15 21:54:15 2010
@@ -0,0 +1,144 @@
+/*
+ * 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_WIREFORMATINFOMARSHALLER_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_WIREFORMATINFOMARSHALLER_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.h>
+
+#include <decaf/io/DataInputStream.h>
+#include <decaf/io/DataOutputStream.h>
+#include <decaf/io/IOException.h>
+#include <activemq/util/Config.h>
+#include <activemq/commands/DataStructure.h>
+#include <activemq/wireformat/openwire/OpenWireFormat.h>
+#include <activemq/wireformat/openwire/utils/BooleanStream.h>
+
+namespace activemq{
+namespace wireformat{
+namespace openwire{
+namespace marshal{
+namespace universal{
+
+ /**
+ * Marshaling code for Open Wire Format for WireFormatInfoMarshaller
+ *
+ * NOTE!: This file is auto generated - do not modify!
+ * if you need to make a change, please see the Java Classes
+ * in the activemq-openwire-generator module
+ */
+ class AMQCPP_API WireFormatInfoMarshaller : public BaseDataStreamMarshaller {
+ public:
+
+ WireFormatInfoMarshaller() {}
+ virtual ~WireFormatInfoMarshaller() {}
+
+ /**
+ * Creates a new instance of this marshalable type.
+ *
+ * @return new DataStructure object pointer caller owns it.
+ */
+ virtual commands::DataStructure* createObject() const;
+
+ /**
+ * Get the Data Structure Type that identifies this Marshaler
+ *
+ * @return byte holding the data structure type value
+ */
+ virtual unsigned char getDataStructureType() const;
+
+ /**
+ * Un-marshal an object instance from the data input stream.
+ *
+ * @param wireFormat - describes the wire format of the broker.
+ * @param dataStructure - Object to be un-marshaled.
+ * @param dataIn - BinaryReader that provides that data.
+ * @param bs - BooleanStream stream used to unpack bits from the wire.
+ *
+ * @throws IOException if an error occurs during the unmarshal.
+ */
+ virtual void tightUnmarshal( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ decaf::io::DataInputStream* dataIn,
+ utils::BooleanStream* bs ) throw( decaf::io::IOException );
+
+ /**
+ * Write the booleans that this object uses to a BooleanStream
+ *
+ * @param wireFormat - describes the wire format of the broker
+ * @param dataStructure - Object to be marshaled
+ * @param bs - BooleanStream stream used to pack bits from the wire.
+ * @returns int value indicating the size of the marshaled object.
+ *
+ * @throws IOException if an error occurs during the marshal.
+ */
+ virtual int tightMarshal1( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ utils::BooleanStream* bs ) throw( decaf::io::IOException );
+
+ /**
+ * Write a object instance to data output stream
+ *
+ * @param wireFormat - describes the wire format of the broker
+ * @param dataStructure - Object to be marshaled
+ * @param dataOut - BinaryReader that provides that data sink
+ * @param bs - BooleanStream stream used to pack bits from the wire.
+ *
+ * @throws IOException if an error occurs during the marshal.
+ */
+ virtual void tightMarshal2( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ decaf::io::DataOutputStream* dataOut,
+ utils::BooleanStream* bs ) throw( decaf::io::IOException );
+
+ /**
+ * Un-marshal an object instance from the data input stream
+ *
+ * @param wireFormat - describes the wire format of the broker
+ * @param dataStructure - Object to be marshaled
+ * @param dataIn - BinaryReader that provides that data source
+ *
+ * @throws IOException if an error occurs during the unmarshal.
+ */
+ virtual void looseUnmarshal( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ decaf::io::DataInputStream* dataIn ) throw( decaf::io::IOException );
+
+ /**
+ * Write a object instance to data output stream
+ *
+ * @param wireFormat - describs the wire format of the broker
+ * @param dataStructure - Object to be marshaled
+ * @param dataOut - BinaryWriter that provides that data sink
+ *
+ * @throws IOException if an error occurs during the marshal.
+ */
+ virtual void looseMarshal( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ decaf::io::DataOutputStream* dataOut ) throw( decaf::io::IOException );
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_WIREFORMATINFOMARSHALLER_H_*/
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/WireFormatInfoMarshaller.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/XATransactionIdMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/XATransactionIdMarshaller.cpp?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/XATransactionIdMarshaller.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/XATransactionIdMarshaller.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/XATransactionIdMarshaller.h>
+
+#include <activemq/commands/XATransactionId.h>
+#include <activemq/exceptions/ActiveMQException.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::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;
+using namespace decaf::io;
+using namespace decaf::lang;
+
+///////////////////////////////////////////////////////////////////////////////
+DataStructure* XATransactionIdMarshaller::createObject() const {
+ return new XATransactionId();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+unsigned char XATransactionIdMarshaller::getDataStructureType() const {
+ return XATransactionId::ID_XATRANSACTIONID;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void XATransactionIdMarshaller::tightUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn, BooleanStream* bs ) throw( decaf::io::IOException ) {
+
+ try {
+
+ TransactionIdMarshaller::tightUnmarshal( wireFormat, dataStructure, dataIn, bs );
+
+ XATransactionId* info =
+ dynamic_cast<XATransactionId*>( dataStructure );
+ info->setFormatId( dataIn->readInt() );
+ info->setGlobalTransactionId( tightUnmarshalByteArray( dataIn, bs ) );
+ info->setBranchQualifier( tightUnmarshalByteArray( dataIn, bs ) );
+ }
+ AMQ_CATCH_RETHROW( decaf::io::IOException )
+ AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
+ AMQ_CATCHALL_THROW( decaf::io::IOException )
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int XATransactionIdMarshaller::tightMarshal1( OpenWireFormat* wireFormat, DataStructure* dataStructure, BooleanStream* bs ) throw( decaf::io::IOException ) {
+
+ try {
+
+ XATransactionId* info =
+ dynamic_cast<XATransactionId*>( dataStructure );
+
+ int rc = TransactionIdMarshaller::tightMarshal1( wireFormat, dataStructure, bs );
+ bs->writeBoolean( info->getGlobalTransactionId().size() != 0 );
+ rc += info->getGlobalTransactionId().size() == 0 ? 0 : (int)info->getGlobalTransactionId().size() + 4;
+ bs->writeBoolean( info->getBranchQualifier().size() != 0 );
+ rc += info->getBranchQualifier().size() == 0 ? 0 : (int)info->getBranchQualifier().size() + 4;
+
+ return rc + 4;
+ }
+ AMQ_CATCH_RETHROW( decaf::io::IOException )
+ AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
+ AMQ_CATCHALL_THROW( decaf::io::IOException )
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void XATransactionIdMarshaller::tightMarshal2( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut, BooleanStream* bs ) throw( decaf::io::IOException ) {
+
+ try {
+
+ TransactionIdMarshaller::tightMarshal2( wireFormat, dataStructure, dataOut, bs );
+
+ XATransactionId* info =
+ dynamic_cast<XATransactionId*>( dataStructure );
+ dataOut->writeInt( info->getFormatId() );
+ if( bs->readBoolean() ) {
+ dataOut->writeInt( (int)info->getGlobalTransactionId().size() );
+ dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), (int)info->getGlobalTransactionId().size(), 0, (int)info->getGlobalTransactionId().size() );
+ }
+ if( bs->readBoolean() ) {
+ dataOut->writeInt( (int)info->getBranchQualifier().size() );
+ dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), (int)info->getBranchQualifier().size(), 0, (int)info->getBranchQualifier().size() );
+ }
+ }
+ AMQ_CATCH_RETHROW( decaf::io::IOException )
+ AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
+ AMQ_CATCHALL_THROW( decaf::io::IOException )
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void XATransactionIdMarshaller::looseUnmarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataInputStream* dataIn ) throw( decaf::io::IOException ) {
+
+ try {
+
+ TransactionIdMarshaller::looseUnmarshal( wireFormat, dataStructure, dataIn );
+ XATransactionId* info =
+ dynamic_cast<XATransactionId*>( dataStructure );
+ info->setFormatId( dataIn->readInt() );
+ info->setGlobalTransactionId( looseUnmarshalByteArray( dataIn ) );
+ info->setBranchQualifier( looseUnmarshalByteArray( dataIn ) );
+ }
+ AMQ_CATCH_RETHROW( decaf::io::IOException )
+ AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
+ AMQ_CATCHALL_THROW( decaf::io::IOException )
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void XATransactionIdMarshaller::looseMarshal( OpenWireFormat* wireFormat, DataStructure* dataStructure, DataOutputStream* dataOut ) throw( decaf::io::IOException ) {
+
+ try {
+
+ XATransactionId* info =
+ dynamic_cast<XATransactionId*>( dataStructure );
+ TransactionIdMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
+ dataOut->writeInt( info->getFormatId() );
+ dataOut->write( info->getGlobalTransactionId().size() != 0 );
+ if( info->getGlobalTransactionId().size() != 0 ) {
+ dataOut->writeInt( (int)info->getGlobalTransactionId().size() );
+ dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), (int)info->getGlobalTransactionId().size(), 0, (int)info->getGlobalTransactionId().size() );
+ }
+ dataOut->write( info->getBranchQualifier().size() != 0 );
+ if( info->getBranchQualifier().size() != 0 ) {
+ dataOut->writeInt( (int)info->getBranchQualifier().size() );
+ dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), (int)info->getBranchQualifier().size(), 0, (int)info->getBranchQualifier().size() );
+ }
+ }
+ AMQ_CATCH_RETHROW( decaf::io::IOException )
+ AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
+ AMQ_CATCHALL_THROW( decaf::io::IOException )
+}
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/XATransactionIdMarshaller.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/XATransactionIdMarshaller.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/XATransactionIdMarshaller.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/XATransactionIdMarshaller.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/XATransactionIdMarshaller.h Tue Jun 15 21:54:15 2010
@@ -0,0 +1,144 @@
+/*
+ * 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_XATRANSACTIONIDMARSHALLER_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_XATRANSACTIONIDMARSHALLER_H_
+
+// Turn off warning message for ignored exception specification
+#ifdef _MSC_VER
+#pragma warning( disable : 4290 )
+#endif
+
+#include <activemq/wireformat/openwire/marshal/universal/TransactionIdMarshaller.h>
+
+#include <decaf/io/DataInputStream.h>
+#include <decaf/io/DataOutputStream.h>
+#include <decaf/io/IOException.h>
+#include <activemq/util/Config.h>
+#include <activemq/commands/DataStructure.h>
+#include <activemq/wireformat/openwire/OpenWireFormat.h>
+#include <activemq/wireformat/openwire/utils/BooleanStream.h>
+
+namespace activemq{
+namespace wireformat{
+namespace openwire{
+namespace marshal{
+namespace universal{
+
+ /**
+ * Marshaling code for Open Wire Format for XATransactionIdMarshaller
+ *
+ * NOTE!: This file is auto generated - do not modify!
+ * if you need to make a change, please see the Java Classes
+ * in the activemq-openwire-generator module
+ */
+ class AMQCPP_API XATransactionIdMarshaller : public TransactionIdMarshaller {
+ public:
+
+ XATransactionIdMarshaller() {}
+ virtual ~XATransactionIdMarshaller() {}
+
+ /**
+ * Creates a new instance of this marshalable type.
+ *
+ * @return new DataStructure object pointer caller owns it.
+ */
+ virtual commands::DataStructure* createObject() const;
+
+ /**
+ * Get the Data Structure Type that identifies this Marshaler
+ *
+ * @return byte holding the data structure type value
+ */
+ virtual unsigned char getDataStructureType() const;
+
+ /**
+ * Un-marshal an object instance from the data input stream.
+ *
+ * @param wireFormat - describes the wire format of the broker.
+ * @param dataStructure - Object to be un-marshaled.
+ * @param dataIn - BinaryReader that provides that data.
+ * @param bs - BooleanStream stream used to unpack bits from the wire.
+ *
+ * @throws IOException if an error occurs during the unmarshal.
+ */
+ virtual void tightUnmarshal( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ decaf::io::DataInputStream* dataIn,
+ utils::BooleanStream* bs ) throw( decaf::io::IOException );
+
+ /**
+ * Write the booleans that this object uses to a BooleanStream
+ *
+ * @param wireFormat - describes the wire format of the broker
+ * @param dataStructure - Object to be marshaled
+ * @param bs - BooleanStream stream used to pack bits from the wire.
+ * @returns int value indicating the size of the marshaled object.
+ *
+ * @throws IOException if an error occurs during the marshal.
+ */
+ virtual int tightMarshal1( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ utils::BooleanStream* bs ) throw( decaf::io::IOException );
+
+ /**
+ * Write a object instance to data output stream
+ *
+ * @param wireFormat - describes the wire format of the broker
+ * @param dataStructure - Object to be marshaled
+ * @param dataOut - BinaryReader that provides that data sink
+ * @param bs - BooleanStream stream used to pack bits from the wire.
+ *
+ * @throws IOException if an error occurs during the marshal.
+ */
+ virtual void tightMarshal2( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ decaf::io::DataOutputStream* dataOut,
+ utils::BooleanStream* bs ) throw( decaf::io::IOException );
+
+ /**
+ * Un-marshal an object instance from the data input stream
+ *
+ * @param wireFormat - describes the wire format of the broker
+ * @param dataStructure - Object to be marshaled
+ * @param dataIn - BinaryReader that provides that data source
+ *
+ * @throws IOException if an error occurs during the unmarshal.
+ */
+ virtual void looseUnmarshal( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ decaf::io::DataInputStream* dataIn ) throw( decaf::io::IOException );
+
+ /**
+ * Write a object instance to data output stream
+ *
+ * @param wireFormat - describs the wire format of the broker
+ * @param dataStructure - Object to be marshaled
+ * @param dataOut - BinaryWriter that provides that data sink
+ *
+ * @throws IOException if an error occurs during the marshal.
+ */
+ virtual void looseMarshal( OpenWireFormat* wireFormat,
+ commands::DataStructure* dataStructure,
+ decaf::io::DataOutputStream* dataOut ) throw( decaf::io::IOException );
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_XATRANSACTIONIDMARSHALLER_H_*/
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/universal/XATransactionIdMarshaller.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/util/CMSProvider.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/util/CMSProvider.cpp?rev=955066&r1=955065&r2=955066&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/util/CMSProvider.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/util/CMSProvider.cpp Tue Jun 15 21:54:15 2010
@@ -23,6 +23,7 @@
#include <activemq/core/ActiveMQConnection.h>
#include <activemq/util/IntegrationCommon.h>
+#include <decaf/lang/Thread.h>
#include <decaf/util/UUID.h>
#include <decaf/lang/exceptions/IllegalStateException.h>
@@ -33,6 +34,7 @@ using namespace activemq::util;
using namespace activemq::core;
using namespace decaf;
using namespace decaf::util;
+using namespace decaf::lang;
using namespace decaf::lang::exceptions;
////////////////////////////////////////////////////////////////////////////////
@@ -220,6 +222,10 @@ void CMSProvider::unsubscribe() {
if( this->consumer.get() && this->durable && this->topic ) {
this->consumer->close();
+
+ // Wait a bit to let the broker clean out the consumer.
+ Thread::sleep( 1000 );
+
this->session->unsubscribe( this->subscription );
}
}
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=955066&r1=955065&r2=955066&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am Tue Jun 15 21:54:15 2010
@@ -65,6 +65,62 @@ cc_sources = \
activemq/wireformat/openwire/OpenWireFormatTest.cpp \
activemq/wireformat/openwire/marshal/BaseDataStreamMarshallerTest.cpp \
activemq/wireformat/openwire/marshal/PrimitiveTypesMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQBlobMessageMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQBytesMessageMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQMapMessageMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQMessageMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQObjectMessageMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQQueueMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQStreamMessageMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQTempQueueMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQTempTopicMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQTextMessageMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQTopicMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/BrokerIdMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/BrokerInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ConnectionControlMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ConnectionErrorMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ConnectionIdMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ConnectionInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ConsumerControlMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ConsumerIdMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ConsumerInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ControlCommandMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/DataArrayResponseMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/DataResponseMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/DestinationInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/DiscoveryEventMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ExceptionResponseMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/FlushCommandMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/IntegerResponseMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/JournalQueueAckMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/JournalTopicAckMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/JournalTraceMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/JournalTransactionMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/KeepAliveInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/LastPartialCommandMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/LocalTransactionIdMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/MessageAckMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/MessageDispatchMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/MessageDispatchNotificationMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/MessageIdMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/MessagePullMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/NetworkBridgeFilterMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/PartialCommandMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ProducerAckMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ProducerIdMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ProducerInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/RemoveInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/RemoveSubscriptionInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ReplayCommandMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ResponseMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/SessionIdMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/SessionInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/ShutdownInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/SubscriptionInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/TransactionInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/WireFormatInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/universal/XATransactionIdMarshallerTest.cpp \
activemq/wireformat/openwire/utils/BooleanStreamTest.cpp \
activemq/wireformat/openwire/utils/HexTableTest.cpp \
activemq/wireformat/openwire/utils/MessagePropertyInterceptorTest.cpp \
@@ -219,6 +275,62 @@ h_sources = \
activemq/wireformat/openwire/OpenWireFormatTest.h \
activemq/wireformat/openwire/marshal/BaseDataStreamMarshallerTest.h \
activemq/wireformat/openwire/marshal/PrimitiveTypesMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQBlobMessageMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQBytesMessageMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQMapMessageMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQMessageMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQObjectMessageMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQQueueMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQStreamMessageMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQTempQueueMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQTempTopicMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQTextMessageMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ActiveMQTopicMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/BrokerIdMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/BrokerInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ConnectionControlMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ConnectionErrorMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ConnectionIdMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ConnectionInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ConsumerControlMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ConsumerIdMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ConsumerInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ControlCommandMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/DataArrayResponseMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/DataResponseMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/DestinationInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/DiscoveryEventMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ExceptionResponseMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/FlushCommandMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/IntegerResponseMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/JournalQueueAckMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/JournalTopicAckMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/JournalTraceMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/JournalTransactionMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/KeepAliveInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/LastPartialCommandMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/LocalTransactionIdMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/MessageAckMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/MessageDispatchMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/MessageDispatchNotificationMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/MessageIdMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/MessagePullMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/NetworkBridgeFilterMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/PartialCommandMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ProducerAckMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ProducerIdMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ProducerInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/RemoveInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/RemoveSubscriptionInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ReplayCommandMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ResponseMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/SessionIdMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/SessionInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/ShutdownInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/SubscriptionInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/TransactionInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/WireFormatInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/universal/XATransactionIdMarshallerTest.h \
activemq/wireformat/openwire/utils/BooleanStreamTest.h \
activemq/wireformat/openwire/utils/HexTableTest.h \
activemq/wireformat/openwire/utils/MessagePropertyInterceptorTest.h \
@@ -313,12 +425,6 @@ h_sources = \
util/teamcity/TeamCityProgressListener.h
-include activemq/wireformat/openwire/marshal/v1/srcmakefile.mk
-include activemq/wireformat/openwire/marshal/v2/srcmakefile.mk
-include activemq/wireformat/openwire/marshal/v3/srcmakefile.mk
-include activemq/wireformat/openwire/marshal/v4/srcmakefile.mk
-include activemq/wireformat/openwire/marshal/v5/srcmakefile.mk
-
## Compile this as part of make check
check_PROGRAMS = activemq-test
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.maven
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.maven?rev=955066&r1=955065&r2=955066&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.maven (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.maven Tue Jun 15 21:54:15 2010
@@ -21,12 +21,6 @@ cc_sources = \
h_sources = \
${headers}
-include activemq/wireformat/openwire/marshal/v1/srcmakefile.mk
-include activemq/wireformat/openwire/marshal/v2/srcmakefile.mk
-include activemq/wireformat/openwire/marshal/v3/srcmakefile.mk
-include activemq/wireformat/openwire/marshal/v4/srcmakefile.mk
-include activemq/wireformat/openwire/marshal/v5/srcmakefile.mk
-
## Compile this as part of make check
check_PROGRAMS = activemq-test
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBlobMessageMarshallerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBlobMessageMarshallerTest.cpp?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBlobMessageMarshallerTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBlobMessageMarshallerTest.cpp Tue Jun 15 21:54:15 2010
@@ -0,0 +1,181 @@
+/*
+ * 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/ActiveMQBlobMessageMarshallerTest.h>
+
+#include <activemq/wireformat/openwire/marshal/universal/ActiveMQBlobMessageMarshaller.h>
+#include <activemq/commands/ActiveMQBlobMessage.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 ActiveMQBlobMessageMarshallerTest::test() {
+
+ ActiveMQBlobMessageMarshaller myMarshaller;
+ ActiveMQBlobMessage myCommand;
+ ActiveMQBlobMessage* myCommand2;
+
+ CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() );
+ myCommand2 = dynamic_cast<ActiveMQBlobMessage*>( myMarshaller.createObject() );
+ CPPUNIT_ASSERT( myCommand2 != NULL );
+ delete myCommand2;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void ActiveMQBlobMessageMarshallerTest::testLooseMarshal() {
+
+ ActiveMQBlobMessageMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( false );
+
+ ActiveMQBlobMessage outCommand;
+ ActiveMQBlobMessage inCommand;
+
+ Pointer<ProducerId> producerId( new ProducerId() );
+ producerId->setConnectionId( "ConnectionId" );
+ producerId->setSessionId( 123 );
+ producerId->setValue( 42 );
+
+ Pointer<MessageId> messageId( new MessageId() );
+ messageId->setBrokerSequenceId( 1 );
+ messageId->setProducerSequenceId( 3 );
+ messageId->setProducerId( producerId );
+
+ outCommand.setMessageId( messageId );
+
+ 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 ActiveMQBlobMessageMarshallerTest::testTightMarshal() {
+
+ ActiveMQBlobMessageMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( true );
+
+ ActiveMQBlobMessage outCommand;
+ ActiveMQBlobMessage inCommand;
+
+ Pointer<ProducerId> producerId( new ProducerId() );
+ producerId->setConnectionId( "ConnectionId" );
+ producerId->setSessionId( 123 );
+ producerId->setValue( 42 );
+
+ Pointer<MessageId> messageId( new MessageId() );
+ messageId->setBrokerSequenceId( 1 );
+ messageId->setProducerSequenceId( 3 );
+ messageId->setProducerId( producerId );
+
+ outCommand.setMessageId( messageId );
+
+ 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/ActiveMQBlobMessageMarshallerTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBlobMessageMarshallerTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBlobMessageMarshallerTest.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBlobMessageMarshallerTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBlobMessageMarshallerTest.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_ACTIVEMQBLOBMESSAGEMARSHALLERTEST_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_ACTIVEMQBLOBMESSAGEMARSHALLERTEST_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 ActiveMQBlobMessageMarshallerTest
+ *
+ * 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 ActiveMQBlobMessageMarshallerTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( ActiveMQBlobMessageMarshallerTest );
+ CPPUNIT_TEST( test );
+ CPPUNIT_TEST( testLooseMarshal );
+ CPPUNIT_TEST( testTightMarshal );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ ActiveMQBlobMessageMarshallerTest() {}
+ virtual ~ActiveMQBlobMessageMarshallerTest() {}
+
+ /**
+ * Test the marshaller and its marshalled type.
+ */
+ virtual void test();
+ virtual void testLooseMarshal();
+ virtual void testTightMarshal();
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_ACTIVEMQBLOBMESSAGEMARSHALLERTEST_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBlobMessageMarshallerTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBytesMessageMarshallerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBytesMessageMarshallerTest.cpp?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBytesMessageMarshallerTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBytesMessageMarshallerTest.cpp Tue Jun 15 21:54:15 2010
@@ -0,0 +1,181 @@
+/*
+ * 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/ActiveMQBytesMessageMarshallerTest.h>
+
+#include <activemq/wireformat/openwire/marshal/universal/ActiveMQBytesMessageMarshaller.h>
+#include <activemq/commands/ActiveMQBytesMessage.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 ActiveMQBytesMessageMarshallerTest::test() {
+
+ ActiveMQBytesMessageMarshaller myMarshaller;
+ ActiveMQBytesMessage myCommand;
+ ActiveMQBytesMessage* myCommand2;
+
+ CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() );
+ myCommand2 = dynamic_cast<ActiveMQBytesMessage*>( myMarshaller.createObject() );
+ CPPUNIT_ASSERT( myCommand2 != NULL );
+ delete myCommand2;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void ActiveMQBytesMessageMarshallerTest::testLooseMarshal() {
+
+ ActiveMQBytesMessageMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( false );
+
+ ActiveMQBytesMessage outCommand;
+ ActiveMQBytesMessage inCommand;
+
+ Pointer<ProducerId> producerId( new ProducerId() );
+ producerId->setConnectionId( "ConnectionId" );
+ producerId->setSessionId( 123 );
+ producerId->setValue( 42 );
+
+ Pointer<MessageId> messageId( new MessageId() );
+ messageId->setBrokerSequenceId( 1 );
+ messageId->setProducerSequenceId( 3 );
+ messageId->setProducerId( producerId );
+
+ outCommand.setMessageId( messageId );
+
+ 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 ActiveMQBytesMessageMarshallerTest::testTightMarshal() {
+
+ ActiveMQBytesMessageMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( true );
+
+ ActiveMQBytesMessage outCommand;
+ ActiveMQBytesMessage inCommand;
+
+ Pointer<ProducerId> producerId( new ProducerId() );
+ producerId->setConnectionId( "ConnectionId" );
+ producerId->setSessionId( 123 );
+ producerId->setValue( 42 );
+
+ Pointer<MessageId> messageId( new MessageId() );
+ messageId->setBrokerSequenceId( 1 );
+ messageId->setProducerSequenceId( 3 );
+ messageId->setProducerId( producerId );
+
+ outCommand.setMessageId( messageId );
+
+ 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/ActiveMQBytesMessageMarshallerTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBytesMessageMarshallerTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBytesMessageMarshallerTest.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBytesMessageMarshallerTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBytesMessageMarshallerTest.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_ACTIVEMQBYTESMESSAGEMARSHALLERTEST_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_ACTIVEMQBYTESMESSAGEMARSHALLERTEST_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 ActiveMQBytesMessageMarshallerTest
+ *
+ * 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 ActiveMQBytesMessageMarshallerTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( ActiveMQBytesMessageMarshallerTest );
+ CPPUNIT_TEST( test );
+ CPPUNIT_TEST( testLooseMarshal );
+ CPPUNIT_TEST( testTightMarshal );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ ActiveMQBytesMessageMarshallerTest() {}
+ virtual ~ActiveMQBytesMessageMarshallerTest() {}
+
+ /**
+ * Test the marshaller and its marshalled type.
+ */
+ virtual void test();
+ virtual void testLooseMarshal();
+ virtual void testTightMarshal();
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_ACTIVEMQBYTESMESSAGEMARSHALLERTEST_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQBytesMessageMarshallerTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQMapMessageMarshallerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQMapMessageMarshallerTest.cpp?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQMapMessageMarshallerTest.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQMapMessageMarshallerTest.cpp Tue Jun 15 21:54:15 2010
@@ -0,0 +1,181 @@
+/*
+ * 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/ActiveMQMapMessageMarshallerTest.h>
+
+#include <activemq/wireformat/openwire/marshal/universal/ActiveMQMapMessageMarshaller.h>
+#include <activemq/commands/ActiveMQMapMessage.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 ActiveMQMapMessageMarshallerTest::test() {
+
+ ActiveMQMapMessageMarshaller myMarshaller;
+ ActiveMQMapMessage myCommand;
+ ActiveMQMapMessage* myCommand2;
+
+ CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() );
+ myCommand2 = dynamic_cast<ActiveMQMapMessage*>( myMarshaller.createObject() );
+ CPPUNIT_ASSERT( myCommand2 != NULL );
+ delete myCommand2;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void ActiveMQMapMessageMarshallerTest::testLooseMarshal() {
+
+ ActiveMQMapMessageMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( false );
+
+ ActiveMQMapMessage outCommand;
+ ActiveMQMapMessage inCommand;
+
+ Pointer<ProducerId> producerId( new ProducerId() );
+ producerId->setConnectionId( "ConnectionId" );
+ producerId->setSessionId( 123 );
+ producerId->setValue( 42 );
+
+ Pointer<MessageId> messageId( new MessageId() );
+ messageId->setBrokerSequenceId( 1 );
+ messageId->setProducerSequenceId( 3 );
+ messageId->setProducerId( producerId );
+
+ outCommand.setMessageId( messageId );
+
+ 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 ActiveMQMapMessageMarshallerTest::testTightMarshal() {
+
+ ActiveMQMapMessageMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 6 );
+ openWireFormat.setTightEncodingEnabled( true );
+
+ ActiveMQMapMessage outCommand;
+ ActiveMQMapMessage inCommand;
+
+ Pointer<ProducerId> producerId( new ProducerId() );
+ producerId->setConnectionId( "ConnectionId" );
+ producerId->setSessionId( 123 );
+ producerId->setValue( 42 );
+
+ Pointer<MessageId> messageId( new MessageId() );
+ messageId->setBrokerSequenceId( 1 );
+ messageId->setProducerSequenceId( 3 );
+ messageId->setProducerId( producerId );
+
+ outCommand.setMessageId( messageId );
+
+ 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/ActiveMQMapMessageMarshallerTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQMapMessageMarshallerTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQMapMessageMarshallerTest.h?rev=955066&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQMapMessageMarshallerTest.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQMapMessageMarshallerTest.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_ACTIVEMQMAPMESSAGEMARSHALLERTEST_H_
+#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_ACTIVEMQMAPMESSAGEMARSHALLERTEST_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 ActiveMQMapMessageMarshallerTest
+ *
+ * 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 ActiveMQMapMessageMarshallerTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( ActiveMQMapMessageMarshallerTest );
+ CPPUNIT_TEST( test );
+ CPPUNIT_TEST( testLooseMarshal );
+ CPPUNIT_TEST( testTightMarshal );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ ActiveMQMapMessageMarshallerTest() {}
+ virtual ~ActiveMQMapMessageMarshallerTest() {}
+
+ /**
+ * Test the marshaller and its marshalled type.
+ */
+ virtual void test();
+ virtual void testLooseMarshal();
+ virtual void testTightMarshal();
+
+ };
+
+}}}}}
+
+#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_UNIVERSAL_ACTIVEMQMAPMESSAGEMARSHALLERTEST_H_*/
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/universal/ActiveMQMapMessageMarshallerTest.h
------------------------------------------------------------------------------
svn:eol-style = native