maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dant...@apache.org
Subject svn commit: r477049 - in /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src: main/java/org/apache/maven/scm/provider/starteam/command/ main/java/org/apache/maven/scm/provider/starteam/command/add/ main/java/org/apache/maven/scm/provid...
Date Mon, 20 Nov 2006 05:16:27 GMT
Author: dantran
Date: Sun Nov 19 21:16:25 2006
New Revision: 477049

URL: http://svn.apache.org/viewvc?view=rev&rev=477049
Log:
Refactor to move stdcmd's -is option into central method

Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/add/StarteamAddCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/remove/StarteamRemoveCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommand.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommandTest.java
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommandTest.java

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.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/StarteamCommandLineUtils.java?view=diff&rev=477049&r1=477048&r2=477049
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java
Sun Nov 19 21:16:25 2006
@@ -29,6 +29,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.util.List;
 
 /**
  * Command line construction utility.
@@ -120,19 +121,22 @@
         return cl;
     }
     
-    /**
-     * Create stcmd command base on ScmFileSet contents.
-     * The fileset can not have more then one files.
-     * @param action
-     * @param scmFileSet
-     * @param repo
-     * @return
-     */
-    public static Commandline createStarteamBaseCommandLine( String action, ScmFileSet scmFileSet,
+    
+    private static Commandline addCommandlineArguments( Commandline cl, List args )
+    {
+    	for ( int i = 0; args != null && i < args.size(); ++i )
+    	{
+    		cl.createArgument().setValue( (String)args.get( i ) );
+    	}
+    	return cl;
+    }
+    
+    public static Commandline createStarteamCommandLine( String action, List args, ScmFileSet
scmFileSet,
             StarteamScmProviderRepository repo )
     {
         Commandline cl = StarteamCommandLineUtils.createStarteamBaseCommandLine( action,
repo );
-        
+                
+        // case 1: scmFileSet has only basedir
         if ( scmFileSet.getFileList().size() == 0 )
         {
         	//perform an action on directory
@@ -141,45 +145,65 @@
             cl.createArgument().setValue( "-fp" );
             cl.createArgument().setValue( scmFileSet.getBasedir().getAbsolutePath().replace(
'\\', '/' ) );
 
+            cl.createArgument().setValue( "-is" );
+            
             addCompressionOption( cl );
             
+            addCommandlineArguments( cl, args );
+            
             return cl;
         }
 
+        //case 2 scmFileSet has a sub file, but we dont know if the sub file is a directory
or a file  
+        File fileInFileSet = (File) scmFileSet.getFileList().get( 0 );
+        File subFile = new File( scmFileSet.getBasedir(), fileInFileSet.getPath() );
+        
         //Perform an scm action on a single file where the orignal
         // url and local directory ( -p and -fp options ) are altered 
-        // to deal with single file
+        // to deal with single file/subdirectory
         
-        File file = (File) scmFileSet.getFileList().get( 0 );
+        File workingDirectory = subFile;
+        String scmUrl = repo.getFullUrl() + "/" + fileInFileSet.getPath().replace( '\\',
'/' );
+        if ( ! subFile.isDirectory() )
+        {
+        	workingDirectory = subFile.getParentFile();
+        	if ( fileInFileSet.getParent() != null ) 
+        	{
+        	    scmUrl = repo.getFullUrl() + "/" + fileInFileSet.getParent().replace( '\\',
'/' );
+        	}
+        	else
+        	{
+        		//subFile is right under root
+        		scmUrl = repo.getFullUrl();
+        	}
+        }
         
-        String newUrl = repo.getFullUrl();
+        cl.createArgument().setValue( "-p" );
+        cl.createArgument().setValue( scmUrl );
 
-        if ( file.getParent() != null )
-        {
-        	newUrl += "/" + file.getParent().replace( '\\', '/' ); 
-        }
+        cl.createArgument().setValue( "-fp" );
+        cl.createArgument().setValue( workingDirectory.getPath().replace( '\\', '/' ) );
 
-        cl.createArgument().setValue( "-p" );
+        cl.setWorkingDirectory( workingDirectory.getPath() );
 
-        cl.createArgument().setValue( newUrl );
         
-        File newWorkingDirectory = scmFileSet.getBasedir();
-        if ( file.getParent() != null )
+        if ( subFile.isDirectory() )
         {
-        	newWorkingDirectory = new File( newWorkingDirectory, file.getParent() );
-        }        
-        
-        cl.setWorkingDirectory( newWorkingDirectory.getAbsolutePath() );
-        
-        cl.createArgument().setValue( "-fp" );
+        	cl.createArgument().setValue( "-is" );
+        }
+              
+        StarteamCommandLineUtils.addCompressionOption( cl );
 
-        cl.createArgument().setValue( newWorkingDirectory.getAbsolutePath().replace( '\\',
'/' ) );
+        addCommandlineArguments( cl, args );
         
-        StarteamCommandLineUtils.addCompressionOption( cl );
+        if ( ! subFile.isDirectory() )
+        {
+        	cl.createArgument().setValue( subFile.getName() );
+        }        
         
         return cl;
-    }    
-
+    }      
+    
     public static void addCompressionOption( Commandline cl )
     {
         if ( settings.isCompressionEnable() )

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/add/StarteamAddCommand.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/add/StarteamAddCommand.java?view=diff&rev=477049&r1=477048&r2=477049
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/add/StarteamAddCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/add/StarteamAddCommand.java
Sun Nov 19 21:16:25 2006
@@ -29,6 +29,7 @@
 import org.codehaus.plexus.util.cli.Commandline;
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -79,18 +80,13 @@
 
     static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet
scmFileSet, String issue )
     {
-        Commandline cl = StarteamCommandLineUtils.createStarteamBaseCommandLine( "add", scmFileSet,
repo );
-        
-        if ( issue != null && issue.length() > 0 )
+    	List args = new ArrayList();
+        if ( issue != null && issue.length() != 0 )
         {
-            cl.createArgument().setValue( "-cr" );
-
-            cl.createArgument().setValue( issue );
-        }
-
-        File fileToBeAdded = (File) scmFileSet.getFileList().get(0);
-        cl.createArgument().setValue( fileToBeAdded.getName() );
-
-        return cl;
+        	args.add( "-cr" );
+        	args.add( issue );
+        }    	
+        
+        return StarteamCommandLineUtils.createStarteamCommandLine( "add", args, scmFileSet,
repo );
     }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInCommand.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/checkin/StarteamCheckInCommand.java?view=diff&rev=477049&r1=477048&r2=477049
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInCommand.java
Sun Nov 19 21:16:25 2006
@@ -17,6 +17,7 @@
  */
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.maven.scm.ScmException;
@@ -106,46 +107,47 @@
     public static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet
