Search in sources :

Example 56 with Commandline

use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.

the class JazzUnEditCommandTest method testCreateUneditCommandWithEmptyFileSet.

public void testCreateUneditCommandWithEmptyFileSet() throws Exception {
    ScmFileSet scmFileSet = new ScmFileSet(new File("."));
    // An empty file set will be all files, which jazz will take as a "."
    Commandline cmd = new JazzUnEditCommand().createUneditCommand(repo, scmFileSet).getCommandline();
    String expected = "scm lock release --repository-uri https://localhost:9443/jazz --username myUserName --password myPassword .";
    assertCommandLine(expected, scmFileSet.getBasedir(), cmd);
}
Also used : ScmFileSet(org.apache.maven.scm.ScmFileSet) Commandline(org.codehaus.plexus.util.cli.Commandline) File(java.io.File)

Example 57 with Commandline

use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.

the class JazzUpdateCommandTest method testCreateAcceptCommand.

public void testCreateAcceptCommand() throws Exception {
    Commandline cmd = new JazzUpdateCommand().createAcceptCommand(repo, getScmFileSet()).getCommandline();
    String expected = "scm accept --repository-uri https://localhost:9443/jazz --username myUserName --password myPassword --flow-components";
    assertCommandLine(expected, getWorkingDirectory(), cmd);
}
Also used : Commandline(org.codehaus.plexus.util.cli.Commandline)

Example 58 with Commandline

use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.

the class JazzEditCommandTest method testCreateEditCommandWithEmptyFileSet.

public void testCreateEditCommandWithEmptyFileSet() throws Exception {
    ScmFileSet scmFileSet = new ScmFileSet(new File("."));
    // An empty file set will be all files, which jazz will take as a "."
    Commandline cmd = new JazzEditCommand().createEditCommand(repo, scmFileSet).getCommandline();
    String expected = "scm lock acquire --repository-uri https://localhost:9443/jazz --username myUserName --password myPassword .";
    assertCommandLine(expected, scmFileSet.getBasedir(), cmd);
}
Also used : ScmFileSet(org.apache.maven.scm.ScmFileSet) Commandline(org.codehaus.plexus.util.cli.Commandline) File(java.io.File)

Example 59 with Commandline

use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.

the class JazzEditCommandTest method testCreateEditCommandWithSpecificFiles.

public void testCreateEditCommandWithSpecificFiles() throws Exception {
    Commandline cmd = new JazzEditCommand().createEditCommand(repo, getScmFileSet()).getCommandline();
    String expected = "scm lock acquire --repository-uri https://localhost:9443/jazz --username myUserName --password myPassword file1 file2";
    assertCommandLine(expected, getWorkingDirectory(), cmd);
}
Also used : Commandline(org.codehaus.plexus.util.cli.Commandline)

Example 60 with Commandline

use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.

the class JazzCheckInCommandTest method testCreateCreateChangesetCommand.

public void testCreateCreateChangesetCommand() throws Exception {
    JazzScmProviderRepository repo = getScmProviderRepository();
    Commandline cmd = new JazzCheckInCommand().createCreateChangesetCommand(repo, getScmFileSet(), "This is my comment.").getCommandline();
    String expected = "scm create changeset --username myUserName --password myPassword \"This is my comment.\"";
    assertCommandLine(expected, getWorkingDirectory(), cmd);
}
Also used : Commandline(org.codehaus.plexus.util.cli.Commandline) JazzScmProviderRepository(org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository)

Aggregations

Commandline (org.codehaus.plexus.util.cli.Commandline)446 File (java.io.File)133 CommandLineUtils (org.codehaus.plexus.util.cli.CommandLineUtils)117 ScmException (org.apache.maven.scm.ScmException)84 CommandLineException (org.codehaus.plexus.util.cli.CommandLineException)70 ScmRepository (org.apache.maven.scm.repository.ScmRepository)51 IOException (java.io.IOException)48 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 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)18 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 ScmFile (org.apache.maven.scm.ScmFile)13 CvsScmProviderRepository (org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository)13