maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r691433 - in /maven/scm/trunk: maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/ maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/jav...
Date Tue, 02 Sep 2008 23:41:55 GMT
Author: vsiveton
Date: Tue Sep  2 16:41:54 2008
New Revision: 691433

URL: http://svn.apache.org/viewvc?rev=691433&view=rev
Log:
SCM-408: Support the CVSNT "sserver" protocol

o updated code to support sserver protocol
o added test case
o updated the documentation

Added:
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProviderTest.java
  (with props)
Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProvider.java
    maven/scm/trunk/src/site/apt/cvs.apt

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java?rev=691433&r1=691432&r2=691433&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider.java
Tue Sep  2 16:41:54 2008
@@ -59,19 +59,19 @@
 public abstract class AbstractCvsScmProvider
     extends AbstractScmProvider
 {
-    /** */
-    public static final String TRANSPORT_LOCAL = "local";
+    /** ext transport method */
+    public static final String TRANSPORT_EXT = "ext";
 
-    /** */
-    public static final String TRANSPORT_PSERVER = "pserver";
+    /** local transport method */
+    public static final String TRANSPORT_LOCAL = "local";
 
-    /** */
+    /** lserver transport method */
     public static final String TRANSPORT_LSERVER = "lserver";
 
-    /** */
-    public static final String TRANSPORT_EXT = "ext";
+    /** pserver transport method */
+    public static final String TRANSPORT_PSERVER = "pserver";
 
-    /** */
+    /** sspi transport method */
     public static final String TRANSPORT_SSPI = "sspi";
 
     // ----------------------------------------------------------------------
@@ -79,13 +79,60 @@
     // ----------------------------------------------------------------------
 
     /**
-     * Internal class
+     * The current ScmUrlParserResult
+     *
+     * @since 1.1.1
      */
-    private static class ScmUrlParserResult
+    public static class ScmUrlParserResult
     {
-        private List messages = new ArrayList();
+        private List messages;
 
         private ScmProviderRepository repository;
+
+        public ScmUrlParserResult()
+        {
+            messages = new ArrayList();
+        }
+
+        /**
+         * @return the messages
+         */
+        public List getMessages()
+        {
+            return messages;
+        }
+
+        /**
+         * @param messages the messages to set
+         */
+        public void setMessages( List messages )
+        {
+            this.messages = messages;
+        }
+
+        /**
+         * @return the repository
+         */
+        public ScmProviderRepository getRepository()
+        {
+            return repository;
+        }
+
+        /**
+         * @param repository the repository to set
+         */
+        public void setRepository( ScmProviderRepository repository )
+        {
+            this.repository = repository;
+        }
+
+        /**
+         * Reset messages.
+         */
+        public void resetMessages()
+        {
+            this.messages = new ArrayList();
+        }
     }
 
     // ----------------------------------------------------------------------
@@ -138,12 +185,12 @@
     {
         ScmUrlParserResult result = parseScmUrl( scmSpecificUrl, delimiter );
 
-        if ( result.messages.size() > 0 )
+        if ( result.getMessages().size() > 0 )
         {
-            throw new ScmRepositoryException( "The scm url is invalid.", result.messages
);
+            throw new ScmRepositoryException( "The scm url is invalid.", result.getMessages()
);
         }
 
-        return result.repository;
+        return result.getRepository();
     }
 
     /** {@inheritDoc} */
@@ -195,7 +242,7 @@
     {
         ScmUrlParserResult result = parseScmUrl( scmSpecificUrl, delimiter );
 
-        return result.messages;
+        return result.getMessages();
     }
 
     /** {@inheritDoc} */
@@ -204,11 +251,126 @@
         return "cvs";
     }
 
