Try to run some tests with Surefire

Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/eea99444
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/eea99444
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/eea99444

Branch: refs/heads/master
Commit: eea994440f5e530f2e8f8cda4ba828e9da2b31b8
Parents: d8d00ba
Author: Gintas Grigelionis <gin...@apache.org>
Authored: Sat Oct 20 09:04:14 2018 +0200
Committer: Gintas Grigelionis <gin...@apache.org>
Committed: Sat Oct 20 09:04:14 2018 +0200

----------------------------------------------------------------------
 src/etc/poms/ant-antlr/pom.xml                  | 14 +++++++++++-
 src/etc/poms/ant-apache-regexp/pom.xml          |  5 ++++-
 src/etc/poms/ant-commons-net/pom.xml            | 11 +++++++++-
 src/etc/poms/ant-imageio/pom.xml                | 14 +++++++++++-
 src/etc/poms/ant-jai/pom.xml                    | 23 +++++++++++++++-----
 src/etc/poms/ant-jdepend/pom.xml                | 14 +++++++++++-
 src/etc/poms/ant-jsch/pom.xml                   | 16 +++++++++++++-
 src/etc/poms/ant-junit/pom.xml                  | 11 +++++++++-
 src/etc/poms/ant-junitlauncher/pom.xml          |  9 ++++++++
 src/etc/poms/ant/pom.xml                        |  2 ++
 .../ant/taskdefs/optional/ssh/ScpTest.java      |  4 ++++
 11 files changed, 110 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/eea99444/src/etc/poms/ant-antlr/pom.xml
----------------------------------------------------------------------
diff --git a/src/etc/poms/ant-antlr/pom.xml b/src/etc/poms/ant-antlr/pom.xml
index dd3d72a..783b15d 100644
--- a/src/etc/poms/ant-antlr/pom.xml
+++ b/src/etc/poms/ant-antlr/pom.xml
@@ -62,11 +62,23 @@
           <includes>
             <include>org/apache/tools/ant/taskdefs/optional/ANTLR*</include>
           </includes>
+          <testIncludes>
+            <include>org/apache/tools/ant/taskdefs/optional/ANTLR*</include>
+          </testIncludes>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <basedir>../../../..</basedir>
+          <workingDirectory>../../../..</workingDirectory>
+          <skipTests>true</skipTests>
         </configuration>
       </plugin>
     </plugins>
     <sourceDirectory>../../../../src/main</sourceDirectory>
-    <testSourceDirectory>../../../../src/testcases</testSourceDirectory>
+    <testSourceDirectory>../../../../src/tests/junit</testSourceDirectory>
     
<outputDirectory>../../../../target/${project.artifactId}/classes</outputDirectory>
     
<testOutputDirectory>../../../../target/${project.artifactId}/testcases</testOutputDirectory>
     <directory>../../../../target/${project.artifactId}</directory>

http://git-wip-us.apache.org/repos/asf/ant/blob/eea99444/src/etc/poms/ant-apache-regexp/pom.xml
----------------------------------------------------------------------
diff --git a/src/etc/poms/ant-apache-regexp/pom.xml 
b/src/etc/poms/ant-apache-regexp/pom.xml
index 70976ff..11b1188 100644
--- a/src/etc/poms/ant-apache-regexp/pom.xml
+++ b/src/etc/poms/ant-apache-regexp/pom.xml
@@ -57,11 +57,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/ma
           <includes>
             <include>org/apache/tools/ant/util/regexp/JakartaRegexp*</include>
           </includes>
+          <testIncludes>
+            <include>org/apache/tools/ant/util/regexp/JakartaRegexp*</include>
+          </testIncludes>
         </configuration>
       </plugin>
     </plugins>
     <sourceDirectory>../../../../src/main</sourceDirectory>
-    <testSourceDirectory>../../../../src/testcases</testSourceDirectory>
+    <testSourceDirectory>../../../../src/tests/junit</testSourceDirectory>
     
<outputDirectory>../../../../target/${project.artifactId}/classes</outputDirectory>
     
