maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1042246 [2/2] - in /maven/surefire/trunk: maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/ maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/ maven-surefire-common/src/main/java/org/apache/maven/plug...
Date Sat, 04 Dec 2010 22:16:47 GMT
Modified: maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreParameters.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreParameters.java?rev=1042246&r1=1042245&r2=1042246&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreParameters.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/JUnitCoreParameters.java
Sat Dec  4 22:16:45 2010
@@ -25,7 +25,6 @@ import java.util.Properties;
  */
 class JUnitCoreParameters
 {
-
     private final String parallel;
 
     private final Boolean perCoreThreadCount;

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=1042246&r1=1042245&r2=1042246&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
Sat Dec  4 22:16:45 2010
@@ -19,6 +19,7 @@ package org.apache.maven.surefire.junitc
  * under the License.
  */
 
+import org.apache.maven.surefire.providerapi.BooterParameters;
 import org.apache.maven.surefire.providerapi.SurefireProvider;
 import org.apache.maven.surefire.report.ReporterException;
 import org.apache.maven.surefire.report.ReporterManagerFactory;
@@ -43,15 +44,15 @@ public class JUnitCoreProvider
     private final DirectoryScanner directoryScanner;
 
 
-    public JUnitCoreProvider( Properties providerProperties, ReporterManagerFactory reporterManagerFactory,
-                              ClassLoader testClassLoader, DirectoryScanner directoryScanner
)
+    public JUnitCoreProvider( BooterParameters booterParameters )
     {
-        this.providerProperties = providerProperties;
-        this.reporterManagerFactory = reporterManagerFactory;
-        this.testClassLoader = testClassLoader;
-        this.directoryScanner = directoryScanner;
+        this.reporterManagerFactory = booterParameters.getReporterManagerFactory();
+        this.testClassLoader = booterParameters.getTestClassLoader();
+        this.directoryScanner = booterParameters.getDirectoryScanner();
+        this.providerProperties = booterParameters.getProviderProperties();
     }
 
+
     @SuppressWarnings( { "UnnecessaryUnboxing" } )
     public RunResult invoke( Object forkTestSet )
         throws TestSetFailedException, ReporterException
@@ -88,4 +89,10 @@ public class JUnitCoreProvider
     {
         return getSuite().locateTestSetsImpl( testClassLoader ).entrySet().iterator();
     }
+
+    public Boolean isRunnable()
+    {
+        return Boolean.TRUE;
+    }
+
 }

Added: maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/resources/META-INF/services/org.apache.maven.surefire.providerapi.SurefireProvider
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/resources/META-INF/services/org.apache.maven.surefire.providerapi.SurefireProvider?rev=1042246&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/resources/META-INF/services/org.apache.maven.surefire.providerapi.SurefireProvider
(added)
+++ maven/surefire/trunk/surefire-providers/surefire-junit47/src/main/resources/META-INF/services/org.apache.maven.surefire.providerapi.SurefireProvider
Sat Dec  4 22:16:45 2010
@@ -0,0 +1 @@
+org.apache.maven.surefire.junitcore.JUnitCoreProvider

Added: maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/SpiTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/SpiTest.java?rev=1042246&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/SpiTest.java
(added)
+++ maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/SpiTest.java
Sat Dec  4 22:16:45 2010
@@ -0,0 +1,25 @@
+package org.apache.maven.surefire.junitcore;
+
+import org.apache.maven.surefire.booter.ProviderDetector;
+import org.apache.maven.surefire.providerapi.ProviderFactory;
+import org.junit.Test;
+
+import java.io.IOException;
+
+import static junit.framework.Assert.assertNotNull;
+
+/**
+ * @author Kristian Rosenvold
+ */
+public class SpiTest
+{
+    @Test
+    public void detectionOfProvider()
+        throws IOException
+    {
+        ProviderDetector providerDetector = new ProviderDetector();
+        final Object[] objects =
+            ProviderDetector.loadServices( ProviderFactory.class, this.getClass().getClassLoader()
);
+        assertNotNull( objects);
+    }
+}

