camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r965352 - in /camel/trunk: components/camel-protobuf/ components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/ components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/generated/ parent/
Date Mon, 19 Jul 2010 04:45:58 GMT
Author: davsclaus
Date: Mon Jul 19 04:45:58 2010
New Revision: 965352

URL: http://svn.apache.org/viewvc?rev=965352&view=rev
Log:
CAMEL-2931: Upgrade to protobuf 2.3.0

Modified:
    camel/trunk/components/camel-protobuf/pom.xml
    camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/ProtobufMarshalTest.java
    camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/generated/AddressBookProtos.java
    camel/trunk/parent/pom.xml

Modified: camel/trunk/components/camel-protobuf/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-protobuf/pom.xml?rev=965352&r1=965351&r2=965352&view=diff
==============================================================================
--- camel/trunk/components/camel-protobuf/pom.xml (original)
+++ camel/trunk/components/camel-protobuf/pom.xml Mon Jul 19 04:45:58 2010
@@ -17,14 +17,14 @@
   	</properties>
 
 	<dependencies>	
-          <dependency>
-		<groupId>org.apache.camel</groupId>
+        <dependency>
+		    <groupId>org.apache.camel</groupId>
 			<artifactId>camel-core</artifactId>
 		</dependency>
 		<dependency>
 			<groupId>com.google.protobuf</groupId>
 			<artifactId>protobuf-java</artifactId>
-			<version>2.2.0</version>
+			<version>${protobuf-version}</version>
 		</dependency>
 
 		<!-- testing -->

Modified: camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/ProtobufMarshalTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/ProtobufMarshalTest.java?rev=965352&r1=965351&r2=965352&view=diff
==============================================================================
--- camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/ProtobufMarshalTest.java
(original)
+++ camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/ProtobufMarshalTest.java
Mon Jul 19 04:45:58 2010
@@ -14,13 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.dataformat.protobuf;
 
 import org.apache.camel.CamelException;
 import org.apache.camel.FailedToCreateRouteException;
