@Test(timeOut = 5 * 60 * 1000) public void testCreateContainer() throws Exception { boolean created = false; while (!created) { privateContainer = prefix + new SecureRandom().nextInt(); try { created = getApi().createContainer(privateContainer, withMetadata(ImmutableMultimap.of("foo", "bar"))); } catch (UndeclaredThrowableException e) { HttpResponseException htpe = (HttpResponseException) e.getCause().getCause(); if (htpe.getResponse().getStatusCode() == 409) continue; throw e; } } Set<ContainerProperties> response = getApi().listContainers(includeMetadata()); assert null != response; long containerCount = response.size(); assertTrue(containerCount >= 1); ListBlobsResponse list = getApi().listBlobs(privateContainer); assertEquals(list.getUrl(), URI.create(String.format("https://%s.blob.core.windows.net/%s", view.unwrap( AzureBlobApiMetadata.CONTEXT_TOKEN).getIdentity(), privateContainer))); // TODO .. check to see the container actually exists }
@Test(timeOut = 5 * 60 * 1000) public void testCreateContainer() throws Exception { boolean created = false; while (!created) { // testListOwnedContainers requires a unique prefix privateContainer = CONTAINER_PREFIX + "unique-" + containerIndex.incrementAndGet(); try { created = getApi().createContainer(privateContainer, withMetadata(ImmutableMultimap.of("foo", "bar"))); } catch (UndeclaredThrowableException e) { HttpResponseException htpe = (HttpResponseException) e.getCause().getCause(); if (htpe.getResponse().getStatusCode() == 409) continue; throw e; } } Set<ContainerProperties> response = getApi().listContainers(includeMetadata()); assert null != response; long containerCount = response.size(); assertTrue(containerCount >= 1); ListBlobsResponse list = getApi().listBlobs(privateContainer); assertEquals(list.getUrl(), URI.create(String.format("https://%s.blob.core.windows.net/%s", view.unwrap().getIdentity(), privateContainer))); // TODO .. check to see the container actually exists }
assertEquals(list.getUrl(), URI.create(String.format("https://%s.blob.core.windows.net/$root", view.unwrap( AzureBlobApiMetadata.CONTEXT_TOKEN).getIdentity())));
assertEquals(list.getUrl(), URI.create(String.format("https://%s.blob.core.windows.net/$root", view.unwrap().getIdentity())));