From 15af98ba02ded71ab5ebf9a0929a574193abb385 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sun, 15 Jan 2012 15:30:58 -0800 Subject: [PATCH] fixed test glitch in azureblob --- .../java/org/jclouds/azureblob/AzureBlobClientLiveTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java index 22ecdfcd66..dc84cf6044 100644 --- a/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java +++ b/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java @@ -50,6 +50,7 @@ import org.jclouds.io.Payloads; import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.rest.BaseRestClientLiveTest; import org.jclouds.util.Strings2; +import org.jclouds.util.Throwables2; import org.testng.annotations.BeforeGroups; import org.testng.annotations.Test; @@ -320,8 +321,9 @@ public class AzureBlobClientLiveTest extends BaseRestClientLiveTest { client.getBlob(privateContainer, object.getProperties().getName(), GetOptions.Builder .ifETagDoesntMatch(newEtag)); } catch (Exception e) { - assertEquals(e.getCause().getClass(), HttpResponseException.class); - assertEquals(((HttpResponseException) e.getCause()).getResponse().getStatusCode(), 304); + HttpResponseException httpEx = Throwables2.getFirstThrowableOfType(e, HttpResponseException.class); + assert (httpEx != null) : "expected http exception, not " + e; + assertEquals(httpEx.getResponse().getStatusCode(), 304); } // Matching ETag TODO this shouldn't fail!!!