You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Andrew Gaul <no...@github.com> on 2013/09/11 07:20:43 UTC

[jclouds] Add test for correct and incorrect contentMD5 (#148)

You can merge this Pull Request by running:

  git pull https://github.com/maginatics/jclouds md5-integration-test

Or you can view, comment on it, or merge it online at:

  https://github.com/jclouds/jclouds/pull/148

-- Commit Summary --

  * Add test for correct and incorrect contentMD5

-- File Changes --

    M apis/atmos/src/test/java/org/jclouds/atmos/AtmosClientLiveTest.java (6)
    M blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java (40)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/148.patch
https://github.com/jclouds/jclouds/pull/148.diff

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #673](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/673/) FAILURE
Looks like there's a problem with this pull request

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148#issuecomment-24214646

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by Andrew Phillips <no...@github.com>.
> jclouds-java-7-pull-requests #675 UNSTABLE

Spurious [timing-related failure](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/org.apache.jclouds$jclouds-core/675/testReport/org.jclouds.rest.functions/PresentWhenApiVersionLexicographicallyAtOrAfterSinceApiVersionTest/testCacheIsFasterWhenAnnotationPresent/)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148#issuecomment-24281493

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #214](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/214/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148#issuecomment-24270257

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by Andrew Phillips <no...@github.com>.
> +   public void testPutCorrectContentMD5() throws InterruptedException, IOException {
> +      byte[] payload = ByteStreams.toByteArray(createTestInput(1024));
> +      HashCode contentMD5 = md5().hashBytes(payload);
> +      putBlobWithMd5(payload, contentMD5);
> +   }
> +
> +   @Test(groups = { "integration", "live" })
> +   public void testPutIncorrectContentMD5() throws InterruptedException, IOException {
> +      byte[] payload = ByteStreams.toByteArray(createTestInput(1024));
> +      HashCode contentMD5 = md5().hashBytes(new byte[0]);
> +      try {
> +         putBlobWithMd5(payload, contentMD5);
> +         fail();
> +      } catch (HttpResponseException hre) {
> +         if (hre.getResponse().getStatusCode() != getIncorrectContentMD5StatusCode()) {
> +            throw hre;

`fail("Expected response code %d but was %d", ...);`?

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

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by Andrew Phillips <no...@github.com>.
> jclouds-pull-requests #212 FAILURE

Compile error in Atmos now?
```
[ERROR] bad path element "": no such file or directory
/scratch/jenkins/workspace/jclouds-pull-requests/apis/atmos/src/test/java/org/jclouds/atmos/AtmosClientLiveTest.java:[23,17] cannot find symbol
symbol  : class testng
location: package org
[ERROR] /scratch/jenkins/workspace/jclouds-pull-requests/apis/atmos/src/test/java/org/jclouds/atmos/AtmosClientLiveTest.java:[23,0] static import only from classes and interfaces
[ERROR] /scratch/jenkins/workspace/jclouds-pull-requests/apis/atmos/src/test/java/org/jclouds/atmos/AtmosClientLiveTest.java:[191,16] cannot find symbol
symbol  : class SkipException
location: class org.jclouds.atmos.AtmosClientLiveTest
```

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148#issuecomment-24220762

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #674](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/674/) FAILURE
Looks like there's a problem with this pull request

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148#issuecomment-24222075

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds #401](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/401/) FAILURE
Looks like there's a problem with this pull request
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148#issuecomment-24221826

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by Andrew Phillips <no...@github.com>.
> demobox closed the pull request just now

Sorry, wrong button :-)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148#issuecomment-24220779

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #213](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/213/) FAILURE
Looks like there's a problem with this pull request

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148#issuecomment-24222287

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-java-7-pull-requests #675](https://jclouds.ci.cloudbees.com/job/jclouds-java-7-pull-requests/675/) UNSTABLE
Looks like there's a problem with this pull request

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148#issuecomment-24270851

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds #400](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/400/) FAILURE
Looks like there's a problem with this pull request
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148#issuecomment-24214610

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by Andrew Gaul <no...@github.com>.
Fixed compilation error, import vs. static import.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148#issuecomment-24249589

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by Andrew Gaul <no...@github.com>.
@aledsage Thanks for the report; I pushed a fix to master and 1.6.x.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148#issuecomment-24499847

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by Aled Sage <no...@github.com>.
On 1.6.x, `TransientBlobIntegrationTest.testPutIncorrectContentMD5` is failing with `mvn clean install`.
@andrewgaul guessing it should `SkipException` in same way as FilesystemBlobIntegrationTest?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148#issuecomment-24497385

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #212](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/212/) FAILURE
Looks like there's a problem with this pull request

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148#issuecomment-24214704

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by Andrew Phillips <no...@github.com>.
> +   public void testPutCorrectContentMD5() throws InterruptedException, IOException {
> +      byte[] payload = ByteStreams.toByteArray(createTestInput(1024));
> +      HashCode contentMD5 = md5().hashBytes(payload);
> +      putBlobWithMd5(payload, contentMD5);
> +   }
> +
> +   @Test(groups = { "integration", "live" })
> +   public void testPutIncorrectContentMD5() throws InterruptedException, IOException {
> +      byte[] payload = ByteStreams.toByteArray(createTestInput(1024));
> +      HashCode contentMD5 = md5().hashBytes(new byte[0]);
> +      try {
> +         putBlobWithMd5(payload, contentMD5);
> +         fail();
> +      } catch (HttpResponseException hre) {
> +         if (hre.getResponse().getStatusCode() != getIncorrectContentMD5StatusCode()) {
> +            throw hre;

> Rethrowing the exception seems superior to me, giving the complete backtrace instead of an error message.

For debugging, perhaps, but it doesn't indicate what the _expectation_ was..?

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

Re: [jclouds] Add test for correct and incorrect contentMD5 (#148)

Posted by Andrew Gaul <no...@github.com>.
> +   public void testPutCorrectContentMD5() throws InterruptedException, IOException {
> +      byte[] payload = ByteStreams.toByteArray(createTestInput(1024));
> +      HashCode contentMD5 = md5().hashBytes(payload);
> +      putBlobWithMd5(payload, contentMD5);
> +   }
> +
> +   @Test(groups = { "integration", "live" })
> +   public void testPutIncorrectContentMD5() throws InterruptedException, IOException {
> +      byte[] payload = ByteStreams.toByteArray(createTestInput(1024));
> +      HashCode contentMD5 = md5().hashBytes(new byte[0]);
> +      try {
> +         putBlobWithMd5(payload, contentMD5);
> +         fail();
> +      } catch (HttpResponseException hre) {
> +         if (hre.getResponse().getStatusCode() != getIncorrectContentMD5StatusCode()) {
> +            throw hre;

Rethrowing the exception seems superior to me, giving the complete backtrace instead of an error message.

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