-import org.apache.camel.InvalidPayloadException;
-import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.dataformat.protobuf.generated.AddressBookProtos;
@@ -30,9 +27,6 @@ import org.junit.Test;
 
 public class ProtobufMarshalTest extends CamelTestSupport {
 
-    /**
-     * @throws Exception
-     */
     @Test
     public void testMarshalAndUnmarshalWithDataFormat() throws Exception {
         marshalAndUnmarshal("direct:in", "direct:back");
@@ -49,15 +43,13 @@ public class ProtobufMarshalTest extends
     }
     
     @Test
-    public void testMarshalAndUnmashalWithDSL3() throws Exception {
+    public void testMarshalAndUnmarshalWithDSL3() throws Exception {
         try {
             context.addRoutes(new RouteBuilder() {
-    
                 @Override
                 public void configure() throws Exception {
                     from("direct:unmarshalC").unmarshal().protobuf(new CamelException("wrong
instance"))
                         .to("mock:reverse");
-    
                 }
             });
             fail("Expect the exception here");
@@ -90,10 +82,8 @@ public class ProtobufMarshalTest extends
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
-
             @Override
             public void configure() throws Exception {
-
                 ProtobufDataFormat format = new ProtobufDataFormat(Person.getDefaultInstance());
 
                 from("direct:in").marshal(format);
@@ -103,8 +93,6 @@ public class ProtobufMarshalTest extends
                 from("direct:unmarshalA").unmarshal().protobuf("org.apache.camel.dataformat.protobuf.generated.AddressBookProtos$Person").to("mock:reverse");
                 
                 from("direct:unmarshalB").unmarshal().protobuf(Person.getDefaultInstance()).to("mock:reverse");
-                
-
             }
         };
     }

Modified: camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/generated/AddressBookProtos.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/generated/AddressBookProtos.java?rev=965352&r1=965351&r2=965352&view=diff
==============================================================================
--- camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/generated/AddressBookProtos.java
(original)
+++ camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/generated/AddressBookProtos.java
Mon Jul 19 04:45:58 2010
@@ -1,4 +1,5 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: addressbook.proto
 
 package org.apache.camel.dataformat.protobuf.generated;
 
@@ -10,9 +11,12 @@ public final class AddressBookProtos {
   public static final class Person extends
       com.google.protobuf.GeneratedMessage {
     // Use Person.newBuilder() to construct.
-    private Person() {}
+    private Person() {
+      initFields();
+    }
+    private Person(boolean noInit) {}
     
-    private static final Person defaultInstance = new Person();
+    private static final Person defaultInstance;
     public static Person getDefaultInstance() {
       return defaultInstance;
     }
@@ -96,14 +100,19 @@ public final class AddressBookProtos {
       static {
         org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.getDescriptor();
       }
+      
+      // @@protoc_insertion_point(enum_scope:org.apache.camel.dataformat.protobuf.generated.Person.PhoneType)
     }
     
     public static final class PhoneNumber extends
         com.google.protobuf.GeneratedMessage {
       // Use PhoneNumber.newBuilder() to construct.
-      private PhoneNumber() {}
+      private PhoneNumber() {
+        initFields();
+      }
+      private PhoneNumber(boolean noInit) {}
       
-      private static final PhoneNumber defaultInstance = new PhoneNumber();
+      private static final PhoneNumber defaultInstance;
       public static PhoneNumber getDefaultInstance() {
         return defaultInstance;
       }
@@ -132,10 +141,13 @@ public final class AddressBookProtos {
       // optional .org.apache.camel.dataformat.protobuf.generated.Person.PhoneType type =
2 [default = HOME];
       public static final int TYPE_FIELD_NUMBER = 2;
       private boolean hasType;
-      private org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person.PhoneType
type_ = org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person.PhoneType.HOME;
+      private org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person.PhoneType
type_;
       public boolean hasType() { return hasType; }
       public org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person.PhoneType
getType() { return type_; }
       
+      private void initFields() {
+        type_ = org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person.PhoneType.HOME;
+      }
       public final boolean isInitialized() {
         if (!hasNumber) return false;
         return true;
@@ -143,6 +155,7 @@ public final class AddressBookProtos {
       
       public void writeTo(com.google.protobuf.CodedOutputStream output)
                           throws java.io.IOException {
+        getSerializedSize();
         if (hasNumber()) {
           output.writeString(1, getNumber());
         }
@@ -207,14 +220,23 @@ public final class AddressBookProtos {
       }
       public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person.PhoneNumber
parseDelimitedFrom(java.io.InputStream input)
           throws java.io.IOException {
-        return newBuilder().mergeDelimitedFrom(input).buildParsed();
+        Builder builder = newBuilder();
+        if (builder.mergeDelimitedFrom(input)) {
+          return builder.buildParsed();
+        } else {
+          return null;
+        }
       }
       public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person.PhoneNumber
parseDelimitedFrom(
           java.io.InputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
-        return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
-                 .buildParsed();
+        Builder builder = newBuilder();
+        if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
+          return builder.buildParsed();
+        } else {
+          return null;
+        }
       }
       public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person.PhoneNumber
parseFrom(
           com.google.protobuf.CodedInputStream input)
@@ -406,15 +428,17 @@ public final class AddressBookProtos {
           result.type_ = org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person.PhoneType.HOME;
           return this;
         }
+        
+        // @@protoc_insertion_point(builder_scope:org.apache.camel.dataformat.protobuf.generated.Person.PhoneNumber)
       }
       
       static {
-        org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.getDescriptor();
-      }
-      
-      static {
+        defaultInstance = new PhoneNumber(true);
         org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.internalForceInit();
+        defaultInstance.initFields();
       }
+      
+      // @@protoc_insertion_point(class_scope:org.apache.camel.dataformat.protobuf.generated.Person.PhoneNumber)
     }
     
     // required string name = 1;
@@ -450,6 +474,8 @@ public final class AddressBookProtos {
       return phone_.get(index);
     }
     
+    private void initFields() {
+    }
     public final boolean isInitialized() {
       if (!hasName) return false;
       if (!hasId) return false;
@@ -461,6 +487,7 @@ public final class AddressBookProtos {
     
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
+      getSerializedSize();
       if (hasName()) {
         output.writeString(1, getName());
       }
@@ -539,14 +566,23 @@ public final class AddressBookProtos {
     }
     public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person
parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return newBuilder().mergeDelimitedFrom(input).buildParsed();
+      Builder builder = newBuilder();
+      if (builder.mergeDelimitedFrom(input)) {
+        return builder.buildParsed();
+      } else {
+        return null;
+      }
     }
     public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person
parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
-               .buildParsed();
+      Builder builder = newBuilder();
+      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
+        return builder.buildParsed();
+      } else {
+        return null;
+      }
     }
     public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person
parseFrom(
         com.google.protobuf.CodedInputStream input)
@@ -824,23 +860,28 @@ public final class AddressBookProtos {
         result.phone_ = java.util.Collections.emptyList();
         return this;
       }
+      
+      // @@protoc_insertion_point(builder_scope:org.apache.camel.dataformat.protobuf.generated.Person)
     }
     
     static {
-      org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.getDescriptor();
-    }
-    
-    static {
+      defaultInstance = new Person(true);
       org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.internalForceInit();
+      defaultInstance.initFields();
     }
+    
+    // @@protoc_insertion_point(class_scope:org.apache.camel.dataformat.protobuf.generated.Person)
   }
   
   public static final class AddressBook extends
       com.google.protobuf.GeneratedMessage {
     // Use AddressBook.newBuilder() to construct.
-    private AddressBook() {}
+    private AddressBook() {
+      initFields();
+    }
+    private AddressBook(boolean noInit) {}
     
-    private static final AddressBook defaultInstance = new AddressBook();
+    private static final AddressBook defaultInstance;
     public static AddressBook getDefaultInstance() {
       return defaultInstance;
     }
@@ -871,6 +912,8 @@ public final class AddressBookProtos {
       return person_.get(index);
     }
     
+    private void initFields() {
+    }
     public final boolean isInitialized() {
       for (org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person element
: getPersonList()) {
         if (!element.isInitialized()) return false;
@@ -880,6 +923,7 @@ public final class AddressBookProtos {
     
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
+      getSerializedSize();
       for (org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person element
: getPersonList()) {
         output.writeMessage(1, element);
       }
@@ -937,14 +981,23 @@ public final class AddressBookProtos {
     }
     public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.AddressBook
parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      return newBuilder().mergeDelimitedFrom(input).buildParsed();
+      Builder builder = newBuilder();
+      if (builder.mergeDelimitedFrom(input)) {
+        return builder.buildParsed();
+      } else {
+        return null;
+      }
     }
     public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.AddressBook
parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
-               .buildParsed();
+      Builder builder = newBuilder();
+      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
+        return builder.buildParsed();
+      } else {
+        return null;
+      }
     }
     public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.AddressBook
parseFrom(
         com.google.protobuf.CodedInputStream input)
@@ -1141,15 +1194,17 @@ public final class AddressBookProtos {
         result.person_ = java.util.Collections.emptyList();
         return this;
       }
+      
+      // @@protoc_insertion_point(builder_scope:org.apache.camel.dataformat.protobuf.generated.AddressBook)
     }
     
     static {
-      org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.getDescriptor();
-    }
-    
-    static {
+      defaultInstance = new AddressBook(true);
       org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.internalForceInit();
+      defaultInstance.initFields();
     }
+    
+    // @@protoc_insertion_point(class_scope:org.apache.camel.dataformat.protobuf.generated.AddressBook)
   }
   
   private static com.google.protobuf.Descriptors.Descriptor
@@ -1229,4 +1284,6 @@ public final class AddressBookProtos {
   }
   
   public static void internalForceInit() {}
+  
+  // @@protoc_insertion_point(outer_class_scope)
 }

Modified: camel/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=965352&r1=965351&r2=965352&view=diff
==============================================================================
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Mon Jul 19 04:45:58 2010
@@ -101,6 +101,7 @@
     <osgi-version>4.1.0</osgi-version>
     <pax-exam-version>1.2.0</pax-exam-version>
     <pax-tiny-bundle-version>1.2.0</pax-tiny-bundle-version>
+    <protobuf-version>2.3.0</protobuf-version>
     <qpid-version>0.5.0</qpid-version>
     <quartz-version>1.8.3</quartz-version>
     <restlet-version>1.1.10</restlet-version>



Mime
View raw message