public Object run() throws RepositoryException { return vMgr.createConfiguration(getNodePath(nodeId, sInfo)); } }, getSessionInfoImpl(sessionInfo));
@Override public Node createConfiguration(final String absPath) throws UnsupportedRepositoryOperationException, RepositoryException { return versionManager.createConfiguration(absPath); }
public Object run() throws RepositoryException { return vMgr.createConfiguration(getNodePath(nodeId, sInfo)); } }, getSessionInfoImpl(sessionInfo));
public void testCreateConfigurationTwiceFails() throws Exception { vm.createConfiguration(versionableNode.getPath()); try { vm.createConfiguration(versionableNode.getPath()); fail("Create configuration must fail if versionable is already a configuration"); } catch (UnsupportedRepositoryOperationException e) { // ignore } }
public void testCreateConfigurationNotVersionableFails() throws Exception { try { vm.createConfiguration(nonVersionableNode.getPath()); fail("Create configuration must fail for non-versionable node"); } catch (UnsupportedRepositoryOperationException e) { // ignore } }
@Override public Node createConfiguration(String absPath) throws UnsupportedRepositoryOperationException, RepositoryException { return getWrappedVersionManager().createConfiguration(absPath); }
public void testCheckinConfig() throws Exception { vm.checkin(versionableNode.getPath()); Node config = vm.createConfiguration(versionableNode.getPath()); vm.checkin(config.getPath()); }
public void testCheckinConfigFailsWithUnversionedChild() throws Exception { Node config = vm.createConfiguration(versionableNode.getPath()); try { vm.checkin(config.getPath()); fail("Checkin configuration must fail one of the recorded versions is not versioned."); } catch (UnsupportedRepositoryOperationException e) { // ignore } }
public void testConfigurationsPath() throws Exception { Node config = vm.createConfiguration(versionableNode.getPath()); assertNotNull(config); NodeType nt = config.getPrimaryNodeType(); assertTrue("created node must be subtype of nt:configuration", nt.isNodeType(ntConfiguration)); assertTrue("path for configuration must be below " + PREFIX + ", but was " + config.getPath(), config.getPath().startsWith(PREFIX)); }
public void testCreateConfigWithExistentConfigFromBaselineFails() throws Exception { // create configuration String path = versionableNode.getPath(); vm.checkin(path); Node config = vm.createConfiguration(path); // record baseline Version baseline = vm.checkin(config.getPath()); try { vm.restore(testRoot + "/nonExisting", baseline, true); fail("Create configuration must fail if config recorded in baseline already exists."); } catch (RepositoryException e) { // ignore } }
public RemoteNode createConfiguration(String absPath) throws RepositoryException, RemoteException { try { return getFactory().getRemoteNode( manager.createConfiguration(absPath)); } catch (RepositoryException e) { throw getRepositoryException(e); } }
public void testCreateConfigWithNonExistentParentFails() throws Exception { // create configuration String path = versionableNode.getPath(); vm.checkin(path); Node config = vm.createConfiguration(path); // record baseline Version baseline = vm.checkin(config.getPath()); // remove workspace nodes removeConfiguration(versionableNode); versionableNode.remove(); versionableNode = null; testRootNode.getSession().save(); try { vm.restore("/non/existent/parent", baseline, true); fail("Create configuration must fail if parent does not exist."); } catch (RepositoryException e) { // ignore } }
public void testCreateConfiguration() throws Exception { Node config = vm.createConfiguration(versionableNode.getPath()); assertNotNull(config); NodeType nt = config.getPrimaryNodeType(); assertTrue("created node must be subtype of nt:configuration", nt.isNodeType(ntConfiguration)); // check if the configuration points to the versionable assertTrue("jcr:root property of the configuration must reference the versionable node", config.getProperty("jcr:root").getNode().isSame(versionableNode)); // check if the versionable points to the configuration assertTrue("jcr:configuration property of the versionable node must reference the configuration", versionableNode.getProperty("jcr:configuration").getNode().isSame(config)); }
public void testCreateConfigWithBaseline() throws Exception { // create configuration String path = versionableNode.getPath(); Version baseVersion = vm.checkin(path); Node config = vm.createConfiguration(path); // record baseline Version baseline = vm.checkin(config.getPath()); // remove workspace nodes removeConfiguration(versionableNode); versionableNode.remove(); versionableNode = null; testRootNode.getSession().save(); // and try to restore it vm.restore(path, baseline, true); versionableNode = testRootNode.getSession().getNode(path); Version baseVersion2 = vm.getBaseVersion(versionableNode.getPath()); assertTrue("restored node must have former base version.", baseVersion.isSame(baseVersion2)); config = versionableNode.getProperty("jcr:configuration").getNode(); // base version of config must be baseline assertTrue("Baseversion of restored config must be given baseline.", vm.getBaseVersion(config.getPath()).isSame(baseline)); }
public void testRestoreBaseline() throws Exception { // create configuration String path = versionableNode.getPath(); Version bv1 = vm.checkpoint(path); Node config = vm.createConfiguration(path); // record baseline 1 (should contain bv1) Version bl1 = vm.checkpoint(config.getPath()); // create bv2 Version bv2 = vm.checkpoint(path); // record baseline 2 (should contain bv2) Version bl2 = vm.checkpoint(config.getPath()); // restore bl1 vm.restore(bl1, true); Version bv = vm.getBaseVersion(path); assertTrue("restored node must have former base version V1.0.", bv.isSame(bv1)); // restore bl2 vm.restore(bl2, true); bv = vm.getBaseVersion(path); assertTrue("restored node must have former base version V1.1.", bv.isSame(bv2)); }
public void testRestoreConfig() throws Exception { // create configuration String path = versionableNode.getPath(); Version bv1 = vm.checkpoint(path); Node config = vm.createConfiguration(path); String configPath = config.getPath(); // record baseline 1 (should contain bv1) Version bl1 = vm.checkpoint(config.getPath()); // create bv2 Version bv2 = vm.checkpoint(path); // record baseline 2 (should contain bv2) Version bl2 = vm.checkpoint(config.getPath()); // restore bl1 vm.restore(configPath, bl1.getName(), true); Version bv = vm.getBaseVersion(path); assertTrue("restored node must have former base version V1.0.", bv.isSame(bv1)); // restore bl2 vm.restore(configPath, bl2.getName(), true); bv = vm.getBaseVersion(path); assertTrue("restored node must have former base version V1.1.", bv.isSame(bv2)); } }