Package com.microsoft.windowsazure.services.blob.models

Examples of com.microsoft.windowsazure.services.blob.models.ListContainersResult


    }

    private static Set<String> listContainers(BlobContract service,
            String prefix) throws Exception {
        HashSet<String> result = new HashSet<String>();
        ListContainersResult list = service
                .listContainers(new ListContainersOptions().setPrefix(prefix));
        for (Container item : list.getContainers()) {
            result.add(item.getName());
        }
        return result;
    }
View Full Code Here


                .setPublicAccess("blob").addMetadata("test", "bar")
                .addMetadata("blah", "bleah"));

        // Act
        service.deleteContainer(containerName);
        ListContainersResult listContainerResult = service.listContainers();

        // Assert
        for (Container container : listContainerResult.getContainers()) {
            assertTrue(!container.getName().equals(containerName));
        }
    }
View Full Code Here

        // Arrange
        Configuration config = createConfiguration();
        BlobContract service = BlobService.create(config);

        // Act
        ListContainersResult results = service.listContainers();

        // Assert
        assertNotNull(results);
        assertTrue(testContainers.length <= results.getContainers().size());
        assertNotNull(results.getContainers().get(0).getName());
        assertNotNull(results.getContainers().get(0).getMetadata());
        assertNotNull(results.getContainers().get(0).getProperties());
        assertNotNull(results.getContainers().get(0).getProperties().getEtag());
        assertNotNull(results.getContainers().get(0).getProperties()
                .getLastModified());
        assertNotNull(results.getContainers().get(0).getUrl());
    }
View Full Code Here

        // Arrange
        Configuration config = createConfiguration();
        BlobContract service = BlobService.create(config);

        // Act
        ListContainersResult results = service
                .listContainers(new ListContainersOptions().setMaxResults(3));
        ListContainersResult results2 = service
                .listContainers(new ListContainersOptions().setMarker(results
                        .getNextMarker()));

        // Assert
        assertNotNull(results);
        assertEquals(3, results.getContainers().size());
        assertNotNull(results.getNextMarker());
        assertEquals(3, results.getMaxResults());

        assertNotNull(results2);
        assertTrue(testContainers.length - 3 <= results2.getContainers().size());
        assertEquals("", results2.getNextMarker());
        assertEquals(0, results2.getMaxResults());
    }
View Full Code Here

        // Arrange
        Configuration config = createConfiguration();
        BlobContract service = BlobService.create(config);

        // Act
        ListContainersResult results = service
                .listContainers(new ListContainersOptions().setPrefix(
                        testContainersPrefix).setMaxResults(3));
        // Assert
        assertNotNull(results);
        assertEquals(3, results.getContainers().size());
        assertNotNull(results.getNextMarker());
        assertEquals(3, results.getMaxResults());

        // Act
        ListContainersResult results2 = service
                .listContainers(new ListContainersOptions().setPrefix(
                        testContainersPrefix)
                        .setMarker(results.getNextMarker()));

        // Assert
        assertNotNull(results2);
        assertNotNull(results2.getNextMarker());
        assertEquals(0, results2.getMaxResults());

        // Act
        ListContainersResult results3 = service
                .listContainers(new ListContainersOptions()
                        .setPrefix(testContainersPrefix));

        // Assert
        assertEquals(results.getContainers().size()
                + results2.getContainers().size(), results3.getContainers()
                .size());
    }
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.services.blob.models.ListContainersResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.