maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From steph...@apache.org
Subject svn commit: r945127 [1/2] - in /maven/surefire/trunk: ./ maven-failsafe-plugin/ maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/ maven-surefire-common/ maven-surefire-common/src/ maven-surefire-common/src/main/ maven-surefire-commo...
Date Mon, 17 May 2010 13:02:39 GMT
Author: stephenc
Date: Mon May 17 13:02:39 2010
New Revision: 945127

URL: http://svn.apache.org/viewvc?rev=945127&view=rev
Log:
[SUREFIRE-592] Partial refactoring

o Need to refactor further to remove isolate the extra dummy accessors in each of the three mojos

Added:
    maven/surefire/trunk/maven-surefire-common/   (with props)
    maven/surefire/trunk/maven-surefire-common/pom.xml
      - copied, changed from r945008, maven/surefire/trunk/maven-failsafe-plugin/pom.xml
    maven/surefire/trunk/maven-surefire-common/src/
    maven/surefire/trunk/maven-surefire-common/src/main/
    maven/surefire/trunk/maven-surefire-common/src/main/java/
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java   (with props)
Modified:
    maven/surefire/trunk/maven-failsafe-plugin/pom.xml
    maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
    maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java
    maven/surefire/trunk/maven-surefire-plugin/pom.xml
    maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
    maven/surefire/trunk/pom.xml

Modified: maven/surefire/trunk/maven-failsafe-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-failsafe-plugin/pom.xml?rev=945127&r1=945126&r2=945127&view=diff
==============================================================================
--- maven/surefire/trunk/maven-failsafe-plugin/pom.xml (original)
+++ maven/surefire/trunk/maven-failsafe-plugin/pom.xml Mon May 17 13:02:39 2010
@@ -107,6 +107,10 @@
       <artifactId>surefire-booter</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.maven.surefire</groupId>
+      <artifactId>maven-surefire-common</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
     </dependency>

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=945127&r1=945126&r2=945127&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 Mon May 17 13:02:39 2010
@@ -50,9 +50,9 @@ import org.apache.maven.artifact.version
 import org.apache.maven.artifact.versioning.OverConstrainedVersionException;
 import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.execution.MavenSession;
-import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.surefire.AbstractSurefireMojo;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.surefire.booter.ForkConfiguration;
 import org.apache.maven.surefire.booter.SurefireBooter;
@@ -83,7 +83,7 @@ import org.codehaus.plexus.util.StringUt
  * @phase integration-test
  */
 public class IntegrationTestMojo
-    extends AbstractMojo
+    extends AbstractSurefireMojo
 {
 
     /**
@@ -152,7 +152,7 @@ public class IntegrationTestMojo
      * @parameter default-value="${project}"
      * @readonly
      */
-    protected MavenProject project;
+    private MavenProject project;
 
     /**
      * the classpath elements to be excluded from classpath
@@ -593,7 +593,7 @@ public class IntegrationTestMojo
      *
      * @parameter expression="${encoding}" default-value="${project.reporting.outputEncoding}"
      */
-    protected String encoding;
+    private String encoding;
 
     /**
      * @component
@@ -608,7 +608,8 @@ public class IntegrationTestMojo
         {
             SurefireBooter surefireBooter = constructSurefireBooter();
 
-            getLog().info( "Failsafe report directory: " + reportsDirectory );
+            getLog().info(
+                StringUtils.capitalizeFirstLetter( getPluginName() ) + " report directory: " + getReportsDirectory() );
 
             FailsafeSummary result = new FailsafeSummary();
             try
@@ -632,21 +633,21 @@ public class IntegrationTestMojo
                 result.setException( e.getMessage() );
             }
 
-            if ( originalSystemProperties != null && !surefireBooter.isForking() )
+            if ( getOriginalSystemProperties() != null && !surefireBooter.isForking() )
             {
                 // restore system properties, only makes sense when not forking..
-                System.setProperties( originalSystemProperties );
+                System.setProperties( getOriginalSystemProperties() );
             }
 
-            if ( !summaryFile.getParentFile().isDirectory() )
+            if ( !getSummaryFile().getParentFile().isDirectory() )
             {
-                summaryFile.getParentFile().mkdirs();
+                getSummaryFile().getParentFile().mkdirs();
             }
 
             try
             {
                 String encoding;
-                if ( StringUtils.isEmpty( this.encoding ) )
+                if ( StringUtils.isEmpty( this.getEncoding() ) )
                 {
                     getLog().warn(
                         "File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING
@@ -655,10 +656,10 @@ public class IntegrationTestMojo
                 }
                 else
                 {
-                    encoding = this.encoding;
+                    encoding = this.getEncoding();
                 }
 
-                FileOutputStream fileOutputStream = new FileOutputStream( summaryFile );
+                FileOutputStream fileOutputStream = new FileOutputStream( getSummaryFile() );
                 BufferedOutputStream bufferedOutputStream = new BufferedOutputStream( fileOutputStream );
                 Writer writer = new OutputStreamWriter( bufferedOutputStream, encoding );
                 FailsafeSummaryXpp3Writer xpp3Writer = new FailsafeSummaryXpp3Writer();
@@ -674,717 +675,621 @@ public class IntegrationTestMojo
         }
     }
 
-    private boolean verifyParameters()
-        throws MojoFailureException
+    protected boolean isTestsSkipped()
     {
-        if ( skip || skipTests || skipITs || skipExec )
-        {
-            getLog().info( "Tests are skipped." );
-            return false;
-        }
+        return isSkip() || isSkipTests() || isSkipITs() || isSkipExec();
+    }
 
-        if ( !testClassesDirectory.exists() )
-        {
-            if ( failIfNoTests != null && failIfNoTests.booleanValue() )
-            {
-                throw new MojoFailureException( "No tests to run!" );
-            }
-            getLog().info( "No tests to run." );
-            return false;
-        }
+    protected String getPluginName()
+    {
+        return "failsafe";
+    }
 
-        if ( !workingDirectory.exists() )
-        {
-            if ( !workingDirectory.mkdirs() )
-            {
-                throw new MojoFailureException( "Cannot create workingDirectory " + workingDirectory );
-            }
-        }
+    protected String[] getDefaultIncludes()
+    {
+        return new String[]{"**/IT*.java", "**/*IT.java", "**/*ITCase.java"} ;
+    }
 
-        if ( !workingDirectory.isDirectory() )
-        {
-            throw new MojoFailureException( "workingDirectory " + workingDirectory + " exists and is not a directory" );
-        }
+    public boolean isSkipTests()
+    {
+        return skipTests;
+    }
 
-        if ( useSystemClassLoader != null && ForkConfiguration.FORK_NEVER.equals( forkMode ) )
-        {
-            getLog().warn( "useSystemClassloader setting has no effect when not forking" );
-        }
+    public void setSkipTests( boolean skipTests )
+    {
+        this.skipTests = skipTests;
+    }
 
-        return true;
+    public boolean isSkipITs()
+    {
+        return skipITs;
     }
 
-    /**
-     * Converts old TestNG configuration parameters over to new properties based configuration
-     * method. (if any are defined the old way)
-     */
-    private void convertTestNGParameters()
+    public void setSkipITs( boolean skipITs )
     {
-        if ( properties == null )
-        {
-            properties = new Properties();
-        }
+        this.skipITs = skipITs;
+    }
 
-        if ( this.parallel != null )
-        {
-            properties.setProperty( "parallel", this.parallel );
-        }
-        if ( this.excludedGroups != null )
-        {
-            properties.setProperty( "excludegroups", this.excludedGroups );
-        }
-        if ( this.groups != null )
-        {
-            properties.setProperty( "groups", this.groups );
-        }
+    public boolean isSkipExec()
+    {
+        return skipExec;
+    }
 
-        if ( this.threadCount > 0 )
-        {
-            properties.setProperty( "threadcount", new Integer( this.threadCount ).toString() );
-        }
-        if ( this.objectFactory != null )
-        {
-            properties.setProperty( "objectfactory", this.objectFactory );
-        }
+    public void setSkipExec( boolean skipExec )
+    {
+        this.skipExec = skipExec;
     }
 
-    private boolean isAnyConcurrencySelected()
+    public boolean isSkip()
     {
-        return this.parallel != null && this.parallel.trim().length() > 0;
+        return skip;
     }
 
