@Override public boolean remove() { parent.removeProperty(name); return true; } }
public IndexDefinitionBuilder async(String ... asyncVals){ tree.removeProperty("async"); tree.setProperty("async", asList(asyncVals), STRINGS); return this; }
/** * Remove the property */ @Override public boolean remove() { if (parent.hasProperty(name)) { parent.removeProperty(name); return true; } else { return false; } }
private void updateImpersonatorNames(@NotNull Tree userTree, @NotNull Set<String> principalNames) { if (principalNames.isEmpty()) { userTree.removeProperty(REP_IMPERSONATORS); } else { userTree.setProperty(REP_IMPERSONATORS, principalNames, Type.STRINGS); } }
public IndexDefinitionBuilder async(String ... asyncVals){ tree.removeProperty("async"); tree.setProperty("async", asList(asyncVals), STRINGS); return this; }
@Override public void apply(Root root) throws RemoteCommitException { logger.debug("performing 'unset' operation on path={}, name={}", path, name); Tree tree = root.getTree(path); if (!tree.exists()) { throw new RemoteCommitException("tree does not exists"); } if (!tree.hasProperty(name)) { throw new RemoteCommitException("property does not exist"); } tree.removeProperty(name); }
@Test(expected = RepositoryException.class) public void testGetPrincipalNamePropertyMissing() throws Exception { Tree t = root.getTree(authorizable.getPath()); t.removeProperty(UserConstants.REP_PRINCIPAL_NAME); // getPrincipalName must throw authorizable.getPrincipalName(); }}
@Test public void testDeleteDeletedProperty() throws CommitFailedException { theirRoot.getTree("/").removeProperty("a"); ourRoot.getTree("/").removeProperty("a"); theirRoot.commit(); ourRoot.commit(); PropertyState p = ourRoot.getTree("/").getProperty("a"); assertNull(p); }
@Test public void testManualModification() throws Exception { // EXERCISE: fix the test case such that it passes. Tree jcrAllTree = PrivilegeUtil.getPrivilegesTree(root).getChild(PrivilegeConstants.JCR_ALL); jcrAllTree.removeProperty(PrivilegeConstants.REP_AGGREGATES); root.commit(); } }
@Test public void testStartAclTreeMissingMixin() throws Exception { init(); accessControlledTree.removeProperty(JcrConstants.JCR_MIXINTYPES); assertFalse(importer.start(aclTree)); }
@Test public void testDeleteDeletedProperty() throws CommitFailedException { theirRoot.getTree("/").removeProperty("a"); ourRoot.getTree("/").removeProperty("a"); theirRoot.commit(); ourRoot.commit(); PropertyState p = ourRoot.getTree("/").getProperty("a"); assertNull(p); }
private void wipeGroup(Root r) throws Exception { UserManager um = getUserManager(r); Group g = (Group) um.getAuthorizable(GROUP_ID); r.getTree(g.getPath()).removeProperty(UserConstants.REP_MEMBERS); r.commit(); } }
@Override public void testRemoveRepExternalIdWithoutPrincipalNames() throws Exception { root.getTree(testUserPath).setProperty(ExternalIdentityConstants.REP_EXTERNAL_ID, "id"); root.commit(); root.getTree(testUserPath).removeProperty(ExternalIdentityConstants.REP_EXTERNAL_ID); root.commit(); } }
@Test public void testGetVersionableMissingPathProperty() throws Exception { Tree versionHistory = checkNotNull(versionManager.getVersionHistory(root.getTree("/a"))); versionHistory.removeProperty(workspaceName); assertNull(versionManager.getVersionable(versionHistory, workspaceName)); assertNull(versionManager.getVersionable(versionHistory.getChild(JcrConstants.JCR_ROOTVERSION), workspaceName)); }
@Test public void testRemoveRepExternalIdWithoutPrincipalNamesAsSystem() throws Exception { Root systemRoot = getSystemRoot(); systemRoot.getTree(testUserPath).setProperty(ExternalIdentityConstants.REP_EXTERNAL_ID, "id"); systemRoot.commit(); systemRoot.getTree(testUserPath).removeProperty(ExternalIdentityConstants.REP_EXTERNAL_ID); systemRoot.commit(); }
@Test public void testGetNumEntriesMissingPropertyThreshold() throws Exception { try { Tree everyoneTree = getPermissionRoot(EveryonePrincipal.NAME); everyoneTree.removeProperty(REP_NUM_PERMISSIONS); long max = 1; assertEquals(NumEntries.valueOf(everyoneTree.getChildrenCount(max), false), permissionStore.getNumEntries(EveryonePrincipal.NAME, max)); } finally { root.refresh(); } }
@Test public void testRemoveRepExternalId() { try { root.getTree(externalUserPath).removeProperty(ExternalIdentityConstants.REP_EXTERNAL_ID); root.commit(); fail("Removal of rep:externalId must be detected in the default setup."); } catch (CommitFailedException e) { // success: verify nature of the exception assertTrue(e.isConstraintViolation()); assertEquals(73, e.getCode()); } }
@Test public void testChangeDeletedProperty() throws CommitFailedException { theirRoot.getTree("/").removeProperty("a"); ourRoot.getTree("/").setProperty("a", OUR_VALUE); theirRoot.commit(); ourRoot.commit(); PropertyState p = ourRoot.getTree("/").getProperty("a"); assertNull(p); }
@Test public void testChangeDeletedProperty() throws CommitFailedException { theirRoot.getTree("/").removeProperty("a"); ourRoot.getTree("/").setProperty("a", OUR_VALUE); theirRoot.commit(); ourRoot.commit(); PropertyState p = ourRoot.getTree("/").getProperty("a"); assertNotNull(p); assertEquals(OUR_VALUE, p.getValue(STRING)); }
@Test public void testDeleteChangedProperty() throws CommitFailedException { theirRoot.getTree("/").setProperty("a", THEIR_VALUE); ourRoot.getTree("/").removeProperty("a"); theirRoot.commit(); ourRoot.commit(); PropertyState p = ourRoot.getTree("/").getProperty("a"); assertNotNull(p); assertEquals(THEIR_VALUE, p.getValue(STRING)); }