fileSet, String message,
                                                  String tag, String issueType, String issueValue
)
     {
-        Commandline cl = StarteamCommandLineUtils.createStarteamBaseCommandLine( "ci", fileSet,
repo );
-
-        if ( message != null && message.length() > 0 )
-        {
-            cl.createArgument().setValue( "-r" );
-
-            cl.createArgument().setValue( message );
-        }
-
-        if ( tag != null && tag.length() > 0 )
-        {
-            cl.createArgument().setValue( "-vl" );
-
-            cl.createArgument().setValue( tag );
-        }
-
+   
+    	List args = new ArrayList();
+        if ( message != null && message.length() != 0 )
+        {
+        	args.add( "-r" );
+        	args.add( message );
+        }    	
+
+        if ( tag != null && tag.length() != 0 )
+        {
+        	args.add( "-vl" );
+        	args.add( tag );
+        }    	
+        
         if ( issueType != null && issueType.trim().length() > 0 )
         {
-            cl.createArgument().setValue( "-" + issueType.trim() );
+        	args.add( "-" + issueType.trim() );
             if ( issueValue != null && issueValue.trim().length() > 0 )
             {
-                cl.createArgument().setValue( issueValue.trim() );
+            	args.add( issueValue.trim() );
             }
-        }
+        }      
         
-        if ( fileSet.getFileList().size() == 0 )
+        boolean checkinDirectory = fileSet.getFileList().size() == 0;
+        if ( !checkinDirectory )
         {
-            cl.createArgument().setValue( "-f" );
-
-            cl.createArgument().setValue( "NCI" );
-
-            cl.createArgument().setValue( "-is" );
+        	if ( fileSet.getFileList().size() != 0 )
+        	{
+        		File subFile = (File) fileSet.getFileList().get( 0 );
+        		checkinDirectory = subFile.isDirectory();
+        	}
         }
-        else
+        
+        if ( checkinDirectory )
         {
-        	File checkinFile = (File) fileSet.getFileList().get( 0 ) ;
-            cl.createArgument().setValue( checkinFile.getName() );
+        	args.add( "-f" );
+        	args.add( "NCI" );
         }
+        
+        return StarteamCommandLineUtils.createStarteamCommandLine( "ci", args, fileSet, repo
);
 
