maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1062201 - in /maven/surefire/trunk: maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/ maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ maven-surefire-common/src/main/java/org/apache/maven/plugin/sur...
Date Sat, 22 Jan 2011 17:02:30 GMT
Author: krosenvold
Date: Sat Jan 22 17:02:29 2011
New Revision: 1062201

URL: http://svn.apache.org/viewvc?rev=1062201&view=rev
Log:
[SUREFIRE-257] Should not re-run tests.

Fixed with IT. Does not ever re-run the same execution configuration
in the same module for both failsafe and surefire.

Added:
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ChecksumCalculator.java
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire257NotRerunningTestsIT.java
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/pom.xml
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/main/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/main/java/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/main/java/surefire257/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/main/java/surefire257/MyModule1Class.java
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/test/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/test/java/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/test/java/surefire257/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/test/java/surefire257/MyModule1ClassTest.java
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/pom.xml
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/main/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/main/java/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/main/java/surefire257/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/main/java/surefire257/MyModule2Class.java
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/test/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/test/java/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/test/java/surefire257/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/test/java/surefire257/MyModule2ClassTest.java
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/pom.xml
  (with props)
Modified:
    maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
    maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java

Modified: maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java?rev=1062201&r1=1062200&r2=1062201&view=diff
==============================================================================
--- maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
(original)
+++ maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
Sat Jan 22 17:02:29 2011
@@ -29,6 +29,7 @@ import org.apache.maven.plugin.MojoFailu
 import org.apache.maven.plugin.surefire.AbstractSurefireMojo;
 import org.apache.maven.plugin.surefire.ProviderInfo;
 import org.apache.maven.plugin.surefire.SurefireExecutionParameters;
+import org.apache.maven.plugin.surefire.booterclient.ChecksumCalculator;
 import org.apache.maven.plugin.surefire.booterclient.ForkConfiguration;
 import org.apache.maven.plugin.surefire.booterclient.ForkStarter;
 import org.apache.maven.project.MavenProject;
@@ -207,16 +208,16 @@ public class IntegrationTestMojo
      * A list of <include> elements specifying the tests (by pattern) that should
be included in testing. When not
      * specified and when the <code>test</code> parameter is not specified, the
default includes will be
      * <code><br/>
-        &lt;includes><br/>
-            &nbsp;&lt;include>**&#47;IT*.java&lt;/include><br/>
-            &nbsp;&lt;include>**&#47;*IT.java&lt;/include><br/>
-            &nbsp;&lt;include>**&#47;*ITCase.java&lt;/include><br/>
-        &lt;/includes><br/>
+     * &lt;includes><br/>
+     * &nbsp;&lt;include>**&#47;IT*.java&lt;/include><br/>
+     * &nbsp;&lt;include>**&#47;*IT.java&lt;/include><br/>
+     * &nbsp;&lt;include>**&#47;*ITCase.java&lt;/include><br/>
+     * &lt;/includes><br/>
      * </code>
-     *
+     * <p/>
      * Each include item may also contain a comma-separated sublist of items, which will
be treated as multiple &nbsp;&lt;include>
      * entries.<br/>
-     *
+     * <p/>
      * This parameter is ignored if the TestNG <code>suiteXmlFiles</code> parameter
is specified.
      *
      * @parameter
@@ -227,13 +228,13 @@ public class IntegrationTestMojo
      * A list of &lt;exclude> elements specifying the tests (by pattern) that should
be excluded in testing. When not
      * specified and when the <code>test</code> parameter is not specified, the
default excludes will be
      * <code><br/>
-        &lt;excludes><br/>
-            &nbsp;&lt;exclude>**&#47;*$*&lt;/exclude><br/>
-        &lt;/excludes><br/>
+     * &lt;excludes><br/>
+     * &nbsp;&lt;exclude>**&#47;*$*&lt;/exclude><br/>
+     * &lt;/excludes><br/>
      * </code>
      * (which excludes all inner classes).<br>
      * This parameter is ignored if the TestNG <code>suiteXmlFiles</code> parameter
