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
30
31
32
33
34 public class SvnMkdirCommandTckTest
35 extends MkdirCommandTckTest
36 {
37
38 public String getScmUrl()
39 throws Exception
40 {
41 return SvnScmTestUtils.getScmUrl( new File( getRepositoryRoot(), "trunk" ) );
42 }
43
44
45 public void initRepo()
46 throws Exception
47 {
48 SvnScmTestUtils.initializeRepository( getRepositoryRoot() );
49 }
50
51 public void testMkdirCommandMkdirUrl()
52 throws Exception
53 {
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 public void testMkdirCommandDirAlreadyAdded()
68 throws Exception
69 {
70 ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( getMissingDirectory() ) );
71
72 MkdirScmResult result = getScmManager().mkdir( getScmRepository(), fileSet, null, false );
73
74 assertResultIsSuccess( result );
75
76 assertNotNull( result.getRevision() );
77
78 ListScmResult listResult = getScmManager().list( getScmRepository(), fileSet, true, null );
79
80 assertTrue( "Directory should have been found.", listResult.isSuccess() );
81
82
83 result = getScmManager().mkdir( getScmRepository(), fileSet, null, false );
84
85 printOutputError( result );
86
87 assertFalse( result.isSuccess() );
88 }
89 }