Examples of BlobStoreContext


Examples of org.jclouds.blobstore.BlobStoreContext

    @EndpointInject(uri = "mock:result-bar")
    protected MockEndpoint resultBar;

    @BeforeClass
    public static void setUpClass() throws Exception {
        BlobStoreContext context = new BlobStoreContextFactory().createContext("transient", "id", "credential");
        context.getBlobStore().createContainerInLocation(null, "foo");
        context.getBlobStore().createContainerInLocation(null, "bar");
    }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext

     * Strategy to perform any pre setup, before {@link org.apache.camel.CamelContext} is created
     */
    @Override
    protected void doPreSetup() throws Exception {
        BlobStoreContextFactory contextFactory = new BlobStoreContextFactory();
        BlobStoreContext blobStoreContext = contextFactory.createContext("transient", "identity", "credential");
        BlobStore blobStore = blobStoreContext.getBlobStore();
        blobStore.createContainerInLocation(null, TEST_CONTAINER);
        blobStore.clearContainer(TEST_CONTAINER);
    }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext

     * Strategy to perform any pre setup, before {@link org.apache.camel.CamelContext} is created
     */
    @Override
    protected void doPreSetup() throws Exception {
        BlobStoreContextFactory contextFactory = new BlobStoreContextFactory();
        BlobStoreContext blobStoreContext = contextFactory.createContext("transient", "identity", "credential");
        BlobStore blobStore = blobStoreContext.getBlobStore();
        blobStore.createContainerInLocation(null, TEST_CONTAINER);
        blobStore.clearContainer(TEST_CONTAINER);
    }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext

  @Test
  public void testStoreAndLoadState() throws Exception {
    ClusterSpec spec = getTestClusterSpec();

    BlobStoreContext context = BlobStoreContextBuilder.build(spec);
    String container = generateRandomContainerName(context);
    try {
      spec.setStateStore("blob");
      spec.setStateStoreContainer(container);

      Cluster expected = createTestCluster(new String[]{"region/id1", "region/id2"},
          new String[]{"role1", "role2"});

      BlobClusterStateStore store = new BlobClusterStateStore(spec);
      store.save(expected);

      /* load and check the stored state */
      Cluster stored = store.load();
      Cluster.Instance first = Iterables.getFirst(stored.getInstances(), null);
      assertNotNull(first);

      assertThat(first.getId(), is("region/id1"));
      assertThat(first.getRoles().contains("role1"), is(true));
      assertThat(stored.getInstances().size(), is(2));

      /* destroy stored state and check it no longer exists */
      store.destroy();
      expected = store.load();
      assertNull(expected);

    } finally {
      LOG.info("Removing temporary container '{}'", container);
      context.getBlobStore().deleteContainer(container);
    }
  }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext

  @Test
  public void testSpecifyCacheContainerInConfig() throws Exception {
    ClusterSpec spec = getTestClusterSpec();

    BlobStoreContext context = BlobStoreContextBuilder.build(spec);
    String container = generateRandomContainerName(context);
    LOG.info("Created temporary container '{}'", container);

    try {
      spec.setBlobStoreCacheContainer(container);

      BlobCache cache = BlobCache.getInstance(ComputeCache.INSTANCE, spec);
      assertThat(cache.getContainer(), is(container));
      cache.dropAndClose();

      assertThat(context.getBlobStore().containerExists(container), is(true));

    } finally {
      LOG.info("Removing temporary container '{}'", container);
      context.getBlobStore().deleteContainer(container);
    }
  }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext

         @Override
         public BlobStoreContext get() {
            // GAE alert!
            new File(basedir).mkdirs();
            BlobStoreContext returnVal = ContextBuilder.newBuilder("filesystem").overrides(overrides).modules(modules)
                     .buildView(BlobStoreContext.class);
            closer.addToClose(returnVal);
            return returnVal;
         }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext

@Test
public class BlobStoreConversionsTest {

   private BlobStore getBlobStore() {
      BlobStoreContext context = ContextBuilder.newBuilder("transient").name("test-transient").credentials("user", "pass").build(BlobStoreContext.class);
      return context.getBlobStore();
   }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext

  @Test
  public void testStoreAndLoadState() throws Exception {
    ClusterSpec spec = getTestClusterSpec();

    BlobStoreContext context = BlobStoreContextBuilder.build(spec);
    String container = generateRandomContainerName(context);
    try {
      spec.setStateStore("blob");
      spec.setStateStoreContainer(container);

      Cluster expected = createTestCluster(new String[]{"region/id1", "region/id2"},
          new String[]{"role1", "role2"});

      BlobClusterStateStore store = new BlobClusterStateStore(spec);
      store.save(expected);

      /* load and check the stored state */
      Cluster stored = store.load();
      Cluster.Instance first = Iterables.getFirst(stored.getInstances(), null);
      assertNotNull(first);

      assertThat(first.getId(), is("region/id1"));
      assertThat(first.getRoles().contains("role1"), is(true));
      assertThat(stored.getInstances().size(), is(2));

      /* destroy stored state and check it no longer exists */
      store.destroy();
      expected = store.load();
      assertNull(expected);

    } finally {
      LOG.info("Removing temporary container '{}'", container);
      context.getBlobStore().deleteContainer(container);
    }
  }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext

     * Strategy to perform any pre setup, before {@link org.apache.camel.CamelContext} is created
     */
    @Override
    protected void doPreSetup() throws Exception {
        BlobStoreContextFactory contextFactory = new BlobStoreContextFactory();
        BlobStoreContext blobStoreContext = contextFactory.createContext("transient", "identity", "credential");
        BlobStore blobStore = blobStoreContext.getBlobStore();
        blobStore.createContainerInLocation(null, TEST_CONTAINER);
        blobStore.clearContainer(TEST_CONTAINER);
    }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext

     * Strategy to perform any pre setup, before {@link org.apache.camel.CamelContext} is created
     */
    @Override
    protected void doPreSetup() throws Exception {
        BlobStoreContextFactory contextFactory = new BlobStoreContextFactory();
        BlobStoreContext blobStoreContext = contextFactory.createContext("transient", "identity", "credential");
        BlobStore blobStore = blobStoreContext.getBlobStore();
        blobStore.createContainerInLocation(null, TEST_CONTAINER);
        blobStore.clearContainer(TEST_CONTAINER);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.