use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class AccessControlValidatorTest method hiddenNodeChanged.
@Test
public void hiddenNodeChanged() throws CommitFailedException {
AccessControlValidatorProvider provider = new AccessControlValidatorProvider(getSecurityProvider());
MemoryNodeStore store = new MemoryNodeStore();
NodeBuilder builder = store.getRoot().builder();
builder.child("test").child(":hidden");
NodeState root = builder.getNodeState();
NodeBuilder test = root.builder().child("test");
NodeBuilder hidden = test.child(":hidden");
hidden.child("added");
Validator validator = provider.getRootValidator(root, builder.getNodeState(), CommitInfo.EMPTY);
Validator childValidator = validator.childNodeChanged("test", root.getChildNode("test"), test.getNodeState());
assertNotNull(childValidator);
Validator hiddenValidator = childValidator.childNodeChanged(":hidden", root.getChildNode("test").getChildNode(":hidden"), hidden.getNodeState());
assertNull(hiddenValidator);
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class AccessControlValidatorTest method hiddenNodeAdded.
@Test
public void hiddenNodeAdded() throws CommitFailedException {
AccessControlValidatorProvider provider = new AccessControlValidatorProvider(getSecurityProvider());
MemoryNodeStore store = new MemoryNodeStore();
NodeState root = store.getRoot();
NodeBuilder builder = root.builder();
NodeBuilder test = builder.child("test");
NodeBuilder hidden = test.child(":hidden");
Validator validator = provider.getRootValidator(root, builder.getNodeState(), CommitInfo.EMPTY);
Validator childValidator = validator.childNodeAdded("test", test.getNodeState());
assertNotNull(childValidator);
Validator hiddenValidator = childValidator.childNodeAdded(":hidden", hidden.getNodeState());
assertNull(hiddenValidator);
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class AccessControlValidatorTest method hiddenNodeDeleted.
@Test
public void hiddenNodeDeleted() throws CommitFailedException {
AccessControlValidatorProvider provider = new AccessControlValidatorProvider(getSecurityProvider());
MemoryNodeStore store = new MemoryNodeStore();
NodeBuilder builder = store.getRoot().builder();
builder.child("test").child(":hidden");
NodeState root = builder.getNodeState();
builder = root.builder();
NodeBuilder test = builder.child("test");
test.child(":hidden").remove();
Validator validator = provider.getRootValidator(root, builder.getNodeState(), CommitInfo.EMPTY);
Validator childValidator = validator.childNodeChanged("test", root.getChildNode("test"), test.getNodeState());
assertNotNull(childValidator);
Validator hiddenValidator = childValidator.childNodeDeleted(":hidden", root.getChildNode("test").getChildNode(":hidden"));
assertNull(hiddenValidator);
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class UserValidatorTest method hiddenNodeDeleted.
@Test
public void hiddenNodeDeleted() throws CommitFailedException {
UserValidatorProvider provider = new UserValidatorProvider(getConfig());
MemoryNodeStore store = new MemoryNodeStore();
NodeBuilder builder = store.getRoot().builder();
builder.child("test").child(":hidden");
NodeState root = builder.getNodeState();
builder = root.builder();
NodeBuilder test = builder.child("test");
test.child(":hidden").remove();
Validator validator = provider.getRootValidator(root, builder.getNodeState(), CommitInfo.EMPTY);
Validator childValidator = validator.childNodeChanged("test", root.getChildNode("test"), test.getNodeState());
assertNotNull(childValidator);
Validator hiddenValidator = childValidator.childNodeDeleted(":hidden", root.getChildNode("test").getChildNode(":hidden"));
assertNull(hiddenValidator);
}
use of org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore in project jackrabbit-oak by apache.
the class CompositeNodeStoreBuilderTest method mismatchBetweenMountNameAndStoreName.
@Test(expected = NullPointerException.class)
public void mismatchBetweenMountNameAndStoreName() {
MountInfoProvider mip = Mounts.newBuilder().mount("temp", "/tmp").build();
new CompositeNodeStore.Builder(mip, new MemoryNodeStore()).addMount("not-temp", new MemoryNodeStore()).build();
}
Aggregations