-        return cl;
     }
 
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.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/checkout/StarteamCheckOutCommand.java?view=diff&rev=477049&r1=477048&r2=477049
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommand.java
Sun Nov 19 21:16:25 2006
@@ -28,6 +28,8 @@
 import org.codehaus.plexus.util.cli.Commandline;
 
 import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -76,17 +78,13 @@
 
     public static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet
baseDir, String tag )
     {
-        Commandline cl = StarteamCommandLineUtils.createStarteamBaseCommandLine( "co", baseDir,
repo );
-
-        if ( tag != null && tag.trim().length() != 0 )
+    	List args = new ArrayList();
+        if ( tag != null && tag.length() != 0 )
         {
-            cl.createArgument().setValue( "-vl" );
-
-            cl.createArgument().setValue( tag );
-        }
-
-        cl.createArgument().setValue( "-is" );
-
-        return cl;
+        	args.add( "-vl" );
+        	args.add( tag );
+        }    	
+        
+        return StarteamCommandLineUtils.createStarteamCommandLine( "co", args, baseDir, repo
);
     }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/remove/StarteamRemoveCommand.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/remove/StarteamRemoveCommand.java?view=diff&rev=477049&r1=477048&r2=477049
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/remove/StarteamRemoveCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/remove/StarteamRemoveCommand.java
Sun Nov 19 21:16:25 2006
@@ -30,6 +30,7 @@
 import org.codehaus.plexus.util.cli.Commandline;
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -90,18 +91,6 @@
 
     public static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet
dirOrFile )
     {
-        Commandline cl = StarteamCommandLineUtils.createStarteamBaseCommandLine( "remove",
dirOrFile, repo );
-
-        if ( dirOrFile.getFileList().size() == 0 )
-        {
-            cl.createArgument().setValue( "-is" );
-        }
-        else
-        {
-        	File fileToBeRemoved = (File) dirOrFile.getFileList().get(0);
-            cl.createArgument().setValue( fileToBeRemoved.getName() );
-        }
-
-        return cl;
+        return StarteamCommandLineUtils.createStarteamCommandLine( "remove", null, dirOrFile,
repo );
     }
 }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommand.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/update/StarteamUpdateCommand.java?view=diff&rev=477049&r1=477048&r2=477049
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommand.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommand.java
Sun Nov 19 21:16:25 2006
@@ -33,6 +33,7 @@
 import org.codehaus.plexus.util.cli.StreamConsumer;
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -113,28 +114,16 @@
 
     public static Commandline createCommandLine( StarteamScmProviderRepository repo, ScmFileSet
fileSet, String tag )
     {
-        Commandline cl = StarteamCommandLineUtils.createStarteamBaseCommandLine( "co", fileSet,
repo );
-
-        cl.createArgument().setValue( "-merge" );
-
-        cl.createArgument().setValue( "-neverprompt" );
-
+    	List args = new ArrayList();
+    	args.add( "-merge" );
+    	args.add( "-neverprompt" );
         if ( tag != null && tag.length() != 0 )
         {
-            cl.createArgument().setValue( "-vl" );
-
-            cl.createArgument().setValue( tag );
-        }
-
-        if ( fileSet.getFileList().size() == 0 )
-        {
-            cl.createArgument().setValue( "-is" );
-        }
-        else
-        {
-        	File updateFile = (File) fileSet.getFileList().get( 0 );
-            cl.createArgument().setValue( updateFile.getName() );
-        }
+        	args.add( "-vl" );
+        	args.add( tag );
+        }    	
+        
+        Commandline cl = StarteamCommandLineUtils.createStarteamCommandLine( "co", args,
fileSet, repo );
 
         return cl;
     }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInCommandTest.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/checkin/StarteamCheckInCommandTest.java?view=diff&rev=477049&r1=477048&r2=477049
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInCommandTest.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkin/StarteamCheckInCommandTest.java
Sun Nov 19 21:16:25 2006
@@ -35,6 +35,21 @@
     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" ; 
