@Test public void shouldMoveNode() { graph.move(validPath).into(validIdProperty1, validIdProperty2); assertThat(numberOfExecutions, is(1)); assertNextRequestIsMove(Location.create(validPath), Location.create(validIdProperty1, validIdProperty2)); assertNoMoreRequests(); graph.move(validPathString).into(validIdProperty1, validIdProperty2); assertThat(numberOfExecutions, is(1)); assertNextRequestIsMove(Location.create(validPath), Location.create(validIdProperty1, validIdProperty2)); assertNoMoreRequests(); graph.move(validUuid).into(validPath); assertThat(numberOfExecutions, is(1)); assertNextRequestIsMove(Location.create(validUuid), Location.create(validPath)); assertNoMoreRequests(); }
@Test public void shouldIgnoreIncompleteRequests() { graph.move(validPath); // missing 'into(...)' assertNoMoreRequests(); graph.move(validPath).into(validUuid); assertThat(numberOfExecutions, is(1)); assertNextRequestIsMove(Location.create(validPath), Location.create(validUuid)); assertNoMoreRequests(); }
cache.operations.move(child.getLocation()).into(parent.getLocation()); } else { cache.operations.move(child.getLocation()).as(newNodeName).into(parent.getLocation()); cache.store.move(child.getLocation()).into(parent.getLocation()); } else { cache.store.move(child.getLocation()).as(newNodeName).into(parent.getLocation());
graph.move("/node2").into("/node3");
cache.operations.move(nodeToBeMoved.getLocation()).into(this.location); } else {
@Test public void shouldMoveNodeInBatches() { graph.batch().move(validPath).into(validIdProperty1, validIdProperty2).execute(); assertThat(numberOfExecutions, is(1)); assertNextRequestIsMove(Location.create(validPath), Location.create(validIdProperty1, validIdProperty2)); assertNoMoreRequests(); graph.batch().move(validPathString).into(validIdProperty1, validIdProperty2).execute(); assertThat(numberOfExecutions, is(1)); assertNextRequestIsMove(Location.create(validPath), Location.create(validIdProperty1, validIdProperty2)); assertNoMoreRequests(); graph.batch().move(validUuid).into(validPath).execute(); assertThat(numberOfExecutions, is(1)); assertNextRequestIsMove(Location.create(validUuid), Location.create(validPath)); .into(validIdProperty1, validIdProperty2) .and() .move(validPathString) .into(validIdProperty1, validIdProperty2) .and() .move(validUuid) .into(validPath) .execute(); assertThat(numberOfExecutions, is(1));
@Test public void shouldMoveAndRenameNodesThroughMultipleMoveRequests() { graph.move(validPath).as(validName).into(validIdProperty1, validIdProperty2).and().move(validUuid).into(validPathString); assertThat(numberOfExecutions, is(2)); assertNextRequestIsMove(Location.create(validPath), Location.create(validIdProperty1, validIdProperty2)); assertNextRequestIsMove(Location.create(validUuid), Location.create(createPath(validPathString))); assertNoMoreRequests(); }
@Test public void shouldMoveNodesThroughMultipleMoveRequests() { graph.move(validPath).into(validIdProperty1, validIdProperty2).and().move(validUuid).into(validPathString); assertThat(numberOfExecutions, is(2)); assertNextRequestIsMove(Location.create(validPath), Location.create(validIdProperty1, validIdProperty2)); assertNextRequestIsMove(Location.create(validUuid), Location.create(createPath(validPathString))); assertNoMoreRequests(); }
@Test( expected = InvalidPathException.class ) public void shouldPropogateExceptionFromConnectorWhenMovingLocationIsNotFound() { connection.error = new InvalidPathException(); graph.move(validUuid).into(validPath); }
@Test public void shouldCreateNodesWithBatch() { graph.batch().create(validPath, validIdProperty1).and().remove("prop").on(validPathString).execute(); graph.batch().move(validPath).and(validPath).into(validPathString).and().create(validPath).and().execute(); graph.batch().createUnder(validLocation).nodeNamed("someName").and().delete(validLocation).execute(); }