Author: brett
Date: Wed Mar  1 08:15:30 2006
New Revision: 382071

URL: http://svn.apache.org/viewcvs?rev=382071&view=rev
Log:
[MSUREFIRE-23] continue towards getting test ng working. This is not the right 
location to run the suites from, but its a start

Modified:
    maven/plugins/branches/maven-surefire-plugin-testng/pom.xml
    
maven/plugins/branches/maven-surefire-plugin-testng/src/main/java/org/apache/maven/test/SurefirePlugin.java

Modified: maven/plugins/branches/maven-surefire-plugin-testng/pom.xml
URL: 
http://svn.apache.org/viewcvs/maven/plugins/branches/maven-surefire-plugin-testng/pom.xml?rev=382071&r1=382070&r2=382071&view=diff
==============================================================================
--- maven/plugins/branches/maven-surefire-plugin-testng/pom.xml (original)
+++ maven/plugins/branches/maven-surefire-plugin-testng/pom.xml Wed Mar  1 
08:15:30 2006
@@ -1,4 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?><project>
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
   <parent>
     <artifactId>maven-plugin-parent</artifactId>
     <groupId>org.apache.maven.plugins</groupId>
@@ -14,12 +15,25 @@
       <name>Joakim Erdfelt</name>
       <email>[EMAIL PROTECTED]</email>
     </contributor>
-  </contributors> 
+  </contributors>
   <dependencies>
+    <!-- temporary -->
+    <dependency>
+      <groupId>org.apache.maven.surefire</groupId>
+      <artifactId>surefire-testng</artifactId>
+      <version>2.0-SNAPSHOT</version>
+    </dependency>
     <dependency>
       <groupId>org.apache.maven.surefire</groupId>
       <artifactId>surefire-booter</artifactId>
       <version>2.0-SNAPSHOT</version>
+    </dependency>
+    <!-- required because it isn't listed in plugin.artifacts -->
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+      <version>1.1</version>
+      <scope>runtime</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>

Modified: 
maven/plugins/branches/maven-surefire-plugin-testng/src/main/java/org/apache/maven/test/SurefirePlugin.java
URL: 
http://svn.apache.org/viewcvs/maven/plugins/branches/maven-surefire-plugin-testng/src/main/java/org/apache/maven/test/SurefirePlugin.java?rev=382071&r1=382070&r2=382071&view=diff
==============================================================================
--- 
maven/plugins/branches/maven-surefire-plugin-testng/src/main/java/org/apache/maven/test/SurefirePlugin.java
 (original)
+++ 
maven/plugins/branches/maven-surefire-plugin-testng/src/main/java/org/apache/maven/test/SurefirePlugin.java
 Wed Mar  1 08:15:30 2006
@@ -53,14 +53,6 @@
     private boolean skip;
 
     /**
-     * Set this to 'true' to force all tests to be run using TestNG. This 
should be safe to do in almost all
-     * circumstances as TestNG is capable of running JUnit and TestNG tests.
-     *
-     * @parameter expression="${maven.test.forcetestng}"
-     */
-    private boolean forceTestNG;
-
-    /**
      * Set this to true to ignore a failure during testing. Its use is NOT 
RECOMMENDED, but quite convenient on occasion.
      *
      * @parameter expression="${maven.test.failure.ignore}"
@@ -237,7 +229,7 @@
     private boolean childDelegation;
 
     /**
-     * TestNG included groups for this test. Only classes/methods/etc 
decorated with one of the
+     * Groups for this test. Only classes/methods/etc decorated with one of the
      * groups specified here will be included in test run, if specified.
      *
      * @parameter expression="${groups}"
@@ -245,7 +237,7 @@
     private String groups;
 
     /**
-     * TestNG excluded groups. Any methods/classes/etc with one of the groups 
specified in this
+     * Excluded groups. Any methods/classes/etc with one of the groups 
specified in this
      * list will specifically not be run.
      *
      * @parameter expression="${excludedGroups}"
@@ -258,6 +250,7 @@
      * any other parameters, like include/exclude useless.
      *
      * @parameter
+     * @todo do we want this? should they be discovered?
      */
     private List suiteXmlFiles;
 
@@ -303,8 +296,6 @@
 
         SurefireBooter surefireBooter = new SurefireBooter();
 
-        surefireBooter.setForceTestNG( forceTestNG );
-
         surefireBooter.setGroups( groups );
 
         surefireBooter.setExcludedGroups( excludedGroups );
@@ -403,12 +394,6 @@
             surefireBooter.addClassPathUrl( classpathElement );
         }
 
-        boolean jvm15 = false;
-        if ( System.getProperty( "java.version" ).indexOf( "1.5" ) > -1 )
-        {
-            jvm15 = true;
-        }
-
         for ( Iterator i = pluginArtifacts.iterator(); i.hasNext(); )
         {
             Artifact artifact = (Artifact) i.next();
@@ -416,11 +401,9 @@
             // TODO: this is crude for now. We really want to get 
"surefire-booter" and all its dependencies, but the
             // artifacts don't keep track of their children. We could just 
throw all of them in, but that would add an
             // unnecessary maven-artifact dependency which is precisely the 
reason we are isolating the classloader
-            if ( "junit".equals( artifact.getArtifactId() ) || 
"surefire-api".equals( artifact.getArtifactId() ) ||
-                "surefire-booter".equals( artifact.getArtifactId() ) ||
-                "plexus-utils".equals( artifact.getArtifactId() ) ||
-                ( "testng-jdk14".equals( artifact.getArtifactId() ) && !jvm15 
) ||
-                ( "testng-jdk15".equals( artifact.getArtifactId() ) && jvm15 ) 
)
+            if ( "junit".equals( artifact.getArtifactId() ) || 
"org.testng".equals( artifact.getGroupId() ) ||
+                "org.apache.maven.surefire".equals( artifact.getGroupId() ) ||
+                "plexus-utils".equals( artifact.getArtifactId() ) )
             {
                 getLog().debug( "Adding to surefire test classpath: " + 
artifact.getFile().getAbsolutePath() );
 


Reply via email to