Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 98431 invoked from network); 16 Jun 2010 14:18:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Jun 2010 14:18:59 -0000 Received: (qmail 96695 invoked by uid 500); 16 Jun 2010 14:18:59 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 96676 invoked by uid 500); 16 Jun 2010 14:18:59 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 96669 invoked by uid 99); 16 Jun 2010 14:18:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jun 2010 14:18:59 +0000 X-ASF-Spam-Status: No, hits=-1463.6 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jun 2010 14:18:52 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6F9BF2388BBD; Wed, 16 Jun 2010 14:17:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r955237 [16/19] - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/ main/activemq/wireformat/openwire/ main/activemq/wireformat/openwire/marshal/generated/ main/activemq/wireformat/openwire/marshal/universal/ test/ test/activemq/wiref... Date: Wed, 16 Jun 2010 14:17:09 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100616141713.6F9BF2388BBD@eris.apache.org> Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalQueueAckMarshallerTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalQueueAckMarshallerTest.cpp?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalQueueAckMarshallerTest.cpp (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalQueueAckMarshallerTest.cpp Wed Jun 16 14:17:04 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 + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// +// 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::generated; +using namespace decaf::io; +using namespace decaf::lang; +using namespace decaf::util; + +/////////////////////////////////////////////////////////////////////////////// +void JournalQueueAckMarshallerTest::test() { + + JournalQueueAckMarshaller myMarshaller; + JournalQueueAck myCommand; + JournalQueueAck* myCommand2; + + CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() ); + myCommand2 = dynamic_cast( myMarshaller.createObject() ); + CPPUNIT_ASSERT( myCommand2 != NULL ); + delete myCommand2; +} + +/////////////////////////////////////////////////////////////////////////////// +void JournalQueueAckMarshallerTest::testLooseMarshal() { + + JournalQueueAckMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( false ); + + JournalQueueAck outCommand; + JournalQueueAck inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + dataOut.writeByte( outCommand.getDataStructureType() ); + marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut ); + + // Now read it back in and make sure it's all right. + std::pair 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 JournalQueueAckMarshallerTest::testTightMarshal() { + + JournalQueueAckMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( true ); + + JournalQueueAck outCommand; + JournalQueueAck inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + // Phase 1 - count the size + int size = 1; + BooleanStream bs; + size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs ); + size += bs.marshalledSize(); + // Phase 2 - marshal + dataOut.writeByte( outCommand.getDataStructureType() ); + bs.marshal( &dataOut ); + marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs ); + + // Now read it back in and make sure it's all right. + std::pair 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/generated/JournalQueueAckMarshallerTest.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalQueueAckMarshallerTest.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalQueueAckMarshallerTest.h?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalQueueAckMarshallerTest.h (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalQueueAckMarshallerTest.h Wed Jun 16 14:17:04 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_GENERATED_JOURNALQUEUEACKMARSHALLERTEST_H_ +#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_JOURNALQUEUEACKMARSHALLERTEST_H_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include + +namespace activemq{ +namespace wireformat{ +namespace openwire{ +namespace marshal{ +namespace generated{ + + /** + * Marshalling Test code for Open Wire Format for JournalQueueAckMarshallerTest + * + * 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 JournalQueueAckMarshallerTest : public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE( JournalQueueAckMarshallerTest ); + CPPUNIT_TEST( test ); + CPPUNIT_TEST( testLooseMarshal ); + CPPUNIT_TEST( testTightMarshal ); + CPPUNIT_TEST_SUITE_END(); + + public: + + JournalQueueAckMarshallerTest() {} + virtual ~JournalQueueAckMarshallerTest() {} + + /** + * Test the marshaller and its marshalled type. + */ + virtual void test(); + virtual void testLooseMarshal(); + virtual void testTightMarshal(); + + }; + +}}}}} + +#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_JOURNALQUEUEACKMARSHALLERTEST_H_*/ Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalQueueAckMarshallerTest.h ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTopicAckMarshallerTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTopicAckMarshallerTest.cpp?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTopicAckMarshallerTest.cpp (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTopicAckMarshallerTest.cpp Wed Jun 16 14:17:04 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 + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// +// 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::generated; +using namespace decaf::io; +using namespace decaf::lang; +using namespace decaf::util; + +/////////////////////////////////////////////////////////////////////////////// +void JournalTopicAckMarshallerTest::test() { + + JournalTopicAckMarshaller myMarshaller; + JournalTopicAck myCommand; + JournalTopicAck* myCommand2; + + CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() ); + myCommand2 = dynamic_cast( myMarshaller.createObject() ); + CPPUNIT_ASSERT( myCommand2 != NULL ); + delete myCommand2; +} + +/////////////////////////////////////////////////////////////////////////////// +void JournalTopicAckMarshallerTest::testLooseMarshal() { + + JournalTopicAckMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( false ); + + JournalTopicAck outCommand; + JournalTopicAck inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + dataOut.writeByte( outCommand.getDataStructureType() ); + marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut ); + + // Now read it back in and make sure it's all right. + std::pair 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 JournalTopicAckMarshallerTest::testTightMarshal() { + + JournalTopicAckMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( true ); + + JournalTopicAck outCommand; + JournalTopicAck inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + // Phase 1 - count the size + int size = 1; + BooleanStream bs; + size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs ); + size += bs.marshalledSize(); + // Phase 2 - marshal + dataOut.writeByte( outCommand.getDataStructureType() ); + bs.marshal( &dataOut ); + marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs ); + + // Now read it back in and make sure it's all right. + std::pair 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/generated/JournalTopicAckMarshallerTest.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTopicAckMarshallerTest.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTopicAckMarshallerTest.h?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTopicAckMarshallerTest.h (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTopicAckMarshallerTest.h Wed Jun 16 14:17:04 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_GENERATED_JOURNALTOPICACKMARSHALLERTEST_H_ +#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_JOURNALTOPICACKMARSHALLERTEST_H_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include + +namespace activemq{ +namespace wireformat{ +namespace openwire{ +namespace marshal{ +namespace generated{ + + /** + * Marshalling Test code for Open Wire Format for JournalTopicAckMarshallerTest + * + * 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 JournalTopicAckMarshallerTest : public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE( JournalTopicAckMarshallerTest ); + CPPUNIT_TEST( test ); + CPPUNIT_TEST( testLooseMarshal ); + CPPUNIT_TEST( testTightMarshal ); + CPPUNIT_TEST_SUITE_END(); + + public: + + JournalTopicAckMarshallerTest() {} + virtual ~JournalTopicAckMarshallerTest() {} + + /** + * Test the marshaller and its marshalled type. + */ + virtual void test(); + virtual void testLooseMarshal(); + virtual void testTightMarshal(); + + }; + +}}}}} + +#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_JOURNALTOPICACKMARSHALLERTEST_H_*/ Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTopicAckMarshallerTest.h ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTraceMarshallerTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTraceMarshallerTest.cpp?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTraceMarshallerTest.cpp (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTraceMarshallerTest.cpp Wed Jun 16 14:17:04 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 + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// +// 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::generated; +using namespace decaf::io; +using namespace decaf::lang; +using namespace decaf::util; + +/////////////////////////////////////////////////////////////////////////////// +void JournalTraceMarshallerTest::test() { + + JournalTraceMarshaller myMarshaller; + JournalTrace myCommand; + JournalTrace* myCommand2; + + CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() ); + myCommand2 = dynamic_cast( myMarshaller.createObject() ); + CPPUNIT_ASSERT( myCommand2 != NULL ); + delete myCommand2; +} + +/////////////////////////////////////////////////////////////////////////////// +void JournalTraceMarshallerTest::testLooseMarshal() { + + JournalTraceMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( false ); + + JournalTrace outCommand; + JournalTrace inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + dataOut.writeByte( outCommand.getDataStructureType() ); + marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut ); + + // Now read it back in and make sure it's all right. + std::pair 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 JournalTraceMarshallerTest::testTightMarshal() { + + JournalTraceMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( true ); + + JournalTrace outCommand; + JournalTrace inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + // Phase 1 - count the size + int size = 1; + BooleanStream bs; + size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs ); + size += bs.marshalledSize(); + // Phase 2 - marshal + dataOut.writeByte( outCommand.getDataStructureType() ); + bs.marshal( &dataOut ); + marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs ); + + // Now read it back in and make sure it's all right. + std::pair 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/generated/JournalTraceMarshallerTest.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTraceMarshallerTest.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTraceMarshallerTest.h?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTraceMarshallerTest.h (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTraceMarshallerTest.h Wed Jun 16 14:17:04 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_GENERATED_JOURNALTRACEMARSHALLERTEST_H_ +#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_JOURNALTRACEMARSHALLERTEST_H_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include + +namespace activemq{ +namespace wireformat{ +namespace openwire{ +namespace marshal{ +namespace generated{ + + /** + * Marshalling Test code for Open Wire Format for JournalTraceMarshallerTest + * + * 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 JournalTraceMarshallerTest : public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE( JournalTraceMarshallerTest ); + CPPUNIT_TEST( test ); + CPPUNIT_TEST( testLooseMarshal ); + CPPUNIT_TEST( testTightMarshal ); + CPPUNIT_TEST_SUITE_END(); + + public: + + JournalTraceMarshallerTest() {} + virtual ~JournalTraceMarshallerTest() {} + + /** + * Test the marshaller and its marshalled type. + */ + virtual void test(); + virtual void testLooseMarshal(); + virtual void testTightMarshal(); + + }; + +}}}}} + +#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_JOURNALTRACEMARSHALLERTEST_H_*/ Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTraceMarshallerTest.h ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTransactionMarshallerTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTransactionMarshallerTest.cpp?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTransactionMarshallerTest.cpp (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTransactionMarshallerTest.cpp Wed Jun 16 14:17:04 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 + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// +// 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::generated; +using namespace decaf::io; +using namespace decaf::lang; +using namespace decaf::util; + +/////////////////////////////////////////////////////////////////////////////// +void JournalTransactionMarshallerTest::test() { + + JournalTransactionMarshaller myMarshaller; + JournalTransaction myCommand; + JournalTransaction* myCommand2; + + CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() ); + myCommand2 = dynamic_cast( myMarshaller.createObject() ); + CPPUNIT_ASSERT( myCommand2 != NULL ); + delete myCommand2; +} + +/////////////////////////////////////////////////////////////////////////////// +void JournalTransactionMarshallerTest::testLooseMarshal() { + + JournalTransactionMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( false ); + + JournalTransaction outCommand; + JournalTransaction inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + dataOut.writeByte( outCommand.getDataStructureType() ); + marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut ); + + // Now read it back in and make sure it's all right. + std::pair 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 JournalTransactionMarshallerTest::testTightMarshal() { + + JournalTransactionMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( true ); + + JournalTransaction outCommand; + JournalTransaction inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + // Phase 1 - count the size + int size = 1; + BooleanStream bs; + size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs ); + size += bs.marshalledSize(); + // Phase 2 - marshal + dataOut.writeByte( outCommand.getDataStructureType() ); + bs.marshal( &dataOut ); + marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs ); + + // Now read it back in and make sure it's all right. + std::pair 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/generated/JournalTransactionMarshallerTest.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTransactionMarshallerTest.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTransactionMarshallerTest.h?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTransactionMarshallerTest.h (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTransactionMarshallerTest.h Wed Jun 16 14:17:04 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_GENERATED_JOURNALTRANSACTIONMARSHALLERTEST_H_ +#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_JOURNALTRANSACTIONMARSHALLERTEST_H_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include + +namespace activemq{ +namespace wireformat{ +namespace openwire{ +namespace marshal{ +namespace generated{ + + /** + * Marshalling Test code for Open Wire Format for JournalTransactionMarshallerTest + * + * 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 JournalTransactionMarshallerTest : public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE( JournalTransactionMarshallerTest ); + CPPUNIT_TEST( test ); + CPPUNIT_TEST( testLooseMarshal ); + CPPUNIT_TEST( testTightMarshal ); + CPPUNIT_TEST_SUITE_END(); + + public: + + JournalTransactionMarshallerTest() {} + virtual ~JournalTransactionMarshallerTest() {} + + /** + * Test the marshaller and its marshalled type. + */ + virtual void test(); + virtual void testLooseMarshal(); + virtual void testTightMarshal(); + + }; + +}}}}} + +#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_JOURNALTRANSACTIONMARSHALLERTEST_H_*/ Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/JournalTransactionMarshallerTest.h ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/KeepAliveInfoMarshallerTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/KeepAliveInfoMarshallerTest.cpp?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/KeepAliveInfoMarshallerTest.cpp (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/KeepAliveInfoMarshallerTest.cpp Wed Jun 16 14:17:04 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 + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// +// 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::generated; +using namespace decaf::io; +using namespace decaf::lang; +using namespace decaf::util; + +/////////////////////////////////////////////////////////////////////////////// +void KeepAliveInfoMarshallerTest::test() { + + KeepAliveInfoMarshaller myMarshaller; + KeepAliveInfo myCommand; + KeepAliveInfo* myCommand2; + + CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() ); + myCommand2 = dynamic_cast( myMarshaller.createObject() ); + CPPUNIT_ASSERT( myCommand2 != NULL ); + delete myCommand2; +} + +/////////////////////////////////////////////////////////////////////////////// +void KeepAliveInfoMarshallerTest::testLooseMarshal() { + + KeepAliveInfoMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( false ); + + KeepAliveInfo outCommand; + KeepAliveInfo inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + dataOut.writeByte( outCommand.getDataStructureType() ); + marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut ); + + // Now read it back in and make sure it's all right. + std::pair 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 KeepAliveInfoMarshallerTest::testTightMarshal() { + + KeepAliveInfoMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( true ); + + KeepAliveInfo outCommand; + KeepAliveInfo inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + // Phase 1 - count the size + int size = 1; + BooleanStream bs; + size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs ); + size += bs.marshalledSize(); + // Phase 2 - marshal + dataOut.writeByte( outCommand.getDataStructureType() ); + bs.marshal( &dataOut ); + marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs ); + + // Now read it back in and make sure it's all right. + std::pair 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/generated/KeepAliveInfoMarshallerTest.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/KeepAliveInfoMarshallerTest.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/KeepAliveInfoMarshallerTest.h?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/KeepAliveInfoMarshallerTest.h (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/KeepAliveInfoMarshallerTest.h Wed Jun 16 14:17:04 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_GENERATED_KEEPALIVEINFOMARSHALLERTEST_H_ +#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_KEEPALIVEINFOMARSHALLERTEST_H_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include + +namespace activemq{ +namespace wireformat{ +namespace openwire{ +namespace marshal{ +namespace generated{ + + /** + * Marshalling Test code for Open Wire Format for KeepAliveInfoMarshallerTest + * + * 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 KeepAliveInfoMarshallerTest : public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE( KeepAliveInfoMarshallerTest ); + CPPUNIT_TEST( test ); + CPPUNIT_TEST( testLooseMarshal ); + CPPUNIT_TEST( testTightMarshal ); + CPPUNIT_TEST_SUITE_END(); + + public: + + KeepAliveInfoMarshallerTest() {} + virtual ~KeepAliveInfoMarshallerTest() {} + + /** + * Test the marshaller and its marshalled type. + */ + virtual void test(); + virtual void testLooseMarshal(); + virtual void testTightMarshal(); + + }; + +}}}}} + +#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_KEEPALIVEINFOMARSHALLERTEST_H_*/ Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/KeepAliveInfoMarshallerTest.h ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LastPartialCommandMarshallerTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LastPartialCommandMarshallerTest.cpp?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LastPartialCommandMarshallerTest.cpp (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LastPartialCommandMarshallerTest.cpp Wed Jun 16 14:17:04 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 + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// +// 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::generated; +using namespace decaf::io; +using namespace decaf::lang; +using namespace decaf::util; + +/////////////////////////////////////////////////////////////////////////////// +void LastPartialCommandMarshallerTest::test() { + + LastPartialCommandMarshaller myMarshaller; + LastPartialCommand myCommand; + LastPartialCommand* myCommand2; + + CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() ); + myCommand2 = dynamic_cast( myMarshaller.createObject() ); + CPPUNIT_ASSERT( myCommand2 != NULL ); + delete myCommand2; +} + +/////////////////////////////////////////////////////////////////////////////// +void LastPartialCommandMarshallerTest::testLooseMarshal() { + + LastPartialCommandMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( false ); + + LastPartialCommand outCommand; + LastPartialCommand inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + dataOut.writeByte( outCommand.getDataStructureType() ); + marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut ); + + // Now read it back in and make sure it's all right. + std::pair 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 LastPartialCommandMarshallerTest::testTightMarshal() { + + LastPartialCommandMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( true ); + + LastPartialCommand outCommand; + LastPartialCommand inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + // Phase 1 - count the size + int size = 1; + BooleanStream bs; + size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs ); + size += bs.marshalledSize(); + // Phase 2 - marshal + dataOut.writeByte( outCommand.getDataStructureType() ); + bs.marshal( &dataOut ); + marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs ); + + // Now read it back in and make sure it's all right. + std::pair 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/generated/LastPartialCommandMarshallerTest.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LastPartialCommandMarshallerTest.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LastPartialCommandMarshallerTest.h?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LastPartialCommandMarshallerTest.h (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LastPartialCommandMarshallerTest.h Wed Jun 16 14:17:04 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_GENERATED_LASTPARTIALCOMMANDMARSHALLERTEST_H_ +#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_LASTPARTIALCOMMANDMARSHALLERTEST_H_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include + +namespace activemq{ +namespace wireformat{ +namespace openwire{ +namespace marshal{ +namespace generated{ + + /** + * Marshalling Test code for Open Wire Format for LastPartialCommandMarshallerTest + * + * 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 LastPartialCommandMarshallerTest : public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE( LastPartialCommandMarshallerTest ); + CPPUNIT_TEST( test ); + CPPUNIT_TEST( testLooseMarshal ); + CPPUNIT_TEST( testTightMarshal ); + CPPUNIT_TEST_SUITE_END(); + + public: + + LastPartialCommandMarshallerTest() {} + virtual ~LastPartialCommandMarshallerTest() {} + + /** + * Test the marshaller and its marshalled type. + */ + virtual void test(); + virtual void testLooseMarshal(); + virtual void testTightMarshal(); + + }; + +}}}}} + +#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_LASTPARTIALCOMMANDMARSHALLERTEST_H_*/ Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LastPartialCommandMarshallerTest.h ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LocalTransactionIdMarshallerTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LocalTransactionIdMarshallerTest.cpp?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LocalTransactionIdMarshallerTest.cpp (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LocalTransactionIdMarshallerTest.cpp Wed Jun 16 14:17:04 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 + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// +// 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::generated; +using namespace decaf::io; +using namespace decaf::lang; +using namespace decaf::util; + +/////////////////////////////////////////////////////////////////////////////// +void LocalTransactionIdMarshallerTest::test() { + + LocalTransactionIdMarshaller myMarshaller; + LocalTransactionId myCommand; + LocalTransactionId* myCommand2; + + CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() ); + myCommand2 = dynamic_cast( myMarshaller.createObject() ); + CPPUNIT_ASSERT( myCommand2 != NULL ); + delete myCommand2; +} + +/////////////////////////////////////////////////////////////////////////////// +void LocalTransactionIdMarshallerTest::testLooseMarshal() { + + LocalTransactionIdMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( false ); + + LocalTransactionId outCommand; + LocalTransactionId inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + dataOut.writeByte( outCommand.getDataStructureType() ); + marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut ); + + // Now read it back in and make sure it's all right. + std::pair 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 LocalTransactionIdMarshallerTest::testTightMarshal() { + + LocalTransactionIdMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( true ); + + LocalTransactionId outCommand; + LocalTransactionId inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + // Phase 1 - count the size + int size = 1; + BooleanStream bs; + size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs ); + size += bs.marshalledSize(); + // Phase 2 - marshal + dataOut.writeByte( outCommand.getDataStructureType() ); + bs.marshal( &dataOut ); + marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs ); + + // Now read it back in and make sure it's all right. + std::pair 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/generated/LocalTransactionIdMarshallerTest.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LocalTransactionIdMarshallerTest.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LocalTransactionIdMarshallerTest.h?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LocalTransactionIdMarshallerTest.h (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LocalTransactionIdMarshallerTest.h Wed Jun 16 14:17:04 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_GENERATED_LOCALTRANSACTIONIDMARSHALLERTEST_H_ +#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_LOCALTRANSACTIONIDMARSHALLERTEST_H_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include + +namespace activemq{ +namespace wireformat{ +namespace openwire{ +namespace marshal{ +namespace generated{ + + /** + * Marshalling Test code for Open Wire Format for LocalTransactionIdMarshallerTest + * + * 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 LocalTransactionIdMarshallerTest : public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE( LocalTransactionIdMarshallerTest ); + CPPUNIT_TEST( test ); + CPPUNIT_TEST( testLooseMarshal ); + CPPUNIT_TEST( testTightMarshal ); + CPPUNIT_TEST_SUITE_END(); + + public: + + LocalTransactionIdMarshallerTest() {} + virtual ~LocalTransactionIdMarshallerTest() {} + + /** + * Test the marshaller and its marshalled type. + */ + virtual void test(); + virtual void testLooseMarshal(); + virtual void testTightMarshal(); + + }; + +}}}}} + +#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_LOCALTRANSACTIONIDMARSHALLERTEST_H_*/ Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/LocalTransactionIdMarshallerTest.h ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/MessageAckMarshallerTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/MessageAckMarshallerTest.cpp?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/MessageAckMarshallerTest.cpp (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/MessageAckMarshallerTest.cpp Wed Jun 16 14:17:04 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 + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// +// 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::generated; +using namespace decaf::io; +using namespace decaf::lang; +using namespace decaf::util; + +/////////////////////////////////////////////////////////////////////////////// +void MessageAckMarshallerTest::test() { + + MessageAckMarshaller myMarshaller; + MessageAck myCommand; + MessageAck* myCommand2; + + CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() ); + myCommand2 = dynamic_cast( myMarshaller.createObject() ); + CPPUNIT_ASSERT( myCommand2 != NULL ); + delete myCommand2; +} + +/////////////////////////////////////////////////////////////////////////////// +void MessageAckMarshallerTest::testLooseMarshal() { + + MessageAckMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( false ); + + MessageAck outCommand; + MessageAck inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + dataOut.writeByte( outCommand.getDataStructureType() ); + marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut ); + + // Now read it back in and make sure it's all right. + std::pair 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 MessageAckMarshallerTest::testTightMarshal() { + + MessageAckMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( true ); + + MessageAck outCommand; + MessageAck inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + // Phase 1 - count the size + int size = 1; + BooleanStream bs; + size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs ); + size += bs.marshalledSize(); + // Phase 2 - marshal + dataOut.writeByte( outCommand.getDataStructureType() ); + bs.marshal( &dataOut ); + marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs ); + + // Now read it back in and make sure it's all right. + std::pair 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/generated/MessageAckMarshallerTest.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/MessageAckMarshallerTest.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/MessageAckMarshallerTest.h?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/MessageAckMarshallerTest.h (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/MessageAckMarshallerTest.h Wed Jun 16 14:17:04 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_GENERATED_MESSAGEACKMARSHALLERTEST_H_ +#define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_MESSAGEACKMARSHALLERTEST_H_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include + +namespace activemq{ +namespace wireformat{ +namespace openwire{ +namespace marshal{ +namespace generated{ + + /** + * Marshalling Test code for Open Wire Format for MessageAckMarshallerTest + * + * 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 MessageAckMarshallerTest : public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE( MessageAckMarshallerTest ); + CPPUNIT_TEST( test ); + CPPUNIT_TEST( testLooseMarshal ); + CPPUNIT_TEST( testTightMarshal ); + CPPUNIT_TEST_SUITE_END(); + + public: + + MessageAckMarshallerTest() {} + virtual ~MessageAckMarshallerTest() {} + + /** + * Test the marshaller and its marshalled type. + */ + virtual void test(); + virtual void testLooseMarshal(); + virtual void testTightMarshal(); + + }; + +}}}}} + +#endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_MESSAGEACKMARSHALLERTEST_H_*/ Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/MessageAckMarshallerTest.h ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/MessageDispatchMarshallerTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/MessageDispatchMarshallerTest.cpp?rev=955237&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/MessageDispatchMarshallerTest.cpp (added) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/wireformat/openwire/marshal/generated/MessageDispatchMarshallerTest.cpp Wed Jun 16 14:17:04 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 + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// +// 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::generated; +using namespace decaf::io; +using namespace decaf::lang; +using namespace decaf::util; + +/////////////////////////////////////////////////////////////////////////////// +void MessageDispatchMarshallerTest::test() { + + MessageDispatchMarshaller myMarshaller; + MessageDispatch myCommand; + MessageDispatch* myCommand2; + + CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType() ); + myCommand2 = dynamic_cast( myMarshaller.createObject() ); + CPPUNIT_ASSERT( myCommand2 != NULL ); + delete myCommand2; +} + +/////////////////////////////////////////////////////////////////////////////// +void MessageDispatchMarshallerTest::testLooseMarshal() { + + MessageDispatchMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( false ); + + MessageDispatch outCommand; + MessageDispatch inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + dataOut.writeByte( outCommand.getDataStructureType() ); + marshaller.looseMarshal( &openWireFormat, &outCommand, &dataOut ); + + // Now read it back in and make sure it's all right. + std::pair 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 MessageDispatchMarshallerTest::testTightMarshal() { + + MessageDispatchMarshaller marshaller; + Properties props; + OpenWireFormat openWireFormat( props ); + + // Configure for this test. + openWireFormat.setVersion( 6 ); + openWireFormat.setTightEncodingEnabled( true ); + + MessageDispatch outCommand; + MessageDispatch inCommand; + + try { + + // Marshal the dataStructure to a byte array. + ByteArrayOutputStream baos; + DataOutputStream dataOut( &baos ); + // Phase 1 - count the size + int size = 1; + BooleanStream bs; + size += marshaller.tightMarshal1( &openWireFormat, &outCommand, &bs ); + size += bs.marshalledSize(); + // Phase 2 - marshal + dataOut.writeByte( outCommand.getDataStructureType() ); + bs.marshal( &dataOut ); + marshaller.tightMarshal2( &openWireFormat, &outCommand, &dataOut, &bs ); + + // Now read it back in and make sure it's all right. + std::pair 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/generated/MessageDispatchMarshallerTest.cpp ------------------------------------------------------------------------------ svn:eol-style = native