maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1076794 - in /maven/surefire/trunk: surefire-integration-tests/src/test/resources/surefire-141-pluggableproviders/test-provider/src/main/java/org/apache/maven/surefire/testprovider/ surefire-providers/surefire-junit3/src/main/java/org/apac...
Date Thu, 03 Mar 2011 21:06:34 GMT
Author: krosenvold
Date: Thu Mar  3 21:06:33 2011
New Revision: 1076794

URL: http://svn.apache.org/viewvc?rev=1076794&view=rev
Log:
[SUREFIRE-711] Added closing of reportermanager upon scanning of classpath to avoid memory
leak

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
    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-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConcurrentReporterManagerTest.java
    maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/MavenSurefireJUnit47RunnerTestCase.java
    maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGProvider.java

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=1076794&r1=1076793&r2=1076794&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
Thu Mar  3 21:06:33 2011
@@ -50,6 +50,7 @@ public class TestProvider  extends Abstr
 
     public Iterator getSuites()
     {
+
         return null;
     }
 

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=1076794&r1=1076793&r2=1076794&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
Thu Mar  3 21:06:33 2011
@@ -115,6 +115,10 @@ public class JUnit3Provider extends Abst
     public Iterator getSuites()
     {
         testsToRun = scanClassPath();
+        // Added to free the streams when scanning the classpath.
+        // It is essentially wrong that the capture of stdout is embedded within the reporter
manager,
+        // which will change for 2.8.1+
+        reporterFactory.close();
         return testsToRun.iterator();
     }
 

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=1076794&r1=1076793&r2=1076794&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
Thu Mar  3 21:06:33 2011
@@ -159,6 +159,11 @@ public class JUnit4Provider extends Abst
     public Iterator getSuites()
     {
         testsToRun = scanClassPath();
+        // Added to free the streams when scanning the classpath.
+        // It is essentially wrong that the capture of stdout is embedded within the reporter
manager,
+        // which will change for 2.8.1+
+        reporterFactory.close();
+
         return testsToRun.iterator();
     }
 

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=1076794&r1=1076793&r2=1076794&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
Thu Mar  3 21:06:33 2011
@@ -84,6 +84,11 @@ public class JUnitCoreProvider extends A
     public Iterator getSuites()
     {
         testsToRun = scanClassPath();
+        // Added to free the streams when scanning the classpath.
+        // It is essentially wrong that the capture of stdout is embedded within the reporter
manager,
+        // which will change for 2.8.1+
+        reporterFactory.close();
+
         return testsToRun.iterator();
     }
 

Modified: maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConcurrentReporterManagerTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConcurrentReporterManagerTest.java?rev=1076794&r1=1076793&r2=1076794&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConcurrentReporterManagerTest.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConcurrentReporterManagerTest.java
Thu Mar  3 21:06:33 2011
@@ -198,6 +198,7 @@ public class ConcurrentReporterManagerTe
         Computer computer = new Computer();
 
         jUnitCore.run( computer, classes );
+        reporterManagerFactory.close();
         return reporterManagerFactory.getGlobalRunStatistics();
     }
 

Modified: maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/MavenSurefireJUnit47RunnerTestCase.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/MavenSurefireJUnit47RunnerTestCase.java?rev=1076794&r1=1076793&r2=1076794&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/MavenSurefireJUnit47RunnerTestCase.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/MavenSurefireJUnit47RunnerTestCase.java
Thu Mar  3 21:06:33 2011
@@ -151,6 +151,8 @@ public class MavenSurefireJUnit47RunnerT
 
         Assert.assertEquals( "The exception thrown by the failing TestCase", RuntimeException.class,
                              result.getFailures().get( 0 ).getException().getClass() );
+
+        reporterManagerFactory.close();
     }
 
     private ReporterConfiguration getReporterConfiguration()

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=1076794&r1=1076793&r2=1076794&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
Thu Mar  3 21:06:33 2011
@@ -43,7 +43,8 @@ import java.util.Properties;
  * @author Kristian Rosenvold
  * @noinspection UnusedDeclaration
  */
-public class TestNGProvider extends AbstractProvider
+public class TestNGProvider
+    extends AbstractProvider
 {
     private final Properties providerProperties;
 
@@ -128,7 +129,8 @@ public class TestNGProvider extends Abst
                                              new ArrayList( directoryScannerParameters.getExcludes()
),
                                              testRequest.getTestSourceDirectory().toString(),
                                              testArtifactInfo.getVersion(), providerProperties,
-                                             reporterConfiguration.getReportsDirectory(),
testRequest.getRequestedTestMethod() );
+                                             reporterConfiguration.getReportsDirectory(),
+                                             testRequest.getRequestedTestMethod() );
     }
 
     private TestNGXmlTestSuite getXmlSuite()
@@ -145,6 +147,11 @@ public class TestNGProvider extends Abst
         {
             try
             {
+                // Added to free the streams when scanning the classpath.
+                // It is essentially wrong that the capture of stdout is embedded within
the reporter manager,
+                // which will change for 2.8.1+
+                reporterFactory.close();
+
                 return getXmlSuite().locateTestSets( testClassLoader ).keySet().iterator();
             }
             catch ( TestSetFailedException e )
@@ -155,6 +162,11 @@ public class TestNGProvider extends Abst
         else
         {
             testsToRun = scanClassPath();
+            // Added to free the streams when scanning the classpath.
+            // It is essentially wrong that the capture of stdout is embedded within the
reporter manager,
+            // which will change for 2.8.1+
+            reporterFactory.close();
+
             return testsToRun.iterator();
         }
     }



Mime
View raw message