+        
+        testCommandLine( mavenUrl, fileSet, "", "", "", "", expectedCmd );
+        
+        /*
         File workDir = new File( getBasedir() + "/target" );
 
         String workDirAbsolutePath = StarteamCommandLineUtils.toJavaPath( workDir.getAbsolutePath()
);
@@ -43,52 +58,86 @@
 
         testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl", fileSet,
"", "", "", "",
                          "stcmd ci -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl
" + "-fp " +
-                             workDirAbsolutePath + " -f NCI -is" );
+                             workDirAbsolutePath + " -is -f NCI" );
+                             */
     }
 
     public void testGetCommandLineWithFileOnRoot()
         throws Exception
     {
-        File testFile = new File( "testfile" );
-
-        String testFileAbsolutePath = StarteamCommandLineUtils.toJavaPath( testFile.getAbsoluteFile().getParent()
);
-
-        ScmFileSet fileSet = new ScmFileSet( testFile.getAbsoluteFile().getParentFile(),
testFile );
-
-        testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl", fileSet,
"myMessage", "myTag",
-                         "", "", "stcmd ci -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl
" + "-fp " +
-            testFileAbsolutePath + " -r myMessage -vl myTag " + "testfile" );
+    	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 
+                             + " test.txt" ; 
+        
+        testCommandLine( mavenUrl, fileSet, "", "", "", "", expectedCmd );
+    	
     }
 
     public void testGetCommandLineWithFileInSubDir()
         throws Exception
     {
-        File testFile = new File( "src/testfile.txt" );
+    	ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( "src/test.txt" ) );
 
-        File workingDir = testFile.getAbsoluteFile().getParentFile().getParentFile();
-        ScmFileSet fileSet = new ScmFileSet( workingDir, testFile );
+        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"
+                             + " test.txt" ; 
         
-        String testFileDirectory = StarteamCommandLineUtils.toJavaPath( testFile.getAbsoluteFile().getParent()
);
+        testCommandLine( mavenUrl, fileSet, "", "", "", "", expectedCmd );
 
-        testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl", fileSet,
null, "", "cr" ,"myCr",
-                         "stcmd ci -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl/src
" + "-fp " +
-                         testFileDirectory + " -cr myCr " + "testfile.txt" );
     }
 
+    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" ; 
+    
+        testCommandLine( mavenUrl, fileSet, "", "", "", "", expectedCmd );
+
+   }
+    
     public void testGetCommandLineWithEmptyIssueValue()
         throws Exception
     {
-        File testFile = new File( "src/testfile" );
+    	ScmFileSet fileSet = new ScmFileSet( getWorkingCopy(), new File( "test.txt" ) );
 
-        File workingDir = testFile.getAbsoluteFile().getParentFile().getParentFile();
-        ScmFileSet fileSet = new ScmFileSet( workingDir, testFile );
+        String workingCopy = StarteamCommandLineUtils.toJavaPath( getWorkingCopy().getPath()
);
+    	
+        String starteamUrl = "user:password@host:1234/project/view";
+        String mavenUrl = "scm:starteam:" + starteamUrl;
         
-        String testFileAbsolutePath = StarteamCommandLineUtils.toJavaPath( testFile.getAbsoluteFile().getParent()
);
-
-        testCommandLine( "scm:starteam:myusername:mypassword@myhost:1234/projecturl", fileSet,
null, "", "active", " ",
-                         "stcmd ci -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl/src
" + "-fp "
-                             + testFileAbsolutePath + " -active " + "testfile" );
+        String expectedCmd = "stcmd ci -x -nologo -stop"
+        	                 + " -p " + starteamUrl   
+                             + " -fp " + workingCopy 
+                             + " -active test.txt" ; 
+        
+        testCommandLine( mavenUrl, fileSet, null, "", "active", " ", expectedCmd );
     }    
 // ----------------------------------------------------------------------
 //

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommandTest.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/checkout/StarteamCheckOutCommandTest.java?view=diff&rev=477049&r1=477048&r2=477049
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommandTest.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/checkout/StarteamCheckOutCommandTest.java
Sun Nov 19 21:16:25 2006
@@ -43,7 +43,7 @@
         String expectedCmd = "stcmd co -x -nologo -stop"
         	                 + " -p " + starteamUrl   
                              + " -fp " + workDirAbsolutePath 
-                             + " -vl myTag -is" ; 
+                             + " -is -vl myTag" ; 
         
         testCommandLine( mavenUrl, workingCopy, "myTag", expectedCmd );
     }

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommandTest.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/update/StarteamUpdateCommandTest.java?view=diff&rev=477049&r1=477048&r2=477049
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommandTest.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/test/java/org/apache/maven/scm/provider/starteam/command/update/StarteamUpdateCommandTest.java
Sun Nov 19 21:16:25 2006
@@ -45,7 +45,7 @@
         String expectedCmd = "stcmd co -x -nologo -stop"
         	                 + " -p " + starteamUrl   
                              + " -fp " + workDirAbsolutePath 
-                             + " -merge -neverprompt -vl myTag -is" ; 
+                             + " -is -merge -neverprompt -vl myTag" ; 
         
         testCommandLine( mavenUrl, workingCopy, "myTag", expectedCmd );
     



Mime
View raw message