private SegmentNodeStore nodeStore;
private FileBlob fileBlob;
@Test
public void testCreateAndRead() throws Exception {
SegmentNodeStore nodeStore = getNodeStore();
NodeState state = nodeStore.getRoot().getChildNode("hello");
if (!state.exists()) {
NodeBuilder builder = nodeStore.getRoot().builder();
builder.child("hello");
nodeStore.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
}
Blob blob = getFileBlob();
NodeBuilder builder = nodeStore.getRoot().builder();
builder.getChildNode("hello").setProperty("world", blob);
nodeStore.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
state = nodeStore.getRoot().getChildNode("hello");
blob = state.getProperty("world").getValue(Type.BINARY);
assertTrue("Blob written and read must be equal",
AbstractBlob.equal(blob, getFileBlob()));
}