camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r962769 - 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 Sat, 10 Jul 2010 06:38:35 GMT
Author: davsclaus
Date: Sat Jul 10 06:38:35 2010
New Revision: 962769

URL: http://svn.apache.org/viewvc?rev=962769&view=rev
Log:
CAMEL-2931: Reverted back to protobuf 2.2.0 due OSGi bundle needs to be upgraded as well.
revert commit rev: 962550

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=962769&r1=962768&r2=962769&view=diff
==============================================================================
--- camel/trunk/components/camel-protobuf/pom.xml (original)
+++ camel/trunk/components/camel-protobuf/pom.xml Sat Jul 10 06:38:35 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>${protobuf-version}</version>
+			<version>2.2.0</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=962769&r1=962768&r2=962769&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
Sat Jul 10 06:38:35 2010
@@ -14,10 +14,13 @@
  * 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;
@@ -27,6 +30,9 @@ import org.junit.Test;
 
 public class ProtobufMarshalTest extends CamelTestSupport {
 
+    /**
+     * @throws Exception
+     */
     @Test
     public void testMarshalAndUnmarshalWithDataFormat() throws Exception {
         marshalAndUnmarshal("direct:in", "direct:back");
@@ -43,13 +49,15 @@ public class ProtobufMarshalTest extends
     }
     
     @Test
-    public void testMarshalAndUnmarshalWithDSL3() throws Exception {
+    public void testMarshalAndUnmashalWithDSL3() 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");
@@ -82,8 +90,10 @@ 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);
@@ -93,6 +103,8 @@ 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=962769&r1=962768&r2=962769&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
Sat Jul 10 06:38:35 2010
@@ -1,5 +1,4 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: addressbook.proto
 
 package org.apache.camel.dataformat.protobuf.generated;
 
@@ -11,12 +10,9 @@ public final class AddressBookProtos {
   public static final class Person extends
       com.google.protobuf.GeneratedMessage {
     // Use Person.newBuilder() to construct.
-    private Person() {
-      initFields();
-    }
-    private Person(boolean noInit) {}
+    private Person() {}
     
-    private static final Person defaultInstance;
+    private static final Person defaultInstance = new Person();
     public static Person getDefaultInstance() {
       return defaultInstance;
     }
@@ -100,19 +96,14 @@ 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() {
-        initFields();
-      }
-      private PhoneNumber(boolean noInit) {}
+      private PhoneNumber() {}
       
-      private static final PhoneNumber defaultInstance;
+      private static final PhoneNumber defaultInstance = new PhoneNumber();
       public static PhoneNumber getDefaultInstance() {
         return defaultInstance;
       }
@@ -141,13 +132,10 @@ 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_;
+      private org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person.PhoneType
type_ = org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person.PhoneType.HOME;
       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;
@@ -155,7 +143,6 @@ public final class AddressBookProtos {
       
       public void writeTo(com.google.protobuf.CodedOutputStream output)
                           throws java.io.IOException {
-        getSerializedSize();
         if (hasNumber()) {
           output.writeString(1, getNumber());
         }
@@ -220,23 +207,14 @@ public final class AddressBookProtos {
       }
       public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person.PhoneNumber
parseDelimitedFrom(java.io.InputStream input)
           throws java.io.IOException {
-        Builder builder = newBuilder();
-        if (builder.mergeDelimitedFrom(input)) {
-          return builder.buildParsed();
-        } else {
-          return null;
-        }
+        return newBuilder().mergeDelimitedFrom(input).buildParsed();
       }
       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 {
-        Builder builder = newBuilder();
-        if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
-          return builder.buildParsed();
-        } else {
-          return null;
-        }
+        return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
+                 .buildParsed();
       }
       public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person.PhoneNumber
parseFrom(
           com.google.protobuf.CodedInputStream input)
@@ -428,17 +406,15 @@ 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 {
-        defaultInstance = new PhoneNumber(true);
-        org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.internalForceInit();
-        defaultInstance.initFields();
+        org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.getDescriptor();
       }
       
-      // @@protoc_insertion_point(class_scope:org.apache.camel.dataformat.protobuf.generated.Person.PhoneNumber)
+      static {
+        org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.internalForceInit();
+      }
     }
     
     // required string name = 1;
@@ -474,8 +450,6 @@ public final class AddressBookProtos {
       return phone_.get(index);
     }
     
-    private void initFields() {
-    }
     public final boolean isInitialized() {
       if (!hasName) return false;
       if (!hasId) return false;
@@ -487,7 +461,6 @@ public final class AddressBookProtos {
     
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
-      getSerializedSize();
       if (hasName()) {
         output.writeString(1, getName());
       }
@@ -566,23 +539,14 @@ public final class AddressBookProtos {
     }
     public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person
parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      Builder builder = newBuilder();
-      if (builder.mergeDelimitedFrom(input)) {
-        return builder.buildParsed();
-      } else {
-        return null;
-      }
+      return newBuilder().mergeDelimitedFrom(input).buildParsed();
     }
     public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person
parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      Builder builder = newBuilder();
-      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
-        return builder.buildParsed();
-      } else {
-        return null;
-      }
+      return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
+               .buildParsed();
     }
     public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.Person
parseFrom(
         com.google.protobuf.CodedInputStream input)
@@ -860,28 +824,23 @@ 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 {
-      defaultInstance = new Person(true);
-      org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.internalForceInit();
-      defaultInstance.initFields();
+      org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.getDescriptor();
     }
     
-    // @@protoc_insertion_point(class_scope:org.apache.camel.dataformat.protobuf.generated.Person)
+    static {
+      org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.internalForceInit();
+    }
   }
   
   public static final class AddressBook extends
       com.google.protobuf.GeneratedMessage {
     // Use AddressBook.newBuilder() to construct.
-    private AddressBook() {
-      initFields();
-    }
-    private AddressBook(boolean noInit) {}
+    private AddressBook() {}
     
-    private static final AddressBook defaultInstance;
+    private static final AddressBook defaultInstance = new AddressBook();
     public static AddressBook getDefaultInstance() {
       return defaultInstance;
     }
@@ -912,8 +871,6 @@ 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;
@@ -923,7 +880,6 @@ 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);
       }
