@Override protected void addTenObjectsUnderRoot(String containerName) throws InterruptedException { BlobMap blobMap = createMap(context, containerName, ListContainerOptions.NONE); for (int i = 0; i < 10; i++) { blobMap.put(i + "", blobMap.blobBuilder().payload(i + "content").build()); } }
@Test(groups = {"integration", "live"}) public void testPutMoreThanSingleListing() throws InterruptedException, ExecutionException, TimeoutException { if (maxResultsForTestListings() == 0) return; String bucketName = getContainerName(); try { BlobMap map = createMap(context, bucketName); Builder<String> keySet = ImmutableSet.<String>builder(); for (int i = 0; i < maxResultsForTestListings() + 1; i++) { keySet.add(i + ""); } Map<String, Blob> newMap = Maps.newLinkedHashMap(); for (String key : keySet.build()) { newMap.put(key, map.blobBuilder().payload(key).build()); } map.putAll(newMap); newMap.clear(); assertConsistencyAwareMapSize(map, maxResultsForTestListings() + 1); assertConsistencyAwareKeySetEquals(map, keySet.build()); map.clear(); assertConsistencyAwareMapSize(map, 0); } finally { returnContainer(bucketName); } }
@Override protected void addTenObjectsUnderPrefix(String containerName, String prefix) throws InterruptedException { BlobMap blobMap = createMap(context, containerName, inDirectory(prefix)); for (int i = 0; i < 10; i++) { blobMap.put(i + "", blobMap.blobBuilder().payload(i + "content").build()); } }
@Override public Blob apply(String arg0) { return map.blobBuilder().payload(arg0).build(); }