maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1054767 - in /maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng: TestNGDirectoryTestSuite.java TestNGExecutor.java TestNGProvider.java TestNGXmlTestSuite.java
Date Mon, 03 Jan 2011 21:32:06 GMT
Author: krosenvold
Date: Mon Jan  3 21:32:05 2011
New Revision: 1054767

URL: http://svn.apache.org/viewvc?rev=1054767&view=rev
Log:
o Removed unused classifier attribute

Modified:
    maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGDirectoryTestSuite.java
    maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java
    maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGProvider.java
    maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGXmlTestSuite.java

Modified: maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGDirectoryTestSuite.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGDirectoryTestSuite.java?rev=1054767&r1=1054766&r2=1054767&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGDirectoryTestSuite.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGDirectoryTestSuite.java
Mon Jan  3 21:32:05 2011
@@ -59,8 +59,6 @@ public class TestNGDirectoryTestSuite
 
     private ArtifactVersion version;
 
-    private String classifier;
-
     private Map options;
 
     private String testSourceDirectory;
@@ -72,16 +70,14 @@ public class TestNGDirectoryTestSuite
     private final DirectoryScanner surefireDirectoryScanner;
 
     public TestNGDirectoryTestSuite( File basedir, ArrayList includes, ArrayList excludes,
String testSourceDirectory,
-                                     String artifactVersion, String artifactClassifier, Properties
confOptions,
-                                     File reportsDirectory )
+                                     String artifactVersion, Properties confOptions, File
reportsDirectory )
     {
         this( basedir, includes, excludes, testSourceDirectory, new DefaultArtifactVersion(
artifactVersion ),
-              artifactClassifier, confOptions, reportsDirectory );
+              confOptions, reportsDirectory );
     }
 
     public TestNGDirectoryTestSuite( File basedir, List includes, List excludes, String testSourceDirectory,
-                                     ArtifactVersion artifactVersion, String artifactClassifier,
Map confOptions,
-                                     File reportsDirectory )
+                                     ArtifactVersion artifactVersion, Map confOptions, File
reportsDirectory )
     {
         this.surefireDirectoryScanner = new DefaultDirectoryScanner( basedir, includes, excludes,
                                                                      "filesystem" );
@@ -92,8 +88,6 @@ public class TestNGDirectoryTestSuite
         this.reportsDirectory = reportsDirectory;
         this.version = artifactVersion;
 
-        this.classifier = artifactClassifier;
-
     }
 
     public void execute( TestsToRun testsToRun, ReporterFactory reporterManagerFactory )
@@ -115,7 +109,7 @@ public class TestNGDirectoryTestSuite
         startTestSuite( reporterManager, this );
 
         TestNGExecutor.run( new Class[]{ (Class) testsToRun.iterator().next() }, this.testSourceDirectory,
this.options,
-                            this.version, this.classifier, reporterManager, this, reportsDirectory
);
+                            this.version, reporterManager, this, reportsDirectory );
 
         finishTestSuite( reporterManager, this );
     }
@@ -162,8 +156,7 @@ public class TestNGDirectoryTestSuite
 
         Class[] testClasses = (Class[]) testNgTestClasses.toArray( new Class[testNgTestClasses.size()]
);
 
-        TestNGExecutor.run( testClasses, this.testSourceDirectory, this.options, this.version,
this.classifier,
-                            reporterManager, this, testNgReportsDirectory );
+        TestNGExecutor.run( testClasses, this.testSourceDirectory, this.options, this.version,
reporterManager, this, testNgReportsDirectory );
 
         if ( junitTestClasses.size() > 0 )
         {
@@ -178,8 +171,7 @@ public class TestNGDirectoryTestSuite
 
             junitOptions.put( "junit", Boolean.TRUE );
 
-            TestNGExecutor.run( testClasses, this.testSourceDirectory, junitOptions, this.version,
this.classifier,
-                                reporterManager, this, junitReportsDirectory );
+            TestNGExecutor.run( testClasses, this.testSourceDirectory, junitOptions, this.version,
reporterManager, this, junitReportsDirectory );
         }
 
         finishTestSuite( reporterManager, this );
