1 package org.apache.maven.plugin.surefire.booterclient;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.Commandline;
23 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
24 import org.apache.maven.surefire.booter.Classpath;
25 import org.apache.maven.surefire.booter.StartupConfiguration;
26 import org.apache.maven.surefire.booter.SurefireBooterForkException;
27 import org.apache.maven.surefire.extensions.ForkNodeFactory;
28
29 import javax.annotation.Nonnull;
30 import javax.annotation.Nullable;
31 import java.io.File;
32 import java.util.Map;
33 import java.util.Properties;
34
35 import static org.apache.maven.surefire.shared.utils.StringUtils.join;
36
37
38
39
40
41 public final class ClasspathForkConfiguration
42 extends AbstractClasspathForkConfiguration
43 {
44 @SuppressWarnings( "checkstyle:parameternumber" )
45 public ClasspathForkConfiguration( @Nonnull Classpath bootClasspath, @Nonnull File tempDirectory,
46 @Nullable String debugLine, @Nonnull File workingDirectory,
47 @Nonnull Properties modelProperties, @Nullable String argLine,
48 @Nonnull Map<String, String> environmentVariables,
49 @Nonnull String[] excludedEnvironmentVariables,
50 boolean debug, int forkCount,
51 boolean reuseForks, @Nonnull Platform pluginPlatform,
52 @Nonnull ConsoleLogger log,
53 @Nonnull ForkNodeFactory forkNodeFactory )
54 {
55 super( bootClasspath, tempDirectory, debugLine, workingDirectory, modelProperties, argLine,
56 environmentVariables, excludedEnvironmentVariables, debug, forkCount, reuseForks, pluginPlatform, log,
57 forkNodeFactory );
58 }
59
60 @Override
61 protected void resolveClasspath( @Nonnull Commandline cli,
62 @Nonnull String booterThatHasMainMethod,
63 @Nonnull StartupConfiguration config,
64 @Nonnull File dumpLogDirectory )
65 throws SurefireBooterForkException
66 {
67 cli.addEnvironment( "CLASSPATH", join( toCompleteClasspath( config ).iterator(), File.pathSeparator ) );
68 cli.createArg().setValue( booterThatHasMainMethod );
69 }
70 }