Propchange: maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/SpiTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/surefire/trunk/surefire-providers/surefire-testng/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-testng/pom.xml?rev=1042246&r1=1042245&r2=1042246&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-testng/pom.xml (original)
+++ maven/surefire/trunk/surefire-providers/surefire-testng/pom.xml Sat Dec  4 22:16:45 2010
@@ -46,6 +46,13 @@
   </dependencies>
 
   <build>
+    <resources>
+      <resource>
+        <directory>src/main/resources/META-INF</directory>
+        <targetPath>META-INF</targetPath>
+      </resource>
+    </resources>
+
     <plugins>
       <plugin>
         <artifactId>maven-compiler-plugin</artifactId>

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=1042246&r1=1042245&r2=1042246&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
Sat Dec  4 22:16:45 2010
@@ -19,6 +19,7 @@ package org.apache.maven.surefire.testng
  * under the License.
  */
 
+import org.apache.maven.surefire.providerapi.BooterParameters;
 import org.apache.maven.surefire.providerapi.SurefireProvider;
 import org.apache.maven.surefire.report.ReporterConfiguration;
 import org.apache.maven.surefire.report.ReporterException;
@@ -43,11 +44,11 @@ import java.util.Properties;
 public class TestNGProvider
     implements SurefireProvider
 {
-    private Properties providerProperties;
+    private final Properties providerProperties;
 
-    private TestArtifactInfo testArtifactInfo;
+    private final TestArtifactInfo testArtifactInfo;
 
-    private ReporterConfiguration reporterConfiguration;
+    private final ReporterConfiguration reporterConfiguration;
 
     private final ReporterManagerFactory reporterManagerFactory;
 
@@ -59,19 +60,21 @@ public class TestNGProvider
 
     private final File basedir;
 
-    public TestNGProvider( Properties providerProperties, TestArtifactInfo testArtifactInfo,
-                           ReporterConfiguration reporterConfiguration, ReporterManagerFactory
reporterManagerFactory,
-                           ClassLoader testClassLoader, DirectoryScannerParameters directoryScannerParameters,
-                           DirectoryScanner directoryScanner, TestRequest testRequest, File
basedir )
-    {
-        this.providerProperties = providerProperties;
-        this.testArtifactInfo = testArtifactInfo;
-        this.reporterConfiguration = reporterConfiguration;
-        this.reporterManagerFactory = reporterManagerFactory;
-        this.testClassLoader = testClassLoader;
-        this.directoryScannerParameters = directoryScannerParameters;
-        this.testRequest = testRequest;
-        this.basedir = basedir;
+    public TestNGProvider( BooterParameters booterParameters )
+    {
+        this.reporterManagerFactory = booterParameters.getReporterManagerFactory();
+        this.testClassLoader = booterParameters.getTestClassLoader();
+        this.directoryScannerParameters = booterParameters.getDirectoryScannerParameters();
+        this.providerProperties = booterParameters.getProviderProperties();
+        this.testRequest = booterParameters.getTestRequest();
+        basedir = directoryScannerParameters != null ? directoryScannerParameters.getTestClassesDirectory()
: null;
+        testArtifactInfo = booterParameters.getTestArtifactInfo();
+        reporterConfiguration = booterParameters.getReporterConfiguration();
+    }
+
+    public Boolean isRunnable()
+    {
+        return Boolean.TRUE;
     }
 
     public RunResult invoke( Object forkTestSet )

Added: maven/surefire/trunk/surefire-providers/surefire-testng/src/main/resources/META-INF/services/org.apache.maven.surefire.providerapi.SurefireProvider
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-testng/src/main/resources/META-INF/services/org.apache.maven.surefire.providerapi.SurefireProvider?rev=1042246&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-testng/src/main/resources/META-INF/services/org.apache.maven.surefire.providerapi.SurefireProvider
(added)
+++ maven/surefire/trunk/surefire-providers/surefire-testng/src/main/resources/META-INF/services/org.apache.maven.surefire.providerapi.SurefireProvider
Sat Dec  4 22:16:45 2010
@@ -0,0 +1 @@
+org.apache.maven.surefire.testng.TestNGProvider



Mime
View raw message