<testOutputDirectory>../../../../target/${project.artifactId}/testcases</testOutputDirectory>
     <directory>../../../../target/${project.artifactId}</directory>

http://git-wip-us.apache.org/repos/asf/ant/blob/eea99444/src/etc/poms/ant-commons-net/pom.xml
----------------------------------------------------------------------
diff --git a/src/etc/poms/ant-commons-net/pom.xml 
b/src/etc/poms/ant-commons-net/pom.xml
index a119fb1..a5fc544 100644
--- a/src/etc/poms/ant-commons-net/pom.xml
+++ b/src/etc/poms/ant-commons-net/pom.xml
@@ -65,9 +65,18 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/ma
           </testIncludes>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <basedir>../../../..</basedir>
+          <workingDirectory>../../../..</workingDirectory>
+          <skipTests>true</skipTests>
+        </configuration>
+      </plugin>
     </plugins>
     <sourceDirectory>../../../../src/main</sourceDirectory>
-    <testSourceDirectory>../../../../src/testcases</testSourceDirectory>
+    <testSourceDirectory>../../../../src/tests/junit</testSourceDirectory>
     
<outputDirectory>../../../../target/${project.artifactId}/classes</outputDirectory>
     
<testOutputDirectory>../../../../target/${project.artifactId}/testcases</testOutputDirectory>
     <directory>../../../../target/${project.artifactId}</directory>

http://git-wip-us.apache.org/repos/asf/ant/blob/eea99444/src/etc/poms/ant-imageio/pom.xml
----------------------------------------------------------------------
diff --git a/src/etc/poms/ant-imageio/pom.xml b/src/etc/poms/ant-imageio/pom.xml
index 24829b6..39f90d1 100644
--- a/src/etc/poms/ant-imageio/pom.xml
+++ b/src/etc/poms/ant-imageio/pom.xml
@@ -54,11 +54,23 @@
             
