コード例 #1
0
  /**
   * Integration test, because clearContainer is not redefined in {@link FilesystemAsyncBlobStore}
   * class
   */
  public void testClearContainer_NoOptions() throws IOException {
    final String CONTAINER_NAME2 = "containerToClear";

    // create containers
    blobStore.createContainerInLocation(null, CONTAINER_NAME);
    blobStore.createContainerInLocation(null, CONTAINER_NAME2);

    // creates blobs in first container
    Set<String> blobNamesCreatedInContainer1 =
        TestUtils.createBlobsInContainer(
            CONTAINER_NAME,
            "bbb" + File.separator + "ccc" + File.separator + "ddd" + File.separator + "1234.jpg",
            TestUtils.createRandomBlobKey(),
            "rrr" + File.separator + "sss" + File.separator + "788.jpg",
            "xdc" + File.separator + "wert.kpg");

    // creates blobs in second container
    blobStore.createContainerInLocation(null, CONTAINER_NAME2);
    Set<String> blobNamesCreatedInContainer2 =
        TestUtils.createBlobsInContainer(
            CONTAINER_NAME2,
            "asd"
                + File.separator
                + "bbb"
                + File.separator
                + "ccc"
                + File.separator
                + "ddd"
                + File.separator
                + "1234.jpg",
            TestUtils.createRandomBlobKey(),
            "rrr" + File.separator + "sss" + File.separator + "788.jpg",
            "xdc" + File.separator + "wert.kpg");

    // test blobs in containers
    checkForContainerContent(CONTAINER_NAME, blobNamesCreatedInContainer1);
    checkForContainerContent(CONTAINER_NAME2, blobNamesCreatedInContainer2);

    // delete blobs in first container
    blobStore.clearContainer(CONTAINER_NAME);
    checkForContainerContent(CONTAINER_NAME, null);
    checkForContainerContent(CONTAINER_NAME2, blobNamesCreatedInContainer2);
    // delete blobs in second container
    blobStore.clearContainer(CONTAINER_NAME2);
    checkForContainerContent(CONTAINER_NAME2, null);
  }
コード例 #2
0
 /** Strategy to perform any pre setup, before {@link org.apache.camel.CamelContext} is created */
 @Override
 protected void doPreSetup() throws Exception {
   BlobStore blobStore =
       ContextBuilder.newBuilder("transient")
           .credentials("identity", "credential")
           .buildView(BlobStoreContext.class)
           .getBlobStore();
   blobStore.createContainerInLocation(null, TEST_CONTAINER);
   blobStore.clearContainer(TEST_CONTAINER);
 }
コード例 #3
0
 /** TODO Should throws an exception? */
 public void testClearContainer_NotExistingContainer() {
   blobStore.clearContainer(CONTAINER_NAME);
 }