is specified.
-     *
+     * <p/>
      * Each exclude item may also contain a comma-separated sublist of items, which will
be treated as multiple &nbsp;&lt;exclude>
      * entries.<br/>
      *
@@ -642,6 +643,10 @@ public class IntegrationTestMojo
     {
         if ( verifyParameters() )
         {
+            if ( hasExecutedBefore() )
+            {
+                return;
+            }
             logReportsDirectory();
 
             final List providers = initialize();
@@ -699,8 +704,8 @@ public class IntegrationTestMojo
                 if ( StringUtils.isEmpty( this.encoding ) )
                 {
                     getLog().warn(
-                        "File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING
+
-                            ", i.e. build is platform dependent!" );
+                        "File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING
+                            + ", i.e. build is platform dependent!" );
                     encoding = ReaderFactory.FILE_ENCODING;
                 }
                 else
@@ -724,6 +729,7 @@ public class IntegrationTestMojo
         }
     }
 
+
     protected boolean verifyParameters()
         throws MojoFailureException
     {
@@ -1378,4 +1384,10 @@ public class IntegrationTestMojo
     {
         this.runOrder = runOrder;
     }
+
+    protected void addPluginSpecificChecksumItems( ChecksumCalculator checksum )
+    {
+        checksum.add(skipITs);
+        checksum.add(summaryFile);
+    }
 }

Modified: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java?rev=1062201&r1=1062200&r2=1062201&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
(original)
+++ maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
Sat Jan 22 17:02:29 2011
@@ -33,6 +33,7 @@ import org.apache.maven.artifact.version
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.surefire.booterclient.ChecksumCalculator;
 import org.apache.maven.plugin.surefire.booterclient.ForkConfiguration;
 import org.apache.maven.plugin.surefire.booterclient.ForkStarter;
 import org.apache.maven.shared.artifact.filter.PatternIncludesArtifactFilter;
@@ -506,7 +507,7 @@ public abstract class AbstractSurefireMo
 
     protected ForkConfiguration getForkConfiguration()
     {
-        File tmpDir = new File( getReportsDirectory().getParentFile(), "surefire" );
+        File tmpDir = getSurefireTempDir();
         //noinspection ResultOfMethodCallIgnored
         tmpDir.mkdirs();
 
@@ -578,6 +579,90 @@ public abstract class AbstractSurefireMo
         return fork;
     }
 
