> +   }
> +
> +   @Test(groups = {"live", "livelong", "longtest"}, dependsOnMethods = 
> {"testInitiateJob", "testDescribeJob", "testListJobs"})
> +   public void testWaitForSucceed() throws InterruptedException {
> +      Thread.sleep(INITIAL_WAIT);
> +      while(api.describeJob(VAULT_NAME, archiveRetrievalJob).getStatusCode() 
> == JobStatus.IN_PROGRESS ||
> +            api.describeJob(VAULT_NAME, 
> inventoryRetrievalJob).getStatusCode() == JobStatus.IN_PROGRESS) {
> +         Thread.sleep(TIME_BETWEEN_POLLS);
> +      }
> +      assertThat(api.describeJob(VAULT_NAME, 
> archiveRetrievalJob).getStatusCode()).isEqualTo(JobStatus.SUCCEEDED);
> +      assertThat(api.describeJob(VAULT_NAME, 
> inventoryRetrievalJob).getStatusCode()).isEqualTo(JobStatus.SUCCEEDED);
> +   }
> +
> +   @Test(groups = {"live", "livelong", "longtest"}, dependsOnMethods = 
> {"testWaitForSucceed"})
> +   public void testGetJobOutput() throws IOException {
> +      assertThat(ByteSources.asByteSource(api.getJobOutput(VAULT_NAME, 
> archiveRetrievalJob).openStream()))

`ByteSources.asByteSource` is kind of a dangerous method and I would like to 
remove it.  It breaks the contract of `ByteSource` which specifies that 
`openStream` can produce multiple independent streams.  Can you rewrite this 
with `assertThat(InputStream).hasSameContentAs` instead?  This will require 
some verbosity to close the `InputStream` but when we move to Java 7 this will 
all read well.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/41/files#r15262670

Reply via email to