-    /**
-     * Converts old TestNG configuration parameters over to new properties based configuration
-     * method. (if any are defined the old way)
-     */
-    private void convertJunitCoreParameters()
+    public void setSkip( boolean skip )
     {
-        if ( properties == null )
-        {
-            properties = new Properties();
-        }
+        this.skip = skip;
+    }
 
-        if ( this.parallel != null )
-        {
-            properties.setProperty( "parallel", this.parallel );
-        }
-        if ( this.threadCount > 0 )
-        {
-            properties.setProperty( "threadCount", new Integer( this.threadCount ).toString() );
-        }
-        if ( this.perCoreThreadCount != null )
-        {
-            properties.setProperty( "perCoreThreadCount", perCoreThreadCount );
-        }
-        if ( this.useUnlimitedThreads != null )
-        {
-            properties.setProperty( "useUnlimitedThreads", useUnlimitedThreads );
-        }
-        Artifact configurableParallelComputer =
-            (Artifact) projectArtifactMap.get( "org.jdogma.junit:configurable-parallel-computer" );
-        properties.setProperty( "configurableParallelComputerPresent",
-                                Boolean.toString( configurableParallelComputer != null ) );
+    public File getBasedir()
+    {
+        return basedir;
+    }
 
+    public void setBasedir( File basedir )
+    {
+        this.basedir = basedir;
     }
 
-    private boolean isJunit47Compatible( Artifact artifact )
-        throws MojoExecutionException
+    public File getTestClassesDirectory()
     {
-        return isWithinVersionSpec( artifact, "[4.7,)" );
+        return testClassesDirectory;
     }
 
-    private boolean isAnyJunit4( Artifact artifact )
-        throws MojoExecutionException
+    public void setTestClassesDirectory( File testClassesDirectory )
     {
-        return isWithinVersionSpec( artifact, "[4.0,)" );
+        this.testClassesDirectory = testClassesDirectory;
     }
 
-    private boolean isWithinVersionSpec( Artifact artifact, String versionSpec )
-        throws MojoExecutionException
+    public File getClassesDirectory()
     {
-        if ( artifact == null )
-        {
-            return false;
-        }
-        try
-        {
-            VersionRange range = VersionRange.createFromVersionSpec( versionSpec );
-            try
-            {
-                return range.containsVersion( artifact.getSelectedVersion() );
-            }
-            catch ( NullPointerException e )
-            {
-                return range.containsVersion( new DefaultArtifactVersion( artifact.getBaseVersion() ) );
-            }
-        }
-        catch ( InvalidVersionSpecificationException e )
-        {
-            throw new MojoExecutionException( "Bug in junit 4.7 plugin. Please report with stacktrace" );
-        }
-        catch ( OverConstrainedVersionException e )
-        {
-            throw new MojoExecutionException( "Bug in junit 4.7 plugin. Please report with stacktrace" );
-        }
+        return classesDirectory;
     }
 
+    public void setClassesDirectory( File classesDirectory )
+    {
+        this.classesDirectory = classesDirectory;
+    }
 
-    private SurefireBooter constructSurefireBooter()
-        throws MojoExecutionException, MojoFailureException
+    public MavenProject getProject()
     {
-        SurefireBooter surefireBooter = new SurefireBooter();
+        return project;
+    }
 
-        Artifact surefireArtifact = (Artifact) pluginArtifactMap.get( "org.apache.maven.surefire:surefire-booter" );
-        if ( surefireArtifact == null )
-        {
-            throw new MojoExecutionException( "Unable to locate surefire-booter in the list of plugin artifacts" );
-        }
+    public void setProject( MavenProject project )
+    {
+        this.project = project;
+    }
 
-        surefireArtifact.isSnapshot(); // MNG-2961: before Maven 2.0.8, fixes getBaseVersion to be -SNAPSHOT if needed
+    public String getIgnoreClasspathElements()
+    {
+        return ignoreClasspathElements;
+    }
 
-        Artifact junitArtifact;
-        Artifact testNgArtifact;
-        try
-        {
-            addArtifact( surefireBooter, surefireArtifact );
+    public void setIgnoreClasspathElements( String ignoreClasspathElements )
+    {
+        this.ignoreClasspathElements = ignoreClasspathElements;
+    }
 
-            junitArtifact = (Artifact) projectArtifactMap.get( junitArtifactName );
-            // SUREFIRE-378, junit can have an alternate artifact name
-            if ( junitArtifact == null && "junit:junit".equals( junitArtifactName ) )
-            {
-                junitArtifact = (Artifact) projectArtifactMap.get( "junit:junit-dep" );
-            }
+    public List getAdditionalClasspathElements()
+    {
+        return additionalClasspathElements;
+    }
 
-            // TODO: this is pretty manual, but I'd rather not require the plugin > dependencies section right now
-            testNgArtifact = (Artifact) projectArtifactMap.get( testNGArtifactName );
+    public void setAdditionalClasspathElements( List additionalClasspathElements )
+    {
+        this.additionalClasspathElements = additionalClasspathElements;
+    }
 
-            if ( testNgArtifact != null )
-            {
-                VersionRange range = VersionRange.createFromVersionSpec( "[4.7,)" );
-                if ( !range.containsVersion( new DefaultArtifactVersion( testNgArtifact.getVersion() ) ) )
-                {
-                    throw new MojoFailureException(
-                        "TestNG support requires version 4.7 or above. You have declared version "
-                            + testNgArtifact.getVersion() );
-                }
+    public File getReportsDirectory()
+    {
+        return reportsDirectory;
+    }
 
-                convertTestNGParameters();
+    public void setReportsDirectory( File reportsDirectory )
+    {
+        this.reportsDirectory = reportsDirectory;
+    }
 
-                if ( this.testClassesDirectory != null )
-                {
-                    properties.setProperty( "testng.test.classpath", testClassesDirectory.getAbsolutePath() );
-                }
+    public File getTestSourceDirectory()
+    {
+        return testSourceDirectory;
+    }
 
-                addArtifact( surefireBooter, testNgArtifact );
+    public void setTestSourceDirectory( File testSourceDirectory )
+    {
+        this.testSourceDirectory = testSourceDirectory;
+    }
 
-                // The plugin uses a JDK based profile to select the right testng. We might be explicity using a
-                // different one since its based on the source level, not the JVM. Prune using the filter.
-                addProvider( surefireBooter, "surefire-testng", surefireArtifact.getBaseVersion(), testNgArtifact );
-            }
-            else if ( junitArtifact != null && isAnyJunit4( junitArtifact ) )
-            {
-                if ( isAnyConcurrencySelected() && isJunit47Compatible( junitArtifact ) )
-                {
-                    convertJunitCoreParameters();
-                    addProvider( surefireBooter, "surefire-junit47", surefireArtifact.getBaseVersion(), null );
-                }
-                else
-                {
-                    addProvider( surefireBooter, "surefire-junit4", surefireArtifact.getBaseVersion(), null );
-                }
-            }
-            else
-            {
-                // add the JUnit provider as default - it doesn't require JUnit to be present,
-                // since it supports POJO tests.
-                addProvider( surefireBooter, "surefire-junit", surefireArtifact.getBaseVersion(), null );
-            }
-        }
-        catch ( ArtifactNotFoundException e )
-        {
-            throw new MojoExecutionException(
-                "Unable to locate required surefire provider dependency: " + e.getMessage(), e );
-        }
-        catch ( InvalidVersionSpecificationException e )
-        {
-            throw new MojoExecutionException( "Error determining the TestNG version requested: " + e.getMessage(), e );
-        }
-        catch ( ArtifactResolutionException e )
-        {
-            throw new MojoExecutionException( "Error to resolving surefire provider dependency: " + e.getMessage(), e );
-        }
+    public String getTest()
+    {
+        return test;
+    }
 
