@Test public void testRemoveExternalPrincipalNamesAsSystem() throws Exception { Root systemRoot = getSystemRoot(); NodeUtil n = new NodeUtil(systemRoot.getTree(externalUserPath)); // removal with system root must succeed n.removeProperty(ExternalIdentityConstants.REP_EXTERNAL_PRINCIPAL_NAMES); systemRoot.commit(); }
@Override @Test public void testRemoveRepExternalIdAsSystem() throws Exception { Root systemRoot = getSystemRoot(); NodeUtil n = new NodeUtil(systemRoot.getTree(externalUserPath)); n.removeProperty(ExternalIdentityConstants.REP_EXTERNAL_ID); systemRoot.commit(); } }
@Test public void testRemoveRepExternalIdAsSystem() throws Exception { Root systemRoot = getSystemRoot(); try { NodeUtil n = new NodeUtil(systemRoot.getTree(externalUserPath)); n.removeProperty(ExternalIdentityConstants.REP_EXTERNAL_ID); systemRoot.commit(); fail("Removing rep:externalId is not allowed if rep:externalPrincipalNames is present."); } catch (CommitFailedException e) { // success assertEquals(73, e.getCode()); } finally { systemRoot.refresh(); } }
@Test public void testRemoveMixin() throws Exception { node.setNames(JcrConstants.JCR_MIXINTYPES, MIX_REP_CUG_MIXIN); NodeUtil cug = node.addChild(REP_CUG_POLICY, NT_REP_CUG_POLICY); cug.setStrings(REP_PRINCIPAL_NAMES, EveryonePrincipal.NAME); root.commit(); try { node.removeProperty(JcrConstants.JCR_MIXINTYPES); root.commit(); fail(); } catch (CommitFailedException e) { assertTrue(e.isAccessControlViolation()); assertEquals(22, e.getCode()); } finally { root.refresh(); } }
rNode.removeProperty("boolean"); try { provider.validateRestrictions("/test", aceNode.getTree());