@Test(expected = CommitFailedException.class) public void testPropertyChanged() throws Exception { try { PropertyState before = PropertyStates.createProperty(REP_AGGREGATES, ImmutableList.of(REP_READ_NODES, REP_READ_PROPERTIES), Type.NAMES); PropertyState after = PropertyStates.createProperty(REP_AGGREGATES, ImmutableList.of(REP_READ_NODES), Type.NAMES); PrivilegeValidator validator = new PrivilegeValidator(root, root, getTreeProvider()); validator.propertyChanged(before, after); } catch (CommitFailedException e) { throw assertCommitFailed(e, 45); } }
@Override public void propertyChanged(PropertyState before, PropertyState after) throws CommitFailedException { if (REP_NEXT.equals(before.getName())) { validateNext(PrivilegeBits.getInstance(getPrivilegesTree(rootBefore).getProperty(REP_NEXT))); } else { throw new CommitFailedException(CONSTRAINT, 45, "Attempt to modify existing privilege definition."); } }
PrivilegeValidator extends DefaultValidator implements PrivilegeConstants { @Override public void propertyChanged(PropertyState before, PropertyState after) throws CommitFailedException { if (REP_NEXT.equals(before.getName())) { validateNext(PrivilegeBits.getInstance(getPrivilegesTree(rootBefore).getProperty(REP_NEXT))); } else { throw new CommitFailedException(CONSTRAINT, 45, "Attempt to modify existing privilege definition."); } } }
PrivilegeValidator extends DefaultValidator implements PrivilegeConstants { @Override public void propertyChanged(PropertyState before, PropertyState after) throws CommitFailedException { if (REP_NEXT.equals(before.getName())) { validateNext(PrivilegeBits.getInstance(getPrivilegesTree(rootBefore).getProperty(REP_NEXT))); } else { throw new CommitFailedException(CONSTRAINT, 45, "Attempt to modify existing privilege definition."); } } PrivilegeValidator(@NotNull Root before, @NotNull Root after, @NotNull TreeProvider treeProvider); }
PrivilegeValidator extends DefaultValidator implements PrivilegeConstants { @Override public void propertyChanged(PropertyState before, PropertyState after) throws CommitFailedException { if (REP_NEXT.equals(before.getName())) { validateNext(PrivilegeBits.getInstance(getPrivilegesTree(rootBefore).getProperty(REP_NEXT))); } else { throw new CommitFailedException(CONSTRAINT, 45, "Attempt to modify existing privilege definition."); } } PrivilegeValidator(@NotNull Root before, @NotNull Root after, @NotNull TreeProvider treeProvider); @Override void propertyAdded(PropertyState after); @Override void propertyChanged(PropertyState before, PropertyState after); @Override void propertyDeleted(PropertyState before); @Override Validator childNodeAdded(String name, NodeState after); @Override Validator childNodeChanged(String name, NodeState before, NodeState after); @Override Validator childNodeDeleted(String name, NodeState before); }
PrivilegeValidator extends DefaultValidator implements PrivilegeConstants { @Override public void propertyChanged(PropertyState before, PropertyState after) throws CommitFailedException { if (REP_NEXT.equals(before.getName())) { validateNext(PrivilegeBits.getInstance(getPrivilegesTree(rootBefore).getProperty(REP_NEXT))); } else { throw new CommitFailedException(CONSTRAINT, 45, "Attempt to modify existing privilege definition."); } } PrivilegeValidator(@NotNull Root before, @NotNull Root after, @NotNull TreeProvider treeProvider); @Override void propertyAdded(PropertyState after); @Override void propertyChanged(PropertyState before, PropertyState after); @Override void propertyDeleted(PropertyState before); @Override Validator childNodeAdded(String name, NodeState after); @Override Validator childNodeChanged(String name, NodeState before, NodeState after); @Override Validator childNodeDeleted(String name, NodeState before);  }