activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r585631 - /activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppTestMarshallingClassesGenerator.java
Date Wed, 17 Oct 2007 18:56:39 GMT
Author: tabish
Date: Wed Oct 17 11:56:38 2007
New Revision: 585631

URL: http://svn.apache.org/viewvc?rev=585631&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-139

Make the cloneDataStructure methods return covarient return types to eliminate as many dynamic
casts from the OpenWireConnector as possible.

Modified:
    activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppTestMarshallingClassesGenerator.java

Modified: activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppTestMarshallingClassesGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppTestMarshallingClassesGenerator.java?rev=585631&r1=585630&r2=585631&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppTestMarshallingClassesGenerator.java
(original)
+++ activemq/activemq-cpp/trunk/src/main/java/org/apache/activemq/openwire/tool/AmqCppTestMarshallingClassesGenerator.java
Wed Oct 17 11:56:38 2007
@@ -42,6 +42,8 @@
     protected void generateFile(PrintWriter out) throws Exception {
         generateLicence(out);
 
+        String target = super.getClassName();
+
 out.println("");
 out.println("#include <activemq/connector/openwire/marshal/v"+getOpenwireVersion()+"/"+className+".h>");
 out.println("");
@@ -74,8 +76,15 @@
 out.println("///////////////////////////////////////////////////////////////////////////////");
 out.println("void "+className+"::test() {");
 out.println("");
-out.println("    "+ super.getClassName() + " myMarshaller;");
+out.println("    "+ target + " myMarshaller;");
 out.println("    "+ jclass.getSimpleName() + " myCommand;");
+out.println("    "+ jclass.getSimpleName() + "* myCommand2;");
+out.println("");
+out.println("    CPPUNIT_ASSERT( myMarshaller.getDataStructureType() == myCommand.getDataStructureType()
);");
+out.println("    myCommand2 = myMarshaller.createObject();");
+out.println("    CPPUNIT_ASSERT( myCommand2 != NULL );");
+out.println("    delete myCommand2;");
+out.println("");
 out.println("}");
     }
 



Mime
View raw message