Search in sources :

Example 1 with DeleteNodeCommand

use of org.apache.sling.ide.impl.vlt.DeleteNodeCommand in project sling by apache.

the class DefaultBatcherTest method dataIsClearedBetweenCalls.

@Test
public void dataIsClearedBetweenCalls() {
    batcher.add(new DeleteNodeCommand(mockRepo, credentials, "/content/branch", null));
    batcher.get();
    assertThat(batcher.get(), hasSize(0));
}
Also used : DeleteNodeCommand(org.apache.sling.ide.impl.vlt.DeleteNodeCommand) Test(org.junit.Test)

Example 2 with DeleteNodeCommand

use of org.apache.sling.ide.impl.vlt.DeleteNodeCommand in project sling by apache.

the class DefaultBatcherTest method testMoreComprehensiveDeletesAreCompacted.

private void testMoreComprehensiveDeletesAreCompacted(String expected, String firstPath, String... otherPaths) {
    batcher.add(new DeleteNodeCommand(mockRepo, credentials, firstPath, null));
    for (String otherPath : otherPaths) {
        batcher.add(new DeleteNodeCommand(mockRepo, credentials, otherPath, null));
    }
    List<Command<?>> batched = batcher.get();
    assertThat(batched, hasSize(1));
    Command<?> command = batched.get(0);
    assertThat(command, instanceOf(DeleteNodeCommand.class));
    assertThat(command.getPath(), equalTo(expected));
}
Also used : ReorderChildNodesCommand(org.apache.sling.ide.impl.vlt.ReorderChildNodesCommand) DeleteNodeCommand(org.apache.sling.ide.impl.vlt.DeleteNodeCommand) GetNodeContentCommand(org.apache.sling.ide.impl.vlt.GetNodeContentCommand) Command(org.apache.sling.ide.transport.Command) AddOrUpdateNodeCommand(org.apache.sling.ide.impl.vlt.AddOrUpdateNodeCommand) DeleteNodeCommand(org.apache.sling.ide.impl.vlt.DeleteNodeCommand)

Aggregations

DeleteNodeCommand (org.apache.sling.ide.impl.vlt.DeleteNodeCommand)2 AddOrUpdateNodeCommand (org.apache.sling.ide.impl.vlt.AddOrUpdateNodeCommand)1 GetNodeContentCommand (org.apache.sling.ide.impl.vlt.GetNodeContentCommand)1 ReorderChildNodesCommand (org.apache.sling.ide.impl.vlt.ReorderChildNodesCommand)1 Command (org.apache.sling.ide.transport.Command)1 Test (org.junit.Test)1