1 package org.apache.maven.scm.provider.jazz.command.unedit;
2
3 import org.apache.maven.scm.ScmFileSet;
4 import org.apache.maven.scm.provider.jazz.JazzScmTestCase;
5 import org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository;
6 import org.codehaus.plexus.util.cli.Commandline;
7
8 import java.io.File;
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 public class JazzUnEditCommandTest
33 extends JazzScmTestCase
34 {
35 private JazzScmProviderRepository repo;
36
37 protected void setUp()
38 throws Exception
39 {
40 super.setUp();
41 repo = getScmProviderRepository();
42 }
43
44 public void testCreateUneditCommandWithSpecificFiles()
45 throws Exception
46 {
47 Commandline cmd = new JazzUnEditCommand().createUneditCommand( repo, getScmFileSet() ).getCommandline();
48 String expected =
49 "scm lock release --repository-uri https://localhost:9443/jazz --username myUserName --password myPassword file1 file2";
50 assertCommandLine( expected, getWorkingDirectory(), cmd );
51 }
52
53 public void testCreateUneditCommandWithEmptyFileSet()
54 throws Exception
55 {
56 ScmFileSet scmFileSet = new ScmFileSet( new File( "." ) );
57
58 Commandline cmd =
59 new JazzUnEditCommand().createUneditCommand( repo, scmFileSet ).getCommandline();
60 String expected =
61 "scm lock release --repository-uri https://localhost:9443/jazz --username myUserName --password myPassword .";
62 assertCommandLine( expected, scmFileSet.getBasedir(), cmd );
63 }
64 }