-        if ( suiteXmlFiles != null && suiteXmlFiles.length > 0 && test == null )
-        {
-            if ( testNgArtifact == null )
-            {
-                throw new MojoExecutionException( "suiteXmlFiles is configured, but there is no TestNG dependency" );
-            }
+    public void setTest( String test )
+    {
+        this.test = test;
+    }
 
-            // TODO: properties should be passed in here too
-            surefireBooter.addTestSuite( "org.apache.maven.surefire.testng.TestNGXmlTestSuite",
-                                         new Object[]{suiteXmlFiles, testSourceDirectory.getAbsolutePath(),
-                                             testNgArtifact.getVersion(), testNgArtifact.getClassifier(), properties,
-                                             reportsDirectory} );
-        }
-        else
-        {
-            List includes;
-            List excludes;
+    public List getIncludes()
+    {
+        return includes;
+    }
 
-            if ( test != null )
-            {
-                // Check to see if we are running a single test. The raw parameter will
-                // come through if it has not been set.
+    public void setIncludes( List includes )
+    {
+        this.includes = includes;
+    }
 
-                // FooTest -> **/FooTest.java
+    public List getExcludes()
+    {
+        return excludes;
+    }
 
-                includes = new ArrayList();
+    public void setExcludes( List excludes )
+    {
+        this.excludes = excludes;
+    }
 
-                excludes = new ArrayList();
+    public ArtifactRepository getLocalRepository()
+    {
+        return localRepository;
+    }
 
-                if ( failIfNoTests == null )
-                {
-                    failIfNoTests = Boolean.TRUE;
-                }
+    public void setLocalRepository( ArtifactRepository localRepository )
+    {
+        this.localRepository = localRepository;
+    }
 
-                String[] testRegexes = StringUtils.split( test, "," );
+    public Properties getSystemProperties()
+    {
+        return systemProperties;
+    }
 
-                for ( int i = 0; i < testRegexes.length; i++ )
-                {
-                    String testRegex = testRegexes[i];
-                    if ( testRegex.endsWith( ".java" ) )
-                    {
-                        testRegex = testRegex.substring( 0, testRegex.length() - 5 );
-                    }
-                    // Allow paths delimited by '.' or '/'
-                    testRegex = testRegex.replace( '.', '/' );
-                    includes.add( "**/" + testRegex + ".java" );
-                }
-            }
-            else
-            {
-                includes = this.includes;
+    public void setSystemProperties( Properties systemProperties )
+    {
+        this.systemProperties = systemProperties;
+    }
 
-                excludes = this.excludes;
+    public Map getSystemPropertyVariables()
+    {
+        return systemPropertyVariables;
+    }
 
-                // defaults here, qdox doesn't like the end javadoc value
-                // Have to wrap in an ArrayList as surefire expects an ArrayList instead of a List for some reason
-                if ( includes == null || includes.size() == 0 )
-                {
-                    includes = new ArrayList(
-                        Arrays.asList( new String[]{"**/IT*.java", "**/*IT.java", "**/*ITCase.java"} ) );
-                }
-                if ( excludes == null || excludes.size() == 0 )
-                {
-                    excludes = new ArrayList( Arrays.asList( new String[]{"**/*$*"} ) );
-                }
-            }
+    public void setSystemPropertyVariables( Map systemPropertyVariables )
+    {
+        this.systemPropertyVariables = systemPropertyVariables;
+    }
 
-            if ( testNgArtifact != null )
-            {
-                surefireBooter.addTestSuite( "org.apache.maven.surefire.testng.TestNGDirectoryTestSuite",
-                                             new Object[]{testClassesDirectory, includes, excludes,
-                                                 testSourceDirectory.getAbsolutePath(), testNgArtifact.getVersion(),
-                                                 testNgArtifact.getClassifier(), properties, reportsDirectory} );
-            }
-            else
-            {
-                String junitDirectoryTestSuite;
-                if ( isAnyConcurrencySelected() && isJunit47Compatible( junitArtifact ) )
-                {
-                    junitDirectoryTestSuite = "org.apache.maven.surefire.junitcore.JUnitCoreDirectoryTestSuite";
-                    getLog().info( "Concurrency config is " + properties.toString() );
-                    surefireBooter.addTestSuite( junitDirectoryTestSuite,
-                                                 new Object[]{testClassesDirectory, includes, excludes, properties} );
-                }
-                else
-                {
-                    if ( isAnyJunit4( junitArtifact ) )
-                    {
-                        junitDirectoryTestSuite = "org.apache.maven.surefire.junit4.JUnit4DirectoryTestSuite";
-                    }
-                    else
-                    {
-                        // fall back to JUnit, which also contains POJO support. Also it can run
-                        // classes compiled against JUnit since it has a dependency on JUnit itself.
-                        junitDirectoryTestSuite = "org.apache.maven.surefire.junit.JUnitDirectoryTestSuite";
-                    }
-                    surefireBooter.addTestSuite( junitDirectoryTestSuite,
-                                                 new Object[]{testClassesDirectory, includes, excludes} );
-                }
-            }
-        }
+    public Properties getProperties()
+    {
+        return properties;
+    }
 
-        List classpathElements = null;
-        try
-        {
-            classpathElements = generateTestClasspath();
-        }
-        catch ( DependencyResolutionRequiredException e )
-        {
-            throw new MojoExecutionException( "Unable to generate test classpath: " + e, e );
-        }
+    public void setProperties( Properties properties )
+    {
+        this.properties = properties;
+    }
 
-        getLog().debug( "Test Classpath :" );
+    public Map getPluginArtifactMap()
+    {
+        return pluginArtifactMap;
+    }
 
-        for ( Iterator i = classpathElements.iterator(); i.hasNext(); )
-        {
-            String classpathElement = (String) i.next();
+    public void setPluginArtifactMap( Map pluginArtifactMap )
+    {
+        this.pluginArtifactMap = pluginArtifactMap;
+    }
 
-            getLog().debug( "  " + classpathElement );
+    public Map getProjectArtifactMap()
+    {
+        return projectArtifactMap;
+    }
 
-            surefireBooter.addClassPathUrl( classpathElement );
-        }
+    public void setProjectArtifactMap( Map projectArtifactMap )
+    {
+        this.projectArtifactMap = projectArtifactMap;
+    }
 
-        Toolchain tc = getToolchain();
+    public File getSummaryFile()
+    {
+        return summaryFile;
+    }
 
-        if ( tc != null )
-        {
-            getLog().info( "Toolchain in failsafe-plugin: " + tc );
-            if ( ForkConfiguration.FORK_NEVER.equals( forkMode ) )
-            {
-                forkMode = ForkConfiguration.FORK_ONCE;
-            }
-            if ( jvm != null )
-            {
-                getLog().warn( "Toolchains are ignored, 'executable' parameter is set to " + jvm );
-            }
-            else
-            {
-                jvm = tc.findTool( "java" ); //NOI18N
-            }
-        }
+    public void setSummaryFile( File summaryFile )
+    {
+        this.summaryFile = summaryFile;
+    }
 
-        // ----------------------------------------------------------------------
-        // Forking
-        // ----------------------------------------------------------------------
+    public boolean isPrintSummary()
+    {
+        return printSummary;
+    }
 
-        ForkConfiguration fork = new ForkConfiguration();
+    public void setPrintSummary( boolean printSummary )
+    {
+        this.printSummary = printSummary;
+    }
 
-        fork.setForkMode( forkMode );
+    public String getReportFormat()
+    {
+        return reportFormat;
+    }
 
-        processSystemProperties( !fork.isForking() );
+    public void setReportFormat( String reportFormat )
+    {
+        this.reportFormat = reportFormat;
+    }
 
-        if ( getLog().isDebugEnabled() )
-        {
-            showMap( internalSystemProperties, "system property" );
-        }
+    public boolean isUseFile()
+    {
+        return useFile;
+    }
 