@@ -204,7 +196,7 @@ public class TestNGDirectoryTestSuite
         startTestSuite( reporterManager, this );
 
         TestNGExecutor.run( new Class[]{ testSet.getTestClass() }, this.testSourceDirectory,
this.options, this.version,
-                            this.classifier, reporterManager, this, reportsDirectory );
+                            reporterManager, this, reportsDirectory );
 
         finishTestSuite( reporterManager, this );
     }

Modified: maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java?rev=1054767&r1=1054766&r2=1054767&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGExecutor.java
Mon Jan  3 21:32:05 2011
@@ -28,7 +28,6 @@ import org.apache.maven.surefire.testng.
 import org.apache.maven.surefire.testng.conf.TestNG52Configurator;
 import org.apache.maven.surefire.testng.conf.TestNGMapConfigurator;
 import org.apache.maven.surefire.testset.TestSetFailedException;
-import org.testng.IReporter;
 import org.testng.TestNG;
 
 import java.io.File;
@@ -49,27 +48,25 @@ public class TestNGExecutor
     }
 
     public static void run( Class[] testClasses, String testSourceDirectory, Map options,
ArtifactVersion version,
-                            String classifier, ReporterManager reportManager, TestNgTestSuite
suite,
-                            File reportsDirectory )
+                            ReporterManager reportManager, TestNgTestSuite suite, File reportsDirectory
)
         throws TestSetFailedException
     {
         TestNG testng = new TestNG( true );
         Configurator configurator = getConfigurator( version );
         configurator.configure( testng, options );
-        postConfigure( testng, testSourceDirectory, classifier, reportManager, suite, reportsDirectory
);
+        postConfigure( testng, testSourceDirectory, reportManager, suite, reportsDirectory
);
         testng.setTestClasses( testClasses );
         testng.run();
     }
 
     public static void run( List suiteFiles, String testSourceDirectory, Map options, ArtifactVersion
version,
-                            String classifier, ReporterManager reportManager, TestNgTestSuite
suite,
-                            File reportsDirectory )
+                            ReporterManager reportManager, TestNgTestSuite suite, File reportsDirectory
)
         throws TestSetFailedException
     {
         TestNG testng = new TestNG( true );
         Configurator configurator = getConfigurator( version );
         configurator.configure( testng, options );
-        postConfigure( testng, testSourceDirectory, classifier, reportManager, suite, reportsDirectory
);
+        postConfigure( testng, testSourceDirectory, reportManager, suite, reportsDirectory
);
         testng.setTestSuites( suiteFiles );
         testng.run();
     }
@@ -104,8 +101,7 @@ public class TestNGExecutor
     }
 
 
-    private static void postConfigure( TestNG testNG, String sourcePath, String classifier,
-                                       ReporterManager reportManager, TestNgTestSuite suite,
File reportsDirectory )
+    private static void postConfigure( TestNG testNG, String sourcePath, ReporterManager
reportManager, TestNgTestSuite suite, File reportsDirectory )
         throws TestSetFailedException
     {
         // turn off all TestNG output
@@ -146,21 +142,4 @@ public class TestNGExecutor
             return new TestNGReporter( reportManager );
         }
     }
-
-    private static void attachNonStandardReporter( TestNG testNG, String className )
-    {
-        try
-        {
-            Class c = Class.forName( className );
-            if ( IReporter.class.isAssignableFrom( c ) )
-            {
-                testNG.addListener( c.newInstance() );
-            }
-        }
-        catch ( Exception e )
-        {
-            // ignore
-        }
-    }
-
 }

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=1054767&r1=1054766&r2=1054767&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
Mon Jan  3 21:32:05 2011
@@ -116,8 +116,8 @@ public class TestNGProvider
 
     boolean isTestNGXmlTestSuite( TestRequest testSuiteDefinition )
     {
-        return testSuiteDefinition.getSuiteXmlFiles() != null && testSuiteDefinition.getSuiteXmlFiles().size()
> 0 &&
-            testSuiteDefinition.getRequestedTest() == null;
+        return testSuiteDefinition.getSuiteXmlFiles() != null && testSuiteDefinition.getSuiteXmlFiles().size()
> 0
+            && testSuiteDefinition.getRequestedTest() == null;
 
     }
 