+    /** {@inheritDoc} */
+    public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
+        throws ScmException
+    {
+        return (AddScmResult) executeCommand( getAddCommand(), repository, fileSet, parameters
);
+    }
+
+    /** {@inheritDoc} */
+    public BranchScmResult branch( ScmProviderRepository repository, ScmFileSet fileSet,
CommandParameters parameters )
+        throws ScmException
+    {
+        return (BranchScmResult) executeCommand( getBranchCommand(), repository, fileSet,
parameters );
+    }
+
+    /** {@inheritDoc} */
+    public ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet,
+                                         CommandParameters parameters )
+        throws ScmException
+    {
+        return (ChangeLogScmResult) executeCommand( getChangeLogCommand(), repository, fileSet,
parameters );
+    }
+
+    /** {@inheritDoc} */
+    public CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet,
+                                     CommandParameters parameters )
+        throws ScmException
+    {
+        return (CheckInScmResult) executeCommand( getCheckInCommand(), repository, fileSet,
parameters );
+    }
+
+    /** {@inheritDoc} */
+    public CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet,
+                                       CommandParameters parameters )
+        throws ScmException
+    {
+        return (CheckOutScmResult) executeCommand( getCheckOutCommand(), repository, fileSet,
parameters );
+    }
+
+    /** {@inheritDoc} */
+    public DiffScmResult diff( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
+        throws ScmException
+    {
+        return (DiffScmResult) executeCommand( getDiffCommand(), repository, fileSet, parameters
);
+    }
+
+    /** {@inheritDoc} */
+    protected ExportScmResult export( ScmProviderRepository repository, ScmFileSet fileSet,
+                                      CommandParameters parameters )
+        throws ScmException
+    {
+        return (ExportScmResult) executeCommand( getExportCommand(), repository, fileSet,
parameters );
+    }
+
+    /** {@inheritDoc} */
+    public LoginScmResult login( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
+        throws ScmException
+    {
+        return (LoginScmResult) executeCommand( getLoginCommand(), repository, fileSet, parameters
);
+    }
+
+    /** {@inheritDoc} */
+    public RemoveScmResult remove( ScmProviderRepository repository, ScmFileSet fileSet,
CommandParameters parameters )
+        throws ScmException
+    {
+        return (RemoveScmResult) executeCommand( getRemoveCommand(), repository, fileSet,
parameters );
+    }
+
+    /** {@inheritDoc} */
+    public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet,
CommandParameters parameters )
+        throws ScmException
+    {
+        return (StatusScmResult) executeCommand( getStatusCommand(), repository, fileSet,
parameters );
+    }
+
+    /** {@inheritDoc} */
+    public TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
+        throws ScmException
+    {
+        return (TagScmResult) executeCommand( getTagCommand(), repository, fileSet, parameters
);
+    }
+
+    /** {@inheritDoc} */
+    public UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet,
CommandParameters parameters )
+        throws ScmException
+    {
+        return (UpdateScmResult) executeCommand( getUpdateCommand(), repository, fileSet,
parameters );
+    }
+
+    /** {@inheritDoc} */
+    protected ListScmResult list( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
+        throws ScmException
+    {
+        return (ListScmResult) executeCommand( getListCommand(), repository, fileSet, parameters
);
+    }
+
+    /**
+     * @param basedir not null
+     * @param f not null
+     * @return the relative path
+     * @throws ScmException if any
+     * @throws IOException if any
+     */
+    public static String getRelativePath( File basedir, File f )
+        throws ScmException, IOException
+    {
+        File fileOrDir = getAbsoluteFilePath( f );
+
+        if ( !fileOrDir.getPath().startsWith( basedir.getPath() ) )
+        {
+            throw new ScmException( fileOrDir.getPath() + " was not contained in " + basedir.getPath()
);
+        }
+
+        return fileOrDir.getPath().substring( basedir.getPath().length() + 1, fileOrDir.getPath().length()
);
+    }
+
     // ----------------------------------------------------------------------
-    //
+    // Protected methods
     // ----------------------------------------------------------------------
 
-    private ScmUrlParserResult parseScmUrl( String scmSpecificUrl, char delimiter )
+    protected ScmUrlParserResult parseScmUrl( String scmSpecificUrl, char delimiter )
     {
         ScmUrlParserResult result = new ScmUrlParserResult();
 
@@ -216,7 +378,7 @@
 
         if ( tokens.length < 3 )
         {
-            result.messages.add( "The connection string contains too few tokens." );
+            result.getMessages().add( "The connection string contains too few tokens." );
 
             return result;
         }
@@ -235,25 +397,25 @@
         {
             if ( tokens.length != 4 && transport.equalsIgnoreCase( TRANSPORT_EXT
) )
             {
-                result.messages.add( "The connection string contains too few tokens." );
+                result.getMessages().add( "The connection string contains too few tokens."
);
 
                 return result;
             }
             else if ( ( tokens.length < 4 || tokens.length > 6 ) && transport.equalsIgnoreCase(
TRANSPORT_PSERVER ) )
             {
-                result.messages.add( "The connection string contains too few tokens." );
+                result.getMessages().add( "The connection string contains too few tokens."
);
 
                 return result;
             }
             else if ( tokens.length < 4 || tokens.length > 5 && !transport.equalsIgnoreCase(
TRANSPORT_PSERVER ) )
             {
-                result.messages.add( "The connection string contains too few tokens." );
+                result.getMessages().add( "The connection string contains too few tokens."
);
 
                 return result;
             }
             else if ( tokens.length < 4 || tokens.length > 5 && transport.equalsIgnoreCase(
TRANSPORT_SSPI ) )
             {
-                result.messages.add( "The connection string contains too few tokens." );
+                result.getMessages().add( "The connection string contains too few tokens."
);
 
                 return result;
             }
@@ -278,7 +440,7 @@
         }
         else
         {
-            result.messages.add( "Unknown transport: " + transport );
+            result.getMessages().add( "Unknown transport: " + transport );
 
             return result;
         }
@@ -333,7 +495,7 @@
 
                 if ( index == -1 )
                 {
-                    result.messages
+                    result.getMessages()
                         .add( "The user_password_host part must be on the form: <username>:<password>@<hostname>."
);
 
                     return result;
@@ -389,7 +551,7 @@
                     catch ( Exception e )
                     {
                         //incorrect
-                        result.messages.add( "Your scm url is invalid." );
+                        result.getMessages().add( "Your scm url is invalid." );
 
                         return result;
                     }
@@ -457,7 +619,7 @@
                 catch ( Exception e )
                 {
                     //incorrect
-                    result.messages.add( "Your scm url is invalid, could not get port value."
);
+                    result.getMessages().add( "Your scm url is invalid, could not get port
value." );
 
                     return result;
                 }
@@ -526,28 +688,18 @@
 
         if ( port == -1 )
         {
-            result.repository = new CvsScmProviderRepository( cvsroot, transport, user, password,
host, path, module );
+            result.setRepository( new CvsScmProviderRepository( cvsroot, transport, user,
password, host, path,
+                                                                module ) );
         }
         else
         {
-            result.repository =
-                new CvsScmProviderRepository( cvsroot, transport, user, password, host, port,
path, module );
+            result.setRepository( new CvsScmProviderRepository( cvsroot, transport, user,
password, host, port,
+                                                                path, module ) );
         }
 
         return result;
     }
 
-    private ScmResult executeCommand( Command command, ScmProviderRepository repository,
ScmFileSet fileSet,
-                                      CommandParameters parameters )
-        throws ScmException
-    {
-        fileSet = fixUpScmFileSetAbsoluteFilePath( fileSet );
-
-        command.setLogger( getLogger() );
-
-        return command.execute( repository, fileSet, parameters );
-    }
-
     protected abstract Command getAddCommand();
 
     protected abstract Command getBranchCommand();
@@ -574,100 +726,21 @@
 
     protected abstract Command getUpdateCommand();
 
-    /** {@inheritDoc} */
-    public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
-        throws ScmException
-    {
-        return (AddScmResult) executeCommand( getAddCommand(), repository, fileSet, parameters
);
-    }
-
-    /** {@inheritDoc} */
-    public BranchScmResult branch( ScmProviderRepository repository, ScmFileSet fileSet,
CommandParameters parameters )
-        throws ScmException
-    {
-        return (BranchScmResult) executeCommand( getBranchCommand(), repository, fileSet,
parameters );
-    }
-
-    /** {@inheritDoc} */
-    public ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet,
-                                         CommandParameters parameters )
-        throws ScmException
-    {
-        return (ChangeLogScmResult) executeCommand( getChangeLogCommand(), repository, fileSet,
parameters );
-    }
-
-    /** {@inheritDoc} */
-    public CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet,
-                                     CommandParameters parameters )
-        throws ScmException
-    {
-        return (CheckInScmResult) executeCommand( getCheckInCommand(), repository, fileSet,
parameters );
-    }
-
-    /** {@inheritDoc} */
-    public CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet,
-                                       CommandParameters parameters )
-        throws ScmException
-    {
-        return (CheckOutScmResult) executeCommand( getCheckOutCommand(), repository, fileSet,
parameters );
-    }
-
-    /** {@inheritDoc} */
-    public DiffScmResult diff( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
-        throws ScmException
-    {
-        return (DiffScmResult) executeCommand( getDiffCommand(), repository, fileSet, parameters
);
-    }
+    // ----------------------------------------------------------------------
+    // Private methods
+    // ----------------------------------------------------------------------
 
-    /** {@inheritDoc} */
-    protected ExportScmResult export( ScmProviderRepository repository, ScmFileSet fileSet,
+    private ScmResult executeCommand( Command command, ScmProviderRepository repository,
ScmFileSet fileSet,
                                       CommandParameters parameters )
         throws ScmException
     {
-        return (ExportScmResult) executeCommand( getExportCommand(), repository, fileSet,
parameters );
-    }
-
-    /** {@inheritDoc} */
-    public LoginScmResult login( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
-        throws ScmException
-    {
-        return (LoginScmResult) executeCommand( getLoginCommand(), repository, fileSet, parameters
);
-    }
-
-    /** {@inheritDoc} */
-    public RemoveScmResult remove( ScmProviderRepository repository, ScmFileSet fileSet,
CommandParameters parameters )
-        throws ScmException
-    {
-        return (RemoveScmResult) executeCommand( getRemoveCommand(), repository, fileSet,
parameters );
-    }
-
-    /** {@inheritDoc} */
-    public StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet,
CommandParameters parameters )
-        throws ScmException
-    {
-        return (StatusScmResult) executeCommand( getStatusCommand(), repository, fileSet,
parameters );
-    }
+        fileSet = fixUpScmFileSetAbsoluteFilePath( fileSet );
 
-    /** {@inheritDoc} */
-    public TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
-        throws ScmException
-    {
-        return (TagScmResult) executeCommand( getTagCommand(), repository, fileSet, parameters
);
-    }
+        command.setLogger( getLogger() );
 
-    /** {@inheritDoc} */
-    public UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet,
CommandParameters parameters )
-        throws ScmException
-    {
-        return (UpdateScmResult) executeCommand( getUpdateCommand(), repository, fileSet,
parameters );
+        return command.execute( repository, fileSet, parameters );
     }
 
-    /** {@inheritDoc} */
-    protected ListScmResult list( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters
parameters )
-        throws ScmException
-    {
-        return (ListScmResult) executeCommand( getListCommand(), repository, fileSet, parameters
);
-    }
 
     /**
      * CVS provider requires that all files in ScmFileSet must be relative to basedir
@@ -706,19 +779,6 @@
         return newFileSet;
     }
 
-    public static String getRelativePath( File basedir, File f )
-        throws ScmException, IOException
-    {
-        File fileOrDir = getAbsoluteFilePath( f );
-
-        if ( !fileOrDir.getPath().startsWith( basedir.getPath() ) )
-        {
-            throw new ScmException( fileOrDir.getPath() + " was not contained in " + basedir.getPath()
);
-        }
-
-        return fileOrDir.getPath().substring( basedir.getPath().length() + 1, fileOrDir.getPath().length()
);
-    }
-
     private static File getAbsoluteFilePath( File fileOrDir )
         throws IOException
     {

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProvider.java?rev=691433&r1=691432&r2=691433&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProvider.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/main/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProvider.java
Tue Sep  2 16:41:54 2008
@@ -34,6 +34,8 @@
 import org.apache.maven.scm.provider.cvslib.cvsexe.command.status.CvsExeStatusCommand;
 import org.apache.maven.scm.provider.cvslib.cvsexe.command.tag.CvsExeTagCommand;
 import org.apache.maven.scm.provider.cvslib.cvsexe.command.update.CvsExeUpdateCommand;
+import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository;
+import org.codehaus.plexus.util.StringUtils;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -43,6 +45,9 @@
 public class CvsExeScmProvider
     extends AbstractCvsScmProvider
 {
+    /** sserver transport method */
+    public static final String TRANSPORT_SSERVER = "sserver";
+
     /** {@inheritDoc} */
     protected Command getAddCommand()
     {
@@ -120,4 +125,129 @@
     {
         return new CvsExeUpdateCommand();
     }
+
+    /** {@inheritDoc} */
+    protected ScmUrlParserResult parseScmUrl( String scmSpecificUrl, char delimiter )
+    {
+        ScmUrlParserResult result = super.parseScmUrl( scmSpecificUrl, delimiter );
+        if ( result.getMessages().isEmpty() )
+        {
+            return result;
+        }
+
+        result.resetMessages();
+
+        String[] tokens = StringUtils.split( scmSpecificUrl, Character.toString( delimiter
) );
+
+        String cvsroot;
+
+        String transport = tokens[0];
+
+        // support sserver
+        if ( transport.equalsIgnoreCase( TRANSPORT_SSERVER ) )
+        {
+            if ( tokens.length < 4 || tokens.length > 5 && transport.equalsIgnoreCase(
TRANSPORT_SSERVER ) )
+            {
+                result.getMessages().add( "The connection string contains too few tokens."
);
+
+                return result;
+            }
+
+            //create the cvsroot as the remote cvsroot
+            if ( tokens.length == 4 )
+            {
+                cvsroot = ":" + transport + ":" + tokens[1] + ":" + tokens[2];
+            }
+            else
+            {
+                cvsroot = ":" + transport + ":" + tokens[1] + ":" + tokens[2] + ":" + tokens[3];
+            }
+        }
+        else
+        {
+            result.getMessages().add( "Unknown transport: " + transport );
+
+            return result;
+        }
+
+        String user = null;
+
+        String password = null;
+
+        String host = null;
+
+        String path = null;
+
+        String module = null;
+
+        int port = -1;
+
+        if ( transport.equalsIgnoreCase( TRANSPORT_SSERVER ) )
+        {
+            //sspi:[username@]host:[port]path:module
+            String userhost = tokens[1];
+
+            int index = userhost.indexOf( "@" );
+
+            if ( index == -1 )
+            {
+                user = "";
+
+                host = userhost;
+            }
+            else
+            {
+                user = userhost.substring( 0, index );
+
+                host = userhost.substring( index + 1 );
+            }
+
+            // no port specified
+            if ( tokens.length == 4 )
+            {
+                path = tokens[2];
+                module = tokens[3];
+            }
+            else
+            {
+                // getting port
+                try
+                {
+                    port = new Integer( tokens[2] ).intValue();
+                    path = tokens[3];
+                    module = tokens[4];
+                }
+                catch ( Exception e )
+                {
+                    //incorrect
+                    result.getMessages().add( "Your scm url is invalid, could not get port
value." );
+
+                    return result;
+                }
+            }
+
+            // cvsroot format is :sspi:host:path
+            cvsroot = ":" + transport + ":" + host + ":";
+
+            if ( port != -1 )
+            {
+                cvsroot += port;
+            }
+
+            cvsroot += path;
+        }
+
+        if ( port == -1 )
+        {
+            result.setRepository( new CvsScmProviderRepository( cvsroot, transport, user,
password, host, path,
+                                                                module ) );
+        }
+        else
+        {
+            result.setRepository( new CvsScmProviderRepository( cvsroot, transport, user,
password, host, port,
+                                                                path, module ) );
+        }
+
+        return result;
+    }
 }

Added: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProviderTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProviderTest.java?rev=691433&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProviderTest.java
(added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProviderTest.java
Tue Sep  2 16:41:54 2008
@@ -0,0 +1,46 @@
+package org.apache.maven.scm.provider.cvslib.cvsexe;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ */
+public class CvsExeScmProviderTest
+    extends TestCase
+{
+    public void testValidateScmUrl()
+        throws Exception
+    {
+        CvsExeScmProvider provider = new CvsExeScmProvider();
+
+        List messages = provider.validateScmUrl( "pserver:cvsserver:/bigrepo:myproject",
':' );
+        assertTrue( messages.toString(), messages.isEmpty() );
+
+        messages = provider.validateScmUrl( "sserver:cvsserver:/bigrepo:myproject", ':' );
+        assertTrue( messages.toString(), messages.isEmpty() );
+
+        messages = provider.validateScmUrl( "sserver2:cvsserver:/bigrepo:myproject", ':'
);
+        assertFalse( messages.toString(), messages.isEmpty() );
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProviderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvsexe/src/test/java/org/apache/maven/scm/provider/cvslib/cvsexe/CvsExeScmProviderTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/scm/trunk/src/site/apt/cvs.apt
URL: http://svn.apache.org/viewvc/maven/scm/trunk/src/site/apt/cvs.apt?rev=691433&r1=691432&r2=691433&view=diff
==============================================================================
--- maven/scm/trunk/src/site/apt/cvs.apt (original)
+++ maven/scm/trunk/src/site/apt/cvs.apt Tue Sep  2 16:41:54 2008
@@ -3,7 +3,7 @@
  ------
  Wim Deblauwe
  ------
- 2005-12-01
+ 2008-09-02
  ------
 
 ~~ Licensed to the Apache Software Foundation (ASF) under one
@@ -47,6 +47,8 @@
 
   The following methods are supported:
 
+  * ext, connecting to a server using an external rsh program
+
   * local, connecting to the local file system
 
   * lserver, connecting to a local server
@@ -55,7 +57,7 @@
 
   * sspi, secure authentication (less supported by clients and servers, may require using
native implementation, for more details see "How to choose the CVS provider implementation")
 
-  * ext, connecting to a server using an external rsh program
+  * sserver, SSL connection method for CVS (only if cvs_native is used i.e. using -Dmaven.scm.provider.cvs.implementation=cvs_native
with Maven)
 
   []
 



Mime
View raw message