-        if ( fork.isForking() )
-        {
-            useSystemClassLoader = useSystemClassLoader == null ? Boolean.TRUE : useSystemClassLoader;
-            fork.setUseSystemClassLoader( useSystemClassLoader.booleanValue() );
-            fork.setUseManifestOnlyJar( useManifestOnlyJar );
+    public void setUseFile( boolean useFile )
+    {
+        this.useFile = useFile;
+    }
 
-            fork.setSystemProperties( internalSystemProperties );
+    public boolean isRedirectTestOutputToFile()
+    {
+        return redirectTestOutputToFile;
+    }
 
-            if ( "true".equals( debugForkedProcess ) )
-            {
-                debugForkedProcess =
-                    "-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005";
-            }
+    public void setRedirectTestOutputToFile( boolean redirectTestOutputToFile )
+    {
+        this.redirectTestOutputToFile = redirectTestOutputToFile;
+    }
 
-            fork.setDebugLine( debugForkedProcess );
+    public Boolean getFailIfNoTests()
+    {
+        return failIfNoTests;
+    }
 
-            if ( jvm == null || "".equals( jvm ) )
-            {
-                // use the same JVM as the one used to run Maven (the "java.home" one)
-                jvm = System.getProperty( "java.home" ) + File.separator + "bin" + File.separator + "java";
-                getLog().debug( "Using JVM: " + jvm );
-            }
+    public void setFailIfNoTests( Boolean failIfNoTests )
+    {
+        this.failIfNoTests = failIfNoTests;
+    }
 
-            fork.setJvmExecutable( jvm );
+    public String getForkMode()
+    {
+        return forkMode;
+    }
 
-            if ( workingDirectory != null )
-            {
-                fork.setWorkingDirectory( workingDirectory );
-            }
-            else
-            {
-                fork.setWorkingDirectory( basedir );
-            }
+    public void setForkMode( String forkMode )
+    {
+        this.forkMode = forkMode;
+    }
 
-            fork.setArgLine( argLine );
+    public String getJvm()
+    {
+        return jvm;
+    }
 
-            fork.setEnvironmentVariables( environmentVariables );
+    public void setJvm( String jvm )
+    {
+        this.jvm = jvm;
+    }
 
-            if ( getLog().isDebugEnabled() )
-            {
-                showMap( environmentVariables, "environment variable" );
+    public String getArgLine()
+    {
+        return argLine;
+    }
 
-                fork.setDebug( true );
-            }
+    public void setArgLine( String argLine )
+    {
+        this.argLine = argLine;
+    }
 
-            if ( argLine != null )
-            {
-                List args = Arrays.asList( argLine.split( " " ) );
-                if ( args.contains( "-da" ) || args.contains( "-disableassertions" ) )
-                {
-                    enableAssertions = false;
-                }
-            }
-        }
+    public String getDebugForkedProcess()
+    {
+        return debugForkedProcess;
+    }
 
-        surefireBooter.setFailIfNoTests( failIfNoTests == null ? false : failIfNoTests.booleanValue() );
+    public void setDebugForkedProcess( String debugForkedProcess )
+    {
+        this.debugForkedProcess = debugForkedProcess;
+    }
 
-        surefireBooter.setForkedProcessTimeoutInSeconds( forkedProcessTimeoutInSeconds );
+    public int getForkedProcessTimeoutInSeconds()
+    {
+        return forkedProcessTimeoutInSeconds;
+    }
 
-        surefireBooter.setRedirectTestOutputToFile( redirectTestOutputToFile );
+    public void setForkedProcessTimeoutInSeconds( int forkedProcessTimeoutInSeconds )
+    {
+        this.forkedProcessTimeoutInSeconds = forkedProcessTimeoutInSeconds;
+    }
 
-        surefireBooter.setForkConfiguration( fork );
+    public Map getEnvironmentVariables()
+    {
+        return environmentVariables;
+    }
 
-        surefireBooter.setChildDelegation( childDelegation );
+    public void setEnvironmentVariables( Map environmentVariables )
+    {
+        this.environmentVariables = environmentVariables;
+    }
 
-        surefireBooter.setEnableAssertions( enableAssertions );
+    public File getWorkingDirectory()
+    {
+        return workingDirectory;
+    }
 
-        surefireBooter.setReportsDirectory( reportsDirectory );
+    public void setWorkingDirectory( File workingDirectory )
+    {
+        this.workingDirectory = workingDirectory;
+    }
 
-        addReporters( surefireBooter, fork.isForking() );
+    public boolean isChildDelegation()
+    {
+        return childDelegation;
+    }
 
-        return surefireBooter;
+    public void setChildDelegation( boolean childDelegation )
+    {
+        this.childDelegation = childDelegation;
     }
 
-    /**
-     * Generate the test classpath.
-     *
-     * @return List containing the classpath elements
-     * @throws DependencyResolutionRequiredException
-     */
-    public List generateTestClasspath()
-        throws DependencyResolutionRequiredException, MojoExecutionException
+    public String getGroups()
     {
-        List classpath = new ArrayList( 2 + project.getArtifacts().size() );
+        return groups;
+    }
 
-        classpath.add( testClassesDirectory.getAbsolutePath() );
+    public void setGroups( String groups )
+    {
+        this.groups = groups;
+    }
 
-        classpath.add( classesDirectory.getAbsolutePath() );
+    public String getExcludedGroups()
+    {
+        return excludedGroups;
+    }
 
-        for ( Iterator iter = project.getArtifacts().iterator(); iter.hasNext(); )
-        {
-            Artifact artifact = (Artifact) iter.next();
-            if ( artifact.getArtifactHandler().isAddedToClasspath() )
-            {
-                File file = artifact.getFile();
-                if ( file != null )
-                {
-                    classpath.add( file.getPath() );
-                }
-            }
-        }
+    public void setExcludedGroups( String excludedGroups )
+    {
+        this.excludedGroups = excludedGroups;
+    }
 
-        // Remove elements from the classpath according to configuration
-        if ( ignoreClasspathElements.equals( "all" ) )
-        {
-            classpath.clear();
-        }
-        else if ( ignoreClasspathElements.equals( "runtime" ) )
-        {
-            classpath.removeAll( project.getRuntimeClasspathElements() );
-        }
-        else if ( !ignoreClasspathElements.equals( "none" ) )
-        {
-            throw new MojoExecutionException( "Unsupported value for ignoreClasspathElements parameter: " +
-                ignoreClasspathElements );
-        }
+    public File[] getSuiteXmlFiles()
+    {
+        return suiteXmlFiles;
+    }
 
-        // Add additional configured elements to the classpath
-        if ( additionalClasspathElements != null )
-        {
-            for ( Iterator iter = additionalClasspathElements.iterator(); iter.hasNext(); )
-            {
-                String classpathElement = (String) iter.next();
-                classpath.add( classpathElement );
-            }
-        }
+    public void setSuiteXmlFiles( File[] suiteXmlFiles )
+    {
+        this.suiteXmlFiles = suiteXmlFiles;
+    }
 
-        return classpath;
+    public String getJunitArtifactName()
+    {
+        return junitArtifactName;
     }
 
-    private void showMap( Map map, String setting )
+    public void setJunitArtifactName( String junitArtifactName )
     {
-        for ( Iterator i = map.keySet().iterator(); i.hasNext(); )
-        {
-            String key = (String) i.next();
-            String value = (String) map.get( key );
-            getLog().debug( "Setting " + setting + " [" + key + "]=[" + value + "]" );
-        }
+        this.junitArtifactName = junitArtifactName;
     }
 
