maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dfabul...@apache.org
Subject svn commit: r597783 - in /maven/surefire/trunk: maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/ surefire-integration-tests/src/test/resources/additional-classpath/ surefire-integration-tests/src/test/resources/additional-classpath...
Date Sat, 24 Nov 2007 02:00:33 GMT
Author: dfabulich
Date: Fri Nov 23 18:00:31 2007
New Revision: 597783

URL: http://svn.apache.org/viewvc?rev=597783&view=rev
Log:
[SUREFIRE-118] [SUREFIRE-180] additionalClasspathElements patch.  Submitted by: David J. M.
Karlsen

Added:
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/
  (with props)
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/extraResource/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/extraResource/test.txt
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/pom.xml
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/src/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/src/test/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/src/test/java/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/src/test/java/additionalClasspath/
    maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/src/test/java/additionalClasspath/BasicTest.java
Modified:
    maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java

Modified: maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java?rev=597783&r1=597782&r2=597783&view=diff
==============================================================================
--- maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
(original)
+++ maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java
Fri Nov 23 18:00:31 2007
@@ -138,6 +138,13 @@
     private List classpathElements;
 
     /**
+     * Additional elements to be appended to the classpath.
+     * 
+     * @parameter
+     */
+    private List additionalClasspathElements;
+    
+    /**
      * Base directory where all reports are written to.
      * 
      * @parameter expression="${project.build.directory}/surefire-reports"
@@ -711,6 +718,18 @@
             surefireBooter.addClassPathUrl( classpathElement );
         }
 
+        if ( additionalClasspathElements != null )
+        {
+            for ( Iterator i = additionalClasspathElements.iterator(); i.hasNext(); )
+            {
+                String classpathElement = (String) i.next();
+    
+                getLog().debug( "  " + classpathElement );
+    
+                surefireBooter.addClassPathUrl( classpathElement );
+            }
+        }
+        
         // ----------------------------------------------------------------------
         // Forking
         // ----------------------------------------------------------------------

Propchange: maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Nov 23 18:00:31 2007
@@ -0,0 +1,5 @@
+.classpath
+.project
+target
+.settings
+log.txt

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/extraResource/test.txt
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/extraResource/test.txt?rev=597783&view=auto
==============================================================================
    (empty)

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/pom.xml
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/pom.xml?rev=597783&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/pom.xml
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/pom.xml
Fri Nov 23 18:00:31 2007
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<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>additional-classpath</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <name>Test for additionalClasspathElements</name>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <additionalClasspathElements>
+            <additionalClasspathElement>${basedir}/extraResource</additionalClasspathElement>
+          </additionalClasspathElements>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+</project>

Added: maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/src/test/java/additionalClasspath/BasicTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/src/test/java/additionalClasspath/BasicTest.java?rev=597783&view=auto
==============================================================================
--- maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/src/test/java/additionalClasspath/BasicTest.java
(added)
+++ maven/surefire/trunk/surefire-integration-tests/src/test/resources/additional-classpath/src/test/java/additionalClasspath/BasicTest.java
Fri Nov 23 18:00:31 2007
@@ -0,0 +1,13 @@
+package additionalClasspath;
+
+import junit.framework.TestCase;
+
+public class BasicTest
+    extends TestCase
+{
+
+    public void testExtraResource() {
+        assertNotNull(BasicTest.class.getResourceAsStream("/test.txt"));
+    }
+
+}



Mime
View raw message