@@ -981,23 +937,14 @@ public final class AddressBookProtos {
     }
     public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.AddressBook
parseDelimitedFrom(java.io.InputStream input)
         throws java.io.IOException {
-      Builder builder = newBuilder();
-      if (builder.mergeDelimitedFrom(input)) {
-        return builder.buildParsed();
-      } else {
-        return null;
-      }
+      return newBuilder().mergeDelimitedFrom(input).buildParsed();
     }
     public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.AddressBook
parseDelimitedFrom(
         java.io.InputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      Builder builder = newBuilder();
-      if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
-        return builder.buildParsed();
-      } else {
-        return null;
-      }
+      return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
+               .buildParsed();
     }
     public static org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.AddressBook
parseFrom(
         com.google.protobuf.CodedInputStream input)
@@ -1194,17 +1141,15 @@ 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 {
-      defaultInstance = new AddressBook(true);
-      org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.internalForceInit();
-      defaultInstance.initFields();
+      org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.getDescriptor();
     }
     
-    // @@protoc_insertion_point(class_scope:org.apache.camel.dataformat.protobuf.generated.AddressBook)
+    static {
+      org.apache.camel.dataformat.protobuf.generated.AddressBookProtos.internalForceInit();
+    }
   }
   
   private static com.google.protobuf.Descriptors.Descriptor
@@ -1284,6 +1229,4 @@ 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=962769&r1=962768&r2=962769&view=diff
==============================================================================
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Sat Jul 10 06:38:35 2010
@@ -100,7 +100,6 @@
     <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