-    private void addProvider( SurefireBooter surefireBooter, String provider, String version,
-                              Artifact filteredArtifact )
-        throws ArtifactNotFoundException, ArtifactResolutionException
-    {
-        Artifact providerArtifact = artifactFactory.createDependencyArtifact( "org.apache.maven.surefire", provider,
-                                                                              VersionRange.createFromVersion( version ),
-                                                                              "jar", null, Artifact.SCOPE_TEST );
-        ArtifactResolutionResult result = resolveArtifact( filteredArtifact, providerArtifact );
+    public String getTestNGArtifactName()
+    {
+        return testNGArtifactName;
+    }
 
-        for ( Iterator i = result.getArtifacts().iterator(); i.hasNext(); )
-        {
-            Artifact artifact = (Artifact) i.next();
+    public void setTestNGArtifactName( String testNGArtifactName )
+    {
+        this.testNGArtifactName = testNGArtifactName;
+    }
 
-            getLog().debug( "Adding to failsafe test classpath: " + artifact.getFile().getAbsolutePath() + " Scope: " + artifact.getScope() );
+    public int getThreadCount()
+    {
+        return threadCount;
+    }
 
-            surefireBooter.addSurefireClassPathUrl( artifact.getFile().getAbsolutePath() );
-        }
+    public void setThreadCount( int threadCount )
+    {
+        this.threadCount = threadCount;
     }
 
-    private ArtifactResolutionResult resolveArtifact( Artifact filteredArtifact, Artifact providerArtifact )
-        throws ArtifactResolutionException, ArtifactNotFoundException
+    public String getPerCoreThreadCount()
     {
-        ArtifactFilter filter = null;
-        if ( filteredArtifact != null )
-        {
-            filter = new ExcludesArtifactFilter(
-                Collections.singletonList( filteredArtifact.getGroupId() + ":" + filteredArtifact.getArtifactId() ) );
-        }
+        return perCoreThreadCount;
+    }
 
-        Artifact originatingArtifact = artifactFactory.createBuildArtifact( "dummy", "dummy", "1.0", "jar" );
+    public void setPerCoreThreadCount( String perCoreThreadCount )
+    {
+        this.perCoreThreadCount = perCoreThreadCount;
+    }
 
-        return artifactResolver.resolveTransitively( Collections.singleton( providerArtifact ), originatingArtifact,
-                                                     localRepository, remoteRepositories, metadataSource, filter );
+    public String getUseUnlimitedThreads()
+    {
+        return useUnlimitedThreads;
     }
 
-    private void addArtifact( SurefireBooter surefireBooter, Artifact surefireArtifact )
-        throws ArtifactNotFoundException, ArtifactResolutionException
+    public void setUseUnlimitedThreads( String useUnlimitedThreads )
     {
-        ArtifactResolutionResult result = resolveArtifact( null, surefireArtifact );
+        this.useUnlimitedThreads = useUnlimitedThreads;
+    }
 
-        for ( Iterator i = result.getArtifacts().iterator(); i.hasNext(); )
-        {
-            Artifact artifact = (Artifact) i.next();
+    public String getParallel()
+    {
+        return parallel;
+    }
 
-            getLog().debug( "Adding to failsafe booter test classpath: " + artifact.getFile().getAbsolutePath() + " Scope: " + artifact.getScope() );
+    public void setParallel( String parallel )
+    {
+        this.parallel = parallel;
+    }
 
-            surefireBooter.addSurefireBootClassPathUrl( artifact.getFile().getAbsolutePath() );
-        }
+    public boolean isTrimStackTrace()
+    {
+        return trimStackTrace;
     }
 
-    protected void processSystemProperties( boolean setInSystem )
+    public void setTrimStackTrace( boolean trimStackTrace )
     {
-        if ( this.systemProperties != null )
-        {
-            for ( Iterator i = systemProperties.keySet().iterator(); i.hasNext(); )
-            {
-                String key = (String) i.next();
-                String value = (String) systemProperties.get( key );
-                internalSystemProperties.setProperty( key, value );
-            }
-        }
+        this.trimStackTrace = trimStackTrace;
+    }
 
-        if ( this.systemPropertyVariables != null )
-        {
-            for ( Iterator i = systemPropertyVariables.keySet().iterator(); i.hasNext(); )
-            {
-                String key = (String) i.next();
-                String value = (String) systemPropertyVariables.get( key );
-                //java Properties does not accept null value
-                if ( value != null )
-                {
-                    internalSystemProperties.setProperty( key, value );
-                }
-            }
-        }
+    public ArtifactResolver getArtifactResolver()
+    {
+        return artifactResolver;
+    }
 
-        originalSystemProperties = (Properties) System.getProperties().clone();
+    public void setArtifactResolver( ArtifactResolver artifactResolver )
+    {
+        this.artifactResolver = artifactResolver;
+    }
 
-        // We used to take all of our system properties and dump them in with the
-        // user specified properties for SUREFIRE-121, causing SUREFIRE-491.
-        // Not gonna do THAT any more... but I'm leaving this code here in case
-        // we need it later when we try to fix SUREFIRE-121 again.
+    public ArtifactFactory getArtifactFactory()
+    {
+        return artifactFactory;
+    }
 
-        // Get the properties from the MavenSession instance to make embedded use work correctly
-        Properties userSpecifiedProperties = (Properties) session.getExecutionProperties().clone();
-        userSpecifiedProperties.putAll( internalSystemProperties );
-        //systemProperties = userSpecifiedProperties;
+    public void setArtifactFactory( ArtifactFactory artifactFactory )
+    {
+        this.artifactFactory = artifactFactory;
+    }
 
-        internalSystemProperties.setProperty( "basedir", basedir.getAbsolutePath() );
-        internalSystemProperties.setProperty( "user.dir", workingDirectory.getAbsolutePath() );
+    public List getRemoteRepositories()
+    {
+        return remoteRepositories;
+    }
 
-        internalSystemProperties.setProperty( "localRepository", localRepository.getBasedir() );
+    public void setRemoteRepositories( List remoteRepositories )
+    {
+        this.remoteRepositories = remoteRepositories;
+    }
 
-        if ( setInSystem )
-        {
-            // Add all system properties configured by the user
-            Iterator iter = internalSystemProperties.keySet().iterator();
+    public ArtifactMetadataSource getMetadataSource()
+    {
+        return metadataSource;
+    }
 
-            while ( iter.hasNext() )
-            {
-                String key = (String) iter.next();
+    public void setMetadataSource( ArtifactMetadataSource metadataSource )
+    {
+        this.metadataSource = metadataSource;
+    }
 
-                String value = internalSystemProperties.getProperty( key );
+    public Properties getOriginalSystemProperties()
+    {
+        return originalSystemProperties;
+    }
 
-                System.setProperty( key, value );
-            }
-        }
+    public void setOriginalSystemProperties( Properties originalSystemProperties )
+    {
+        this.originalSystemProperties = originalSystemProperties;
     }
 
-    /**
-     * <p/>
-     * Adds Reporters that will generate reports with different formatting.
-     * <p/>
-     * The Reporter that will be added will be based on the value of the parameter useFile, reportFormat, and
-     * printSummary.
-     *
-     * @param surefireBooter The surefire booter that will run tests.
-     * @param forking
-     */
-    private void addReporters( SurefireBooter surefireBooter, boolean forking )
+    public Properties getInternalSystemProperties()
     {
-        Boolean trimStackTrace = Boolean.valueOf( this.trimStackTrace );
-        if ( useFile )
-        {
-            if ( printSummary )
-            {
-                if ( forking )
-                {
-                    surefireBooter.addReport( ForkingConsoleReporter.class.getName(), new Object[]{trimStackTrace} );
-                }
-                else
-                {
-                    surefireBooter.addReport( ConsoleReporter.class.getName(), new Object[]{trimStackTrace} );
-                }
-            }
+        return internalSystemProperties;
+    }
 
-            if ( BRIEF_REPORT_FORMAT.equals( reportFormat ) )
-            {
-                surefireBooter.addReport( BriefFileReporter.class.getName(),
-                                          new Object[]{reportsDirectory, trimStackTrace} );
-            }
-            else if ( PLAIN_REPORT_FORMAT.equals( reportFormat ) )
-            {
-                surefireBooter.addReport( FileReporter.class.getName(),
-                                          new Object[]{reportsDirectory, trimStackTrace} );
-            }
-        }
-        else
-        {
-            if ( BRIEF_REPORT_FORMAT.equals( reportFormat ) )
-            {
-                surefireBooter.addReport( BriefConsoleReporter.class.getName(), new Object[]{trimStackTrace} );
-            }
-            else if ( PLAIN_REPORT_FORMAT.equals( reportFormat ) )
-            {
-                surefireBooter.addReport( DetailedConsoleReporter.class.getName(), new Object[]{trimStackTrace} );
-            }
-        }
+    public void setInternalSystemProperties( Properties internalSystemProperties )
+    {
+        this.internalSystemProperties = internalSystemProperties;
+    }
 
-        if ( !disableXmlReport )
-        {
-            surefireBooter.addReport( XMLReporter.class.getName(), new Object[]{reportsDirectory, trimStackTrace} );
-        }
+    public boolean isDisableXmlReport()
+    {
+        return disableXmlReport;
     }
 
-    private Toolchain getToolchain()
+    public void setDisableXmlReport( boolean disableXmlReport )
     {
-        Toolchain tc = null;
+        this.disableXmlReport = disableXmlReport;
+    }
 
-        if ( toolchainManager != null )
-        {
-            tc = toolchainManager.getToolchainFromBuildContext( "jdk", session );
-        }
+    public Boolean getUseSystemClassLoader()
+    {
+        return useSystemClassLoader;
+    }
+
+    public void setUseSystemClassLoader( Boolean useSystemClassLoader )
+    {
+        this.useSystemClassLoader = useSystemClassLoader;
+    }
+
+    public boolean isUseManifestOnlyJar()
+    {
+        return useManifestOnlyJar;
+    }
+
+    public void setUseManifestOnlyJar( boolean useManifestOnlyJar )
+    {
+        this.useManifestOnlyJar = useManifestOnlyJar;
+    }
+
+    public boolean isEnableAssertions()
+    {
+        return enableAssertions;
+    }
 
-        return tc;
+    public void setEnableAssertions( boolean enableAssertions )
+    {
+        this.enableAssertions = enableAssertions;
     }
+
+    public MavenSession getSession()
+    {
+        return session;
+    }
+
+    public void setSession( MavenSession session )
+    {
+        this.session = session;
+    }
+
+    public String getObjectFactory()
+    {
+        return objectFactory;
+    }
+
+    public void setObjectFactory( String objectFactory )
+    {
+        this.objectFactory = objectFactory;
+    }
+
+    public String getEncoding()
+    {
+        return encoding;
+    }
+
+    public void setEncoding( String encoding )
+    {
+        this.encoding = encoding;
+    }
+
+    public ToolchainManager getToolchainManager()
+    {
+        return toolchainManager;
+    }
+
+    public void setToolchainManager( ToolchainManager toolchainManager )
+    {
+        this.toolchainManager = toolchainManager;
+    }
+
+    // the following will be refactored out once the common code is all in one place
+
+    public boolean isTestFailureIgnore()
+    {
+        return true; // ignore
+    }
+
+    public void setTestFailureIgnore( boolean testFailureIgnore )
+    {
+        // ignore
+    }
+
 }

