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));
}
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);
}
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);
}
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);
}
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);
}
Aggregations