maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r407289 - in /maven/scm/trunk/maven-scm-plugin: ./ src/main/java/org/apache/maven/scm/plugin/ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/maven/ src/test/java/org/apache/maven/scm/ src/test...
Date Wed, 17 May 2006 15:42:24 GMT
Author: evenisse
Date: Wed May 17 08:42:23 2006
New Revision: 407289

URL: http://svn.apache.org/viewvc?rev=407289&view=rev
Log:
Add some tests

Added:
    maven/scm/trunk/maven-scm-plugin/src/test/
    maven/scm/trunk/maven-scm-plugin/src/test/java/
    maven/scm/trunk/maven-scm-plugin/src/test/java/org/
    maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/
    maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/
    maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/
    maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/
    maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java
  (with props)
    maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/StatusMojoTest.java
  (with props)
    maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UpdateMojoTest.java
  (with props)
    maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ValidateMojoTest.java
  (with props)
    maven/scm/trunk/maven-scm-plugin/src/test/resources/
    maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/
    maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/
    maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWhenCheckoutDirectoryExistsAndSkip.xml
  (with props)
    maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml
  (with props)
    maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithoutConnectionUrl.xml
  (with props)
    maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/status/
    maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/status/status.xml   (with props)
    maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/update/
    maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/update/updateWithConnectionUrl.xml
  (with props)
    maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/
    maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithInvalidScmUrls.xml
  (with props)
    maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithValidScmUrls.xml
  (with props)
    maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithoutScmUrl.xml
  (with props)
Modified:
    maven/scm/trunk/maven-scm-plugin/   (props changed)
    maven/scm/trunk/maven-scm-plugin/pom.xml
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateMojo.java

Propchange: maven/scm/trunk/maven-scm-plugin/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed May 17 08:42:23 2006
@@ -3,3 +3,5 @@
 .project
 .wtpmodules
 maven-scm-plugin.iml
+*.ipr
+*.iws

Modified: maven/scm/trunk/maven-scm-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/pom.xml?rev=407289&r1=407288&r2=407289&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/pom.xml (original)
+++ maven/scm/trunk/maven-scm-plugin/pom.xml Wed May 17 08:42:23 2006
@@ -80,6 +80,18 @@
       <artifactId>maven-scm-provider-starteam</artifactId>
       <version>1.0-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-plugin-testing-harness</artifactId>
+      <version>1.0-beta-1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-provider-svntest</artifactId>
+      <version>1.0-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
   <distributionManagement>
     <site>

Modified: maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java?rev=407289&r1=407288&r2=407289&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
(original)
+++ maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
Wed May 17 08:42:23 2006
@@ -26,12 +26,14 @@
 import org.apache.maven.scm.provider.ScmProviderRepositoryWithHost;
 import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
 import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.scm.repository.ScmRepositoryException;
 import org.apache.maven.settings.Server;
 import org.apache.maven.settings.Settings;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.Iterator;
 
 /**
  * @author <a href="evenisse@apache.org">Emmanuel Venisse</a>
@@ -156,6 +158,11 @@
         throw new NullPointerException( "You need to define a connectionUrl parameter" );
     }
 
+    public void setConnectionUrl( String connectionUrl )
+    {
+        this.connectionUrl = connectionUrl;
+    }
+
     public File getWorkingDirectory()
     {
         if ( workingDirectory == null )
@@ -166,6 +173,11 @@
         return workingDirectory;
     }
 
+    public void setWorkingDirectory( File workingDirectory )
+    {
+        this.workingDirectory = workingDirectory;
+    }
+
     public ScmManager getScmManager()
     {
         return manager;
@@ -238,6 +250,19 @@
 
                 svnRepo.setTagBase( tagBase );
             }
+        }
+        catch ( ScmRepositoryException e )
+        {
+            if ( !e.getValidationMessages().isEmpty() )
+            {
+                for ( Iterator i = e.getValidationMessages().iterator(); i.hasNext(); )
+                {
+                    String message = (String) i.next();
+                    getLog().error( message );
+                }
+            }
+
+            throw new ScmException( "Can't load the scm provider.", e );
         }
         catch ( Exception e )
         {

Modified: maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java?rev=407289&r1=407288&r2=407289&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java
(original)
+++ maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java
Wed May 17 08:42:23 2006
@@ -56,17 +56,17 @@
     private File checkoutDirectory;
 
     /**
-     * Skip checkout if checkoutDirectory exists. 
+     * Skip checkout if checkoutDirectory exists.
      *
      * @parameter expression="${skipCheckoutIfExists}" default-value="false"
      */
     private boolean skipCheckoutIfExists = false;
