mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
Fix offset in recursion
This commit is contained in:
@@ -206,6 +206,75 @@ public class SvnBrowseCommandTest extends AbstractSvnCommandTestBase
|
||||
assertThat(foList).extracting("name").containsExactly("a.txt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecursiveLimit() throws IOException {
|
||||
BrowseCommandRequest request = new BrowseCommandRequest();
|
||||
|
||||
request.setLimit(4);
|
||||
request.setRecursive(true);
|
||||
|
||||
FileObject root = createCommand().getBrowserResult(request).getFile();
|
||||
|
||||
Collection<FileObject> foList = root.getChildren();
|
||||
|
||||
assertThat(foList)
|
||||
.extracting("name")
|
||||
.containsExactly("c", "a.txt");
|
||||
|
||||
FileObject c = getFileObject(foList, "c");
|
||||
|
||||
Collection<FileObject> cChildren = c.getChildren();
|
||||
assertThat(cChildren)
|
||||
.extracting("name")
|
||||
.containsExactly("d.txt", "e.txt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecursiveLimitInSubDir() throws IOException {
|
||||
BrowseCommandRequest request = new BrowseCommandRequest();
|
||||
|
||||
request.setLimit(2);
|
||||
request.setRecursive(true);
|
||||
|
||||
FileObject root = createCommand().getBrowserResult(request).getFile();
|
||||
|
||||
Collection<FileObject> foList = root.getChildren();
|
||||
|
||||
assertThat(foList)
|
||||
.extracting("name")
|
||||
.containsExactly("c");
|
||||
|
||||
FileObject c = getFileObject(foList, "c");
|
||||
|
||||
Collection<FileObject> cChildren = c.getChildren();
|
||||
assertThat(cChildren)
|
||||
.extracting("name")
|
||||
.containsExactly("d.txt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRecursiveOffset() throws IOException {
|
||||
BrowseCommandRequest request = new BrowseCommandRequest();
|
||||
|
||||
request.setOffset(2);
|
||||
request.setRecursive(true);
|
||||
|
||||
FileObject root = createCommand().getBrowserResult(request).getFile();
|
||||
|
||||
Collection<FileObject> foList = root.getChildren();
|
||||
|
||||
assertThat(foList)
|
||||
.extracting("name")
|
||||
.containsExactly("c", "a.txt");
|
||||
|
||||
FileObject c = getFileObject(foList, "c");
|
||||
|
||||
Collection<FileObject> cChildren = c.getChildren();
|
||||
assertThat(cChildren)
|
||||
.extracting("name")
|
||||
.containsExactly("e.txt");
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user