use of org.apache.jackrabbit.oak.plugins.memory.ArrayBasedBlob in project jackrabbit-oak by apache.
the class BlobIdRecordTest method shortReferencesShouldHaveBlobIdType.
@Test
public void shortReferencesShouldHaveBlobIdType() throws Exception {
try (FileStore ss = newFileStore(new ShortIdMappingBlobStore())) {
SegmentWriter sw = defaultSegmentWriterBuilder("test").build(ss);
byte[] content = new byte[Segment.MEDIUM_LIMIT + 1];
SegmentBlob sb = new SegmentBlob(ss.getBlobStore(), sw.writeBlob(new ArrayBasedBlob(content)));
assertRecordTypeEquals(sb, RecordType.BLOB_ID);
}
}
use of org.apache.jackrabbit.oak.plugins.memory.ArrayBasedBlob in project jackrabbit-oak by apache.
the class BlobIdSerializerTest method blobStoreBlob.
@Test
public void blobStoreBlob() throws Exception {
Blob b = new ArrayBasedBlob("hello world".getBytes());
String value = blobStore.writeBlob(b.getNewStream());
String serValue = serializer.serialize(new BlobStoreBlob(blobStore, value));
Blob b2 = serializer.deserialize(serValue);
assertTrue(AbstractBlob.equal(b, b2));
}
Aggregations