Added:
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshallerTest.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshallerTest.cpp?rev=797633&view=auto
==============================================================================
---
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshallerTest.cpp
(added)
+++
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshallerTest.cpp
Fri Jul 24 20:09:31 2009
@@ -0,0 +1,154 @@
+/*
+ * 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/v5/XATransactionIdMarshallerTest.h>
+
+#include <activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshaller.h>
+#include <activemq/commands/XATransactionId.h>
+
+CPPUNIT_TEST_SUITE_REGISTRATION(
activemq::wireformat::openwire::marshal::v5::XATransactionIdMarshallerTest );
+
+#include <activemq/wireformat/openwire/OpenWireFormat.h>
+#include <activemq/commands/DataStructure.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>
+//
+// 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::v5;
+using namespace decaf::io;
+using namespace decaf::lang;
+using namespace decaf::util;
+
+///////////////////////////////////////////////////////////////////////////////
+void XATransactionIdMarshallerTest::test() {
+
+ XATransactionIdMarshaller myMarshaller;
+ XATransactionId myCommand;
+ XATransactionId* myCommand2;
+
+ CPPUNIT_ASSERT( myMarshaller.getDataStructureType() ==
myCommand.getDataStructureType() );
+ myCommand2 = dynamic_cast<XATransactionId*>( myMarshaller.createObject() );
+ CPPUNIT_ASSERT( myCommand2 != NULL );
+ delete myCommand2;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void XATransactionIdMarshallerTest::testLooseMarshal() {
+
+ XATransactionIdMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 5 );
+ openWireFormat.setTightEncodingEnabled( false );
+
+ XATransactionId outCommand;
+ XATransactionId 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.
+ ByteArrayInputStream bais( baos.toByteArray(), baos.size() );
+ 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 XATransactionIdMarshallerTest::testTightMarshal() {
+
+ XATransactionIdMarshaller marshaller;
+ Properties props;
+ OpenWireFormat openWireFormat( props );
+
+ // Configure for this test.
+ openWireFormat.setVersion( 5 );
+ openWireFormat.setTightEncodingEnabled( true );
+
+ XATransactionId outCommand;
+ XATransactionId 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.
+ ByteArrayInputStream bais( baos.toByteArray(), baos.size() );
+ 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/v5/XATransactionIdMarshallerTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added:
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshallerTest.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshallerTest.h?rev=797633&view=auto
==============================================================================
---
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshallerTest.h
(added)
+++
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshallerTest.h
Fri Jul 24 20:09:31 2009
@@ -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_V5_XATRANSACTIONIDMARSHALLERTEST_H_
+#define
_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_V5_XATRANSACTIONIDMARSHALLERTEST_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 v5{
+
+ /**
+ * Marshalling Test code for Open Wire Format for
XATransactionIdMarshallerTest
+ *
+ * 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 XATransactionIdMarshallerTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( XATransactionIdMarshallerTest );
+ CPPUNIT_TEST( test );
+ CPPUNIT_TEST( testLooseMarshal );
+ CPPUNIT_TEST( testTightMarshal );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ XATransactionIdMarshallerTest() {}
+ virtual ~XATransactionIdMarshallerTest() {}
+
+ /**
+ * Test the marshaller and its marshalled type.
+ */
+ virtual void test();
+ virtual void testLooseMarshal();
+ virtual void testTightMarshal();
+
+ };
+
+}}}}}
+
+#endif
/*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_V5_XATRANSACTIONIDMARSHALLERTEST_H_*/
Propchange:
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshallerTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added:
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/v5/srcmakefile.mk
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/v5/srcmakefile.mk?rev=797633&view=auto
==============================================================================
---
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/v5/srcmakefile.mk
(added)
+++
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/v5/srcmakefile.mk
Fri Jul 24 20:09:31 2009
@@ -0,0 +1,132 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+cc_sources += \
+
activemq/wireformat/openwire/marshal/v5/ActiveMQBlobMessageMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/ActiveMQBytesMessageMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/ActiveMQMapMessageMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/ActiveMQMessageMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/ActiveMQObjectMessageMarshallerTest.cpp
\
+ activemq/wireformat/openwire/marshal/v5/ActiveMQQueueMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/ActiveMQStreamMessageMarshallerTest.cpp
\
+
activemq/wireformat/openwire/marshal/v5/ActiveMQTempQueueMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/ActiveMQTempTopicMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/ActiveMQTextMessageMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/ActiveMQTopicMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/BrokerIdMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/BrokerInfoMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/ConnectionControlMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/ConnectionErrorMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/ConnectionIdMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/ConnectionInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/ConsumerControlMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/ConsumerIdMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/ConsumerInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/ControlCommandMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/DataArrayResponseMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/DataResponseMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/DestinationInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/DiscoveryEventMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/ExceptionResponseMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/FlushCommandMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/IntegerResponseMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/JournalQueueAckMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/JournalTopicAckMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/JournalTraceMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/JournalTransactionMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/KeepAliveInfoMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/LastPartialCommandMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/LocalTransactionIdMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/MessageAckMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/MessageDispatchMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/MessageDispatchNotificationMarshallerTest.cpp
\
+ activemq/wireformat/openwire/marshal/v5/MessageIdMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/MessagePullMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/NetworkBridgeFilterMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/PartialCommandMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/ProducerAckMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/ProducerIdMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/ProducerInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/RemoveInfoMarshallerTest.cpp \
+
activemq/wireformat/openwire/marshal/v5/RemoveSubscriptionInfoMarshallerTest.cpp
\
+ activemq/wireformat/openwire/marshal/v5/ReplayCommandMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/ResponseMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/SessionIdMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/SessionInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/ShutdownInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/SubscriptionInfoMarshallerTest.cpp
\
+ activemq/wireformat/openwire/marshal/v5/TransactionInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/WireFormatInfoMarshallerTest.cpp \
+ activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshallerTest.cpp
+
+h_sources += \
+
activemq/wireformat/openwire/marshal/v5/ActiveMQBlobMessageMarshallerTest.h \
+
activemq/wireformat/openwire/marshal/v5/ActiveMQBytesMessageMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ActiveMQMapMessageMarshallerTest.h
\
+ activemq/wireformat/openwire/marshal/v5/ActiveMQMessageMarshallerTest.h \
+
activemq/wireformat/openwire/marshal/v5/ActiveMQObjectMessageMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ActiveMQQueueMarshallerTest.h \
+
activemq/wireformat/openwire/marshal/v5/ActiveMQStreamMessageMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ActiveMQTempQueueMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ActiveMQTempTopicMarshallerTest.h \
+
activemq/wireformat/openwire/marshal/v5/ActiveMQTextMessageMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ActiveMQTopicMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/BrokerIdMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/BrokerInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ConnectionControlMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ConnectionErrorMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ConnectionIdMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ConnectionInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ConsumerControlMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ConsumerIdMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ConsumerInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ControlCommandMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/DataArrayResponseMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/DataResponseMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/DestinationInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/DiscoveryEventMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ExceptionResponseMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/FlushCommandMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/IntegerResponseMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/JournalQueueAckMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/JournalTopicAckMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/JournalTraceMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/JournalTransactionMarshallerTest.h
\
+ activemq/wireformat/openwire/marshal/v5/KeepAliveInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/LastPartialCommandMarshallerTest.h
\
+ activemq/wireformat/openwire/marshal/v5/LocalTransactionIdMarshallerTest.h
\
+ activemq/wireformat/openwire/marshal/v5/MessageAckMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/MessageDispatchMarshallerTest.h \
+
activemq/wireformat/openwire/marshal/v5/MessageDispatchNotificationMarshallerTest.h
\
+ activemq/wireformat/openwire/marshal/v5/MessageIdMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/MessagePullMarshallerTest.h \
+
activemq/wireformat/openwire/marshal/v5/NetworkBridgeFilterMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/PartialCommandMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ProducerAckMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ProducerIdMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ProducerInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/RemoveInfoMarshallerTest.h \
+
activemq/wireformat/openwire/marshal/v5/RemoveSubscriptionInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ReplayCommandMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ResponseMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/SessionIdMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/SessionInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/ShutdownInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/SubscriptionInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/TransactionInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/WireFormatInfoMarshallerTest.h \
+ activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshallerTest.h