use of org.apache.jackrabbit.oak.plugins.blob.serializer.FSBlobSerializer in project jackrabbit-oak by apache.
the class FSBlobSerializerTest method blobs.
@Test
public void blobs() throws Exception {
int maxInlineSize = 100;
FSBlobSerializer serializer = new FSBlobSerializer(folder.getRoot(), maxInlineSize);
String data = Strings.repeat("x", maxInlineSize * 10);
Blob b = new ArrayBasedBlob(data.getBytes(UTF_8));
String id = serializer.serialize(b);
Blob b2 = serializer.deserialize(id);
assertTrue(AbstractBlob.equal(b, b2));
}
use of org.apache.jackrabbit.oak.plugins.blob.serializer.FSBlobSerializer in project jackrabbit-oak by apache.
the class NodeStateSerializer method createBlobSerializer.
private BlobSerializer createBlobSerializer(File dir) {
if (!serializeBlobContent) {
return new BlobSerializer();
}
File blobs = new File(dir, blobDirName);
blobSerializer = new FSBlobSerializer(blobs);
return blobSerializer;
}
use of org.apache.jackrabbit.oak.plugins.blob.serializer.FSBlobSerializer in project jackrabbit-oak by apache.
the class FSBlobSerializerTest method errorBlob.
@Test
public void errorBlob() throws Exception {
FSBlobSerializer serializer = new FSBlobSerializer(folder.getRoot(), 1);
String blobValue = serializer.serialize(new BadBlob());
try {
Blob b = serializer.deserialize(blobValue);
assertEquals("foo", b.getContentIdentity());
b.getNewStream();
fail();
} catch (RuntimeException ignore) {
}
}
Aggregations