1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.scm.provider.svn.command.mkdir;
20
21 import java.io.File;
22
23 import org.apache.maven.scm.ScmFileSet;
24 import org.apache.maven.scm.command.list.ListScmResult;
25 import org.apache.maven.scm.command.mkdir.MkdirScmResult;
26 import org.apache.maven.scm.provider.svn.SvnScmTestUtils;
27 import org.apache.maven.scm.tck.command.mkdir.MkdirCommandTckTest;
28 import org.junit.Test;
29
30 import static org.junit.Assert.assertFalse;
31 import static org.junit.Assert.assertNotNull;
32 import static org.junit.Assert.assertTrue;
33
34
35
36
37 public class SvnMkdirCommandTckTest extends MkdirCommandTckTest {
38
39
40
41 public String getScmUrl() throws Exception {
42 return SvnScmTestUtils.getScmUrl(new File(getRepositoryRoot(), "trunk"));
43 }
44
45
46
47
48 public void initRepo() throws Exception {
49 SvnScmTestUtils.initializeRepository(getRepositoryRoot());
50 }
51
52 @Test
53 public void testMkdirCommandMkdirUrl() throws Exception {
54 ScmFileSet fileSet = new ScmFileSet(getWorkingCopy(), new File(getMissingDirectory()));
55
56 MkdirScmResult result = getScmManager().mkdir(getScmRepository(), fileSet, "Mkdir message", false);
57
58 assertResultIsSuccess(result);
59
60 assertNotNull(result.getRevision());
61
62 ListScmResult listResult = getScmManager().list(getScmRepository(), fileSet, true, null);
63
64 assertTrue("Directory should have been found.", listResult.isSuccess());
65 }
66
67 @Test
68 public void testMkdirCommandDirAlreadyAdded() throws Exception {
69 ScmFileSet fileSet = new ScmFileSet(getWorkingCopy(), new File(getMissingDirectory()));
70
71 MkdirScmResult result = getScmManager().mkdir(getScmRepository(), fileSet, null, false);
72
73 assertResultIsSuccess(result);
74
75 assertNotNull(result.getRevision());
76
77 ListScmResult listResult = getScmManager().list(getScmRepository(), fileSet, true, null);
78
79 assertTrue("Directory should have been found.", listResult.isSuccess());
80
81
82 result = getScmManager().mkdir(getScmRepository(), fileSet, null, false);
83
84 printOutputError(result);
85
86 assertFalse(result.isSuccess());
87 }
88 }