From 0967b1d99d7001cd1d09ebd29b9360f1079410e8 Mon Sep 17 00:00:00 2001 From: Haohui Mai Date: Mon, 30 Mar 2015 12:23:45 -0700 Subject: [PATCH] Addendum for HDFS-7748. --- .../org/apache/hadoop/hdfs/TestDataTransferProtocol.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferProtocol.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferProtocol.java index fcfaa0c2fc..bf011f79c1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferProtocol.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferProtocol.java @@ -33,7 +33,6 @@ import java.nio.ByteBuffer; import java.util.Random; -import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -534,17 +533,17 @@ public void TestPipeLineAckCompatibility() throws IOException { Status.CHECKSUM_OK)) .build(); - ByteOutputStream oldAckBytes = new ByteOutputStream(); + ByteArrayOutputStream oldAckBytes = new ByteArrayOutputStream(); proto.writeDelimitedTo(oldAckBytes); PipelineAck oldAck = new PipelineAck(); - oldAck.readFields(new ByteArrayInputStream(oldAckBytes.getBytes())); + oldAck.readFields(new ByteArrayInputStream(oldAckBytes.toByteArray())); assertEquals(PipelineAck.combineHeader(PipelineAck.ECN.DISABLED, Status .CHECKSUM_OK), oldAck.getHeaderFlag(0)); PipelineAck newAck = new PipelineAck(); - ByteOutputStream newAckBytes = new ByteOutputStream(); + ByteArrayOutputStream newAckBytes = new ByteArrayOutputStream(); newProto.writeDelimitedTo(newAckBytes); - newAck.readFields(new ByteArrayInputStream(newAckBytes.getBytes())); + newAck.readFields(new ByteArrayInputStream(newAckBytes.toByteArray())); assertEquals(PipelineAck.combineHeader(PipelineAck.ECN.SUPPORTED, Status .CHECKSUM_OK), newAck.getHeaderFlag(0)); }