Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
if a custom surefire provider is specified then the logic is delegated to it and known providers resolution is skipped
- Loading branch information
1 parent
1a7e79f
commit ae748e7
Showing
33 changed files
with
565 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
== Surefire Providers | ||
|
||
Internally, Smart Testing uses its own implementation of `SurefireProvider` where calls Smart Testing API. Then, based on the information retrieved from the classpath, it decides which provider should be used for a delegation of the test execution - eg. JUnit4 or TestNG (in the same way as it is done inside of the Surefire plugin itself). | ||
But some projects may use their own surefire provider implementations or can specify one specific known provider that should scan the classpath and execute the test suite. | ||
|
||
=== Known Surefire Providers | ||
|
||
Known Surefire Providers are those implementations that are part of the Surefire project itself plus one implementation distributed as part of JUnit 5. The complete list of known providers: | ||
|
||
* JUnit 4 | ||
** groupId: `org.apache.maven.surefire` | ||
** artifactId: `surefire-junit4` | ||
** provider implementation: `org.apache.maven.surefire.junit4.JUnit4Provider` | ||
|
||
* JUnit 47 and above | ||
** groupId: `org.apache.maven.surefire` | ||
** artifactId: `surefire-junit47` | ||
** provider implementation: `org.apache.maven.surefire.junitcore.JUnitCoreProvider` | ||
|
||
* JUnit 5 | ||
** groupId: `org.junit.platform` | ||
** artifactId: `junit-platform-surefire-provider` | ||
** provider implementation: `org.junit.platform.surefire.provider.JUnitPlatformProvider` | ||
|
||
* TestNG | ||
** groupId: `org.apache.maven.surefire` | ||
** artifactId: `surefire-testng` | ||
** provider implementation: `org.apache.maven.surefire.testng.TestNGProvider` | ||
|
||
When one of these providers is specified inside of the Surefire's dependencies, then Smart Testing is able to automatically detect it and delegate the execution to it. | ||
|
||
=== Custom Surefire Providers | ||
|
||
If some unknown provider (or some other `SurefireProvider` implementation) is used then it is necessary to set this provider either in the configuration file or using system properties. | ||
The format is a pair of groupId and artifactId with a fully qualified name of the class that implements `SurefireProvider` interface and that should be loaded. For JUnit 5 provider it would look like this (in case of configuration file): | ||
[source, yaml] | ||
---- | ||
customProviders: | ||
- org.junit.platform:junit-platform-surefire-provider=org.junit.platform.surefire.provider.JUnitPlatformProvider | ||
---- | ||
If this is specified then Smart Testing will detect the dependency and delegate the test execution to it. | ||
System property dedicated for this usage is `const:core/src/main/java/org/arquillian/smart/testing/configuration/Configuration.java[name="SMART_TESTING_CUSTOM_PROVIDERS"]` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>smart-testing-parent</artifactId> | ||
<groupId>org.arquillian.smart.testing</groupId> | ||
<version>0.0.6-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>known-surefire-providers</artifactId> | ||
|
||
</project> |
46 changes: 46 additions & 0 deletions
46
...rs/src/main/java/org/arquillian/smart/testing/known/surefire/providers/KnownProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.arquillian.smart.testing.known.surefire.providers; | ||
|
||
public enum KnownProvider { | ||
|
||
JUNIT_4( | ||
"org.apache.maven.surefire", | ||
"surefire-junit4", | ||
"org.apache.maven.surefire.junit4.JUnit4Provider"), | ||
|
||
JUNIT_47( | ||
"org.apache.maven.surefire", | ||
"surefire-junit47", | ||
"org.apache.maven.surefire.junitcore.JUnitCoreProvider"), | ||
|
||
JUNIT_5( | ||
"org.junit.platform", | ||
"junit-platform-surefire-provider", | ||
"org.junit.platform.surefire.provider.JUnitPlatformProvider"), | ||
|
||
TESTNG( | ||
"org.apache.maven.surefire", | ||
"surefire-testng", | ||
"org.apache.maven.surefire.testng.TestNGProvider"); | ||
|
||
private final String groupId; | ||
private final String artifactId; | ||
private final String providerClassName; | ||
|
||
KnownProvider(String groupId, String artifactId, String providerClassName) { | ||
this.groupId = groupId; | ||
this.artifactId = artifactId; | ||
this.providerClassName = providerClassName; | ||
} | ||
|
||
public String getGroupId() { | ||
return groupId; | ||
} | ||
|
||
public String getArtifactId() { | ||
return artifactId; | ||
} | ||
|
||
public String getProviderClassName() { | ||
return providerClassName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.