浏览代码

HADOOP-6782. TestAvroRpc fails with avro-1.3.1 and avro-1.3.2. Contributed by Doug Cutting.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.21@958144 13f79535-47bb-0310-9956-ffa450edef68
Thomas White 15 年之前
父节点
当前提交
a658af7686

+ 3 - 0
CHANGES.txt

@@ -1563,6 +1563,9 @@ Release 0.21.0 - Unreleased
     HADOOP-6826.  Revert FileSystem create method that takes CreateFlags.
     (tomwhite)
 
+    HADOOP-6782.  TestAvroRpc fails with avro-1.3.1 and avro-1.3.2.
+    (Doug Cutting via tomwhite)
+
 Release 0.20.3 - Unreleased
 
   NEW FEATURES

+ 1 - 1
ivy/libraries.properties

@@ -17,7 +17,7 @@
 apacheant.version=1.7.1
 ant-task.version=2.0.10
 
-avro.version=1.3.0
+avro.version=1.3.2
 
 checkstyle.version=4.2
 

+ 1 - 2
src/test/core/org/apache/hadoop/ipc/AvroTestProtocol.java

@@ -19,7 +19,6 @@
 package org.apache.hadoop.ipc;
 
 import org.apache.avro.ipc.AvroRemoteException;
-import org.apache.avro.util.Utf8;
 
 @SuppressWarnings("serial")
 public interface AvroTestProtocol {
@@ -27,7 +26,7 @@ public interface AvroTestProtocol {
     public Problem() {}
   }
   void ping();
-  Utf8 echo(Utf8 value);
+  String echo(String value);
   int add(int v1, int v2);
   int error() throws Problem;
 }

+ 3 - 4
src/test/core/org/apache/hadoop/ipc/TestAvroRpc.java

@@ -30,7 +30,6 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.net.NetUtils;
 
 import org.apache.avro.ipc.AvroRemoteException;
-import org.apache.avro.util.Utf8;
 
 /** Unit tests for AvroRpc. */
 public class TestAvroRpc extends TestCase {
@@ -50,7 +49,7 @@ public class TestAvroRpc extends TestCase {
 
     public void ping() {}
     
-    public Utf8 echo(Utf8 value) { return value; }
+    public String echo(String value) { return value; }
 
     public int add(int v1, int v2) { return v1 + v2; }
 
@@ -74,8 +73,8 @@ public class TestAvroRpc extends TestCase {
       
       proxy.ping();
 
-      Utf8 utf8Result = proxy.echo(new Utf8("hello world"));
-      assertEquals(new Utf8("hello world"), utf8Result);
+      String echo = proxy.echo("hello world");
+      assertEquals("hello world", echo);
 
       int intResult = proxy.add(1, 2);
       assertEquals(3, intResult);