<include>org/apache/tools/ant/taskdefs/optional/image/ImageIOTask.java</include>
             <include>org/apache/tools/ant/types/optional/imageio/*</include>
           </includes>
+          <testIncludes>
+            
<include>org/apache/tools/ant/taskdefs/optional/image/ImageIOTest.java</include>
+          </testIncludes>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <basedir>../../../..</basedir>
+          <workingDirectory>../../../..</workingDirectory>
+          <skipTests>true</skipTests>
         </configuration>
       </plugin>
     </plugins>
     <sourceDirectory>../../../../src/main</sourceDirectory>
-    <testSourceDirectory>../../../../src/testcases</testSourceDirectory>
+    <testSourceDirectory>../../../../src/tests/junit</testSourceDirectory>
     
<outputDirectory>../../../../target/${project.artifactId}/classes</outputDirectory>
     
<testOutputDirectory>../../../../target/${project.artifactId}/testcases</testOutputDirectory>
     <directory>../../../../target/${project.artifactId}</directory>

http://git-wip-us.apache.org/repos/asf/ant/blob/eea99444/src/etc/poms/ant-jai/pom.xml
----------------------------------------------------------------------
diff --git a/src/etc/poms/ant-jai/pom.xml b/src/etc/poms/ant-jai/pom.xml
index eae3626..746b4f4 100644
--- a/src/etc/poms/ant-jai/pom.xml
+++ b/src/etc/poms/ant-jai/pom.xml
@@ -57,11 +57,11 @@
   </dependencies>
   <!-- Central has javax.media:jai-core:1.1.3 but only 
com.sun.media:jai-codec:1.1.2_01 -->
   <repositories>
-      <repository>
-          <id>jboss</id>
-          <name>JBoss</name>
-          <url>https://repository.jboss.org/nexus/content/groups/public/</url>
-      </repository>
+    <repository>
+      <id>jboss</id>
+      <name>JBoss</name>
+      <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+    </repository>
   </repositories>
   <build>
     <plugins>
@@ -73,11 +73,22 @@
             
<include>org/apache/tools/ant/taskdefs/optional/image/Image.java</include>
             <include>org/apache/tools/ant/types/optional/image/*</include>
           </includes>
+          <testIncludes>
+            
<include>org/apache/tools/ant/taskdefs/optional/image/ImageTest.java</include>
+          </testIncludes>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <basedir>../../../..</basedir>
+          <workingDirectory>../../../..</workingDirectory>
         </configuration>
       </plugin>
     </plugins>
     <sourceDirectory>../../../../src/main</sourceDirectory>
-    <testSourceDirectory>../../../../src/testcases</testSourceDirectory>
+    <testSourceDirectory>../../../../src/tests/junit</testSourceDirectory>
     
<outputDirectory>../../../../target/${project.artifactId}/classes</outputDirectory>
     
<testOutputDirectory>../../../../target/${project.artifactId}/testcases</testOutputDirectory>
     <directory>../../../../target/${project.artifactId}</directory>

http://git-wip-us.apache.org/repos/asf/ant/blob/eea99444/src/etc/poms/ant-jdepend/pom.xml
----------------------------------------------------------------------
diff --git a/src/etc/poms/ant-jdepend/pom.xml b/src/etc/poms/ant-jdepend/pom.xml
index 06535be..9b30cbc 100644
--- a/src/etc/poms/ant-jdepend/pom.xml
+++ b/src/etc/poms/ant-jdepend/pom.xml
@@ -60,11 +60,23 @@
           <includes>
             <include>org/apache/tools/ant/taskdefs/optional/jdepend/*</include>
           </includes>
+          <testIncludes>
+            <include>org/apache/tools/ant/taskdefs/optional/jdepend/*</include>
+          </testIncludes>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <basedir>../../../..</basedir>
+          <workingDirectory>../../../..</workingDirectory>
+          <skipTests>true</skipTests>
         </configuration>
       </plugin>
     </plugins>
     <sourceDirectory>../../../../src/main</sourceDirectory>
-    <testSourceDirectory>../../../../src/testcases</testSourceDirectory>
+    <testSourceDirectory>../../../../src/tests/junit</testSourceDirectory>
     
<outputDirectory>../../../../target/${project.artifactId}/classes</outputDirectory>
     
<testOutputDirectory>../../../../target/${project.artifactId}/testcases</testOutputDirectory>
     <directory>../../../../target/${project.artifactId}</directory>

http://git-wip-us.apache.org/repos/asf/ant/blob/eea99444/src/etc/poms/ant-jsch/pom.xml
----------------------------------------------------------------------
diff --git a/src/etc/poms/ant-jsch/pom.xml b/src/etc/poms/ant-jsch/pom.xml
index 2895783..fa4e158 100644
--- a/src/etc/poms/ant-jsch/pom.xml
+++ b/src/etc/poms/ant-jsch/pom.xml
@@ -64,9 +64,23 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/ma
           </testIncludes>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <basedir>../../../..</basedir>
+          <workingDirectory>../../../..</workingDirectory>
+          <systemProperties>
+            <property>
+              <name>scp.tmp</name>
+              <value>${java.io.tmpdir}</value>
+            </property>
+          </systemProperties>
+        </configuration>
+      </plugin>
     </plugins>
     <sourceDirectory>../../../../src/main</sourceDirectory>
-    <testSourceDirectory>../../../../src/testcases</testSourceDirectory>
+    <testSourceDirectory>../../../../src/tests/junit</testSourceDirectory>
     
<outputDirectory>../../../../target/${project.artifactId}/classes</outputDirectory>
     
<testOutputDirectory>../../../../target/${project.artifactId}/testcases</testOutputDirectory>
     <directory>../../../../target/${project.artifactId}</directory>

http://git-wip-us.apache.org/repos/asf/ant/blob/eea99444/src/etc/poms/ant-junit/pom.xml
----------------------------------------------------------------------
diff --git a/src/etc/poms/ant-junit/pom.xml b/src/etc/poms/ant-junit/pom.xml
index 99b3762..1448b3d 100644
--- a/src/etc/poms/ant-junit/pom.xml
+++ b/src/etc/poms/ant-junit/pom.xml
@@ -92,9 +92,18 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/ma
           </testIncludes>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <basedir>../../../..</basedir>
+          <workingDirectory>../../../..</workingDirectory>
+          <skipTests>true</skipTests>
+        </configuration>
+      </plugin>
     </plugins>
     <sourceDirectory>../../../../src/main</sourceDirectory>
-    <testSourceDirectory>../../../../src/testcases</testSourceDirectory>
+    <testSourceDirectory>../../../../src/tests/junit</testSourceDirectory>
     
<outputDirectory>../../../../target/${project.artifactId}/classes</outputDirectory>
     
<testOutputDirectory>../../../../target/${project.artifactId}/testcases</testOutputDirectory>
     <directory>../../../../target/${project.artifactId}</directory>

http://git-wip-us.apache.org/repos/asf/ant/blob/eea99444/src/etc/poms/ant-junitlauncher/pom.xml
----------------------------------------------------------------------
diff --git a/src/etc/poms/ant-junitlauncher/pom.xml 
b/src/etc/poms/ant-junitlauncher/pom.xml
index cbb3d9d..99f84b4 100644
--- a/src/etc/poms/ant-junitlauncher/pom.xml
+++ b/src/etc/poms/ant-junitlauncher/pom.xml
@@ -75,6 +75,15 @@
                     </testIncludes>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <basedir>../../../..</basedir>
+                    <workingDirectory>../../../..</workingDirectory>
+                    <skipTests>true</skipTests>
+                </configuration>
+            </plugin>
         </plugins>
         <sourceDirectory>../../../../src/main</sourceDirectory>
         <testSourceDirectory>../../../../src/tests/junit</testSourceDirectory>

http://git-wip-us.apache.org/repos/asf/ant/blob/eea99444/src/etc/poms/ant/pom.xml
----------------------------------------------------------------------
diff --git a/src/etc/poms/ant/pom.xml b/src/etc/poms/ant/pom.xml
index b35714a..df4d652 100644
--- a/src/etc/poms/ant/pom.xml
+++ b/src/etc/poms/ant/pom.xml
@@ -161,6 +161,8 @@
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <basedir>../../../..</basedir>
+          <workingDirectory>../../../..</workingDirectory>
+          <skipTests>true</skipTests>
           <systemProperties>
             <property>
               <name>ant.home</name>

http://git-wip-us.apache.org/repos/asf/ant/blob/eea99444/src/tests/junit/org/apache/tools/ant/taskdefs/optional/ssh/ScpTest.java
----------------------------------------------------------------------
diff --git 
a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/ssh/ScpTest.java 
b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/ssh/ScpTest.java
index 5c6d9d0..b64c211 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/ssh/ScpTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/ssh/ScpTest.java
@@ -39,6 +39,7 @@ import org.junit.Test;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeNotNull;
 
 /**
  * This is a unit test for the Scp task in Ant.  It must be
@@ -82,6 +83,7 @@ public class ScpTest {
 
     @Test
     public void testSingleFileUploadAndDownload() throws IOException {
+        assumeNotNull("system property scp.host must be set", sshHostUri);
         assertNotNull("system property scp.tmp must be set", tempDir);
         File uploadFile = createTemporaryFile();
 
@@ -107,6 +109,7 @@ public class ScpTest {
 
     @Test
     public void testMultiUploadAndDownload() throws IOException {
+        assumeNotNull("system property scp.host must be set", sshHostUri);
         assertNotNull("system property scp.tmp must be set", tempDir);
         List<File> uploadList = new ArrayList<>();
         for (int i = 0; i < 5; i++) {
@@ -143,6 +146,7 @@ public class ScpTest {
 
     @Test
     public void testMultiResourceCollectionUpload() throws IOException {
+        assumeNotNull("system property scp.host must be set", sshHostUri);
         assertNotNull("system property scp.tmp must be set", tempDir);
         List<File> uploadList = new ArrayList<>();
         for (int i = 0; i < 5; i++) {

Reply via email to