Package org.akubraproject

Examples of org.akubraproject.BlobStore


  @Test
  public void testBackingStores() {
    store.setBackingStores(new ArrayList<BlobStore>());
    assertTrue(store.getBackingStores().isEmpty());

    BlobStore store1               = createMockStore(URI.create("urn:store:1"));
    store.setBackingStores(Collections.singletonList(store1));
    assertEquals(1, store.getBackingStores().size());
    assertEquals(store1, store.getBackingStores().get(0));

    BlobStore store2 = createMockStore(URI.create("urn:store:2"));
    BlobStore store3 = createMockStore(URI.create("urn:store:3"));

    store.setBackingStores(Arrays.asList(store1, store2, store3));
    assertEquals(3, store.getBackingStores().size());
    assertEquals(store1, store.getBackingStores().get(0));
    assertEquals(store2, store.getBackingStores().get(1));
View Full Code Here


    FileUtils.deleteDirectory(dbDir);
    dbDir.getParentFile().mkdirs();

    System.setProperty("derby.stream.error.file", new File(base, "derby.log").toString());

    BlobStore store = new TransactionalStore(URI.create("urn:" + name), backingStore, dbDir.getPath());
    return store;
  }
View Full Code Here

    assertEquals(Iterators.size(c.listBlobIds("info")), 1);
  }

  private static BlobStoreConnection getTestConnection(boolean prefixMappable)
      throws Exception {
    BlobStore store = new IdMappingBlobStore(URI.create("urn:test-store"),
        new MemBlobStore(), new MockIdMapper("internal:", prefixMappable));
    return store.openConnection(null, null);
  }
View Full Code Here

  private static Blob getTestBlob(URI blobId,
                                  boolean delegateCanCanonicalize)
      throws Exception {
    IdMapper mapper = new MockIdMapper();
    BlobStore store = new IdMappingBlobStore(URI.create("urn:test-store"),
        new MemBlobStore(), mapper);
    BlobStoreConnection connection = store.openConnection(null, null);
    Blob delegate = connection.getBlob(blobId, null);
    OutputStream out = delegate.openOutputStream(-1, false);
    IOUtils.copy(new StringReader(blobId.toString()), out);
    out.close();
    if (!delegateCanCanonicalize)
View Full Code Here

TOP

Related Classes of org.akubraproject.BlobStore

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.