1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.surefire.providerapi;
20
21 import javax.annotation.Nonnull;
22
23 import java.util.List;
24 import java.util.Set;
25
26 import org.apache.maven.artifact.Artifact;
27 import org.apache.maven.plugin.MojoExecutionException;
28 import org.apache.maven.plugin.surefire.TestClassPath;
29
30 import static org.apache.maven.plugin.surefire.SurefireDependencyResolver.isWithinVersionSpec;
31
32
33
34
35 public interface ProviderInfo {
36
37 enum Engine {
38 JUNIT3,
39 JUNIT4,
40 TESTNG,
41 JUNIT_PLATFORM
42 }
43
44 @Nonnull
45 String getProviderName();
46
47 boolean isApplicable();
48
49 @Nonnull
50 Set<Artifact> getProviderClasspath() throws MojoExecutionException;
51
52 void addProviderProperties() throws MojoExecutionException;
53
54 @Nonnull
55 List<String[]> getJpmsArguments(@Nonnull ProviderRequirements forkRequirements);
56
57 default boolean isAnyJunit4(Artifact artifact) {
58 return isWithinVersionSpec(artifact, "[4.12,)");
59 }
60
61 default TestClassPath decorateTestClassPath(TestClassPath testClasspath) throws MojoExecutionException {
62
63 return testClasspath;
64 }
65 }