1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.scm.tck.command.checkout;
20
21 import java.util.Iterator;
22 import java.util.List;
23 import java.util.SortedSet;
24 import java.util.TreeSet;
25
26 import org.apache.maven.scm.ScmFile;
27 import org.apache.maven.scm.ScmTckTestCase;
28 import org.apache.maven.scm.command.checkout.CheckOutScmResult;
29 import org.junit.Test;
30
31 import static org.junit.Assert.fail;
32
33
34
35
36
37
38
39 public abstract class CheckOutCommandTckTest extends ScmTckTestCase {
40 @Test
41 public void testCheckOutCommandTest() throws Exception {
42 deleteDirectory(getWorkingCopy());
43
44 CheckOutScmResult result = checkOut(getWorkingCopy(), getScmRepository());
45
46 assertResultIsSuccess(result);
47
48 List<ScmFile> checkedOutFiles = result.getCheckedOutFiles();
49
50 if (checkedOutFiles.size() != 4) {
51 SortedSet<ScmFile> files = new TreeSet<>(checkedOutFiles);
52
53 int i = 0;
54
55 for (Iterator<ScmFile> it = files.iterator(); it.hasNext(); i++) {
56 ScmFile scmFile = it.next();
57
58 System.out.println("" + i + ": " + scmFile);
59 }
60
61 fail("Expected 4 files in the updated files list, was " + checkedOutFiles.size());
62 }
63 }
64 }