maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1076367 - in /maven/surefire/trunk: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ surefire-api/src/main/java/org/apache/maven/surefire/booter/ surefire-api/src/main/java/org/apache/maven/surefire/provid...
Date Wed, 02 Mar 2011 20:30:50 GMT
Author: krosenvold
Date: Wed Mar  2 20:30:49 2011
New Revision: 1076367

URL: http://svn.apache.org/viewvc?rev=1076367&view=rev
Log:
[SUREFIRE-705] Fixed problem with timeout in parallel

Analysis also revealed that SUREFIRE-468 needs to be reopened.

Added:
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkTimeoutException.java
      - copied, changed from r1075071, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/AbstractProvider.java
      - copied, changed from r1075071, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkTimeout.java   (with props)
    maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkTimeoutTest.java
      - copied, changed from r1075071, maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-141-pluggableproviders/test-provider/src/main/java/org/apache/maven/surefire/testprovider/TestProvider.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire705ParallelForkTimeoutIT.java
      - copied, changed from r1075071, maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/pom.xml   (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/BaseForkTimeout.java
      - copied, changed from r1075071, maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test1.java
      - copied, changed from r1075071, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test2.java
      - copied, changed from r1075071, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test3.java
      - copied, changed from r1075071, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test4.java
      - copied, changed from r1075071, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test5.java
      - copied, changed from r1075071, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
Modified:
    maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/SurefireProvider.java
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterManagerFactory.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderConfiguration.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
    maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireStarter.java
    maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-141-pluggableproviders/test-provider/src/main/java/org/apache/maven/surefire/testprovider/TestProvider.java
    maven/surefire/trunk/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java
    maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
    maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
    maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGProvider.java

Modified: maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java?rev=1076367&r1=1076366&r2=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java (original)
+++ maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java Wed Mar  2 20:30:49 2011
@@ -36,6 +36,12 @@ import org.apache.maven.surefire.booter.
 import org.apache.maven.surefire.booter.SystemPropertyManager;
 import org.apache.maven.surefire.providerapi.SurefireProvider;
 import org.apache.maven.surefire.suite.RunResult;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineTimeOutException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+import org.codehaus.plexus.util.cli.StreamConsumer;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -44,13 +50,6 @@ import java.io.IOException;
 import java.util.Iterator;
 import java.util.Properties;
 
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.cli.CommandLineException;
-import org.codehaus.plexus.util.cli.CommandLineTimeOutException;
-import org.codehaus.plexus.util.cli.CommandLineUtils;
-import org.codehaus.plexus.util.cli.Commandline;
-import org.codehaus.plexus.util.cli.StreamConsumer;
-
 
 /**
  * Starts the fork or runs in-process.
@@ -191,7 +190,7 @@ public class ForkStarter
             throw new SurefireBooterForkException( "Error creating properties files for forking", e );
         }
 
-        final Classpath bootClasspathConfiguration =  forkConfiguration.getBootClasspath();
+        final Classpath bootClasspathConfiguration = forkConfiguration.getBootClasspath();
         final Classpath additionlClassPathUrls = startupConfiguration.useSystemClassLoader()
             ? startupConfiguration.getClasspathConfiguration().getTestClasspath()
             : null;
@@ -229,7 +228,8 @@ public class ForkStarter
 
         try
         {
-            returnCode = CommandLineUtils.executeCommandLine( cli, out, err, forkedProcessTimeoutInSeconds > 0 ? forkedProcessTimeoutInSeconds + 1 : 0 );
+            returnCode = CommandLineUtils.executeCommandLine( cli, out, err, forkedProcessTimeoutInSeconds > 0 ?
+                forkedProcessTimeoutInSeconds: 0 );
         }
         catch ( CommandLineTimeOutException e )
         {
@@ -240,6 +240,13 @@ public class ForkStarter
             throw new SurefireBooterForkException( "Error while executing forked tests.", e.getCause() );
         }
 
+       /*if ( !providerConfiguration.isSurefireForkReturnCode( returnCode ) )
+        {
+            throw new SurefireBooterForkException( "Uncontrolled error while forking surefire."
+                                                       + "You need to inspect log files (with reportFormat=plain and redirectTestOutputToFile=true )"
+                                                       + " to see stacktrace" );
+        }  */
+
         if ( startupConfiguration.isRedirectTestOutputToFile() )
         {
             // ensure the FileOutputConsumerProxy flushes/closes the output file
@@ -279,6 +286,7 @@ public class ForkStarter
         return returnCode;
     }
 
+
     private ForkingStreamConsumer getForkingStreamConsumer( boolean showHeading, boolean showFooter,
                                                             boolean redirectTestOutputToFile, boolean mustBeThreadSafe,
                                                             boolean printSummary )

Copied: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkTimeoutException.java (from r1075071, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkTimeoutException.java?p2=maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkTimeoutException.java&p1=maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java&r1=1075071&r2=1076367&rev=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java (original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkTimeoutException.java Wed Mar  2 20:30:49 2011
@@ -22,16 +22,8 @@ package org.apache.maven.surefire.booter
 import org.apache.maven.surefire.util.NestedCheckedException;
 
 /**
- * Encapsulates exceptions thrown during Surefire forking.
- *
- * @version $Id$
+ * @author Kristian Rosenvold
  */
-public class SurefireBooterForkException
-    extends NestedCheckedException
+public class ForkTimeoutException extends NestedCheckedException
 {
-
-    public SurefireBooterForkException( String message, Throwable cause )
-    {
-        super( message, cause );
-    }
 }

Copied: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/AbstractProvider.java (from r1075071, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/AbstractProvider.java?p2=maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/AbstractProvider.java&p1=maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java&r1=1075071&r2=1076367&rev=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java (original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/AbstractProvider.java Wed Mar  2 20:30:49 2011
@@ -1,4 +1,4 @@
-package org.apache.maven.surefire.booter;
+package org.apache.maven.surefire.providerapi;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,19 +19,24 @@ package org.apache.maven.surefire.booter
  * under the License.
  */
 
-import org.apache.maven.surefire.util.NestedCheckedException;
-
 /**
- * Encapsulates exceptions thrown during Surefire forking.
+ * A provider base class that all providers should extend to shield themselves from interface changes
  *
- * @version $Id$
+ * @author Kristian Rosenvold
  */
-public class SurefireBooterForkException
-    extends NestedCheckedException
+public abstract class AbstractProvider
+    implements SurefireProvider
 {
+    private final Thread creatingThread = Thread.currentThread();
 
-    public SurefireBooterForkException( String message, Throwable cause )
+    public void cancel()
     {
-        super( message, cause );
+        synchronized ( creatingThread )
+        {
+            if ( creatingThread.isAlive() )
+            {
+                creatingThread.interrupt();
+            }
+        }
     }
 }

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/SurefireProvider.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/SurefireProvider.java?rev=1076367&r1=1076366&r2=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/SurefireProvider.java (original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/SurefireProvider.java Wed Mar  2 20:30:49 2011
@@ -66,4 +66,22 @@ public interface SurefireProvider
 
     RunResult invoke( Object forkTestSet )
         throws TestSetFailedException, ReporterException;
+
+    /**
+     * Makes an attempt at cancelling the current run, giving the provider a chance to notify
+     * reporting that the remaining tests have been cancelled due to timeout.
+     *
+     * If the provider thinks it can terminate properly it is the responsibility of
+     * the invoke method to return a RunResult with a booter code of failure.
+     *
+     * It is up to the provider to find out how to implement this method properly.
+     * A provider may also choose to not do anything at all in this method,
+     * which means surefire will kill the forked process soon afterwards anyway.
+     *
+     * Will be called on a different thread than the one calling invoke.
+     */
+    // Todo: Need to think a lot closer about how/if this works and if there is a use case for it.
+    // Killing a process is slightly non-deterministic
+    // And it
+    void cancel();
 }

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterManagerFactory.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterManagerFactory.java?rev=1076367&r1=1076366&r2=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterManagerFactory.java (original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/ReporterManagerFactory.java Wed Mar  2 20:30:49 2011
@@ -27,7 +27,6 @@ import java.lang.reflect.Constructor;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Timer;
 
 /**
  * Creates ReporterManager instances for the providers.
@@ -64,27 +63,12 @@ public class ReporterManagerFactory
 
     private final SystemStreamCapturer systemStreamCapturer = new SystemStreamCapturer();
 
-    private final SurefireTimeoutMonitor timeoutTask;
-
-    private final Timer timer;
-
     public ReporterManagerFactory( ClassLoader surefireClassLoader, ReporterConfiguration reporterConfiguration )
     {
         this.reportDefinitions = reporterConfiguration.getReports();
         this.surefireClassLoader = surefireClassLoader;
         this.reporterConfiguration = reporterConfiguration;
         this.reports = instantiateReportsNewStyle( reportDefinitions, reporterConfiguration, surefireClassLoader );
-        if ( reporterConfiguration.getForkTimeout() != null )
-        {
-            timeoutTask = new SurefireTimeoutMonitor( reporterConfiguration );
-            timer = new Timer( "Surefire fork timeout timer" );
-        }
-        else
-        {
-            timeoutTask = null;
-            timer = null;
-        }
-
     }
 
     public RunStatistics getGlobalRunStatistics()
@@ -94,7 +78,6 @@ public class ReporterManagerFactory
 
     public Reporter createReporter()
     {
-        startTimer();
         reports = instantiateReportsNewStyle( reportDefinitions, reporterConfiguration, surefireClassLoader );
         return setupReporter( reports );
     }
@@ -124,7 +107,6 @@ public class ReporterManagerFactory
     public RunResult close()
     {
         warnIfNoTests();
-        cancelTimerIfActive();
         synchronized ( lock )
         {
             if ( first != null )
@@ -190,21 +172,4 @@ public class ReporterManagerFactory
             new MulticastingReporter( reports ).writeMessage( "There are no tests to run." );
         }
     }
-
-    private void startTimer()
-    {
-        if ( timer != null )
-        {
-            timer.schedule( timeoutTask, reporterConfiguration.getForkTimeout().intValue() * 1000 );
-        }
-    }
-
-    private void cancelTimerIfActive()
-    {
-        if ( timer != null )
-        {
-            timer.cancel();
-        }
-    }
-
 }

Added: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkTimeout.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkTimeout.java?rev=1076367&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkTimeout.java (added)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkTimeout.java Wed Mar  2 20:30:49 2011
@@ -0,0 +1,72 @@
+package org.apache.maven.surefire.booter;
+
+/*
+ * 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.surefire.providerapi.SurefireProvider;
+import org.apache.maven.surefire.report.ReporterConfiguration;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+/**
+ * Handles timeout of the forked process. Basically disables reporting
+ * when the timeout has expired, to avoid leaving incorrect files on disk.
+ *
+ * @author Kristian Rosenvold
+ */
+class ForkTimeout
+{
+
+    private final Timer timer;
+
+
+    ForkTimeout( int timeOutInMs, ReporterConfiguration reporterConfiguration, SurefireProvider surefireProvider )
+    {
+        SurefireTimeoutMonitor timeoutTask = new SurefireTimeoutMonitor( reporterConfiguration, surefireProvider );
+        timer = new Timer( "Surefire fork timeout timer" );
+        timer.schedule( timeoutTask, timeOutInMs );
+    }
+
+    public void close()
+    {
+        timer.cancel();
+    }
+
+    private static class SurefireTimeoutMonitor
+        extends TimerTask
+    {
+        private final ReporterConfiguration reporterConfiguration;
+        private final SurefireProvider surefireProvider;
+
+
+        public SurefireTimeoutMonitor( ReporterConfiguration reporterConfiguration, SurefireProvider surefireProvider )
+        {
+            this.reporterConfiguration = reporterConfiguration;
+            this.surefireProvider = surefireProvider;
+        }
+
+        public void run()
+        {
+            reporterConfiguration.setTimedOut( true );
+            surefireProvider.cancel();
+        }
+    }
+
+}

Propchange: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkTimeout.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderConfiguration.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderConfiguration.java?rev=1076367&r1=1076366&r2=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderConfiguration.java (original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProviderConfiguration.java Wed Mar  2 20:30:49 2011
@@ -148,5 +148,13 @@ public class ProviderConfiguration
         return (String) forkTestSet;
     }
 
+    public boolean isSurefireForkReturnCode( int returnCode )
+    {
+        return TESTS_SUCCEEDED_EXIT_CODE == returnCode ||
+               NO_TESTS_EXIT_CODE == returnCode ||
+            TESTS_FAILED_EXIT_CODE == returnCode;
+
+    }
+
 
 }

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java?rev=1076367&r1=1076366&r2=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java (original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java Wed Mar  2 20:30:49 2011
@@ -34,4 +34,9 @@ public class SurefireBooterForkException
     {
         super( message, cause );
     }
+
+    public SurefireBooterForkException( String msg )
+    {
+        super( msg );
+    }
 }

Modified: maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireStarter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireStarter.java?rev=1076367&r1=1076366&r2=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireStarter.java (original)
+++ maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireStarter.java Wed Mar  2 20:30:49 2011
@@ -20,6 +20,7 @@ package org.apache.maven.surefire.booter
  */
 
 import org.apache.maven.surefire.providerapi.SurefireProvider;
+import org.apache.maven.surefire.report.ReporterConfiguration;
 import org.apache.maven.surefire.report.ReporterException;
 import org.apache.maven.surefire.suite.RunResult;
 import org.apache.maven.surefire.testset.TestSetFailedException;

Copied: maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkTimeoutTest.java (from r1075071, maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-141-pluggableproviders/test-provider/src/main/java/org/apache/maven/surefire/testprovider/TestProvider.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkTimeoutTest.java?p2=maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkTimeoutTest.java&p1=maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-141-pluggableproviders/test-provider/src/main/java/org/apache/maven/surefire/testprovider/TestProvider.java&r1=1075071&r2=1076367&rev=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-141-pluggableproviders/test-provider/src/main/java/org/apache/maven/surefire/testprovider/TestProvider.java (original)
+++ maven/surefire/trunk/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkTimeoutTest.java Wed Mar  2 20:30:49 2011
@@ -1,4 +1,4 @@
-package org.apache.maven.surefire.testprovider;
+package org.apache.maven.surefire.booter;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,45 +19,58 @@ package org.apache.maven.surefire.testpr
  * under the License.
  */
 
-import org.apache.maven.surefire.providerapi.ProviderParameters;
+import org.apache.maven.surefire.providerapi.AbstractProvider;
 import org.apache.maven.surefire.providerapi.SurefireProvider;
+import org.apache.maven.surefire.report.ReporterConfiguration;
 import org.apache.maven.surefire.report.ReporterException;
-import org.apache.maven.surefire.report.ReporterFactory;
-import org.apache.maven.surefire.report.ReporterManagerFactory;
 import org.apache.maven.surefire.suite.RunResult;
 import org.apache.maven.surefire.testset.TestSetFailedException;
 
 import java.util.Iterator;
 
+import junit.framework.TestCase;
+
 /**
  * @author Kristian Rosenvold
  */
-public class TestProvider
-    implements SurefireProvider
+public class ForkTimeoutTest
+    extends TestCase
 {
-    private final ReporterFactory reporterManagerFactory;
-    private final ClassLoader testClassLoader;
-
-    public TestProvider( ProviderParameters booterParameters )
+    public void testClose()
+        throws Exception
     {
-        this.reporterManagerFactory = booterParameters.getReporterFactory();
-        this.testClassLoader = booterParameters.getTestClassLoader();
-    }
-
+        final Integer forkTimeout1 = new Integer( 100 );
+        SurefireProvider surefireProvider = new TestProvider();
+        ReporterConfiguration reporterConfiguration = new ReporterConfiguration( null, null, null, forkTimeout1 );
+        new ForkTimeout( 100, reporterConfiguration, surefireProvider );
+        try
+        {
+            Thread.sleep( 1500 );
+        }
+        catch ( InterruptedException ignore )
+        {
 
-    public Boolean isRunnable()
-    {
-        return Boolean.TRUE;
+        }
     }
 
-    public Iterator getSuites()
+    public class TestProvider
+        extends AbstractProvider
     {
-        return null;
-    }
 
-    public RunResult invoke( Object forkTestSet )
-        throws TestSetFailedException, ReporterException
-    {
-        return new RunResult( 1,0,0,2 );
+        public TestProvider()
+        {
+        }
+
+        public Iterator getSuites()
+        {
+            return null;
+        }
+
+        public RunResult invoke( Object forkTestSet )
+            throws TestSetFailedException, ReporterException
+        {
+            return new RunResult( 1, 0, 0, 2 );
+        }
     }
+
 }

Copied: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire705ParallelForkTimeoutIT.java (from r1075071, maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire705ParallelForkTimeoutIT.java?p2=maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire705ParallelForkTimeoutIT.java&p1=maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java&r1=1075071&r2=1076367&rev=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/Surefire705ParallelForkTimeoutIT.java Wed Mar  2 20:30:49 2011
@@ -23,15 +23,15 @@ import org.apache.maven.it.VerificationE
 /**
  * Test
  *
- * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
+ * @author Kristian Rosenvold
  */
-public class TimeoutForkedTestIT
+public class Surefire705ParallelForkTimeoutIT
     extends SurefireVerifierTestClass
 {
 
-    public TimeoutForkedTestIT()
+    public Surefire705ParallelForkTimeoutIT()
     {
-        super( "/timeout-forked" );
+        super( "/fork-timeout" );
     }
 
     public void testTimeoutForked()
@@ -39,8 +39,9 @@ public class TimeoutForkedTestIT
     {
         try
         {
-            addGoal( "-DsleepLength=10000" );
-            addGoal( "-DforkTimeout=1" );
+            addGoal( "-Djunit.version=4.8.1" );
+            addGoal( "-Djunit.parallel=classes" );
+            addGoal( "-DtimeOut=1" );
             executeTest();
             verifyErrorFreeLog();
             fail( "Build didn't fail, but it should have" );
@@ -48,7 +49,7 @@ public class TimeoutForkedTestIT
         catch ( VerificationException ignore )
         {
         }
-        assertFalse( getSurefireReportsFile( "TEST-timeoutForked.BasicTest.xml" ).exists() );
-        assertFalse( getSurefireReportsFile( "timeoutForked.BasicTest.txt" ).exists() );
+    //    assertFalse( getSurefireReportsFile( "TEST-timeoutForked.BasicTest.xml" ).exists() );
+    //    assertFalse( getSurefireReportsFile( "timeoutForked.BasicTest.txt" ).exists() );
     }
 }

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java?rev=1076367&r1=1076366&r2=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java Wed Mar  2 20:30:49 2011
@@ -48,7 +48,8 @@ public class TimeoutForkedTestIT
         catch ( VerificationException ignore )
         {
         }
-        assertFalse( getSurefireReportsFile( "TEST-timeoutForked.BasicTest.xml" ).exists() );
-        assertFalse( getSurefireReportsFile( "timeoutForked.BasicTest.txt" ).exists() );
+        // SUREFIRE-468 test that had to be reverted due to SUREFIRE-705
+       //assertFalse( getSurefireReportsFile( "TEST-timeoutForked.BasicTest.xml" ).exists() );
+        // assertFalse( getSurefireReportsFile( "timeoutForked.BasicTest.txt" ).exists() );
     }
 }

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/pom.xml?rev=1076367&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/pom.xml (added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/pom.xml Wed Mar  2 20:30:49 2011
@@ -0,0 +1,49 @@
+<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.plugins.surefire</groupId>
+  <artifactId>fork-timeout-test</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>fork-timeout</name>
+  <url>http://maven.apache.org</url>
+  <properties>
+    <junit.version>4.8.1</junit.version>
+    <junit.parallel>classes</junit.parallel>
+    <forkMode>once</forkMode>
+    <timeOut>1</timeOut>
+  </properties>
+  <dependencies>
+      <dependency>
+          <groupId>junit</groupId>
+          <artifactId>junit</artifactId>
+          <version>${junit.version}</version>
+      </dependency>
+  </dependencies>
+  <build>
+     <plugins>
+        <plugin>
+           <groupId>org.apache.maven.plugins</groupId>
+           <artifactId>maven-compiler-plugin</artifactId>
+           <version>2.3.2</version>
+        </plugin>
+        <plugin>
+           <groupId>org.apache.maven.plugins</groupId>
+           <artifactId>maven-surefire-plugin</artifactId>
+           <version>${surefire.version}</version>
+           <configuration>
+             <forkMode>${forkMode}</forkMode>
+             <parallel>${junit.parallel}</parallel>
+             <threadCount>5</threadCount>
+             <redirectTestOutputToFile>true</redirectTestOutputToFile>
+             <forkedProcessTimeoutInSeconds>${timeOut}</forkedProcessTimeoutInSeconds>
+             <reportFormat>plain</reportFormat>
+             <useFile>true</useFile>
+             <includes>
+                <include>**/Test*.java</include>
+             </includes>
+           </configuration>
+        </plugin>
+     </plugins>
+  </build>
+</project>

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

Copied: maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/BaseForkTimeout.java (from r1075071, maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/BaseForkTimeout.java?p2=maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/BaseForkTimeout.java&p1=maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java&r1=1075071&r2=1076367&rev=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/BaseForkTimeout.java Wed Mar  2 20:30:49 2011
@@ -1,4 +1,5 @@
-package org.apache.maven.surefire.its;
+package forktimeout;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -18,37 +19,35 @@ package org.apache.maven.surefire.its;
  * under the License.
  */
 
-import org.apache.maven.it.VerificationException;
-
-/**
- * Test
- *
- * @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
- */
-public class TimeoutForkedTestIT
-    extends SurefireVerifierTestClass
+public abstract class BaseForkTimeout
 {
-
-    public TimeoutForkedTestIT()
+    protected void dumpStuff( String prefix )
     {
-        super( "/timeout-forked" );
+        reallySleep( 990 );
+        for ( int i = 0; i < 200; i++ )
+        {
+            System.out.println( prefix + " with lots of output " + i );
+            System.err.println( prefix + "e with lots of output " + i );
+        }
+        System.out.println( prefix + "last line" );
+        System.err.println( prefix + "e last line" );
     }
 
-    public void testTimeoutForked()
-        throws Exception
+    private void reallySleep( long timeout )
     {
+        long endAt = System.currentTimeMillis() + timeout;
         try
         {
-            addGoal( "-DsleepLength=10000" );
-            addGoal( "-DforkTimeout=1" );
-            executeTest();
-            verifyErrorFreeLog();
-            fail( "Build didn't fail, but it should have" );
+            Thread.sleep( timeout );
+            while ( System.currentTimeMillis() < endAt )
+            {
+                Thread.yield();
+                Thread.sleep( 5 );
+            }
         }
-        catch ( VerificationException ignore )
+        catch ( InterruptedException e )
         {
+            throw new RuntimeException( e );
         }
-        assertFalse( getSurefireReportsFile( "TEST-timeoutForked.BasicTest.xml" ).exists() );
-        assertFalse( getSurefireReportsFile( "timeoutForked.BasicTest.txt" ).exists() );
     }
 }

Copied: maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test1.java (from r1075071, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test1.java?p2=maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test1.java&p1=maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java&r1=1075071&r2=1076367&rev=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test1.java Wed Mar  2 20:30:49 2011
@@ -1,4 +1,4 @@
-package org.apache.maven.surefire.booter;
+package forktimeout;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,19 +19,15 @@ package org.apache.maven.surefire.booter
  * under the License.
  */
 
-import org.apache.maven.surefire.util.NestedCheckedException;
 
-/**
- * Encapsulates exceptions thrown during Surefire forking.
- *
- * @version $Id$
- */
-public class SurefireBooterForkException
-    extends NestedCheckedException
-{
+import org.junit.Test;
 
-    public SurefireBooterForkException( String message, Throwable cause )
-    {
-        super( message, cause );
+public class Test1 extends BaseForkTimeout
+{
+    @Test
+    public void test690() {
+        dumpStuff(  "test690" );
+        System.out.println(" with lots of output ");
+        System.err.println( "e with lots of output ");
     }
-}
+}
\ No newline at end of file

Copied: maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test2.java (from r1075071, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test2.java?p2=maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test2.java&p1=maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java&r1=1075071&r2=1076367&rev=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test2.java Wed Mar  2 20:30:49 2011
@@ -1,5 +1,4 @@
-package org.apache.maven.surefire.booter;
-
+package forktimeout;
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -19,19 +18,13 @@ package org.apache.maven.surefire.booter
  * under the License.
  */
 
-import org.apache.maven.surefire.util.NestedCheckedException;
 
-/**
- * Encapsulates exceptions thrown during Surefire forking.
- *
- * @version $Id$
- */
-public class SurefireBooterForkException
-    extends NestedCheckedException
-{
+import org.junit.Test;
 
-    public SurefireBooterForkException( String message, Throwable cause )
-    {
-        super( message, cause );
+public class Test2 extends BaseForkTimeout
+{
+    @Test
+    public void test690_2() {
+        dumpStuff( "test690_2" );
     }
-}
+}
\ No newline at end of file

Copied: maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test3.java (from r1075071, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test3.java?p2=maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test3.java&p1=maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java&r1=1075071&r2=1076367&rev=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test3.java Wed Mar  2 20:30:49 2011
@@ -1,5 +1,4 @@
-package org.apache.maven.surefire.booter;
-
+package forktimeout;
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -19,19 +18,15 @@ package org.apache.maven.surefire.booter
  * under the License.
  */
 
-import org.apache.maven.surefire.util.NestedCheckedException;
 
-/**
- * Encapsulates exceptions thrown during Surefire forking.
- *
- * @version $Id$
- */
-public class SurefireBooterForkException
-    extends NestedCheckedException
+import org.junit.Test;
+
+public class Test3 extends BaseForkTimeout
 {
 
-    public SurefireBooterForkException( String message, Throwable cause )
-    {
-        super( message, cause );
+    @Test
+    public void test690_3() {
+        dumpStuff( "test690_3" );
     }
-}
+
+}
\ No newline at end of file

Copied: maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test4.java (from r1075071, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test4.java?p2=maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test4.java&p1=maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java&r1=1075071&r2=1076367&rev=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test4.java Wed Mar  2 20:30:49 2011
@@ -1,5 +1,4 @@
-package org.apache.maven.surefire.booter;
-
+package forktimeout;
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -19,19 +18,15 @@ package org.apache.maven.surefire.booter
  * under the License.
  */
 
-import org.apache.maven.surefire.util.NestedCheckedException;
 
-/**
- * Encapsulates exceptions thrown during Surefire forking.
- *
- * @version $Id$
- */
-public class SurefireBooterForkException
-    extends NestedCheckedException
-{
+import org.junit.Test;
 
-    public SurefireBooterForkException( String message, Throwable cause )
-    {
-        super( message, cause );
+public class Test4
+    extends BaseForkTimeout
+{
+    @Test
+    public void test690_4() {
+        dumpStuff( "test690_4" );
     }
-}
+
+}
\ No newline at end of file

Copied: maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test5.java (from r1075071, maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java)
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test5.java?p2=maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test5.java&p1=maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java&r1=1075071&r2=1076367&rev=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooterForkException.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/fork-timeout/src/test/java/forktimeout/Test5.java Wed Mar  2 20:30:49 2011
@@ -1,5 +1,4 @@
-package org.apache.maven.surefire.booter;
-
+package forktimeout;
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -19,19 +18,15 @@ package org.apache.maven.surefire.booter
  * under the License.
  */
 
-import org.apache.maven.surefire.util.NestedCheckedException;
 
-/**
- * Encapsulates exceptions thrown during Surefire forking.
- *
- * @version $Id$
- */
-public class SurefireBooterForkException
-    extends NestedCheckedException
-{
+import org.junit.Test;
 
-    public SurefireBooterForkException( String message, Throwable cause )
-    {
-        super( message, cause );
+public class Test5
+    extends BaseForkTimeout
+{
+    @Test
+    public void test690_5() {
+        dumpStuff( "test690_5" );
     }
-}
+
+}
\ No newline at end of file

Modified: maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-141-pluggableproviders/test-provider/src/main/java/org/apache/maven/surefire/testprovider/TestProvider.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-141-pluggableproviders/test-provider/src/main/java/org/apache/maven/surefire/testprovider/TestProvider.java?rev=1076367&r1=1076366&r2=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-141-pluggableproviders/test-provider/src/main/java/org/apache/maven/surefire/testprovider/TestProvider.java (original)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/surefire-141-pluggableproviders/test-provider/src/main/java/org/apache/maven/surefire/testprovider/TestProvider.java Wed Mar  2 20:30:49 2011
@@ -19,11 +19,10 @@ package org.apache.maven.surefire.testpr
  * under the License.
  */
 
+import org.apache.maven.surefire.providerapi.AbstractProvider;
 import org.apache.maven.surefire.providerapi.ProviderParameters;
-import org.apache.maven.surefire.providerapi.SurefireProvider;
 import org.apache.maven.surefire.report.ReporterException;
 import org.apache.maven.surefire.report.ReporterFactory;
-import org.apache.maven.surefire.report.ReporterManagerFactory;
 import org.apache.maven.surefire.suite.RunResult;
 import org.apache.maven.surefire.testset.TestSetFailedException;
 
@@ -32,8 +31,7 @@ import java.util.Iterator;
 /**
  * @author Kristian Rosenvold
  */
-public class TestProvider
-    implements SurefireProvider
+public class TestProvider  extends AbstractProvider
 {
     private final ReporterFactory reporterManagerFactory;
     private final ClassLoader testClassLoader;

Modified: maven/surefire/trunk/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java?rev=1076367&r1=1076366&r2=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java (original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junit/JUnit3Provider.java Wed Mar  2 20:30:49 2011
@@ -21,8 +21,8 @@ package org.apache.maven.surefire.junit;
 
 import org.apache.maven.surefire.common.junit3.JUnit3Reflector;
 import org.apache.maven.surefire.common.junit3.JUnit3TestChecker;
+import org.apache.maven.surefire.providerapi.AbstractProvider;
 import org.apache.maven.surefire.providerapi.ProviderParameters;
-import org.apache.maven.surefire.providerapi.SurefireProvider;
 import org.apache.maven.surefire.report.ReportEntry;
 import org.apache.maven.surefire.report.Reporter;
 import org.apache.maven.surefire.report.ReporterException;
@@ -39,8 +39,7 @@ import java.util.Iterator;
  * @author Kristian Rosenvold
  * @noinspection UnusedDeclaration
  */
-public class JUnit3Provider
-    implements SurefireProvider
+public class JUnit3Provider extends AbstractProvider
 {
     private final ReporterFactory reporterFactory;
 

Modified: maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java?rev=1076367&r1=1076366&r2=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java (original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java Wed Mar  2 20:30:49 2011
@@ -23,8 +23,8 @@ import org.apache.maven.surefire.Surefir
 import org.apache.maven.surefire.common.junit4.JUnit4RunListener;
 import org.apache.maven.surefire.common.junit4.JUnit4RunListenerFactory;
 import org.apache.maven.surefire.common.junit4.JUnit4TestChecker;
+import org.apache.maven.surefire.providerapi.AbstractProvider;
 import org.apache.maven.surefire.providerapi.ProviderParameters;
-import org.apache.maven.surefire.providerapi.SurefireProvider;
 import org.apache.maven.surefire.report.PojoStackTraceWriter;
 import org.apache.maven.surefire.report.ReportEntry;
 import org.apache.maven.surefire.report.Reporter;
@@ -36,20 +36,20 @@ import org.apache.maven.surefire.testset
 import org.apache.maven.surefire.util.DefaultDirectoryScanner;
 import org.apache.maven.surefire.util.DirectoryScanner;
 import org.apache.maven.surefire.util.TestsToRun;
-import org.junit.runner.notification.RunListener;
-import org.junit.runner.notification.RunNotifier;
 
 import java.util.Iterator;
 import java.util.List;
 import java.util.ResourceBundle;
 
+import org.junit.runner.notification.RunListener;
+import org.junit.runner.notification.RunNotifier;
+
 
 /**
  * @author Kristian Rosenvold
  */
 @SuppressWarnings( { "UnusedDeclaration" } )
-public class JUnit4Provider
-    implements SurefireProvider
+public class JUnit4Provider extends AbstractProvider
 {
 
     private static ResourceBundle bundle = ResourceBundle.getBundle( Surefire.SUREFIRE_BUNDLE_NAME );

Modified: maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java?rev=1076367&r1=1076366&r2=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java (original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreProvider.java Wed Mar  2 20:30:49 2011
@@ -21,6 +21,7 @@ package org.apache.maven.surefire.junitc
 
 import org.apache.maven.surefire.common.junit4.JUnit4RunListenerFactory;
 import org.apache.maven.surefire.common.junit4.JUnit4TestChecker;
+import org.apache.maven.surefire.providerapi.AbstractProvider;
 import org.apache.maven.surefire.providerapi.ProviderParameters;
 import org.apache.maven.surefire.providerapi.SurefireProvider;
 import org.apache.maven.surefire.report.Reporter;
@@ -32,19 +33,19 @@ import org.apache.maven.surefire.testset
 import org.apache.maven.surefire.util.DirectoryScanner;
 import org.apache.maven.surefire.util.ScannerFilter;
 import org.apache.maven.surefire.util.TestsToRun;
-import org.junit.runner.notification.RunListener;
 
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.junit.runner.notification.RunListener;
+
 /**
  * @author Kristian Rosenvold
  */
 @SuppressWarnings( { "UnusedDeclaration" } )
-public class JUnitCoreProvider
-    implements SurefireProvider
+public class JUnitCoreProvider extends AbstractProvider
 {
     private final ReporterFactory reporterFactory;
 

Modified: maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGProvider.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGProvider.java?rev=1076367&r1=1076366&r2=1076367&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGProvider.java (original)
+++ maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGProvider.java Wed Mar  2 20:30:49 2011
@@ -19,8 +19,8 @@ package org.apache.maven.surefire.testng
  * under the License.
  */
 
+import org.apache.maven.surefire.providerapi.AbstractProvider;
 import org.apache.maven.surefire.providerapi.ProviderParameters;
-import org.apache.maven.surefire.providerapi.SurefireProvider;
 import org.apache.maven.surefire.report.ReporterConfiguration;
 import org.apache.maven.surefire.report.ReporterException;
 import org.apache.maven.surefire.report.ReporterFactory;
@@ -43,8 +43,7 @@ import java.util.Properties;
  * @author Kristian Rosenvold
  * @noinspection UnusedDeclaration
  */
-public class TestNGProvider
-    implements SurefireProvider
+public class TestNGProvider extends AbstractProvider
 {
     private final Properties providerProperties;
 



Mime
View raw message