You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm-commits@maven.apache.org by da...@apache.org on 2006/11/20 07:47:35 UTC
svn commit: r477077 - in
/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src:
main/java/org/apache/maven/scm/provider/starteam/command/status/
test/java/org/apache/maven/scm/provider/starteam/command/status/
Author: dantran
Date: Sun Nov 19 22:47:33 2006
New Revision: 477077
URL: http://svn.apache.org/viewvc?view=rev&rev=477077
Log:
Implement SCM-249 fix for status cmd
Modified:
maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommand.java
maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommandTest.java
Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommand.java?view=diff&rev=477077&r1=477076&r2=477077
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommand.java Sun Nov 19 22:47:33 2006
@@ -27,8 +27,6 @@
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;
-import java.io.File;
-
/**
* @author <a href="mailto:dantran@gmail.com">Dan T. Tran</a>
* @version $Id$
@@ -47,7 +45,7 @@
getLogger().info( "Working directory: " + fileSet.getBasedir().getAbsolutePath() );
- if ( fileSet.getFiles().length != 0 )
+ if ( fileSet.getFileList().size() != 0 )
{
throw new ScmException( "This provider doesn't support checking status of a subsets of a directory" );
}
@@ -58,7 +56,7 @@
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
- Commandline cl = createCommandLine( repository, fileSet.getBasedir() );
+ Commandline cl = createCommandLine( repository, fileSet );
int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );
@@ -74,13 +72,8 @@
//
// ----------------------------------------------------------------------
- public static Commandline createCommandLine( StarteamScmProviderRepository repo, File workingDirectory )
+ public static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet workingDirectory )
{
-
- Commandline cl = StarteamCommandLineUtils.createStarteamBaseCommandLine( "hist", workingDirectory, repo );
-
- cl.createArgument().setValue( "-is" );
-
- return cl;
+ return StarteamCommandLineUtils.createStarteamCommandLine( "hist", null, workingDirectory, repo );
}
}
Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommandTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommandTest.java?view=diff&rev=477077&r1=477076&r2=477077
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommandTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/status/StarteamStatusCommandTest.java Sun Nov 19 22:47:33 2006
@@ -16,6 +16,7 @@
* limitations under the License.
*/
+import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.provider.starteam.command.StarteamCommandLineUtils;
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
@@ -34,20 +35,28 @@
public void testGetCommandLineWithWorkingDirectory()
throws Exception
{
- File workDir = new File( getBasedir() + "/target" );
+
+ 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 hist -x -nologo -stop"
+ + " -p " + starteamUrl
+ + " -fp " + workDirAbsolutePath
+ + " -is" ;
+
+ testCommandLine( mavenUrl, workingCopy, expectedCmd );
- String workDirAbsolutePath = StarteamCommandLineUtils.toJavaPath( workDir.getAbsolutePath() );
-
- testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl", workDir, "myTag",
- "stcmd hist -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl " + "-fp " +
- workDirAbsolutePath + " -is" );
}
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
- private void testCommandLine( String scmUrl, File workDir, String tag, String commandLine )
+ private void testCommandLine( String scmUrl, ScmFileSet workDir, String commandLine )
throws Exception
{
ScmRepository repo = getScmManager().makeScmRepository( scmUrl );