Search in sources :

Example 21 with ScmRevision

use of org.apache.maven.scm.ScmRevision in project maven-scm by apache.

the class SvnCheckOutCommandTest method testCommandLine.

// ----------------------------------------------------------------------
// 
// ----------------------------------------------------------------------
private void testCommandLine(ScmManager scmManager, String scmUrl, String revision, String commandLine) throws Exception {
    ScmRepository repository = scmManager.makeScmRepository(scmUrl);
    SvnScmProviderRepository svnRepository = (SvnScmProviderRepository) repository.getProviderRepository();
    Commandline cl = cl = SvnCheckOutCommand.createCommandLine(svnRepository, workingDirectory, new ScmRevision(revision), svnRepository.getUrl(), recursive);
    assertCommandLine(commandLine, workingDirectory.getParentFile(), cl);
}
Also used : ScmRepository(org.apache.maven.scm.repository.ScmRepository) Commandline(org.codehaus.plexus.util.cli.Commandline) ScmRevision(org.apache.maven.scm.ScmRevision) SvnScmProviderRepository(org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository)

Example 22 with ScmRevision

use of org.apache.maven.scm.ScmRevision in project maven-scm by apache.

the class StarteamCheckInCommandTest method testGetCommandLineWithWorkingDirectory.

public void testGetCommandLineWithWorkingDirectory() throws Exception {
    ScmFileSet fileSet = new ScmFileSet(getWorkingCopy());
    String workingCopy = StarteamCommandLineUtils.toJavaPath(getWorkingCopy().getPath());
    String starteamUrl = "user:password@host:1234/project/view";
    String mavenUrl = "scm:starteam:" + starteamUrl;
    String expectedCmd = "stcmd ci -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workingCopy + " -is -f NCI -eol on";
    testCommandLine(mavenUrl, fileSet, "", new ScmRevision(""), "", "", expectedCmd);
}
Also used : ScmFileSet(org.apache.maven.scm.ScmFileSet) ScmRevision(org.apache.maven.scm.ScmRevision)

Example 23 with ScmRevision

use of org.apache.maven.scm.ScmRevision in project maven-scm by apache.

the class StarteamCheckInCommandTest method testGetCommandLineWithEmptyIssueValue.

public void testGetCommandLineWithEmptyIssueValue() throws Exception {
    ScmFileSet fileSet = new ScmFileSet(getWorkingCopy(), new File("test.txt"));
    String workingCopy = StarteamCommandLineUtils.toJavaPath(getWorkingCopy().getPath());
    String starteamUrl = "user:password@host:1234/project/view";
    String mavenUrl = "scm:starteam:" + starteamUrl;
    String expectedCmd = "stcmd ci -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workingCopy + " -active -eol on test.txt";
    testCommandLine(mavenUrl, fileSet, null, new ScmRevision(""), "active", " ", expectedCmd);
}
Also used : ScmFileSet(org.apache.maven.scm.ScmFileSet) ScmRevision(org.apache.maven.scm.ScmRevision) File(java.io.File)

Example 24 with ScmRevision

use of org.apache.maven.scm.ScmRevision in project maven-scm by apache.

the class StarteamCheckInCommandTest method testGetCommandLineWithDirInWorkingDirectory.

public void testGetCommandLineWithDirInWorkingDirectory() throws Exception {
    // physically create dir so that cmd can be generated correctly
    new File(getWorkingCopy(), "src").mkdirs();
    ScmFileSet fileSet = new ScmFileSet(getWorkingCopy(), new File("src"));
    String workingCopy = StarteamCommandLineUtils.toJavaPath(getWorkingCopy().getPath());
    String starteamUrl = "user:password@host:1234/project/view";
    String mavenUrl = "scm:starteam:" + starteamUrl;
    String expectedCmd = "stcmd ci -x -nologo -stop" + " -p " + starteamUrl + "/src" + " -fp " + workingCopy + "/src" + " -is -f NCI -eol on";
    testCommandLine(mavenUrl, fileSet, "", new ScmRevision(""), "", "", expectedCmd);
}
Also used : ScmFileSet(org.apache.maven.scm.ScmFileSet) ScmRevision(org.apache.maven.scm.ScmRevision) File(java.io.File)

Example 25 with ScmRevision

use of org.apache.maven.scm.ScmRevision in project maven-scm by apache.

the class StarteamCheckInCommandTest method testGetCommandLineWithFileOnRoot.

public void testGetCommandLineWithFileOnRoot() throws Exception {
    ScmFileSet fileSet = new ScmFileSet(getWorkingCopy(), new File("test.txt"));
    String workingCopy = StarteamCommandLineUtils.toJavaPath(getWorkingCopy().getPath());
    String starteamUrl = "user:password@host:1234/project/view";
    String mavenUrl = "scm:starteam:" + starteamUrl;
    String expectedCmd = "stcmd ci -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workingCopy + " -eol on test.txt";
    testCommandLine(mavenUrl, fileSet, "", new ScmRevision(""), "", "", expectedCmd);
}
Also used : ScmFileSet(org.apache.maven.scm.ScmFileSet) ScmRevision(org.apache.maven.scm.ScmRevision) File(java.io.File)

Aggregations

ScmRevision (org.apache.maven.scm.ScmRevision)28 File (java.io.File)12 ScmFileSet (org.apache.maven.scm.ScmFileSet)12 Commandline (org.codehaus.plexus.util.cli.Commandline)10 Date (java.util.Date)5 CommandParameters (org.apache.maven.scm.CommandParameters)5 AbstractAccuRevCommandTest (org.apache.maven.scm.provider.accurev.command.AbstractAccuRevCommandTest)5 Test (org.junit.Test)5 ChangeFile (org.apache.maven.scm.ChangeFile)4 ScmException (org.apache.maven.scm.ScmException)4 ScmFile (org.apache.maven.scm.ScmFile)4 ScmVersion (org.apache.maven.scm.ScmVersion)4 ChangeLogScmResult (org.apache.maven.scm.command.changelog.ChangeLogScmResult)4 ScmRepository (org.apache.maven.scm.repository.ScmRepository)4 ChangeFileMatcher.changeFile (org.apache.maven.scm.ChangeFileMatcher.changeFile)3 ScmBranch (org.apache.maven.scm.ScmBranch)3 ChangeLogSet (org.apache.maven.scm.command.changelog.ChangeLogSet)3 FileDifference (org.apache.maven.scm.provider.accurev.FileDifference)3 Stream (org.apache.maven.scm.provider.accurev.Stream)3 Transaction (org.apache.maven.scm.provider.accurev.Transaction)3