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
38 public class SvnMkdirCommandTckTest extends MkdirCommandTckTest {
39
40 public String getScmUrl() throws Exception {
41 return SvnScmTestUtils.getScmUrl(new File(getRepositoryRoot(), "trunk"));
42 }
43
44
45 public void initRepo() throws Exception {
46 SvnScmTestUtils.initializeRepository(getRepositoryRoot());
47 }
48
49 @Test
50 public void testMkdirCommandMkdirUrl() throws Exception {
51 ScmFileSet fileSet = new ScmFileSet(getWorkingCopy(), new File(getMissingDirectory()));
52
53 MkdirScmResult result = getScmManager().mkdir(getScmRepository(), fileSet, "Mkdir message", false);
54
55 assertResultIsSuccess(result);
56
57 assertNotNull(result.getRevision());
58
59 ListScmResult listResult = getScmManager().list(getScmRepository(), fileSet, true, null);
60
61 assertTrue("Directory should have been found.", listResult.isSuccess());
62 }
63
64 @Test
65 public void testMkdirCommandDirAlreadyAdded() throws Exception {
66 ScmFileSet fileSet = new ScmFileSet(getWorkingCopy(), new File(getMissingDirectory()));
67
68 MkdirScmResult result = getScmManager().mkdir(getScmRepository(), fileSet, null, false);
69
70 assertResultIsSuccess(result);
71
72 assertNotNull(result.getRevision());
73
74 ListScmResult listResult = getScmManager().list(getScmRepository(), fileSet, true, null);
75
76 assertTrue("Directory should have been found.", listResult.isSuccess());
77
78
79 result = getScmManager().mkdir(getScmRepository(), fileSet, null, false);
80
81 printOutputError(result);
82
83 assertFalse(result.isSuccess());
84 }
85 }