Modified: maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java?rev=945127&r1=945126&r2=945127&view=diff
==============================================================================
--- maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java (original)
+++ maven/surefire/trunk/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/VerifyMojo.java Mon May 17 13:02:39 2010
@@ -25,13 +25,23 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.Reader;
-
-import org.apache.maven.plugin.AbstractMojo;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.surefire.AbstractSurefireMojo;
+import org.apache.maven.project.MavenProject;
 import org.apache.maven.surefire.booter.SurefireBooter;
 import org.apache.maven.surefire.failsafe.model.FailsafeSummary;
 import org.apache.maven.surefire.failsafe.model.io.xpp3.FailsafeSummaryXpp3Reader;
+import org.apache.maven.toolchain.ToolchainManager;
 import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
@@ -46,7 +56,7 @@ import org.codehaus.plexus.util.xml.pull
  * @phase verify
  */
 public class VerifyMojo
-    extends AbstractMojo
+    extends AbstractSurefireMojo
 {
 
     /**
@@ -137,7 +147,7 @@ public class VerifyMojo
      *
      * @parameter expression="${encoding}" default-value="${project.reporting.outputEncoding}"
      */
-    protected String encoding;
+    private String encoding;
 
 
     public void execute()
@@ -145,13 +155,14 @@ public class VerifyMojo
     {
         if ( verifyParameters() )
         {
-            getLog().info( "Failsafe report directory: " + reportsDirectory );
+            getLog().info(
+                StringUtils.capitalizeFirstLetter( getPluginName() ) + " report directory: " + getReportsDirectory() );
 
             int result;
             try
             {
                 String encoding;
-                if ( StringUtils.isEmpty( this.encoding ) )
+                if ( StringUtils.isEmpty( this.getEncoding() ) )
                 {
                     getLog().warn(
                         "File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING
@@ -160,10 +171,10 @@ public class VerifyMojo
                 }
                 else
                 {
-                    encoding = this.encoding;
+                    encoding = this.getEncoding();
                 }
 
-                FileInputStream fos = new FileInputStream( summaryFile );
+                FileInputStream fos = new FileInputStream( getSummaryFile() );
                 BufferedInputStream bos = new BufferedInputStream( fos );
                 Reader w = new InputStreamReader( bos, encoding );
                 FailsafeSummaryXpp3Reader reader = new FailsafeSummaryXpp3Reader();
@@ -191,7 +202,7 @@ public class VerifyMojo
 
             if ( result == SurefireBooter.NO_TESTS_EXIT_CODE )
             {
-                if ( ( failIfNoTests == null ) || !failIfNoTests.booleanValue() )
+                if ( ( getFailIfNoTests() == null ) || !getFailIfNoTests().booleanValue() )
                 {
                     return;
                 }
@@ -202,12 +213,12 @@ public class VerifyMojo
             else
             {
                 // TODO: i18n
-                msg = "There are test failures.\n\nPlease refer to " + reportsDirectory
+                msg = "There are test failures.\n\nPlease refer to " + getReportsDirectory()
                     + " for the individual test results.";
 
             }
 
-            if ( testFailureIgnore )
+            if ( isTestFailureIgnore() )
             {
                 getLog().error( msg );
             }
@@ -218,27 +229,620 @@ public class VerifyMojo
         }
     }
 
-    private boolean verifyParameters()
-        throws MojoFailureException
+    protected boolean isTestsSkipped()
     {
-        if ( skip || skipTests || skipITs || skipExec )
-        {
-            getLog().info( "Tests are skipped." );
-            return false;
-        }
+        return isSkip() || isSkipTests() || isSkipITs() || isSkipExec();
+    }
 
-        if ( !testClassesDirectory.exists() )
-        {
-            if ( failIfNoTests != null && failIfNoTests.booleanValue() )
-            {
-                throw new MojoFailureException( "No tests to run!" );
-            }
-            getLog().info( "No tests to run." );
-            return false;
-        }
+    protected String getPluginName()
+    {
+        return "failsafe";
+    }
+
+    protected String[] getDefaultIncludes()
+    {
+        return null;
+    }
+
+    public boolean isSkipTests()
+    {
+        return skipTests;
+    }
+
+    public void setSkipTests( boolean skipTests )
+    {
+        this.skipTests = skipTests;
+    }
+
+    public boolean isSkipITs()
+    {
+        return skipITs;
+    }
+
+    public void setSkipITs( boolean skipITs )
+    {
+        this.skipITs = skipITs;
+    }
+
+    public boolean isSkipExec()
+    {
+        return skipExec;
+    }
+
+    public void setSkipExec( boolean skipExec )
+    {
+        this.skipExec = skipExec;
+    }
+
+    public boolean isSkip()
+    {
+        return skip;
+    }
+
+    public void setSkip( boolean skip )
+    {
+        this.skip = skip;
+    }
+
+    public boolean isTestFailureIgnore()
+    {
+        return testFailureIgnore;
+    }
+
+    public void setTestFailureIgnore( boolean testFailureIgnore )
+    {
+        this.testFailureIgnore = testFailureIgnore;
+    }
+
+    public File getBasedir()
+    {
+        return basedir;
+    }
+
+    public void setBasedir( File basedir )
+    {
+        this.basedir = basedir;
+    }
+
+    public File getTestClassesDirectory()
+    {
+        return testClassesDirectory;
+    }
+
+    public void setTestClassesDirectory( File testClassesDirectory )
+    {
+        this.testClassesDirectory = testClassesDirectory;
+    }
+
+    public File getReportsDirectory()
+    {
+        return reportsDirectory;
+    }
+
+    public void setReportsDirectory( File reportsDirectory )
+    {
+        this.reportsDirectory = reportsDirectory;
+    }
+
+    public File getSummaryFile()
+    {
+        return summaryFile;
+    }
+
+    public void setSummaryFile( File summaryFile )
+    {
+        this.summaryFile = summaryFile;
+    }
+
+    public Boolean getFailIfNoTests()
+    {
+        return failIfNoTests;
+    }
+
+    public void setFailIfNoTests( Boolean failIfNoTests )
+    {
+        this.failIfNoTests = failIfNoTests;
+    }
+
+    public String getEncoding()
+    {
+        return encoding;
+    }
+
+    public void setEncoding( String encoding )
+    {
+        this.encoding = encoding;
+    }
+
+    // the following will be refactored out once the common code is all in one place
+
+    public File getClassesDirectory()
+    {
+        return null; // ignore
+    }
+
+    public void setClassesDirectory( File classesDirectory )
+    {
+        // ignore
+    }
+
+    public MavenProject getProject()
+    {
+        return null; // ignore
+    }
+
+    public void setProject( MavenProject project )
+    {
+        // ignore
+    }
+
+    public String getIgnoreClasspathElements()
+    {
+        return null; // ignore
+    }
+
+    public void setIgnoreClasspathElements( String ignoreClasspathElements )
+    {
+        // ignore
+    }
+
+    public List getAdditionalClasspathElements()
+    {
+        return null; // ignore
+    }
+
+    public void setAdditionalClasspathElements( List additionalClasspathElements )
+    {
+        // ignore
+    }
+
+    public File getTestSourceDirectory()
+    {
+        return null; // ignore
+    }
+
+    public void setTestSourceDirectory( File testSourceDirectory )
+    {
+        // ignore
+    }
+
+    public String getTest()
+    {
+        return null; // ignore
+    }
+
+    public void setTest( String test )
+    {
+        // ignore
+    }
+
+    public List getIncludes()
+    {
+        return null; // ignore
+    }
+
+    public void setIncludes( List includes )
+    {
+        // ignore
+    }
+
+    public List getExcludes()
+    {
+        return null; // ignore
+    }
+
+    public void setExcludes( List excludes )
+    {
+        // ignore
+    }
+
+    public ArtifactRepository getLocalRepository()
+    {
+        return null; // ignore
+    }
+
+    public void setLocalRepository( ArtifactRepository localRepository )
+    {
+        // ignore
+    }
+
+    public Properties getSystemProperties()
+    {
+        return null; // ignore
+    }
+
+    public void setSystemProperties( Properties systemProperties )
+    {
+        // ignore
+    }
+
+    public Map getSystemPropertyVariables()
+    {
+        return null; // ignore
+    }
+
+    public void setSystemPropertyVariables( Map systemPropertyVariables )
+    {
+        // ignore
+    }
+
+    public Properties getProperties()
+    {
+        return null; // ignore
+    }
+
+    public void setProperties( Properties properties )
+    {
+        // ignore
+    }
+
+    public Map getPluginArtifactMap()
+    {
+        return null; // ignore
+    }
+
+    public void setPluginArtifactMap( Map pluginArtifactMap )
+    {
+        // ignore
+    }
+
+    public Map getProjectArtifactMap()
+    {
+        return null; // ignore
+    }
+
+    public void setProjectArtifactMap( Map projectArtifactMap )
+    {
+        // ignore
+    }
+
+    public boolean isPrintSummary()
+    {
+        return false; // ignore
+    }
+
+    public void setPrintSummary( boolean printSummary )
+    {
+        // ignore
+    }
+
+    public String getReportFormat()
+    {
+        return null; // ignore
+    }
+
+    public void setReportFormat( String reportFormat )
+    {
+        // ignore
+    }
+
+    public boolean isUseFile()
+    {
+        return false; // ignore  
+    }
+
+    public void setUseFile( boolean useFile )
+    {
+        // ignore
+    }
+
+    public boolean isRedirectTestOutputToFile()
+    {
+        return false; // ignore
+    }
 
-        return true;
+    public void setRedirectTestOutputToFile( boolean redirectTestOutputToFile )
+    {
+        // ignore
+    }
+
+    public String getForkMode()
+    {
+        return null; // ignore
+    }
+
+    public void setForkMode( String forkMode )
+    {
+        // ignore
+    }
+
+    public String getJvm()
+    {
+        return null; // ignore
+    }
+
+    public void setJvm( String jvm )
+    {
+        // ignore
+    }
+
+    public String getArgLine()
+    {
+        return null; // ignore
+    }
+
+    public void setArgLine( String argLine )
+    {
+        // ignore
+    }
+
+    public String getDebugForkedProcess()
+    {
+        return null; // ignore
     }
 
+    public void setDebugForkedProcess( String debugForkedProcess )
+    {
+        // ignore
+    }
+
+    public int getForkedProcessTimeoutInSeconds()
+    {
+        return 0;  // ignore
+    }
+
+    public void setForkedProcessTimeoutInSeconds( int forkedProcessTimeoutInSeconds )
+    {
+        // ignore
+    }
+
+    public Map getEnvironmentVariables()
+    {
+        return null;  // ignore
+    }
+
+    public void setEnvironmentVariables( Map environmentVariables )
+    {
+        // ignore
+    }
+
+    public File getWorkingDirectory()
+    {
+        return null;  // ignore
+    }
+
+    public void setWorkingDirectory( File workingDirectory )
+    {
+        // ignore
+    }
+
+    public boolean isChildDelegation()
+    {
+        return false;  // ignore
+    }
+
+    public void setChildDelegation( boolean childDelegation )
+    {
+        // ignore
+    }
+
+    public String getGroups()
+    {
+        return null;  // ignore
+    }
+
+    public void setGroups( String groups )
+    {
+        // ignore
+    }
+
+    public String getExcludedGroups()
+    {
+        return null;  // ignore
+    }
+
+    public void setExcludedGroups( String excludedGroups )
+    {
+        // ignore
+    }
+
+    public File[] getSuiteXmlFiles()
+    {
+        return new File[0];  // ignore
+    }
+
+    public void setSuiteXmlFiles( File[] suiteXmlFiles )
+    {
+        // ignore
+    }
+
+    public String getJunitArtifactName()
+    {
+        return null;  // ignore
+    }
+
+    public void setJunitArtifactName( String junitArtifactName )
+    {
+        // ignore
+    }
+
+    public String getTestNGArtifactName()
+    {
+        return null;  // ignore
+    }
+
+    public void setTestNGArtifactName( String testNGArtifactName )
+    {
+        // ignore
+    }
+
+    public int getThreadCount()
+    {
+        return 0;  // ignore
+    }
+
+    public void setThreadCount( int threadCount )
+    {
+        // ignore
+    }
+
+    public String getPerCoreThreadCount()
+    {
+        return null;  // ignore
+    }
+
+    public void setPerCoreThreadCount( String perCoreThreadCount )
+    {
+        // ignore
+    }
+
+    public String getUseUnlimitedThreads()
+    {
+        return null;  // ignore
+    }
 
+    public void setUseUnlimitedThreads( String useUnlimitedThreads )
+    {
+        // ignore
+    }
+
+    public String getParallel()
+    {
+        return null;  // ignore
+    }
+
+    public void setParallel( String parallel )
+    {
+        // ignore
+    }
+
+    public boolean isTrimStackTrace()
+    {
+        return false;  // ignore
+    }
+
+    public void setTrimStackTrace( boolean trimStackTrace )
+    {
+        // ignore
+    }
+
+    public ArtifactResolver getArtifactResolver()
+    {
+        return null;  // ignore
+    }
+
+    public void setArtifactResolver( ArtifactResolver artifactResolver )
+    {
+        // ignore
+    }
+
+    public ArtifactFactory getArtifactFactory()
+    {
+        return null;  // ignore
+    }
+
+    public void setArtifactFactory( ArtifactFactory artifactFactory )
+    {
+        // ignore
+    }
+
+    public List getRemoteRepositories()
+    {
+        return null;  // ignore
+    }
+
+    public void setRemoteRepositories( List remoteRepositories )
+    {
+        // ignore
+    }
+
+    public ArtifactMetadataSource getMetadataSource()
+    {
+        return null;  // ignore
+    }
+
+    public void setMetadataSource( ArtifactMetadataSource metadataSource )
+    {
+        // ignore
+    }
+
+    public Properties getOriginalSystemProperties()
+    {
+        return null;  // ignore
+    }
+
+    public void setOriginalSystemProperties( Properties originalSystemProperties )
+    {
+        // ignore
+    }
+
+    public Properties getInternalSystemProperties()
+    {
+        return null;  // ignore
+    }
+
+    public void setInternalSystemProperties( Properties internalSystemProperties )
+    {
+        // ignore
+    }
+
+    public boolean isDisableXmlReport()
+    {
+        return false;  // ignore
+    }
+
+    public void setDisableXmlReport( boolean disableXmlReport )
+    {
+        // ignore
+    }
+
+    public Boolean getUseSystemClassLoader()
+    {
+        return null;  // ignore
+    }
+
+    public void setUseSystemClassLoader( Boolean useSystemClassLoader )
+    {
+        // ignore
+    }
+
+    public boolean isUseManifestOnlyJar()
+    {
+        return false;  // ignore
+    }
+
+    public void setUseManifestOnlyJar( boolean useManifestOnlyJar )
+    {
+        // ignore
+    }
+
+    public boolean isEnableAssertions()
+    {
+        return false;  // ignore
+    }
+
+    public void setEnableAssertions( boolean enableAssertions )
+    {
+        // ignore
+    }
+
+    public MavenSession getSession()
+    {
+        return null;  // ignore
+    }
+
+    public void setSession( MavenSession session )
+    {
+        // ignore
+    }
+
+    public String getObjectFactory()
+    {
+        return null;  // ignore
+    }
+
+    public void setObjectFactory( String objectFactory )
+    {
+        // ignore
+    }
+
+    public ToolchainManager getToolchainManager()
+    {
+        return null;  // ignore
+    }
+
+    public void setToolchainManager( ToolchainManager toolchainManager )
+    {
+        // ignore
+    }
 }

Propchange: maven/surefire/trunk/maven-surefire-common/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon May 17 13:02:39 2010
@@ -0,0 +1,13 @@
+cobertura.ser
+*~
+*.log
+*.ipr
+*.iws
+*.iml
+target
+.project
+.classpath
+.wtpmodules
+.settings
+bin
+target-eclipse

Copied: maven/surefire/trunk/maven-surefire-common/pom.xml (from r945008, maven/surefire/trunk/maven-failsafe-plugin/pom.xml)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/pom.xml?p2=maven/surefire/trunk/maven-surefire-common/pom.xml&p1=maven/surefire/trunk/maven-failsafe-plugin/pom.xml&r1=945008&r2=945127&rev=945127&view=diff
==============================================================================
--- maven/surefire/trunk/maven-failsafe-plugin/pom.xml (original)
+++ maven/surefire/trunk/maven-surefire-common/pom.xml Mon May 17 13:02:39 2010
@@ -28,74 +28,15 @@
     <relativePath>../pom.xml</relativePath>
   </parent>
 
-  <artifactId>maven-failsafe-plugin</artifactId>
-  <groupId>org.apache.maven.plugins</groupId>
-  <packaging>maven-plugin</packaging>
+  <artifactId>maven-surefire-common</artifactId>
+  <groupId>org.apache.maven.surefire</groupId>
 
-  <name>Maven Failsafe Plugin</name>
+  <name>Maven Surefire Common</name>
 
   <prerequisites>
     <maven>2.0.9</maven>
   </prerequisites>
 
-  <mailingLists>
-    <!-- duplication from maven-plugins pom - temporary until they inherit properly -->
-    <mailingList>
-      <name>Maven User List</name>
-      <subscribe>users-subscribe@maven.apache.org</subscribe>
-      <unsubscribe>users-unsubscribe@maven.apache.org</unsubscribe>
-      <post>users@maven.apache.org</post>
-      <archive>http://mail-archives.apache.org/mod_mbox/maven-users</archive>
-      <otherArchives>
-        <otherArchive>http://www.mail-archive.com/users@maven.apache.org/</otherArchive>
-        <otherArchive>http://www.nabble.com/Maven---Users-f178.html</otherArchive>
-      </otherArchives>
-    </mailingList>
-    <mailingList>
-      <name>Maven Developer List</name>
-      <subscribe>dev-subscribe@maven.apache.org</subscribe>
-      <unsubscribe>dev-unsubscribe@maven.apache.org</unsubscribe>
-      <post>dev@maven.apache.org</post>
-      <archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive>
-    </mailingList>
-    <mailingList>
-      <name>Maven Commits List</name>
-      <subscribe>commits-subscribe@maven.apache.org</subscribe>
-      <unsubscribe>commits-unsubscribe@maven.apache.org</unsubscribe>
-      <post>commits@maven.apache.org</post>
-      <archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive>
-    </mailingList>
-    <!-- duplication from maven-parent pom - temporary until they inherit properly -->
-    <mailingList>
-      <name>Maven Announcements List</name>
-      <post>announce@maven.apache.org</post>
-      <subscribe>announce-subscribe@maven.apache.org</subscribe>
-      <unsubscribe>announce-unsubscribe@maven.apache.org</unsubscribe>
-      <archive>http://mail-archives.apache.org/mod_mbox/maven-announce/</archive>
-    </mailingList>
-    <mailingList>
-      <name>Maven Issues List</name>
-      <post>issues@maven.apache.org</post>
-      <subscribe>issues-subscribe@maven.apache.org</subscribe>
-      <unsubscribe>issues-unsubscribe@maven.apache.org</unsubscribe>
-      <archive>http://mail-archives.apache.org/mod_mbox/maven-issues/</archive>
-    </mailingList>
-    <mailingList>
-      <name>Maven Notifications List</name>
-      <post>notifications@maven.apache.org</post>
-      <subscribe>notifications-subscribe@maven.apache.org</subscribe>
-      <unsubscribe>notifications-unsubscribe@maven.apache.org</unsubscribe>
-      <archive>http://mail-archives.apache.org/mod_mbox/maven-notifications/</archive>
-    </mailingList>
-  </mailingLists>
-
-  <distributionManagement>
-    <site>
-      <id>apache.website</id>
-      <url>scp://people.apache.org/www/maven.apache.org/plugins/maven-failsafe-plugin</url>
-    </site>
-  </distributionManagement>
-
   <dependencies>
     <dependency>
       <groupId>org.apache.maven</groupId>
@@ -137,86 +78,6 @@
     </dependency>
   </dependencies>
 
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-plugin-plugin</artifactId>
-        <version>2.5.1</version>
-        <executions>
-          <execution>
-            <id>generated-helpmojo</id>
-            <goals>
-              <goal>helpmojo</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <artifactId>maven-site-plugin</artifactId>
-        <configuration>
-          <stagingSiteURL>scp://people.apache.org/www/maven.apache.org/plugins/${project.artifactId}-${project.version}</stagingSiteURL>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.modello</groupId>
-        <artifactId>modello-maven-plugin</artifactId>
-        <version>1.0.1</version>
-        <executions>
-          <execution>
-            <goals>
-              <!-- Generate the xpp3 reader code -->
-              <goal>xpp3-reader</goal>
-              <!-- Generate the xpp3 writer code -->
-              <goal>xpp3-writer</goal>
-              <!-- Generate the Java sources for the model itself -->
-              <goal>java</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <models>
-            <model>src/main/mdo/failsafe-summary.mdo</model>
-          </models>
-          <version>2.4.3</version>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-invoker-plugin</artifactId>
-        <version>1.5</version>
-        <configuration>
-          <projectsDirectory>src/it</projectsDirectory>
-          <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
-          <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
-          <showErrors>true</showErrors>
-          <streamLogs>true</streamLogs>
-          <goals>
-            <goal>verify</goal>
-          </goals>
-          <setupIncludes>
-            <setupInclude>dummy-*/pom.xml</setupInclude>
-          </setupIncludes>
-          <pomIncludes>
-            <pomInclude>*/pom.xml</pomInclude>
-          </pomIncludes>
-          <postBuildHookScript>verify.bsh</postBuildHookScript>
-          <settingsFile>src/it/settings.xml</settingsFile>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-  <reporting>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-plugin-plugin</artifactId>
-        <version>2.5.1</version>
-      </plugin>
-    </plugins>
-  </reporting>
-
   <profiles>
     <!-- Force JDK 1.4 for this one, plugins can never be built on 1.3 -->
     <profile>
@@ -235,57 +96,5 @@
         </pluginManagement>
       </build>
     </profile>
-    <profile>
-      <id>ci</id>
-      <activation>
-        <property>
-          <name>enableCiProfile</name>
-          <value>true</value>
-        </property>
-      </activation>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-docck-plugin</artifactId>
-            <version>1.0</version>
-            <executions>
-              <execution>
-                <goals>
-                  <goal>check</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-    <profile>
-      <!-- run integration tests
-          to use this profile:
-          or run integration tests: mvn -Prun-its
-      -->
-      <id>run-its</id>
-      <build>
-        <defaultGoal>verify</defaultGoal>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-invoker-plugin</artifactId>
-            <configuration>
-              <streamLogs>false</streamLogs>
-            </configuration>
-            <executions>
-              <execution>
-                <id>integration-test</id>
-                <goals>
-                  <goal>install</goal>
-                  <goal>run</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
   </profiles>
 </project>



Mime
View raw message