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