fixed test glitch in azureblob

This commit is contained in:
Adrian Cole 2012-01-15 15:30:58 -08:00
parent 181f1de4fd
commit 15af98ba02
1 changed files with 4 additions and 2 deletions

View File

@ -50,6 +50,7 @@ import org.jclouds.io.Payloads;
import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.rest.BaseRestClientLiveTest; import org.jclouds.rest.BaseRestClientLiveTest;
import org.jclouds.util.Strings2; import org.jclouds.util.Strings2;
import org.jclouds.util.Throwables2;
import org.testng.annotations.BeforeGroups; import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -320,8 +321,9 @@ public class AzureBlobClientLiveTest extends BaseRestClientLiveTest {
client.getBlob(privateContainer, object.getProperties().getName(), GetOptions.Builder client.getBlob(privateContainer, object.getProperties().getName(), GetOptions.Builder
.ifETagDoesntMatch(newEtag)); .ifETagDoesntMatch(newEtag));
} catch (Exception e) { } catch (Exception e) {
assertEquals(e.getCause().getClass(), HttpResponseException.class); HttpResponseException httpEx = Throwables2.getFirstThrowableOfType(e, HttpResponseException.class);
assertEquals(((HttpResponseException) e.getCause()).getResponse().getStatusCode(), 304); assert (httpEx != null) : "expected http exception, not " + e;
assertEquals(httpEx.getResponse().getStatusCode(), 304);
} }
// Matching ETag TODO this shouldn't fail!!! // Matching ETag TODO this shouldn't fail!!!