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

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


    }

    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

      {
         try
         {

            String guid = (String) statefulGuidField.get(ejbContext);
            Container container = Ejb3Registry.getContainer(guid);
            return container.getEjbName();
         }
         catch (IllegalArgumentException e)
         {
            throw new RuntimeException(e);
         }
View Full Code Here

   public Object invoke(Invocation invocation) throws Throwable
   {
      if (isLocal())
      {
         String guid = (String)invocation.getMetaData(IS_LOCAL, GUID);
         Container container = Ejb3Registry.getContainer(guid);
        
         return invokeLocal(invocation, container);
      }
      return invocation.invokeNext();
   }
View Full Code Here

   }
  
   public void test1()
   {
      ThreadlocalPool pool = new ThreadlocalPool();
      Container container = new MockContainer();
      int maxSize = -1;
      int timeout = -1;
      pool.initialize(container, maxSize, timeout);
      BeanContext ctx = pool.get();
      pool.release(ctx);
View Full Code Here

   }

   public void testInUse1()
   {
      ThreadlocalPool pool = new ThreadlocalPool();
      Container container = new MockContainer();
      int maxSize = -1;
      int timeout = -1;
      pool.initialize(container, maxSize, timeout);

      assertEquals(0, pool.getAvailableCount());
View Full Code Here

   }

   public void testWithThreads() throws Exception
   {
      final ThreadlocalPool pool = new ThreadlocalPool();
      Container container = new MockContainer();
      int maxSize = -1;
      int timeout = -1;
      pool.initialize(container, maxSize, timeout);
     
      Runnable r = new Runnable()
View Full Code Here

TOP

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

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.