Author: ffang
Date: Fri Apr 6 08:05:58 2012
New Revision: 1310216
URL: http://svn.apache.org/viewvc?rev=1310216&view=rev
Log:
Merged revisions 1310214 via svnmerge from
https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes
........
r1310214 | ffang | 2012-04-06 15:57:04 +0800 (δΊ”, 06 4 2012) | 1 line
[CXF-4227]AttachmentDeserializerTest contains buggy code for reading an
InputStream.
........
Modified:
cxf/branches/2.4.x-fixes/ (props changed)
cxf/branches/2.4.x-fixes/rt/core/src/test/java/org/apache/cxf/attachment/AttachmentDeserializerTest.java
Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.4.x-fixes/rt/core/src/test/java/org/apache/cxf/attachment/AttachmentDeserializerTest.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/test/java/org/apache/cxf/attachment/AttachmentDeserializerTest.java?rev=1310216&r1=1310215&r2=1310216&view=diff
==============================================================================
---
cxf/branches/2.4.x-fixes/rt/core/src/test/java/org/apache/cxf/attachment/AttachmentDeserializerTest.java
(original)
+++
cxf/branches/2.4.x-fixes/rt/core/src/test/java/org/apache/cxf/attachment/AttachmentDeserializerTest.java
Fri Apr 6 08:05:58 2012
@@ -486,9 +486,12 @@ public class AttachmentDeserializerTest
byte bts[] = new byte[1024];
InputStream ins = ds.getInputStream();
- int count = ins.read(bts, 0, bts.length);
- int sz = ins.read(bts, count, bts.length - count);
+ int count = 0;
+ int sz = ins.read(bts, 0, bts.length);
while (sz != -1) {
+ count += sz;
+ // We do not expect the data to fill up the buffer:
+ assertTrue(count < bts.length);
sz = ins.read(bts, count, bts.length - count);
}
assertEquals(x + 1, count);