@Test public void deleteObject() throws IOException { object.uploadObject(new byte[] {}); assertEquals(1, container.list().size()); object.delete(); assertEquals(0, container.list().size()); }
@Test public void listObjectsPaged() { container.getObject("A").uploadObject(new byte[] {}); container.getObject("B").uploadObject(new byte[] {}); StoredObject object3 = container.getObject("C"); object3.uploadObject(new byte[] {}); StoredObject object4 = container.getObject("D"); object4.uploadObject(new byte[] {}); Collection<StoredObject> objects = container.list(null, "B", 2); assertEquals(2, objects.size()); objects.contains(object3); objects.contains(object4); }
@Test public void listContainersUsePaginationMap() { container.getObject("A").uploadObject(new byte[] {}); container.getObject("B").uploadObject(new byte[] {}); StoredObject object3 = container.getObject("C"); object3.uploadObject(new byte[] {}); StoredObject object4 = container.getObject("D"); object4.uploadObject(new byte[] {}); PaginationMap paginationMap = container.getPaginationMap(2); Collection<StoredObject> objects = container.list(paginationMap, 1); assertEquals(2, objects.size()); objects.contains(object3); objects.contains(object4); }
@Test public void listObjects() throws IOException { addObjects(3); assertEquals(3, container.list().size()); }