Search in sources :

Example 11 with ScmTag

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

the class TagCommandTckTest method testTagCommandTest.

public void testTagCommandTest() throws Exception {
    String tag = getTagName();
    @SuppressWarnings("deprecation") TagScmResult tagResult = getScmManager().getProviderByUrl(getScmUrl()).tag(getScmRepository(), new ScmFileSet(getWorkingCopy()), tag);
    assertResultIsSuccess(tagResult);
    // see https://issues.apache.org/jira/browse/SCM-754
    // assertEquals( "check all 4 files tagged", 4, tagResult.getTaggedFiles().size() );
    File readmeTxt = new File(getWorkingCopy(), "readme.txt");
    assertEquals("check readme.txt contents", "/readme.txt", FileUtils.fileRead(readmeTxt));
    this.edit(getWorkingCopy(), "readme.txt", null, getScmRepository());
    changeReadmeTxt(readmeTxt);
    CheckInScmResult checkinResult = getScmManager().checkIn(getScmRepository(), new ScmFileSet(getWorkingCopy()), "commit message");
    assertResultIsSuccess(checkinResult);
    CheckOutScmResult checkoutResult = getScmManager().checkOut(getScmRepository(), new ScmFileSet(getAssertionCopy()));
    assertResultIsSuccess(checkoutResult);
    readmeTxt = new File(getAssertionCopy(), "readme.txt");
    assertEquals("check readme.txt contents", "changed file", FileUtils.fileRead(readmeTxt));
    deleteDirectory(getAssertionCopy());
    assertFalse("check previous assertion copy deleted", getAssertionCopy().exists());
    checkoutResult = getScmManager().getProviderByUrl(getScmUrl()).checkOut(getScmRepository(), new ScmFileSet(getAssertionCopy()), new ScmTag(tag));
    assertResultIsSuccess(checkoutResult);
    assertEquals("check readme.txt contents is from tagged version", "/readme.txt", FileUtils.fileRead(readmeTxt));
}
Also used : ScmFileSet(org.apache.maven.scm.ScmFileSet) ScmTag(org.apache.maven.scm.ScmTag) CheckOutScmResult(org.apache.maven.scm.command.checkout.CheckOutScmResult) TagScmResult(org.apache.maven.scm.command.tag.TagScmResult) File(java.io.File) CheckInScmResult(org.apache.maven.scm.command.checkin.CheckInScmResult)

Example 12 with ScmTag

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

the class StarteamUpdateCommandTest method testGetCommandLineWithWorkingDirectory.

public void testGetCommandLineWithWorkingDirectory() throws Exception {
    ScmFileSet workingCopy = new ScmFileSet(this.getWorkingCopy());
    String workDirAbsolutePath = StarteamCommandLineUtils.toJavaPath(workingCopy.getBasedir().getAbsolutePath());
    String starteamUrl = "user:password@host:1234/project/view";
    String mavenUrl = "scm:starteam:" + starteamUrl;
    String expectedCmd = "stcmd co -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workDirAbsolutePath + " -is -merge -neverprompt -vl myTag -eol on";
    testCommandLine(mavenUrl, workingCopy, new ScmTag("myTag"), expectedCmd);
}
Also used : ScmFileSet(org.apache.maven.scm.ScmFileSet) ScmTag(org.apache.maven.scm.ScmTag)

Example 13 with ScmTag

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

the class StarteamUpdateCommandTest method testGetCommandLineWithFileOnRoot.

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

Example 14 with ScmTag

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

the class StarteamUpdateCommandTest method testGetCommandLineWithFileInSubDir.

public void testGetCommandLineWithFileInSubDir() throws Exception {
    ScmFileSet workingCopy = new ScmFileSet(this.getWorkingCopy(), new File("subdir/test.txt"));
    String workDirAbsolutePath = StarteamCommandLineUtils.toJavaPath(workingCopy.getBasedir().getAbsolutePath());
    String starteamUrl = "user:password@host:1234/project/view";
    String mavenUrl = "scm:starteam:" + starteamUrl;
    String expectedCmd = "stcmd co -x -nologo -stop" + " -p " + starteamUrl + "/subdir" + " -fp " + workDirAbsolutePath + "/subdir" + " -merge -neverprompt -vl myTag" + " -eol on test.txt";
    testCommandLine(mavenUrl, workingCopy, new ScmTag("myTag"), expectedCmd);
}
Also used : ScmFileSet(org.apache.maven.scm.ScmFileSet) ScmTag(org.apache.maven.scm.ScmTag) File(java.io.File)

Example 15 with ScmTag

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

the class StarteamCheckOutCommandTest method testGetCommandLine.

public void testGetCommandLine() throws Exception {
    ScmFileSet workingCopy = new ScmFileSet(this.getWorkingCopy());
    String workDirAbsolutePath = StarteamCommandLineUtils.toJavaPath(workingCopy.getBasedir().getAbsolutePath());
    String starteamUrl = "user:password@host:1234/project/view";
    String mavenUrl = "scm:starteam:" + starteamUrl;
    String expectedCmd = "stcmd co -x -nologo -stop" + " -p " + starteamUrl + " -fp " + workDirAbsolutePath + " -is -vl myTag -eol on";
    testCommandLine(mavenUrl, workingCopy, new ScmTag("myTag"), expectedCmd);
}
Also used : ScmFileSet(org.apache.maven.scm.ScmFileSet) ScmTag(org.apache.maven.scm.ScmTag)

Aggregations

ScmTag (org.apache.maven.scm.ScmTag)32 File (java.io.File)17 ScmFileSet (org.apache.maven.scm.ScmFileSet)17 CheckOutScmResult (org.apache.maven.scm.command.checkout.CheckOutScmResult)9 Commandline (org.codehaus.plexus.util.cli.Commandline)9 Test (org.junit.Test)9 AbstractAccuRevCommandTest (org.apache.maven.scm.provider.accurev.command.AbstractAccuRevCommandTest)8 CommandParameters (org.apache.maven.scm.CommandParameters)7 ScmFileMatcher.assertHasScmFile (org.apache.maven.scm.ScmFileMatcher.assertHasScmFile)7 ExportScmResult (org.apache.maven.scm.command.export.ExportScmResult)6 ScmBranch (org.apache.maven.scm.ScmBranch)5 ScmRepository (org.apache.maven.scm.repository.ScmRepository)5 ScmException (org.apache.maven.scm.ScmException)4 SvnScmProviderRepository (org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository)4 ScmFile (org.apache.maven.scm.ScmFile)3 ScmManager (org.apache.maven.scm.manager.ScmManager)3 SimpleDateFormat (java.text.SimpleDateFormat)2 CheckInScmResult (org.apache.maven.scm.command.checkin.CheckInScmResult)2 TagScmResult (org.apache.maven.scm.command.tag.TagScmResult)2 SvnCommandLineUtils (org.apache.maven.scm.provider.svn.svnexe.command.SvnCommandLineUtils)2