@Test( timeOut = 5 * 60 * 1000, dependsOnMethods = {"testCreatePublicRootContainer"}) public void testDeleteRootContainer() throws Exception { client.deleteRootContainer(); // TODO loop for up to 30 seconds checking if they are really gone }
@Test(timeOut = 5 * 60 * 1000) public void testCreatePublicRootContainer() throws Exception { try { client.deleteRootContainer(); } catch (ContainerNotFoundException e) { Thread.sleep(5000); } catch (AzureStorageResponseException htpe) { if (htpe.getResponse().getStatusCode() == 409) { // TODO look for specific message Thread.sleep(5000); } else { throw htpe; } } boolean created = false; while (!created) { try { created = client.createRootContainer(); } catch (AzureStorageResponseException htpe) { if (htpe.getResponse().getStatusCode() == 409) { // TODO look for specific message Thread.sleep(5000); continue; } else { throw htpe; } } } ListBlobsResponse list = client.listBlobs(); assertEquals( list.getUrl(), URI.create(String.format("https://%s.blob.core.windows.net/$root", identity))); }