| /** |
| * |
| * 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. |
| */ |
| package org.apache.activemq.openwire.tool; |
| |
| import org.codehaus.jam.JAnnotation; |
| import org.codehaus.jam.JAnnotationValue; |
| import org.codehaus.jam.JClass; |
| import org.codehaus.jam.JProperty; |
| |
| import java.io.PrintWriter; |
| import java.util.ArrayList; |
| import java.util.Collections; |
| import java.util.Comparator; |
| import java.util.Iterator; |
| import java.util.List; |
| |
| /** |
| * |
| * @version $Revision: 381410 $ |
| */ |
| public class AmqCppTestMarshallingClassesGenerator extends AmqCppTestMarshallingHeadersGenerator { |
| |
| protected String getFilePostFix() { |
| return ".cpp"; |
| } |
| |
| protected void generateFile(PrintWriter out) throws Exception { |
| generateLicence(out); |
| |
| out.println(""); |
| out.println("#include <activemq/connector/openwire/marshal/v"+getOpenwireVersion()+"/"+className+".h>"); |
| out.println(""); |
| out.println("#include <activemq/connector/openwire/commands/"+jclass.getSimpleName()+".h>"); |
| out.println(""); |
| out.println("CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::openwire::marshal::v"+getOpenwireVersion()+"::"+className+" );"); |
| out.println(""); |
| out.println("#include <activemq/io/DataInputStream.h>"); |
| out.println("#include <activemq/io/DataOutputStream.h>"); |
| out.println("#include <activemq/io/IOException.h>"); |
| out.println("#include <activemq/connector/openwire/OpenWireFormat.h>"); |
| out.println("#include <activemq/connector/openwire/commands/DataStructure.h>"); |
| out.println("#include <activemq/connector/openwire/utils/BooleanStream.h>"); |
| out.println("//"); |
| out.println("// NOTE!: This file is autogenerated - do not modify!"); |
| out.println("// if you need to make a change, please see the Java Classes in the"); |
| out.println("// activemq-core module"); |
| out.println("//"); |
| out.println(""); |
| out.println("using namespace std;"); |
| out.println("using namespace activemq;"); |
| out.println("using namespace activemq::io;"); |
| out.println("using namespace activemq::connector;"); |
| out.println("using namespace activemq::connector::openwire;"); |
| out.println("using namespace activemq::connector::openwire::commands;"); |
| out.println("using namespace activemq::connector::openwire::marshal;"); |
| out.println("using namespace activemq::connector::openwire::utils;"); |
| out.println("using namespace activemq::connector::openwire::marshal::v"+getOpenwireVersion()+";"); |
| out.println(""); |
| out.println("///////////////////////////////////////////////////////////////////////////////"); |
| out.println("void "+className+"::test() {"); |
| out.println(""); |
| out.println(" "+ super.getClassName() + " myMarshaller;"); |
| out.println(" "+ jclass.getSimpleName() + " myCommand;"); |
| out.println("}"); |
| } |
| |
| } |