Package org.jclouds.azureblob.domain

Examples of org.jclouds.azureblob.domain.ListBlobBlocksResponse


      List<BlobBlockProperties> blocks = new LinkedList<BlobBlockProperties>();
      blocks.add(new BlobBlockPropertiesImpl("blockIdA", 1234, true));
      blocks.add(new BlobBlockPropertiesImpl("blockIdB", 4321, true));
      blocks.add(new BlobBlockPropertiesImpl("blockIdC", 5678, false));
      blocks.add(new BlobBlockPropertiesImpl("blockIdD", 8765, false));
      ListBlobBlocksResponse expected = new ListBlobBlocksResponseImpl(blocks);

      ListBlobBlocksResponse result = factory.create(
            injector.getInstance(BlobBlocksResultsHandler.class)).parse(is);

      assertEquals(expected, result);
   }
View Full Code Here


      getApi().createContainer(blockContainer);
      getApi().putBlock(blockContainer, blockBlob, blockIdA, new ByteArrayPayload(A.getBytes()));
      getApi().putBlock(blockContainer, blockBlob, blockIdB, new ByteArrayPayload(B.getBytes()));
      getApi().putBlock(blockContainer, blockBlob, blockIdC, new ByteArrayPayload(C.getBytes()));
      getApi().putBlockList(blockContainer, blockBlob, Arrays.asList(blockIdA, blockIdB, blockIdC));
      ListBlobBlocksResponse blocks = getApi().getBlockList(blockContainer, blockBlob);
      assertEquals(3, blocks.getBlocks().size());
      assertEquals(blockIdA, blocks.getBlocks().get(0).getBlockName());
      assertEquals(blockIdB, blocks.getBlocks().get(1).getBlockName());
      assertEquals(blockIdC, blocks.getBlocks().get(2).getBlockName());
      assertEquals(1, blocks.getBlocks().get(0).getContentLength());
      assertEquals(1, blocks.getBlocks().get(1).getContentLength());
      assertEquals(1, blocks.getBlocks().get(2).getContentLength());
      getApi().deleteContainer(blockContainer);
   }
View Full Code Here

      getApi().createContainer(blockContainer);
      getApi().putBlock(blockContainer, blockBlob, blockIdA, new ByteArrayPayload(A.getBytes()));
      getApi().putBlock(blockContainer, blockBlob, blockIdB, new ByteArrayPayload(B.getBytes()));
      getApi().putBlock(blockContainer, blockBlob, blockIdC, new ByteArrayPayload(C.getBytes()));
      getApi().putBlockList(blockContainer, blockBlob, Arrays.asList(blockIdA, blockIdB, blockIdC));
      ListBlobBlocksResponse blocks = getApi().getBlockList(blockContainer, blockBlob);
      assertEquals(3, blocks.getBlocks().size());
      assertEquals(blockIdA, blocks.getBlocks().get(0).getBlockName());
      assertEquals(blockIdB, blocks.getBlocks().get(1).getBlockName());
      assertEquals(blockIdC, blocks.getBlocks().get(2).getBlockName());
      assertEquals(1, blocks.getBlocks().get(0).getContentLength());
      assertEquals(1, blocks.getBlocks().get(1).getContentLength());
      assertEquals(1, blocks.getBlocks().get(2).getContentLength());
      getApi().deleteContainer(blockContainer);
   }
View Full Code Here

      List<BlobBlockProperties> blocks = Lists.newLinkedList();
      blocks.add(new BlobBlockPropertiesImpl("blockIdA", 1234, true));
      blocks.add(new BlobBlockPropertiesImpl("blockIdB", 4321, true));
      blocks.add(new BlobBlockPropertiesImpl("blockIdC", 5678, false));
      blocks.add(new BlobBlockPropertiesImpl("blockIdD", 8765, false));
      ListBlobBlocksResponse expected = new ListBlobBlocksResponseImpl(blocks);

      ListBlobBlocksResponse result = factory.create(
            injector.getInstance(BlobBlocksResultsHandler.class)).parse(is);

      assertEquals(expected, result);
   }
View Full Code Here

      getApi().createContainer(blockContainer);
      getApi().putBlock(blockContainer, blockBlob, blockIdA, new ByteArrayPayload(A.getBytes()));
      getApi().putBlock(blockContainer, blockBlob, blockIdB, new ByteArrayPayload(B.getBytes()));
      getApi().putBlock(blockContainer, blockBlob, blockIdC, new ByteArrayPayload(C.getBytes()));
      getApi().putBlockList(blockContainer, blockBlob, Arrays.asList(blockIdA, blockIdB, blockIdC));
      ListBlobBlocksResponse blocks = getApi().getBlockList(blockContainer, blockBlob);
      assertEquals(3, blocks.getBlocks().size());
      assertEquals(blockIdA, blocks.getBlocks().get(0).getBlockName());
      assertEquals(blockIdB, blocks.getBlocks().get(1).getBlockName());
      assertEquals(blockIdC, blocks.getBlocks().get(2).getBlockName());
      assertEquals(1, blocks.getBlocks().get(0).getContentLength());
      assertEquals(1, blocks.getBlocks().get(1).getContentLength());
      assertEquals(1, blocks.getBlocks().get(2).getContentLength());
      getApi().deleteContainer(blockContainer);
   }
View Full Code Here

      getApi().createContainer(blockContainer);
      getApi().putBlock(blockContainer, blockBlob, blockIdA, Payloads.newByteArrayPayload(A.getBytes()));
      getApi().putBlock(blockContainer, blockBlob, blockIdB, Payloads.newByteArrayPayload(B.getBytes()));
      getApi().putBlock(blockContainer, blockBlob, blockIdC, Payloads.newByteArrayPayload(C.getBytes()));
      getApi().putBlockList(blockContainer, blockBlob, Arrays.asList(blockIdA, blockIdB, blockIdC));
      ListBlobBlocksResponse blocks = getApi().getBlockList(blockContainer, blockBlob);
      assertEquals(3, blocks.getBlocks().size());
      assertEquals(blockIdA, blocks.getBlocks().get(0).getBlockName());
      assertEquals(blockIdB, blocks.getBlocks().get(1).getBlockName());
      assertEquals(blockIdC, blocks.getBlocks().get(2).getBlockName());
      assertEquals(1, blocks.getBlocks().get(0).getContentLength());
      assertEquals(1, blocks.getBlocks().get(1).getContentLength());
      assertEquals(1, blocks.getBlocks().get(2).getContentLength());
      getApi().deleteContainer(blockContainer);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.azureblob.domain.ListBlobBlocksResponse

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.