You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "Shri Javadekar (JIRA)" <ji...@apache.org> on 2015/03/31 00:20:52 UTC
[jira] [Created] (JCLOUDS-874) IllegalArgumentException while
setting incorrect MD5
Shri Javadekar created JCLOUDS-874:
--------------------------------------
Summary: IllegalArgumentException while setting incorrect MD5
Key: JCLOUDS-874
URL: https://issues.apache.org/jira/browse/JCLOUDS-874
Project: jclouds
Issue Type: Bug
Components: jclouds-blobstore
Affects Versions: 1.9.0
Reporter: Shri Javadekar
Priority: Minor
I had a negative test case that would set the incorrect md5 checksum of a blob. After upgrade to jclouds-1.9.0, this test fails with an IllegalArgumentException with a message that the md5 checksum should be 128 bytes long but is 144 bytes.
Here's the code for the test:
{code:title=TestIncorrectMD5.java|borderStyle=solid}
// Create a blob and set the incorrect md5 checksump
public void testIncorrectMd5() throws Exception {
{
String blobName = "test";
ByteSource input = ByteSource.wrap("testdata".getBytes(
StandardCharsets.UTF_8));
String fakeHash = "fakehash";
byte[] blobHash = fakeHash.getBytes(Charsets.UTF_16);
blobStore.blobBuilder(blobName)
.payload(input)
.contentLength(input.size())
.contentMD5(HashCode.fromBytes(blobHash))
.build();
}
{code}
I wonder if computing of the HashCode has changed. If changed the fakeHash String from "fakehash" to "fakehas", the test worked fine.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)