Search in sources :

Example 31 with BlobStore

use of org.apache.jackrabbit.oak.spi.blob.BlobStore in project jackrabbit-oak by apache.

the class DefaultStandbyBlobReaderTest method shouldReturnBlobContent.

@Test
public void shouldReturnBlobContent() throws Exception {
    BlobStore s = mock(BlobStore.class);
    when(s.getInputStream("id")).thenReturn(new ByteArrayInputStream(new byte[] { 1, 2, 3 }));
    DefaultStandbyBlobReader r = new DefaultStandbyBlobReader(s);
    assertArrayEquals(new byte[] { 1, 2, 3 }, r.readBlob("id"));
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) BlobStore(org.apache.jackrabbit.oak.spi.blob.BlobStore) Test(org.junit.Test)

Aggregations

BlobStore (org.apache.jackrabbit.oak.spi.blob.BlobStore)31 Test (org.junit.Test)14 DataStoreBlobStore (org.apache.jackrabbit.oak.plugins.blob.datastore.DataStoreBlobStore)9 GarbageCollectableBlobStore (org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore)9 File (java.io.File)8 NodeStore (org.apache.jackrabbit.oak.spi.state.NodeStore)8 ByteArrayInputStream (java.io.ByteArrayInputStream)6 DataStoreUtils.getBlobStore (org.apache.jackrabbit.oak.plugins.blob.datastore.DataStoreUtils.getBlobStore)6 IOException (java.io.IOException)5 MemoryBlobStore (org.apache.jackrabbit.oak.spi.blob.MemoryBlobStore)4 DataStore (org.apache.jackrabbit.core.data.DataStore)3 FileDataStore (org.apache.jackrabbit.core.data.FileDataStore)3 Closer (com.google.common.io.Closer)2 Hashtable (java.util.Hashtable)2 Oak (org.apache.jackrabbit.oak.Oak)2 BlobTrackingStore (org.apache.jackrabbit.oak.plugins.blob.BlobTrackingStore)2 MemoryNodeStore (org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore)2 FileBlobStore (org.apache.jackrabbit.oak.spi.blob.FileBlobStore)2 DefaultSplitBlobStore (org.apache.jackrabbit.oak.spi.blob.split.DefaultSplitBlobStore)2 NodeBuilder (org.apache.jackrabbit.oak.spi.state.NodeBuilder)2