/** * @inheritDoc */ public void removeVersionLabel(String label) throws VersionException, RepositoryException { versionHistory.removeVersionLabel(label); }
protected void tearDown() throws Exception { try { // clean up: remove the version labels again. vHistory.removeVersionLabel(versionLabel); vHistory.removeVersionLabel(versionLabel2); } catch (RepositoryException e) { // ignore } vHistory = null; version = null; super.tearDown(); }
/** {@inheritDoc} */ public void removeVersionLabel(String label) throws RepositoryException, RemoteException { try { versionHistory.removeVersionLabel(label); } catch (RepositoryException ex) { throw getRepositoryException(ex); } }
@Override public void removeVersionLabel(String label) throws VersionException, RepositoryException { getWrappedVersionHistory().removeVersionLabel(label); }
public void removeVersionLabel(String label) throws RepositoryException { getDelegate().removeVersionLabel(label); }
public Object run() throws RepositoryException { String jcrLabel; jcrLabel = sInfo.getNamePathResolver().getJCRName((label)); Node vHistory = getNode(versionHistoryId, sInfo); if (vHistory instanceof VersionHistory) { ((VersionHistory) vHistory).removeVersionLabel(jcrLabel); } else { throw new RepositoryException("versionHistoryId does not reference a VersionHistory node"); } return null; } }, sInfo);
public Object run() throws RepositoryException { String jcrLabel; jcrLabel = sInfo.getNamePathResolver().getJCRName((label)); Node vHistory = getNode(versionHistoryId, sInfo); if (vHistory instanceof VersionHistory) { ((VersionHistory) vHistory).removeVersionLabel(jcrLabel); } else { throw new RepositoryException("versionHistoryId does not reference a VersionHistory node"); } return null; } }, sInfo);
/** * Test the removal of an version label that does not exist (must throw VersionException). * * @throws RepositoryException */ public void testRemoveNonExistingLabel() throws RepositoryException { if (vHistory.hasVersionLabel(versionLabel)) { fail("Testing the removal on a non-existing version label failed: '" + versionLabel + "' exists on version history."); } try { vHistory.removeVersionLabel(versionLabel); fail("VersionHistory.removeLabel(String) must throw a VersionException if the label does not exist."); } catch (VersionException e) { // success } }
/** * Test the removal of an version label that has successfully been added * before. * * @throws RepositoryException * @see VersionHistory#removeVersionLabel(String) */ public void testRemoveLabel() throws RepositoryException { vHistory.addVersionLabel(version.getName(), versionLabel, false); vHistory.removeVersionLabel(versionLabel); assertFalse("VersionHistory.removeLabel(String) must remove the version label if it exists (has successfully been added before).", vHistory.hasVersionLabel(versionLabel)); }
public void testRemovedLabel3() throws RepositoryException { vHistory.addVersionLabel(version.getName(), versionLabel, false); vHistory.removeVersionLabel(versionLabel); List<String> labels = Arrays.asList(vHistory.getVersionLabels(version)); assertFalse("VersionHistory.getVersionLabels(Version) must not return a removed label.",labels.contains(versionLabel)); }
public void testRemovedLabel2() throws RepositoryException { vHistory.addVersionLabel(version.getName(), versionLabel, false); vHistory.removeVersionLabel(versionLabel); List<String> labels = Arrays.asList(vHistory.getVersionLabels()); assertFalse("VersionHistory.getVersionLabels() must not return a removed label.",labels.contains(versionLabel)); }
public NodeIterator execute() throws Exception { Node n = getNode(); VersionHistory vh = n.getVersionHistory(); String[] labels = vh.getVersionLabels(); if (labels.length > 0) { String label = labels[getRandom().nextInt(labels.length)]; log.info(n.getPath() + " -> " + label); vh.removeVersionLabel(label); } return wrapWithIterator(n); } }
VersionHistory vh = getVersionHistoryItem(); if (labelInfo.getType() == LabelInfo.TYPE_REMOVE) { vh.removeVersionLabel(labelInfo.getLabelName()); } else if (labelInfo.getType() == LabelInfo.TYPE_ADD) {
/** * @since oak */ @Test public void testRemoveVersionLabel() throws Exception { Node n = createVersionableNode(superuser.getNode(path)); allow(n.getPath(), versionPrivileges); Node testNode = testSession.getNode(n.getPath()); Version v = testNode.checkin(); testNode.checkout(); Version v2 = testNode.checkin(); testNode.checkout(); // -> VersionHistory.addVersionLabel must be allowed VersionHistory history = testNode.getVersionHistory(); history.addVersionLabel(v.getName(), "testLabel", false); history.addVersionLabel(v2.getName(), "testLabel", true); VersionManager vMgr = testSession.getWorkspace().getVersionManager(); history = vMgr.getVersionHistory(testNode.getPath()); history.removeVersionLabel("testLabel"); }
VersionHistory vh = getVersionHistoryItem(); if (labelInfo.getType() == LabelInfo.TYPE_REMOVE) { vh.removeVersionLabel(labelInfo.getLabelName()); } else if (labelInfo.getType() == LabelInfo.TYPE_ADD) {