-    
+
     public void execute()
         throws MojoExecutionException
     {
         //skip checkout if checkout directory is already created. See SCM-201
-        if ( ! this.checkoutDirectory.isDirectory() || ! this.skipCheckoutIfExists  )
+        if ( ! getCheckoutDirectory().isDirectory() || ! this.skipCheckoutIfExists )
         {
             checkout();
         }
@@ -98,23 +98,23 @@
 
             try
             {
-                this.getLog().info( "Removing " + this.checkoutDirectory );
+                this.getLog().info( "Removing " + getCheckoutDirectory() );
 
-                FileUtils.deleteDirectory( this.checkoutDirectory );
+                FileUtils.deleteDirectory( getCheckoutDirectory() );
             }
             catch ( IOException e )
             {
-                throw new MojoExecutionException( "Cannot remove " + this.checkoutDirectory
);
+                throw new MojoExecutionException( "Cannot remove " + getCheckoutDirectory()
);
             }
 
-            if ( ! this.checkoutDirectory.mkdirs() )
+            if ( ! getCheckoutDirectory().mkdirs() )
             {
-                throw new MojoExecutionException( "Cannot create " + this.checkoutDirectory
);
+                throw new MojoExecutionException( "Cannot create " + getCheckoutDirectory()
);
             }
 
             CheckOutScmResult result = getScmManager().getProviderByRepository( repository
).checkOut( repository,
                                                                                         
              new ScmFileSet(
-                                                                                        
                  this.checkoutDirectory.getAbsoluteFile() ),
+                                                                                        
                  getCheckoutDirectory().getAbsoluteFile() ),
                                                                                         
              currentTag );
 
             checkResult( result );

Modified: maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateMojo.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateMojo.java?rev=407289&r1=407288&r2=407289&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateMojo.java
(original)
+++ maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/UpdateMojo.java
Wed May 17 08:42:23 2006
@@ -89,7 +89,10 @@
             {
                 getLog().info( "Storing revision in '" + revisionKey + "' project property."
);
 
-                project.getProperties().put( revisionKey, ( (UpdateScmResultWithRevision)
result ).getRevision() );
+                if ( project.getProperties() != null ) // Remove the test when we'll use
plugin-test-harness 1.0-alpha-2
+                {
+                    project.getProperties().put( revisionKey, ( (UpdateScmResultWithRevision)
result ).getRevision() );
+                }
             }
         }
         catch ( IOException e )

