@Override public void refresh(boolean keepChanges) throws RepositoryException { this.node.refresh(keepChanges); }
@Override public void refresh(boolean keepChanges) throws InvalidItemStateException, RepositoryException { getWrappedNode().refresh(keepChanges); }
@Override protected void after() { if (this.rootNode != null) { try { this.rootNode.refresh(false); this.rootNode.remove(); } catch (RepositoryException e) { LOG.warn("Could not remove root node", e); } } }
/** * {@inheritDoc} */ public void refresh(boolean keepChanges) throws RepositoryException { getRootNode().refresh(keepChanges); }
/** * @see javax.jcr.Session#refresh(boolean) */ public void refresh(boolean keepChanges) throws RepositoryException { // delegate to the root node (including check for isAlive) getRootNode().refresh(keepChanges); }
public void reset() { try { getNode().refresh(false); } catch (RepositoryException ex) { log.error(ex.getMessage()); } }
@Override public void refresh(boolean keepChanges) throws RepositoryException { if (isExist()) { getBinaryNode(false).refresh(keepChanges); } }
@Override protected void tearDown() throws Exception { testRootNode.refresh(false); ntMgr = null; super.tearDown(); }
@Override protected void tearDown() throws Exception { testRootNode.refresh(false); super.tearDown(); }
@Override public void onOk() { try { Node rootNode = ((UserSession) Session.get()).getJcrSession().getRootNode(); // always refresh regardless of the local changes, so external changes // can also be exposed. rootNode.refresh(false); } catch (RepositoryException ex) { error(ex.getMessage()); } }
@Override public void onOk() { try { Node rootNode = UserSession.get().getJcrSession().getRootNode(); // always refresh regardless of the local changes, so external changes // can also be exposed. rootNode.refresh(false); } catch (RepositoryException ex) { error(ex.getMessage()); } }
public void testRemovedProperty() throws RepositoryException, LockException, ConstraintViolationException, VersionException { Property p = testRootNode.setProperty(propertyName1, testValue); testRootNode.save(); p.remove(); testRootNode.refresh(false); // Property p must be reverted to 'existing' -> getString must succeed. p.getString(); // similarly accessing the property again must succeed. testRootNode.getProperty(propertyName1); }
public void testNewProperty() throws RepositoryException, LockException, ConstraintViolationException, VersionException { Property p = testRootNode.setProperty(propertyName1, testValue); testRootNode.refresh(false); try { p.getString(); fail("Refresh 'false' must invalidate a new child property"); } catch (InvalidItemStateException e) { // ok } assertFalse("Refresh 'false' must remove a new child property", testRootNode.hasProperty(propertyName1)); }
public void testRemovedNewProperty() throws RepositoryException, LockException, ConstraintViolationException, VersionException { Property p = testRootNode.setProperty(propertyName1, testValue); p.remove(); testRootNode.refresh(false); try { p.getString(); fail("Refresh 'false' must not bring a removed new child property back to life."); } catch (InvalidItemStateException e) { // ok } assertFalse("Refresh 'false' must not bring a removed new child property back to life.", testRootNode.hasProperty(propertyName1)); }
public void testNewNode() throws RepositoryException { Node n = testRootNode.addNode(nodeName2); Property p = n.setProperty(propertyName1, testValue); testRootNode.refresh(true); // n must still be new and accessible String msg = "Refresh 'true' must not affect the new Node/Property."; assertTrue(msg, testRootNode.hasNode(nodeName2)); assertTrue(msg, n.isNew()); assertTrue(msg, n.hasProperty(propertyName1)); // p must still be accessible p.getString(); assertTrue(msg, p.isSame(n.getProperty(propertyName1))); }
@Override public void testRevertReorder() throws RepositoryException { testRootNode.orderBefore(getRelPath(child4), getRelPath(child2)); testOrder(testRootNode, new Node[] { child1, child4, child2, child3}); // NEW child nodes -> must be removed upon refresh testRootNode.refresh(false); NodeIterator it = testRootNode.getNodes(nodeName2); if (it.hasNext()) { fail("Reverting creation and reordering of new SNSs must remove the children again."); } }
public void testGetExternallyAddedItems() throws RepositoryException { Node node1 = (Node) readOnly.getItem(node1Path); Node n2 = testRootNode.getNode(nodeName1).addNode(nodeName2); Property p3 = n2.setProperty(propertyName1, "test"); testRootNode.save(); node1.refresh(true); assertTrue(readOnly.itemExists(n2.getPath())); assertTrue(readOnly.itemExists(p3.getPath())); }
@Override public void testRevertReorderToEnd() throws RepositoryException { testRootNode.orderBefore(getRelPath(child1), null); testOrder(testRootNode, new Node[] { child2, child3, child4, child1}); testRootNode.refresh(false); testOrder(testRootNode, new Node[] { child1, child2 }); } }
@Override public void testRevertReorder() throws RepositoryException { testRootNode.orderBefore(getRelPath(child4), getRelPath(child2)); testOrder(testRootNode, new Node[] { child1, child4, child2, child3}); testRootNode.refresh(false); testOrder(testRootNode, new Node[] { child1, child2 }); }
public void testRevert() throws RepositoryException { String srcPath = moveNode.getPath(); doMove(srcPath, destinationPath); // now remove the moved node testRootNode.getSession().getItem(destinationPath).remove(); testRootNode.refresh(false); assertTrue(superuser.itemExists(srcPath)); assertFalse(superuser.itemExists(destinationPath)); assertFalse(moveNode.isModified()); assertFalse(destParentNode.isModified()); assertFalse(srcParentNode.isModified()); }