+
+    /**
+     * Where surefire stores its own temp files
+     *
+     * @return A file pointing to the location of surefire's own temp files
+     */
+    private File getSurefireTempDir()
+    {
+        return new File( getReportsDirectory().getParentFile(), "surefire" );
+    }
+
+    private String getConfigChecksum()
+    {
+        ChecksumCalculator checksum = new ChecksumCalculator();
+        checksum.add( getPluginName() );
+        checksum.add( isSkipTests() );
+        checksum.add( isSkipExec() );
+        checksum.add( isSkip() );
+        checksum.add( getTestClassesDirectory() );
+        checksum.add( getClassesDirectory() );
+        checksum.add( getClasspathDependencyExcludes() );
+        checksum.add( getClasspathDependencyScopeExclude() );
+        checksum.add( getAdditionalClasspathElements() );
+        checksum.add( getReportsDirectory() );
+        checksum.add( getTestSourceDirectory() );
+        checksum.add( getTest() );
+        checksum.add( getIncludes() );
+        checksum.add( getExcludes() );
+        checksum.add( getLocalRepository() );
+        checksum.add( getSystemProperties() );
+        checksum.add( getSystemPropertyVariables() );
+        checksum.add( getProperties() );
+        checksum.add( isPrintSummary() );
+        checksum.add( getReportFormat() );
+        checksum.add( isUseFile() );
+        checksum.add( isRedirectTestOutputToFile() );
+        checksum.add( getForkMode() );
+        checksum.add( getJvm() );
+        checksum.add( getArgLine() );
+        checksum.add( getDebugForkedProcess() );
+        checksum.add( getForkedProcessTimeoutInSeconds() );
+        checksum.add( getEnvironmentVariables() );
+        checksum.add( getWorkingDirectory() );
+        checksum.add( isChildDelegation() );
+        checksum.add( getGroups() );
+        checksum.add( getExcludedGroups() );
+        checksum.add( getSuiteXmlFiles() );
+        checksum.add( getJunitArtifact() );
+        checksum.add( getTestNGArtifactName() );
+        checksum.add( getThreadCount() );
+        checksum.add( getPerCoreThreadCount() );
+        checksum.add( getUseUnlimitedThreads() );
+        checksum.add( getParallel() );
+        checksum.add( isTrimStackTrace() );
+        checksum.add( getRemoteRepositories() );
+        checksum.add( isDisableXmlReport() );
+        checksum.add( isUseSystemClassLoader() );
+        checksum.add( isUseManifestOnlyJar() );
+        checksum.add( isEnableAssertions() );
+        checksum.add( getObjectFactory() );
+        checksum.add( getFailIfNoTests() );
+        checksum.add( getRunOrder() );
+        addPluginSpecificChecksumItems(checksum);
+        return checksum.getSha1();
+
+    }
+
+    protected abstract void addPluginSpecificChecksumItems( ChecksumCalculator checksum );
+
+    protected boolean hasExecutedBefore()
+    {
+        // A tribute to Linus Torvalds
+        String configChecksum = getConfigChecksum();
+        Map pluginContext = getPluginContext();
+        if ( pluginContext.containsKey( configChecksum ) )
+        {
+            getLog().info( "Skipping execution of surefire because it has already been run
for this configuration" );
+            return true;
+        }
+        pluginContext.put( configChecksum, configChecksum );
+
+        return false;
+    }
+
     protected ClassLoaderConfiguration getClassLoaderConfiguration( ForkConfiguration fork
)
     {
         return fork.isForking()

Added: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ChecksumCalculator.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ChecksumCalculator.java?rev=1062201&view=auto
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ChecksumCalculator.java
(added)
+++ maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ChecksumCalculator.java
Sat Jan 22 17:02:29 2011
@@ -0,0 +1,176 @@
+package org.apache.maven.plugin.surefire.booterclient;
+
+/*
+ * 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 org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * @author Kristian Rosenvold
+ */
+public class ChecksumCalculator
+{
+    private static final String HEX = "0123456789ABCDEF";
+
+    List checksumItems = new ArrayList();
+
+    private void appendObject( Object item )
+    {
+        checksumItems.add( item );
+    }
+
+    public void add( boolean value )
+    {
+        checksumItems.add( value ? Boolean.TRUE : Boolean.FALSE );
+    }
+
+    public void add( int value )
+    {
+        checksumItems.add( new Integer( value ) );
+    }
+
+    public void add( Map map )
+    {
+        if ( map != null )
+        {
+            appendObject( map.toString() );
+        }
+    }
+
+    public void add( String string )
+    {
+        appendObject( string );
+    }
+
+    public void add( File workingDirectory )
+    {
+        appendObject( workingDirectory );
+    }
+
+    public void add( ArtifactRepository localRepository )
+    {
+        appendObject( localRepository );
+    }
+
+    public void add( List items )
+    {
+        if ( items != null )
+        {
+            int size = items.size();
+            Object item;
+            for ( int i = 0; i < size; i++ )
+            {
+                item = items.get( i );
+                appendObject( item );
+            }
+        }
+        else
+        {
+            appendObject( null );
+        }
+
+    }
+
+    public void add( File[] fileList )
+    {
+        if ( fileList != null )
+        {
+            int size = fileList.length;
+            for ( int i = 0; i < size; i++ )
+            {
+                appendObject( fileList[i] );
+            }
+        }
+        else
+        {
+            appendObject( null );
+        }
+    }
+
+    public void add( Artifact artifact )
+    {
+        appendObject( artifact != null ? artifact.getId() : null );
+    }
+
+    public void add( Boolean aBoolean )
+    {
+        appendObject( aBoolean );
+    }
+
+    private static String asHexString( byte[] bytes )
+    {
+        if ( bytes == null )
+        {
+            return null;
+        }
+        int size = bytes.length;
+        final StringBuilder result = new StringBuilder( 2 * size );
+        byte b;
+        for ( int i = 0; i < size; i++ )
+        {
+            b = bytes[i];
+            result.append( HEX.charAt( ( b & 0xF0 ) >> 4 ) ).append( HEX.charAt(
( b & 0x0F ) ) );
+        }
+        return result.toString();
+    }
+
+    private String getConfig()
+    {
+        StringBuilder result = new StringBuilder();
+        Object item;
+        for ( Iterator iter = checksumItems.iterator(); iter.hasNext(); )
+        {
+            item = iter.next();
+            result.append( item != null ? item.toString() : "null" );
+        }
+        return result.toString();
+    }
+
+    public String getSha1()
+    {
+        try
+        {
+            MessageDigest md = MessageDigest.getInstance( "SHA-1" );
+            String configValue = getConfig();
+            md.update( configValue.getBytes( "iso-8859-1" ), 0, configValue.length() );
+            byte[] sha1hash = md.digest();
+            return asHexString( sha1hash );
+        }
+        catch ( NoSuchAlgorithmException e )
+        {
+            throw new RuntimeException( e );
+        }
+        catch ( UnsupportedEncodingException e )
+        {
+            throw new RuntimeException( e );
+        }
+    }
+
+}

Propchange: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ChecksumCalculator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java?rev=1062201&r1=1062200&r2=1062201&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
(original)
+++ maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
Sat Jan 22 17:02:29 2011
@@ -26,6 +26,7 @@ import org.apache.maven.artifact.resolve
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.surefire.booterclient.ChecksumCalculator;
 import org.apache.maven.plugin.surefire.booterclient.ForkConfiguration;
 import org.apache.maven.plugin.surefire.booterclient.ForkStarter;
 import org.apache.maven.project.MavenProject;
@@ -103,6 +104,7 @@ public class SurefirePlugin
     /**
      * The directory containing generated test classes of the project being tested.
      * This will be included at the beginning of the test classpath.                    
                                                                                         
             *
+     *
      * @parameter default-value="${project.build.testOutputDirectory}"
      */
     private File testClassesDirectory;
@@ -186,11 +188,11 @@ public class SurefirePlugin
      * A list of &lt;include> elements specifying the tests (by pattern) that should
be included in testing. When not
      * specified and when the <code>test</code> parameter is not specified, the
default includes will be
      * <code><br/>
-        &lt;includes><br/>
-            &nbsp;&lt;include>**&#47;Test*.java&lt;/include><br/>
-            &nbsp;&lt;include>**&#47;*Test.java&lt;/include><br/>
-            &nbsp;&lt;include>**&#47;*TestCase.java&lt;/include><br/>
-        &lt;/includes><br/>
+     * &lt;includes><br/>
+     * &nbsp;&lt;include>**&#47;Test*.java&lt;/include><br/>
+     * &nbsp;&lt;include>**&#47;*Test.java&lt;/include><br/>
+     * &nbsp;&lt;include>**&#47;*TestCase.java&lt;/include><br/>
+     * &lt;/includes><br/>
      * </code>
      * This parameter is ignored if the TestNG <code>suiteXmlFiles</code> parameter
is specified.
      *
@@ -202,9 +204,9 @@ public class SurefirePlugin
      * A list of &lt;exclude> elements specifying the tests (by pattern) that should
be excluded in testing. When not
      * specified and when the <code>test</code> parameter is not specified, the
default excludes will be
      * <code><br/>
-        &lt;excludes><br/>
-            &nbsp;&lt;exclude>**&#47;*$*&lt;/exclude><br/>
-        &lt;/excludes><br/>
+     * &lt;excludes><br/>
+     * &nbsp;&lt;exclude>**&#47;*$*&lt;/exclude><br/>
+     * &lt;/excludes><br/>
      * </code>
      * (which excludes all inner classes).<br>
      * This parameter is ignored if the TestNG <code>suiteXmlFiles</code> parameter
is specified.
@@ -595,6 +597,10 @@ public class SurefirePlugin
     {
         if ( verifyParameters() )
         {
+            if ( hasExecutedBefore() )
+            {
+                return;
+            }
             logReportsDirectory();
 
             final List providers = initialize();
@@ -688,13 +694,17 @@ public class SurefirePlugin
         this.skipTests = skipTests;
     }
 
-    /** @noinspection deprecation*/
+    /**
+     * @noinspection deprecation
+     */
     public boolean isSkipExec()
     {
         return skipExec;
     }
 
-    /** @noinspection deprecation*/
+    /**
+     * @noinspection deprecation
+     */
     public void setSkipExec( boolean skipExec )
     {
         this.skipExec = skipExec;
@@ -850,13 +860,17 @@ public class SurefirePlugin
         this.localRepository = localRepository;
     }
 
-    /** @noinspection deprecation*/
+    /**
+     * @noinspection deprecation
+     */
     public Properties getSystemProperties()
     {
         return systemProperties;
     }
 
-    /** @noinspection deprecation*/
+    /**
+     * @noinspection deprecation
+     */
     public void setSystemProperties( Properties systemProperties )
     {
         this.systemProperties = systemProperties;
@@ -1276,4 +1290,8 @@ public class SurefirePlugin
     {
         this.runOrder = runOrder;
     }
+
+    protected void addPluginSpecificChecksumItems( ChecksumCalculator checksum )
+    {
+    }
 }

Added: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire257NotRerunningTestsIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire257NotRerunningTestsIT.java?rev=1062201&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire257NotRerunningTestsIT.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire257NotRerunningTestsIT.java
Sat Jan 22 17:02:29 2011
@@ -0,0 +1,43 @@
+package org.apache.maven.surefire.its;
+/*
+ * 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.
+ */
+
+/**
+ * Test Surefire-257 Verifies that surefire does not re-run tests in site build
+ *
+ * @author Kristian Rosenvold
+ */
+public class Surefire257NotRerunningTestsIT
+    extends SurefireVerifierTestClass
+{
+
+    public Surefire257NotRerunningTestsIT()
+    {
+        super( "/surefire-257-rerunningTests" );
+    }
+
+    public void testShouldNotRerun()
+        throws Exception
+    {
+
+        addGoal( "package" );
+        execute( "site" );
+        verifyTextInLog( "Skipping execution of surefire because it has already been run
for this configuration" );
+    }
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire257NotRerunningTestsIT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/pom.xml?rev=1062201&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/pom.xml
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/pom.xml
Sat Jan 22 17:02:29 2011
@@ -0,0 +1,23 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.surefire-257-rerunningTests</groupId>
+    <artifactId>surefire-257-rerunningTests</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+  </parent>
+
+  <groupId>org.apache.maven.surefire-257-rerunningTests.module1</groupId>
+  <artifactId>module1</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.2</version>
+      <type>jar</type>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/main/java/surefire257/MyModule1Class.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/main/java/surefire257/MyModule1Class.java?rev=1062201&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/main/java/surefire257/MyModule1Class.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/main/java/surefire257/MyModule1Class.java
Sat Jan 22 17:02:29 2011
@@ -0,0 +1,6 @@
+package surefire257;
+public class MyModule1Class {
+  public int getFoo() {
+    return 42;
+  }
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/main/java/surefire257/MyModule1Class.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/test/java/surefire257/MyModule1ClassTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/test/java/surefire257/MyModule1ClassTest.java?rev=1062201&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/test/java/surefire257/MyModule1ClassTest.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/test/java/surefire257/MyModule1ClassTest.java
Sat Jan 22 17:02:29 2011
@@ -0,0 +1,13 @@
+package surefire257;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+import surefire257.MyModule1Class;
+
+public class MyModule1ClassTest extends TestCase {
+
+  public void testGetFooOK() {
+    MyModule1Class mc = new MyModule1Class();
+    Assert.assertEquals(42, mc.getFoo());
+  }
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module1/src/test/java/surefire257/MyModule1ClassTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/pom.xml?rev=1062201&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/pom.xml
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/pom.xml
Sat Jan 22 17:02:29 2011
@@ -0,0 +1,23 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.surefire-257-rerunningTests</groupId>
+    <artifactId>surefire-257-rerunningTests</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+  </parent>
+
+  <groupId>org.apache.maven.surefire-257-rerunningTests.module2</groupId>
+  <artifactId>module2</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.2</version>
+      <type>jar</type>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/main/java/surefire257/MyModule2Class.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/main/java/surefire257/MyModule2Class.java?rev=1062201&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/main/java/surefire257/MyModule2Class.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/main/java/surefire257/MyModule2Class.java
Sat Jan 22 17:02:29 2011
@@ -0,0 +1,6 @@
+package surefire257;
+public class MyModule2Class {
+  public int getFoo() {
+    return 42;
+  }
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/main/java/surefire257/MyModule2Class.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/test/java/surefire257/MyModule2ClassTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/test/java/surefire257/MyModule2ClassTest.java?rev=1062201&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/test/java/surefire257/MyModule2ClassTest.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/test/java/surefire257/MyModule2ClassTest.java
Sat Jan 22 17:02:29 2011
@@ -0,0 +1,13 @@
+package surefire257;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+import surefire257.MyModule2Class;
+
+public class MyModule2ClassTest extends TestCase {
+
+  public void testGetFooOK() {
+    MyModule2Class mc = new MyModule2Class();
+    Assert.assertEquals(42, mc.getFoo());
+  }
+}

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/module2/src/test/java/surefire257/MyModule2ClassTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/pom.xml?rev=1062201&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/pom.xml
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/pom.xml
Sat Jan 22 17:02:29 2011
@@ -0,0 +1,93 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.surefire-257-rerunningTests</groupId>
+  <artifactId>surefire-257-rerunningTests</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>${surefire.version}</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+
+  <profiles>
+    <profile>
+      <id>maven-3</id>
+      <activation>
+        <file>
+          <!--  This employs that the basedir expression is only recognized by Maven 3.x
(see MNG-2363) -->
+          <exists>${basedir}</exists>
+        </file>
+      </activation>
+      <build>
+        <pluginManagement>
+          <plugins>
+            <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-surefire-report-plugin</artifactId>
+              <version>${surefire.version}</version>
+              <inherited>true</inherited>
+            </plugin>
+            <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-surefire-plugin</artifactId>
+              <version>${surefire.version}</version>
+            </plugin>
+            <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-site-plugin</artifactId>
+              <version>3.0-beta-3</version>
+            </plugin>
+          </plugins>
+        </pluginManagement>
+        <plugins>
+          <plugin>
+            <artifactId>maven-site-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>attach-descriptor</id>
+                <goals>
+                  <goal>attach-descriptor</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-report-plugin</artifactId>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-site-plugin</artifactId>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-report-plugin</artifactId>
+        <version>${surefire.version}</version>
+        <inherited>true</inherited>
+      </plugin>
+    </plugins>
+  </reporting>
+
+  <modules>
+    <module>module1</module>
+    <module>module2</module>
+  </modules>
+</project>

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-257-rerunningTests/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message