> +            long countAfter = blobStore.countBlobs(containerName);
> +            assertNotEquals(countBefore, countAfter,
> +                    "No blob was created");
> +            assertTrue(countAfter - countBefore > 1,
> +                    "A multipart blob wasn't actually created - " +
> +                            "there was only 1 extra blob but there should be 
> one manifest blob and multiple chunk blobs");
> +            assertEquals(countBefore + 12, countAfter,
> +                    "12 parts (11 objects + 1 manifest) were expected.");
> +
> +            // download and check again
> +            Blob read = blobStore.getBlob(containerName, objectName);
> +            File outFile = new File("target", "file-read.txt");
> +            ByteStreams.copy(read.getPayload(), Files.asByteSink(outFile));
> +            HashCode expectedHashCode = Files.hash(fileToUpload, 
> Hashing.md5());
> +            HashCode actualHashCode = Files.hash(outFile, Hashing.md5());
> +            assertEquals(actualHashCode, expectedHashCode);

You should compare the test output without using a temporary file and without 
hashing, e.g.,

```
assertTrue(Files.asByteSource(fileToUpload).contentEquals(ByteSources.asByteSource(read.getPayload())));
```

This will read better when you convert `fileToUpload` into a pure `ByteSource` 
instead of a `File`.  Note that assertj has an `assertEquals(InputStream, 
InputStream)` if we bring in that dependency.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/427/files#r14438764

Reply via email to