use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class AccuRevCommandLineTest method testRemoveWorkspace.
@Test
public void testRemoveWorkspace() throws Exception {
AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
accuRevCL.rmws("myWorkspaceName");
Commandline lastCL = accuRevCL.getCommandline();
assertThat(lastCL.getArguments(), is(new String[] { "rmws", "-s", "myWorkspaceName" }));
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class AccuRevCommandLineTest method testChangeWorkspace.
@Test
public void testChangeWorkspace() throws Exception {
AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
accuRevCL.chws(new File("/my/workspace"), "the_workspace_name_me", "a-snapshot");
Commandline lastCL = accuRevCL.getCommandline();
assertThat(lastCL.getWorkingDirectory(), is(new File("/my/workspace").getCanonicalFile()));
assertThat(lastCL.getArguments(), is(new String[] { "chws", "-s", "the_workspace_name_me", "-b", "a-snapshot", "-l", "." }));
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class AccuRevCommandLineTest method testPromote.
@Test
public void testPromote() throws Exception {
AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
List<File> files = new ArrayList<File>();
File testfile = new File("my/test/file");
files.add(testfile);
assertThat(accuRevCL.promote(new File("/my/workspace"), files, "cmt msg"), not(nullValue()));
Commandline lastCL = accuRevCL.getCommandline();
assertThat(lastCL.getWorkingDirectory(), is(new File("/my/workspace").getCanonicalFile()));
assertThat(lastCL.getArguments(), is(new String[] { "promote", "-K", "-c", "cmt msg", testfile.getPath() }));
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class AccuRevCommandLineTest method testPopExternalWithTransactionNull.
@Test
public void testPopExternalWithTransactionNull() throws Exception {
AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester("aHost", 5051);
accuRevCL.setExecutable("accurev.exe");
File testfile = new File("/my/export");
File projectDir = new File("/./project/dir");
accuRevCL.popExternal(testfile, "stream", null, Collections.singleton(projectDir));
Commandline lastCL = accuRevCL.getCommandline();
assertThat(lastCL.getExecutable(), is("accurev.exe"));
assertThat(lastCL.getArguments(), is(new String[] { "pop", "-H", "aHost:5051", "-v", "stream", "-L", testfile.getAbsolutePath(), "-R", projectDir.getPath() }));
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class AccuRevCommandLineTest method testReset.
@Test
public void testReset() throws Exception {
AccuRevCommandLineTester accuRevCL = new AccuRevCommandLineTester();
Commandline commandline = accuRevCL.getCommandline();
Commandline cl = commandline;
List<String> shellCmds = cl.getShell().getShellCommandLine(cl.getArguments());
accuRevCL.reset();
assertThat(cl.getShell().getShellCommandLine(cl.getArguments()), is(shellCmds));
assertThat(commandline.getShell().getExecutable(), is("accurev"));
}
Aggregations