Refine search
@Test(groups = { "integration", "live" }) public void containerDoesntExist() { assert !view.getBlobStore().containerExists("forgetaboutit"); assert !view.getBlobStore().containerExists("cloudcachestorefunctionalintegrationtest-first"); }
@Test(groups = { "integration", "live" }) public void containerDoesntExist() { Random random = new Random(); assert !view.getBlobStore().containerExists("forgetaboutit" + random.nextInt(Integer.MAX_VALUE)); assert !view.getBlobStore().containerExists("cloudcachestorefunctionalintegrationtest-first" + random.nextInt(Integer.MAX_VALUE)); }
@Test(groups = { "integration", "live" }) public void testDuplicateCreateContainer() { BlobStore blobStore = view.getBlobStore(); Location location = null; String container = "container"; boolean created; created = blobStore.createContainerInLocation(location, container); assertTrue(created); created = blobStore.createContainerInLocation(location, container); assertFalse(created); } }
@Test(groups = { "integration", "live" }) public void deleteObjectNoContainer() { try { view.getBlobStore().removeBlob("donb", "test"); } catch (HttpResponseException e) { assertEquals(e.getResponse().getStatusCode(), 404); } catch (ContainerNotFoundException e) { } }
@Test(groups = "live", dependsOnMethods = "testPublicAccess") public void testPublicAccessInNonDefaultLocationWithBigBlob() throws InterruptedException, MalformedURLException, IOException { Location nonDefault = findNonDefaultLocationOrSkip(view.getBlobStore(), defaultLocation); String payload = Strings.repeat("a", 1024 * 1024); // 1MB runCreateContainerInLocation(payload, nonDefault); }
@Test(groups = { "integration", "live" }) void containerDoesntExist() { Set<? extends StorageMetadata> list = view.getBlobStore().list(); assert !list.contains(new MutableStorageMetadataImpl()); }
@Test(groups = { "integration", "live" }) public void testDuplicateCreateContainer() { BlobStore blobStore = view.getBlobStore(); Location location = null; String container = "container"; boolean created; created = blobStore.createContainerInLocation(location, container); assertTrue(created); created = blobStore.createContainerInLocation(location, container); assertFalse(created); }
@Test(groups = { "integration", "live" }) public void deleteObjectNoContainer() { try { view.getBlobStore().removeBlob("donb", "test"); } catch (HttpResponseException e) { assertEquals(e.getResponse().getStatusCode(), 404); } catch (ContainerNotFoundException e) { } }
@SuppressWarnings("CollectionIncompatibleType") @Test(groups = { "integration", "live" }) void containerDoesntExist() { Set<? extends StorageMetadata> list = view.getBlobStore().list(); assert !list.contains(new MutableStorageMetadataImpl()); }
@Test(groups = "live", dependsOnMethods = "testPublicAccess") public void testPublicAccessInNonDefaultLocation() throws InterruptedException, MalformedURLException, IOException { Location nonDefault = findNonDefaultLocationOrSkip(view.getBlobStore(), defaultLocation); String payload = "my data"; runCreateContainerInLocation(payload, nonDefault); }
@Test(groups = "live", dependsOnMethods = "testPublicAccess") public void testPublicAccessInNonDefaultLocationWithBigBlob() throws InterruptedException, MalformedURLException, IOException { Location nonDefault = findNonDefaultLocationOrSkip(view.getBlobStore(), defaultLocation); String payload = Strings.repeat("a", 1024 * 1024); // 1MB runCreateContainerInLocation(payload, nonDefault); }
@Test(groups = { "integration", "live" }) public void testPutTwiceIsOkAndDoesntOverwrite() throws InterruptedException { String containerName = getContainerName(); try { view.getBlobStore().createContainerInLocation(null, containerName); Blob blob = view.getBlobStore().blobBuilder("hello").payload(TEST_STRING).build(); view.getBlobStore().putBlob(containerName, blob); view.getBlobStore().createContainerInLocation(null, containerName); assertEquals(view.getBlobStore().countBlobs(containerName), 1); } finally { returnContainer(containerName); } }
@Test(groups = "live", dependsOnMethods = "testPublicAccess") public void testPublicAccessInNonDefaultLocation() throws InterruptedException, MalformedURLException, IOException { Location nonDefault = findNonDefaultLocationOrSkip(view.getBlobStore(), defaultLocation); String payload = "my data"; runCreateContainerInLocation(payload, nonDefault); }
/** * Default listAll is not eager, so test that exception is thrown when first attempt to iterate. */ @Test(expectedExceptions = { ContainerNotFoundException.class }) public void testListAllForUnknownContainerFromTransientBlobStore() throws Exception { ListContainerOptions options = ListContainerOptions.NONE; BlobStoreContext context = blobStoreContext(); try { BlobStore blobStore = context.getBlobStore(); Iterable<StorageMetadata> iterable = BlobStores.listAll(blobStore, "wrongcontainer", options); iterable.iterator().hasNext(); } finally { context.close(); } }
@Test(groups = { "integration", "live" }) public void testListContainer() throws InterruptedException, ExecutionException, TimeoutException { String containerName = getContainerName(); try { add15UnderRoot(containerName); Set<? extends StorageMetadata> container = view.getBlobStore().list(containerName); assertEquals(container.size(), 15); } finally { returnContainer(containerName); } }
@Test(groups = { "integration", "live" }) public void containerExists() throws InterruptedException { String containerName = getContainerName(); try { assert view.getBlobStore().containerExists(containerName); } finally { returnContainer(containerName); } }
@Test(groups = { "integration", "live" }) public void blobNotFound() throws InterruptedException { String container = getContainerName(); String name = "test"; try { assert !view.getBlobStore().blobExists(container, name); } finally { returnContainer(container); } }
@Test(groups = { "integration", "live" }) public void deleteObjectNotFound() throws InterruptedException { String container = getContainerName(); String name = "test"; try { view.getBlobStore().removeBlob(container, name); } finally { returnContainer(container); } }
@Test(groups = { "integration", "live" }) public void containerExists() throws InterruptedException { String containerName = getContainerName(); try { assert view.getBlobStore().containerExists(containerName); } finally { returnContainer(containerName); } }
@Test(groups = { "integration", "live" }) public void deleteObjectNotFound() throws InterruptedException { String container = getContainerName(); String name = "test"; try { view.getBlobStore().removeBlob(container, name); } finally { returnContainer(container); } }