You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ga...@apache.org on 2017/11/25 05:17:12 UTC

[10/11] jclouds git commit: JCLOUDS-1358: Fix zero byte InputStream test input

JCLOUDS-1358: Fix zero byte InputStream test input

Do not use ByteSource.empty() since it is backed by a
ByteArrayInputStream which supports reset.


Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/9a302453
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/9a302453
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/9a302453

Branch: refs/heads/2.0.x
Commit: 9a302453e01c3dfbd2279b3fa7e49d9a83b11ff3
Parents: 63e6450
Author: Andrew Gaul <ga...@apache.org>
Authored: Tue Nov 21 10:49:53 2017 -0800
Committer: Andrew Gaul <ga...@apache.org>
Committed: Fri Nov 24 20:15:25 2017 -0800

----------------------------------------------------------------------
 .../integration/internal/BaseBlobIntegrationTest.java       | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/9a302453/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
----------------------------------------------------------------------
diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
index 23defff..e03b226 100644
--- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
+++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
@@ -626,14 +626,19 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
    @Test(groups = { "integration", "live" })
    public void testPutZeroLengthByteSource() throws Exception {
       long length = 0;
-      Payload payload = new ByteSourcePayload(ByteSource.empty());
+      // do not use ByteSource.empty() since it is backed by a
+      // ByteArrayInputStream which supports reset
+      ByteSource byteSource = TestUtils.randomByteSource().slice(0, length);
+      Payload payload = new ByteSourcePayload(byteSource);
       testPut(payload, null, payload, length, new PutOptions());
    }
 
    @Test(groups = { "integration", "live" })
    public void testPutZeroLengthInputStream() throws Exception {
       long length = 0;
-      ByteSource byteSource = ByteSource.empty();
+      // do not use ByteSource.empty() since it is backed by a
+      // ByteArrayInputStream which supports reset
+      ByteSource byteSource = TestUtils.randomByteSource().slice(0, length);
       Payload payload = new InputStreamPayload(byteSource.openStream());
       testPut(payload, null, payload, length, new PutOptions());
    }