use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class AccuRevCommandLineTest method testRemove.
@SuppressWarnings("unchecked")
@Test
public void testRemove() throws Exception {
AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
List<File> files = new ArrayList<File>();
File testFile = new File("my/test/file");
files.add(testFile);
File workspaceFile = new File("/workspace");
assertThat(accuRevCL.defunct(workspaceFile, files, "my commit message"), not(nullValue()));
Commandline lastCL = accuRevCL.getCommandline();
assertThat(lastCL.getWorkingDirectory(), is(workspaceFile.getCanonicalFile()));
assertThat(lastCL.getArguments(), is(new String[] { "defunct", "-c", "my commit message", testFile.getPath() }));
assertThat(accuRevCL.defunct(workspaceFile, files, ""), not(nullValue()));
assertThat(lastCL.getArguments(), is(new String[] { "defunct", "-c", AccuRev.DEFAULT_REMOVE_MESSAGE, testFile.getPath() }));
assertThat(accuRevCL.defunct(workspaceFile, Collections.EMPTY_LIST, ""), not(nullValue()));
assertThat(lastCL.getArguments(), is(new String[] { "defunct", "-c", AccuRev.DEFAULT_REMOVE_MESSAGE, "." }));
assertThat(accuRevCL.defunct(workspaceFile, null, ""), not(nullValue()));
assertThat(lastCL.getArguments(), is(new String[] { "defunct", "-c", AccuRev.DEFAULT_REMOVE_MESSAGE, "." }));
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class AccuRevCommandLineTest method testAdd.
@Test
public void testAdd() throws Exception {
AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
List<File> files = new ArrayList<File>();
File testFile = new File("my/test/file");
files.add(testFile);
assertThat(accuRevCL.add(new File("/workspace"), files, "my commit message"), not(nullValue()));
Commandline lastCL = accuRevCL.getCommandline();
assertThat(lastCL.getWorkingDirectory(), is(new File("/workspace").getCanonicalFile()));
assertThat(lastCL.getArguments(), is(new String[] { "add", "-c", "my commit message", testFile.getPath() }));
assertThat(accuRevCL.add(new File("/workspace"), files, ""), not(nullValue()));
assertThat(lastCL.getArguments(), is(new String[] { "add", "-c", AccuRev.DEFAULT_ADD_MESSAGE, testFile.getPath() }));
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class AccuRevCommandLineTest method testPromoteAll.
@Test
public void testPromoteAll() throws Exception {
AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
assertThat(accuRevCL.promoteAll(new File("/my/workspace"), "cmt msg"), not(nullValue()));
Commandline lastCL = accuRevCL.getCommandline();
assertThat(lastCL.getWorkingDirectory(), is(new File("/my/workspace").getCanonicalFile()));
assertThat(lastCL.getArguments(), is(new String[] { "promote", "-p", "-K", "-c", "cmt msg" }));
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class AccuRevCommandLineTest method testMkws.
@Test
public void testMkws() throws Exception {
AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
accuRevCL.setExecutable("accurev2.exe");
File workspaceFile = new File("/my/workspace/location");
accuRevCL.mkws("myStream", "myWorkSpaceName", workspaceFile);
Commandline lastCL = accuRevCL.getCommandline();
assertThat(lastCL.getExecutable(), is("accurev2.exe"));
assertThat(lastCL.getWorkingDirectory(), is(workspaceFile.getCanonicalFile()));
assertThat(lastCL.getArguments(), is(new String[] { "mkws", "-b", "myStream", "-w", "myWorkSpaceName", "-l", workspaceFile.getAbsolutePath() }));
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class AccuRevCommandLineTest method testInfo.
@Test
public void testInfo() throws Exception {
AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
accuRevCL.info(new File("/my/base/dir"));
Commandline lastCL = accuRevCL.getCommandline();
assertThat(lastCL.getWorkingDirectory(), is(new File("/my/base/dir").getCanonicalFile()));
assertThat(lastCL.getArguments(), is(new String[] { "info" }));
}
Aggregations