From 238bdc90b82efa2349b26847cc54df1bbc47b172 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Thu, 14 Jan 2010 12:24:59 +0000 Subject: [PATCH] Fixed failing test --- .../org/jboss/netty/buffer/ReadOnlyChannelBufferTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/jboss/netty/buffer/ReadOnlyChannelBufferTest.java b/src/test/java/org/jboss/netty/buffer/ReadOnlyChannelBufferTest.java index 257d100610..6839e9b047 100644 --- a/src/test/java/org/jboss/netty/buffer/ReadOnlyChannelBufferTest.java +++ b/src/test/java/org/jboss/netty/buffer/ReadOnlyChannelBufferTest.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; +import java.nio.CharBuffer; import java.nio.channels.GatheringByteChannel; import java.nio.channels.ScatteringByteChannel; @@ -95,10 +96,11 @@ public class ReadOnlyChannelBufferTest { ByteBuffer bb = ByteBuffer.allocate(100); ByteBuffer[] bbs = new ByteBuffer[] { ByteBuffer.allocate(101), ByteBuffer.allocate(102) }; + CharBuffer cb = CharBuffer.allocate(100); expect(buf.toByteBuffer(23, 24)).andReturn(bb); expect(buf.toByteBuffers(25, 26)).andReturn(bbs); - expect(buf.getString(27, 28, CharsetUtil.UTF_8)).andReturn("29"); + expect(buf.getString(27, 28, cb, CharsetUtil.UTF_8)).andReturn(29); expect(buf.capacity()).andReturn(30); replay(buf); @@ -126,7 +128,7 @@ public class ReadOnlyChannelBufferTest { assertEquals(102, roBBs[1].capacity()); assertTrue(roBBs[1].isReadOnly()); - assertEquals("29", roBuf.getString(27, 28, CharsetUtil.UTF_8)); + assertEquals(29, roBuf.getString(27, 28, cb, CharsetUtil.UTF_8)); assertEquals(30, roBuf.capacity()); verify(buf);