maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tibordig...@apache.org
Subject [08/16] maven-surefire git commit: Remove usage of internal JUnit API
Date Mon, 13 Feb 2017 23:37:02 GMT
Remove usage of internal JUnit API


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

Branch: refs/heads/3.0-rc1
Commit: 30ee7b94c3421411aa6257e78f77fe8b88aa125e
Parents: 43fb41e
Author: Benedikt Ritter <britter@apache.org>
Authored: Mon Feb 6 19:06:23 2017 +0100
Committer: Benedikt Ritter <britter@apache.org>
Committed: Mon Feb 6 19:06:23 2017 +0100

----------------------------------------------------------------------
 surefire-providers/surefire-junit5/pom.xml      |  2 --
 .../provider/JUnitPlatformProvider.java         | 28 +++++++++++---------
 2 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/30ee7b94/surefire-providers/surefire-junit5/pom.xml
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit5/pom.xml b/surefire-providers/surefire-junit5/pom.xml
index 55099f5..cf25aa2 100644
--- a/surefire-providers/surefire-junit5/pom.xml
+++ b/surefire-providers/surefire-junit5/pom.xml
@@ -43,8 +43,6 @@
       <artifactId>junit-platform-launcher</artifactId>
       <version>${junit-platform.version}</version>
     </dependency>
-    <!-- FIXME: dependency is currenlty needed in scope compile because the initial implementation
uses the internal
-         Preconditions class -->
     <dependency>
       <groupId>org.junit.platform</groupId>
       <artifactId>junit-platform-engine</artifactId>

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/30ee7b94/surefire-providers/surefire-junit5/src/main/java/org/junit/platform/surefire/provider/JUnitPlatformProvider.java
----------------------------------------------------------------------
diff --git a/surefire-providers/surefire-junit5/src/main/java/org/junit/platform/surefire/provider/JUnitPlatformProvider.java
b/surefire-providers/surefire-junit5/src/main/java/org/junit/platform/surefire/provider/JUnitPlatformProvider.java
index 066185f..3ee8acb 100644
--- a/surefire-providers/surefire-junit5/src/main/java/org/junit/platform/surefire/provider/JUnitPlatformProvider.java
+++ b/surefire-providers/surefire-junit5/src/main/java/org/junit/platform/surefire/provider/JUnitPlatformProvider.java
@@ -19,17 +19,6 @@ package org.junit.platform.surefire.provider;
  * under the License.
  */
 
-import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass;
-import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Optional;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
 import org.apache.maven.surefire.providerapi.AbstractProvider;
 import org.apache.maven.surefire.providerapi.ProviderParameters;
 import org.apache.maven.surefire.report.ReporterException;
@@ -39,13 +28,23 @@ import org.apache.maven.surefire.report.SimpleReportEntry;
 import org.apache.maven.surefire.suite.RunResult;
 import org.apache.maven.surefire.testset.TestSetFailedException;
 import org.apache.maven.surefire.util.TestsToRun;
-import org.junit.platform.commons.util.Preconditions;
 import org.junit.platform.engine.Filter;
 import org.junit.platform.launcher.Launcher;
 import org.junit.platform.launcher.LauncherDiscoveryRequest;
 import org.junit.platform.launcher.TagFilter;
 import org.junit.platform.launcher.core.LauncherFactory;
 
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Optional;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass;
+import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request;
+
 /**
  * @since 1.0
  */
@@ -183,7 +182,10 @@ public class JUnitPlatformProvider
     {
         Optional<List<String>> elements = Optional.empty();
 
-        Preconditions.condition( !groups.isPresent() || !tags.isPresent(), EXCEPTION_MESSAGE_BOTH_NOT_ALLOWED
);
+        if ( groups.isPresent() && tags.isPresent() )
+        {
+            throw new IllegalStateException( EXCEPTION_MESSAGE_BOTH_NOT_ALLOWED );
+        }
 
         if ( groups.isPresent() )
         {


Mime
View raw message