@@ -127,15 +127,15 @@ public class TestNGProvider
         return new TestNGDirectoryTestSuite( basedir, new ArrayList( directoryScannerParameters.getIncludes()
),
                                              new ArrayList( directoryScannerParameters.getExcludes()
),
                                              testRequest.getTestSourceDirectory().toString(),
-                                             testArtifactInfo.getVersion(), testArtifactInfo.getClassifier(),
-                                             providerProperties, reporterConfiguration.getReportsDirectory()
);
+                                             testArtifactInfo.getVersion(), providerProperties,
+                                             reporterConfiguration.getReportsDirectory()
);
     }
 
     private TestNGXmlTestSuite getXmlSuite()
     {
         return new TestNGXmlTestSuite( testRequest.getSuiteXmlFiles(), testRequest.getTestSourceDirectory().toString(),
-                                       testArtifactInfo.getVersion(), testArtifactInfo.getClassifier(),
-                                       providerProperties, reporterConfiguration.getReportsDirectory()
);
+                                       testArtifactInfo.getVersion(), providerProperties,
+                                       reporterConfiguration.getReportsDirectory() );
     }
 
 

Modified: maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGXmlTestSuite.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGXmlTestSuite.java?rev=1054767&r1=1054766&r2=1054767&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGXmlTestSuite.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGXmlTestSuite.java
Mon Jan  3 21:32:05 2011
@@ -19,6 +19,13 @@ package org.apache.maven.surefire.testng
  * under the License.
  */
 
+import org.apache.maven.artifact.versioning.ArtifactVersion;
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
+import org.apache.maven.surefire.report.ReporterException;
+import org.apache.maven.surefire.report.ReporterManager;
+import org.apache.maven.surefire.report.ReporterManagerFactory;
+import org.apache.maven.surefire.testset.TestSetFailedException;
+
 import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -27,13 +34,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
-import org.apache.maven.artifact.versioning.ArtifactVersion;
-import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
-import org.apache.maven.surefire.report.ReporterException;
-import org.apache.maven.surefire.report.ReporterManager;
-import org.apache.maven.surefire.report.ReporterManagerFactory;
-import org.apache.maven.surefire.testset.TestSetFailedException;
-
 /**
  * Handles suite xml file definitions for TestNG.
  *
@@ -51,8 +51,6 @@ public class TestNGXmlTestSuite
 
     private ArtifactVersion version;
 
-    private String classifier;
-
     private Map options;
 
     private File reportsDirectory;
@@ -65,18 +63,16 @@ public class TestNGXmlTestSuite
      * xml file(s). The XML files are suite definitions files according to TestNG DTD.
      */
     public TestNGXmlTestSuite( List suiteFiles, String testSourceDirectory, String artifactVersion,
-                               String artifactClassifier, Properties confOptions, File reportsDirectory
)
+                               Properties confOptions, File reportsDirectory )
     {
         this.suiteFiles = suiteFiles;
 
         this.options = confOptions;
-        
-        this.version = new DefaultArtifactVersion( artifactVersion );
 
-        this.classifier = artifactClassifier;
+        this.version = new DefaultArtifactVersion( artifactVersion );
 
         this.testSourceDirectory = testSourceDirectory;
-        
+
         this.reportsDirectory = reportsDirectory;
     }
 
@@ -90,8 +86,8 @@ public class TestNGXmlTestSuite
         ReporterManager reporterManager =
             new SynchronizedReporterManager( reporterManagerFactory.createReporterManager()
);
         TestNGDirectoryTestSuite.startTestSuite( reporterManager, this );
-        TestNGExecutor.run( this.suiteFilePaths, this.testSourceDirectory, this.options,
this.version, 
-                            this.classifier, reporterManager, this, reportsDirectory );
+        TestNGExecutor.run( this.suiteFilePaths, this.testSourceDirectory, this.options,
this.version, reporterManager,
+                            this, reportsDirectory );
         TestNGDirectoryTestSuite.finishTestSuite( reporterManager, this );
     }
 
@@ -130,7 +126,7 @@ public class TestNGXmlTestSuite
 
         return this.testSets;
     }
-    
+
     public String getSuiteName()
     {
         String result = (String) options.get( "suitename" );



Mime
View raw message