You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2017/10/08 20:08:52 UTC

[2/2] maven-surefire git commit: [SUREFIRE-1434] Upgrade PowerMock@Java9 to Version 2.0.0-beta.5

[SUREFIRE-1434] Upgrade PowerMock@Java9 to Version 2.0.0-beta.5


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

Branch: refs/heads/master
Commit: cb3f66add503f61997c6c7e6f2d16c394cc30b8a
Parents: b4c9942
Author: Tibor17 <ti...@apache.org>
Authored: Sun Oct 8 22:08:21 2017 +0200
Committer: Tibor17 <ti...@apache.org>
Committed: Sun Oct 8 22:08:21 2017 +0200

----------------------------------------------------------------------
 pom.xml                                         | 36 ++++++++++++--------
 surefire-booter/pom.xml                         | 18 ++++++++--
 .../maven/surefire/booter/SystemUtilsTest.java  | 10 ++----
 3 files changed, 41 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/cb3f66ad/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index ba00fcd..d73b4b5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,6 +92,7 @@
     <commonsLang3Version>3.5</commonsLang3Version>
     <commonsIoVersion>2.5</commonsIoVersion>
     <mavenSharedUtilsVersion>0.9</mavenSharedUtilsVersion>
+    <powermockVersion>2.0.0-beta.5</powermockVersion>
     <maven.surefire.scm.devConnection>scm:git:https://git-wip-us.apache.org/repos/asf/maven-surefire.git</maven.surefire.scm.devConnection>
     <maven.site.path>surefire-archives/surefire-LATEST</maven.site.path>
     <!-- Override with Jigsaw JRE 9 -->
@@ -239,7 +240,7 @@
       <dependency>
         <groupId>org.mockito</groupId>
         <artifactId>mockito-core</artifactId>
-        <version>1.10.19</version>
+        <version>2.10.0</version>
         <exclusions>
           <exclusion>
             <groupId>org.hamcrest</groupId>
@@ -247,22 +248,29 @@
           </exclusion>
         </exclusions>
       </dependency>
+      <!-- PowerMock@Java9
+      org.powermock for java9, see https://github.com/powermock/powermock/issues/783
+      These dependencies substitute org.powermock:powermock-mockito-release-full:jar:full:1.6.4 in java9.
+      -->
       <dependency>
         <groupId>org.powermock</groupId>
-        <artifactId>powermock-mockito-release-full</artifactId>
-        <version>1.6.4</version>
-        <classifier>full</classifier>
-        <exclusions>
-          <exclusion>
-            <groupId>org.hamcrest</groupId>
-            <artifactId>hamcrest-core</artifactId>
-          </exclusion>
-          <exclusion>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-          </exclusion>
-        </exclusions>
+        <artifactId>powermock-core</artifactId>
+        <version>${powermockVersion}</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.powermock</groupId>
+        <artifactId>powermock-module-junit4</artifactId>
+        <version>${powermockVersion}</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.powermock</groupId>
+        <artifactId>powermock-api-mockito2</artifactId>
+        <version>${powermockVersion}</version>
+        <scope>test</scope>
       </dependency>
+      <!-- END: PowerMock@Java9 -->
       <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/cb3f66ad/surefire-booter/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-booter/pom.xml b/surefire-booter/pom.xml
index d20fbdd..75eb8e7 100644
--- a/surefire-booter/pom.xml
+++ b/surefire-booter/pom.xml
@@ -56,9 +56,23 @@
       <artifactId>commons-io</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.powermock</groupId>
+      <artifactId>powermock-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.powermock</groupId>
+      <artifactId>powermock-module-junit4</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.powermock</groupId>
-      <artifactId>powermock-mockito-release-full</artifactId>
-      <classifier>full</classifier>
+      <artifactId>powermock-api-mockito2</artifactId>
       <scope>test</scope>
     </dependency>
   </dependencies>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/cb3f66ad/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
index 1917cbb..2b8bfed 100644
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
@@ -19,7 +19,6 @@ package org.apache.maven.surefire.booter;
  * under the License.
  */
 
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.runners.Enclosed;
 import org.junit.runner.RunWith;
@@ -268,8 +267,6 @@ public class SystemUtilsTest
 
     @RunWith( PowerMockRunner.class )
     @PrepareForTest( SystemUtils.class )
-    // todo check PowerMock is compliant with Java 9
-    @Ignore( value = "use this test after issue is fixed https://github.com/powermock/powermock/issues/783")
     public static class MockTest
     {
 
@@ -322,12 +319,11 @@ public class SystemUtilsTest
                 assertThat( SystemUtils.isJava9AtLeast( path.getAbsolutePath() ) ).isFalse();
             }
 
-            verifyStatic( Mockito.times( 0 ) );
+            verifyStatic( SystemUtils.class, Mockito.times( 0 ) );
             SystemUtils.toJdkVersionFromReleaseFile( any( File.class ) );
 
-            verifyStatic( Mockito.times( 1 ) );
+            verifyStatic( SystemUtils.class, Mockito.times( 1 ) );
             SystemUtils.isBuiltInJava9AtLeast();
         }
-
     }
-}
\ No newline at end of file
+}