maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r755423 - /maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/tag/SvnExeTagCommandTckTest.java
Date Tue, 17 Mar 2009 22:19:43 GMT
Author: olamy
Date: Tue Mar 17 22:19:42 2009
New Revision: 755423

URL: http://svn.apache.org/viewvc?rev=755423&view=rev
Log:
add unit for svn remote tagging cli generation


Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/tag/SvnExeTagCommandTckTest.java

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/tag/SvnExeTagCommandTckTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/tag/SvnExeTagCommandTckTest.java?rev=755423&r1=755422&r2=755423&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/tag/SvnExeTagCommandTckTest.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-svn/maven-scm-provider-svnexe/src/test/java/org/apache/maven/scm/provider/svn/svnexe/command/tag/SvnExeTagCommandTckTest.java
Tue Mar 17 22:19:42 2009
@@ -19,13 +19,14 @@
  * under the License.
  */
 
+import java.io.File;
+
+import org.apache.maven.scm.ScmTagParameters;
 import org.apache.maven.scm.provider.svn.command.tag.SvnTagCommandTckTest;
 import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
 import org.apache.maven.scm.repository.ScmRepository;
 import org.codehaus.plexus.util.cli.Commandline;
 
-import java.io.File;
-
 /**
  * This test tests the tag command.
  *
@@ -43,10 +44,38 @@
 
         testCommandLine( "scm:svn:svn+ssh://foo.com/svn/trunk", "svntag", messageFile, "user",
                          "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath()
+
-                             " . svn+ssh://user@foo.com/svn/tags/svntag" );
+                             " . svn+ssh://user@foo.com/svn/tags/svntag", null );
     }
+    
+    public void testTagRemoteTagHttps()
+        throws Exception
+    {
+        File messageFile = File.createTempFile( "maven-scm", "commit" );
+        messageFile.deleteOnExit();
+
+        ScmTagParameters scmTagParameters = new ScmTagParameters();
+        scmTagParameters.setRemoteTagging( true );
+        testCommandLine( "scm:svn:https://foo.com/svn/trunk", "svntag", messageFile, "user",
+                         "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath()
+                             + " https://foo.com/svn/trunk https://foo.com/svn/tags/svntag",
scmTagParameters );
+    }    
+    
+    public void testTagRemoteTagHttpsWithRevision()
+    throws Exception
+{
+    File messageFile = File.createTempFile( "maven-scm", "commit" );
+    messageFile.deleteOnExit();
+
+    ScmTagParameters scmTagParameters = new ScmTagParameters();
+    scmTagParameters.setRemoteTagging( true );
+    scmTagParameters.setScmRevision( "12" );
+    testCommandLine( "scm:svn:https://foo.com/svn/trunk", "svntag", messageFile, "user",
+                     "svn --username user --non-interactive copy --file " + messageFile.getAbsolutePath()
+                         + " --revision 12 https://foo.com/svn/trunk https://foo.com/svn/tags/svntag",
scmTagParameters );
+}    
 
-    private void testCommandLine( String scmUrl, String tag, File messageFile, String user,
String commandLine )
+    private void testCommandLine( String scmUrl, String tag, File messageFile, String user,
String commandLine,
+                                  ScmTagParameters scmTagParameters )
         throws Exception
     {
         File workingDirectory = getTestFile( "target/svn-update-command-test" );
@@ -57,8 +86,17 @@
 
         svnRepository.setUser( user );
 
-        Commandline cl = SvnTagCommand.createCommandLine( svnRepository, workingDirectory,
tag, messageFile );
+        Commandline cl = null;
 
+        if ( scmTagParameters == null )
+        {
+            cl = SvnTagCommand.createCommandLine( svnRepository, workingDirectory, tag, messageFile
);
+        }
+        else
+        {
+            cl = SvnTagCommand.createCommandLine( svnRepository, workingDirectory, tag, messageFile,
scmTagParameters );
+        }
+        System.out.println(" command " + cl.toString() );
         assertCommandLine( commandLine, workingDirectory, cl );
     }
 }



Mime
View raw message