maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tibordig...@apache.org
Subject [1/2] maven-surefire git commit: [SUREFIRE-1262] Add modulepath support [Forced Update!]
Date Wed, 20 Sep 2017 18:38:58 GMT
Repository: maven-surefire
Updated Branches:
  refs/heads/SUREFIRE-1262_2 b671a5832 -> 2487cb7b8 (forced update)


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2487cb7b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
index d00abc5..914ddbb 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java
@@ -88,7 +88,7 @@ public final class ForkedBooter
     {
         BooterDeserializer booterDeserializer =
                 new BooterDeserializer( createSurefirePropertiesIfFileExists( tmpDir, surefirePropsFileName
) );
-        // todo: print PID in debug console logger in version 2.20.2
+        // todo: print PID in debug console logger in version 2.21.2
         pingScheduler = isDebugging() ? null : listenToShutdownCommands( booterDeserializer.getPluginPid()
);
         setSystemProperties( new File( tmpDir, effectiveSystemPropertiesFileName ) );
 
@@ -96,20 +96,23 @@ public final class ForkedBooter
         DumpErrorSingleton.getSingleton().init( dumpFileName, providerConfiguration.getReporterConfiguration()
);
 
         startupConfiguration = booterDeserializer.getProviderConfiguration();
-        systemExitTimeoutInSeconds =
-                providerConfiguration.systemExitTimeout( DEFAULT_SYSTEM_EXIT_TIMEOUT_IN_SECONDS
);
+        systemExitTimeoutInSeconds = providerConfiguration.systemExitTimeout( DEFAULT_SYSTEM_EXIT_TIMEOUT_IN_SECONDS
);
 
         ClasspathConfiguration classpathConfiguration = startupConfiguration.getClasspathConfiguration();
-        if ( startupConfiguration.isManifestOnlyJarRequestedAndUsable() )
+
+        if ( !startupConfiguration.isModularClasspath() )
         {
-            classpathConfiguration.trickClassPathWhenManifestOnlyClasspath();
+            if ( startupConfiguration.isManifestOnlyJarRequestedAndUsable() )
+            {
+                classpathConfiguration.trickClassPathWhenManifestOnlyClasspath();
+            }
+            startupConfiguration.writeSurefireTestClasspathProperty();
         }
 
         ClassLoader classLoader = currentThread().getContextClassLoader();
         classLoader.setDefaultAssertionStatus( classpathConfiguration.isEnableAssertions()
);
-        startupConfiguration.writeSurefireTestClasspathProperty();
-        testSet = createTestSet( providerConfiguration.getTestForFork(),
-                                       providerConfiguration.isReadTestsFromInStream(), classLoader
);
+        boolean readTestsFromCommandReader = providerConfiguration.isReadTestsFromInStream();
+        testSet = createTestSet( providerConfiguration.getTestForFork(), readTestsFromCommandReader,
classLoader );
     }
 
     private void execute()

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2487cb7b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ModularClasspath.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ModularClasspath.java
b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ModularClasspath.java
new file mode 100644
index 0000000..c1b5849
--- /dev/null
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ModularClasspath.java
@@ -0,0 +1,77 @@
+package org.apache.maven.surefire.booter;
+
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+
+import static java.util.Collections.unmodifiableCollection;
+import static java.util.Collections.unmodifiableList;
+
+/**
+ * Jigsaw class-path and module-path.
+ *
+ * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
+ * @since 2.21.0.Jigsaw
+ */
+public final class ModularClasspath
+{
+    private final File moduleDescriptor;
+    private final List<String> modulePath;
+    private final List<String> classPath;
+    private final Collection<String> packages;
+    private final File patchFile;
+
+    public ModularClasspath( File moduleDescriptor, List<String> modulePath,
+                             List<String> classPath, Collection<String> packages,
File patchFile )
+    {
+        this.moduleDescriptor = moduleDescriptor;
+        this.modulePath = modulePath;
+        this.classPath = classPath;
+        this.packages = packages;
+        this.patchFile = patchFile;
+    }
+
+    public File getModuleDescriptor()
+    {
+        return moduleDescriptor;
+    }
+
+    public List<String> getModulePath()
+    {
+        return unmodifiableList( modulePath );
+    }
+
+    public List<String> getClassPath()
+    {
+        return unmodifiableList( classPath );
+    }
+
+    public Collection<String> getPackages()
+    {
+        return unmodifiableCollection( packages );
+    }
+
+    public File getPatchFile()
+    {
+        return patchFile;
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/2487cb7b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/StartupConfiguration.java
----------------------------------------------------------------------
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/StartupConfiguration.java
b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/StartupConfiguration.java
index 91530b7..4bf3620 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/StartupConfiguration.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/StartupConfiguration.java
@@ -79,6 +79,11 @@ public class StartupConfiguration
         return classLoaderConfiguration.isManifestOnlyJarRequestedAndUsable();
     }
 
+    public boolean isModularClasspath()
+    {
+        return false; //todo finish
+    }
+
     public String getProviderClassName()
     {
         return providerClassName;


Mime
View raw message