This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch buildfix
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git


The following commit(s) were added to refs/heads/buildfix by this push:
     new 19aea5b  investigating build failure
19aea5b is described below

commit 19aea5bc2acc6c22e79f61682da14f521defc1bc
Author: tibordigana <[email protected]>
AuthorDate: Fri Jul 19 16:28:31 2019 +0200

    investigating build failure
---
 ...Surefire946KillMainProcessInReusableForkIT.java | 36 +++++++++++++++++++---
 1 file changed, 32 insertions(+), 4 deletions(-)

diff --git 
a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
 
b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
index d280f9e..78afdf8 100644
--- 
a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
+++ 
b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
@@ -19,24 +19,36 @@ package org.apache.maven.surefire.its.jiras;
  * under the License.
  */
 
-import com.googlecode.junittoolbox.ParallelParameterized;
 import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameter;
 import org.junit.runners.Parameterized.Parameters;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
 
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathFactory;
+import java.io.File;
+import java.io.FileInputStream;
 import java.util.ArrayList;
 
-@RunWith( ParallelParameterized.class )
+import static org.fest.assertions.Assertions.assertThat;
+
+@RunWith( Parameterized.class )
 public class Surefire946KillMainProcessInReusableForkIT
     extends SurefireJUnit4IntegrationTestCase
 {
     // there are 10 test classes that each would wait 3.5 seconds.
     private static final int TEST_SLEEP_TIME = 3_500;
 
-    @Parameter( 0 )
+    private static final String RELATIVE_PATH_TO_DUMMY_DEPENDENCY
+        = 
"org/apache/maven/plugins/surefire/surefire-946-dummy-dependency/0.1/surefire-946-dummy-dependency-0.1.jar";
+
+    @Parameter
     public String shutdownMavenMethod;
 
     @Parameter( 1 )
@@ -67,7 +79,7 @@ public class Surefire946KillMainProcessInReusableForkIT
     }
 
     @Test( timeout = 60_000 )
-    public void test()
+    public void test() throws Exception
     {
         unpack( "surefire-946-killMainProcessInReusableFork",
                 "-" + shutdownMavenMethod + "-" + shutdownSurefireMethod )
@@ -78,5 +90,21 @@ public class Surefire946KillMainProcessInReusableForkIT
                 .addGoal( 
"org.apache.maven.plugins.surefire:maven-selfdestruct-plugin:selfdestruct" )
                 .setForkJvm()
                 .forkPerThread().threadCount( 1 ).reuseForks( true 
).maven().withFailure().executeTest();
+
+        Thread.sleep( 3_000L );
+
+        XPathFactory xpathFactory = XPathFactory.newInstance();
+        XPath xpath = xpathFactory.newXPath();
+        try ( FileInputStream is = new FileInputStream( System.getProperty( 
"maven.settings.file" ) ) )
+        {
+            Node root = ( Node ) xpath.evaluate( "/", new InputSource( is ), 
XPathConstants.NODE );
+            String localRepository = xpath.evaluate( "/localRepository", root 
);
+            assertThat( localRepository )
+                    .isNotNull()
+                    .isNotEmpty();
+            File dep = new File( localRepository, 
RELATIVE_PATH_TO_DUMMY_DEPENDENCY );
+            assertThat( dep ).exists();
+            assertThat( dep.delete() ).isTrue();
+        }
     }
 }

Reply via email to