Added: maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java?rev=407289&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java
(added)
+++ maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java
Wed May 17 08:42:23 2006
@@ -0,0 +1,97 @@
+package org.apache.maven.scm.plugin;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+import org.apache.maven.scm.provider.svn.SvnScmTestUtils;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.StringUtils;
+
+import java.io.File;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class CheckoutMojoTest
+    extends AbstractMojoTestCase
+{
+    File checkoutDir;
+
+    File repository;
+
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        checkoutDir = getTestFile( "target/checkout" );
+
+        repository = getTestFile( "target/repository" );
+
+        FileUtils.forceDelete( checkoutDir );
+    }
+
+    public void testSkipCheckoutWhenCheckoutDirectoryExistsAndSkip()
+        throws Exception
+    {
+        checkoutDir.mkdirs();
+
+        CheckoutMojo mojo = (CheckoutMojo) lookupMojo( "checkout", getTestFile(
+            "src/test/resources/mojos/checkout/checkoutWhenCheckoutDirectoryExistsAndSkip.xml"
) );
+
+        mojo.execute();
+
+        assertEquals( 0, checkoutDir.listFiles().length );
+    }
+
+    public void testSkipCheckoutWithConnectionUrl()
+        throws Exception
+    {
+        SvnScmTestUtils.initializeRepository( repository );
+
+        CheckoutMojo mojo = (CheckoutMojo) lookupMojo( "checkout", getTestFile(
+            "src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml" ) );
+
+        String connectionUrl = mojo.getConnectionUrl();
+        connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() );
+        connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" );
+        mojo.setConnectionUrl( connectionUrl );
+
+        mojo.execute();
+    }
+
+    public void testSkipCheckoutWithoutConnectionUrl()
+        throws Exception
+    {
+        CheckoutMojo mojo = (CheckoutMojo) lookupMojo( "checkout", getTestFile(
+            "src/test/resources/mojos/checkout/checkoutWithoutConnectionUrl.xml" ) );
+
+        try
+        {
+            mojo.execute();
+
+            fail( "mojo execution must fail." );
+        }
+        catch ( MojoExecutionException e )
+        {
+            assertTrue( true );
+        }
+    }
+
+}

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/CheckoutMojoTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/StatusMojoTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/StatusMojoTest.java?rev=407289&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/StatusMojoTest.java
(added)
+++ maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/StatusMojoTest.java
Wed May 17 08:42:23 2006
@@ -0,0 +1,39 @@
+package org.apache.maven.scm.plugin;
+
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+
+import java.io.File;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class StatusMojoTest
+    extends AbstractMojoTestCase
+{
+    public void testStatusMojo()
+        throws Exception
+    {
+        StatusMojo mojo =
+            (StatusMojo) lookupMojo( "status", getTestFile( "src/test/resources/mojos/status/status.xml"
) );
+
+        mojo.setWorkingDirectory( new File( getBasedir() ) );
+        mojo.execute();
+    }
+}

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/StatusMojoTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/StatusMojoTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UpdateMojoTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UpdateMojoTest.java?rev=407289&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UpdateMojoTest.java
(added)
+++ maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UpdateMojoTest.java
Wed May 17 08:42:23 2006
@@ -0,0 +1,76 @@
+package org.apache.maven.scm.plugin;
+
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+import org.apache.maven.scm.provider.svn.SvnScmTestUtils;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.StringUtils;
+
+import java.io.File;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class UpdateMojoTest
+    extends AbstractMojoTestCase
+{
+    File checkoutDir;
+
+    File repository;
+
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        checkoutDir = getTestFile( "target/checkout" );
+
+        repository = getTestFile( "target/repository" );
+
+        FileUtils.forceDelete( checkoutDir );
+    }
+
+    public void testSkipCheckoutWithConnectionUrl()
+        throws Exception
+    {
+        SvnScmTestUtils.initializeRepository( repository );
+
+        CheckoutMojo checkoutMojo = (CheckoutMojo) lookupMojo( "checkout", getTestFile(
+            "src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml" ) );
+
+        String connectionUrl = checkoutMojo.getConnectionUrl();
+        connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() );
+        connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" );
+        checkoutMojo.setConnectionUrl( connectionUrl );
+
+        checkoutMojo.execute();
+
+        UpdateMojo updateMojo = (UpdateMojo) lookupMojo( "update", getTestFile(
+            "src/test/resources/mojos/update/updateWithConnectionUrl.xml" ) );
+
+        connectionUrl = updateMojo.getConnectionUrl();
+        connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", getBasedir() );
+        connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" );
+        updateMojo.setConnectionUrl( connectionUrl );
+
+        updateMojo.execute();
+
+    }
+
+}

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UpdateMojoTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/UpdateMojoTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ValidateMojoTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ValidateMojoTest.java?rev=407289&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ValidateMojoTest.java
(added)
+++ maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ValidateMojoTest.java
Wed May 17 08:42:23 2006
@@ -0,0 +1,61 @@
+package org.apache.maven.scm.plugin;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed 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 org.apache.maven.plugin.testing.AbstractMojoTestCase;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class ValidateMojoTest
+    extends AbstractMojoTestCase
+{
+    public void testValidateWithoutScmUrl()
+        throws Exception
+    {
+        ValidateMojo mojo = (ValidateMojo) lookupMojo( "validate", getTestFile(
+            "src/test/resources/mojos/validate/validateWithoutScmUrl.xml" ) );
+        mojo.execute();
+    }
+
+    public void testValidateWithValidScmUrls()
+        throws Exception
+    {
+        ValidateMojo mojo = (ValidateMojo) lookupMojo( "validate", getTestFile(
+            "src/test/resources/mojos/validate/validateWithValidScmUrls.xml" ) );
+        mojo.execute();
+    }
+
+    public void testValidateWithInvalidScmUrls()
+        throws Exception
+    {
+        ValidateMojo mojo = (ValidateMojo) lookupMojo( "validate", getTestFile(
+            "src/test/resources/mojos/validate/validateWithInvalidScmUrls.xml" ) );
+        try
+        {
+            mojo.execute();
+
+            fail( "mojo execution must fail." );
+        }
+        catch ( MojoExecutionException e )
+        {
+            assertTrue( true );
+        }
+    }
+}

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ValidateMojoTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/ValidateMojoTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWhenCheckoutDirectoryExistsAndSkip.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWhenCheckoutDirectoryExistsAndSkip.xml?rev=407289&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWhenCheckoutDirectoryExistsAndSkip.xml
(added)
+++ maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWhenCheckoutDirectoryExistsAndSkip.xml
Wed May 17 08:42:23 2006
@@ -0,0 +1,14 @@
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-scm-plugin</artifactId>
+        <configuration>
+          <checkoutDirectory>target/checkout</checkoutDirectory>
+          <connectionUrl>scm:svn:http://svn.apache.org/repos/asf/maven/scm/trunk</connectionUrl>
+          <skipCheckoutIfExists>true</skipCheckoutIfExists>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWhenCheckoutDirectoryExistsAndSkip.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWhenCheckoutDirectoryExistsAndSkip.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml?rev=407289&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml
(added)
+++ maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml
Wed May 17 08:42:23 2006
@@ -0,0 +1,15 @@
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-scm-plugin</artifactId>
+        <configuration>
+          <settings implementation="org.apache.maven.settings.Settings"/>
+          <checkoutDirectory>target/checkout</checkoutDirectory>
+          <connectionType>connection</connectionType>
+          <connectionUrl>scm:svn:file:///${basedir}/target/repository</connectionUrl>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithoutConnectionUrl.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithoutConnectionUrl.xml?rev=407289&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithoutConnectionUrl.xml
(added)
+++ maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithoutConnectionUrl.xml
Wed May 17 08:42:23 2006
@@ -0,0 +1,12 @@
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-scm-plugin</artifactId>
+        <configuration>
+          <checkoutDirectory>target/checkout</checkoutDirectory>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithoutConnectionUrl.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/checkout/checkoutWithoutConnectionUrl.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/status/status.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/status/status.xml?rev=407289&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/status/status.xml (added)
+++ maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/status/status.xml Wed May 17
08:42:23 2006
@@ -0,0 +1,14 @@
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-scm-plugin</artifactId>
+        <configuration>
+          <settings implementation="org.apache.maven.settings.Settings"/>
+          <connectionType>connection</connectionType>
+          <connectionUrl>scm:svn:file:///${basedir}/target/repository</connectionUrl>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/status/status.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/status/status.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/update/updateWithConnectionUrl.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/update/updateWithConnectionUrl.xml?rev=407289&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/update/updateWithConnectionUrl.xml
(added)
+++ maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/update/updateWithConnectionUrl.xml
Wed May 17 08:42:23 2006
@@ -0,0 +1,17 @@
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-scm-plugin</artifactId>
+        <configuration>
+          <settings implementation="org.apache.maven.settings.Settings"/>
+          <project implementation="org.apache.maven.plugin.testing.stubs.MavenProjectStub"/>
+          <connectionType>connection</connectionType>
+          <connectionUrl>scm:svn:file:///${basedir}/target/repository</connectionUrl>
+          <workingDirectory>target/checkout</workingDirectory>
+          <revisionKey>scm.revision</revisionKey>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/update/updateWithConnectionUrl.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/update/updateWithConnectionUrl.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithInvalidScmUrls.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithInvalidScmUrls.xml?rev=407289&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithInvalidScmUrls.xml
(added)
+++ maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithInvalidScmUrls.xml
Wed May 17 08:42:23 2006
@@ -0,0 +1,13 @@
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-scm-plugin</artifactId>
+        <configuration>
+          <scmConnection>scm:unknwonProvider:http://svn.apache.org/repos/asf/maven/scm/trunk</scmConnection>
+          <scmDeveloperConnection>scm:unknownProvider:https://svn.apache.org/repos/asf/maven/scm/trunk</scmDeveloperConnection>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithInvalidScmUrls.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithInvalidScmUrls.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithValidScmUrls.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithValidScmUrls.xml?rev=407289&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithValidScmUrls.xml
(added)
+++ maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithValidScmUrls.xml
Wed May 17 08:42:23 2006
@@ -0,0 +1,14 @@
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-scm-plugin</artifactId>
+        <configuration>
+          <connectionUrl>scm:svn:http://svn.apache.org/repos/asf/maven/scm/trunk</connectionUrl>
+          <scmConnection>scm:svn:http://svn.apache.org/repos/asf/maven/scm/trunk</scmConnection>
+          <scmDeveloperConnection>scm:svn:https://svn.apache.org/repos/asf/maven/scm/trunk</scmDeveloperConnection>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithValidScmUrls.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithValidScmUrls.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithoutScmUrl.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithoutScmUrl.xml?rev=407289&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithoutScmUrl.xml
(added)
+++ maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithoutScmUrl.xml
Wed May 17 08:42:23 2006
@@ -0,0 +1,11 @@
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-scm-plugin</artifactId>
+        <configuration>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithoutScmUrl.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-plugin/src/test/resources/mojos/validate/validateWithoutScmUrl.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message