Search in sources :

Example 11 with Commandline

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" }));
}
Also used : Commandline(org.codehaus.plexus.util.cli.Commandline) Test(org.junit.Test)

Example 12 with Commandline

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", "." }));
}
Also used : Commandline(org.codehaus.plexus.util.cli.Commandline) File(java.io.File) Test(org.junit.Test)

Example 13 with Commandline

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() }));
}
Also used : Commandline(org.codehaus.plexus.util.cli.Commandline) ArrayList(java.util.ArrayList) File(java.io.File) Test(org.junit.Test)

Example 14 with Commandline

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() }));
}
Also used : Commandline(org.codehaus.plexus.util.cli.Commandline) File(java.io.File) Test(org.junit.Test)

Example 15 with Commandline

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"));
}
Also used : Commandline(org.codehaus.plexus.util.cli.Commandline) Test(org.junit.Test)

Aggregations

Commandline (org.codehaus.plexus.util.cli.Commandline)443 File (java.io.File)131 CommandLineUtils (org.codehaus.plexus.util.cli.CommandLineUtils)116 ScmException (org.apache.maven.scm.ScmException)84 CommandLineException (org.codehaus.plexus.util.cli.CommandLineException)67 ScmRepository (org.apache.maven.scm.repository.ScmRepository)51 IOException (java.io.IOException)45 ScmFileSet (org.apache.maven.scm.ScmFileSet)34 Test (org.junit.Test)28 StringStreamConsumer (org.codehaus.plexus.util.cli.CommandLineUtils.StringStreamConsumer)26 ArrayList (java.util.ArrayList)22 StarteamScmProviderRepository (org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository)22 PerforceScmProviderRepository (org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository)19 SvnCommandLineUtils (org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils)17 GitCommandLineUtils (org.apache.maven.scm.provider.git.gitexe.command.GitCommandLineUtils)16 GitScmProviderRepository (org.apache.maven.scm.provider.git.repository.GitScmProviderRepository)16 SvnScmProviderRepository (org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository)16 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)15 ScmFile (org.apache.maven.scm.ScmFile)13 CvsScmProviderRepository (org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository)13