Repository: maven-surefire Updated Branches: refs/heads/master 3128823c7 -> 6e06d2aab
[SUREFIRE-1065] Allow includesFile and excludesFile parameters to be set from the commandline Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/6e06d2aa Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/6e06d2aa Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/6e06d2aa Branch: refs/heads/master Commit: 6e06d2aabb7d612dce1e966c456f2060eeff3eab Parents: 3128823 Author: Tibor17 <tibo...@lycos.com> Authored: Fri Jan 2 14:19:22 2015 +0100 Committer: Tibor17 <tibo...@lycos.com> Committed: Fri Jan 2 14:19:22 2015 +0100 ---------------------------------------------------------------------- maven-failsafe-plugin/pom.xml | 6 ++++ .../plugin/failsafe/IntegrationTestMojo.java | 32 ++++++++++++++++++++ .../plugin/surefire/AbstractSurefireMojo.java | 24 ++------------- .../maven/plugin/surefire/SurefirePlugin.java | 32 ++++++++++++++++++++ 4 files changed, 72 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6e06d2aa/maven-failsafe-plugin/pom.xml ---------------------------------------------------------------------- diff --git a/maven-failsafe-plugin/pom.xml b/maven-failsafe-plugin/pom.xml index 2d9bd30..26ebeac 100644 --- a/maven-failsafe-plugin/pom.xml +++ b/maven-failsafe-plugin/pom.xml @@ -250,6 +250,10 @@ or run integration tests: mvn -Prun-its --> <id>run-its</id> + <properties> + <!-- skip tests with -DskipTests --> + <skipTests>false</skipTests> + </properties> <build> <defaultGoal>verify</defaultGoal> <plugins> @@ -258,6 +262,8 @@ <artifactId>maven-invoker-plugin</artifactId> <configuration> <streamLogs>false</streamLogs> + <skipInstallation>${skipTests}</skipInstallation> + <skipInvocation>${skipTests}</skipInvocation> </configuration> <executions> <execution> http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6e06d2aa/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java ---------------------------------------------------------------------- diff --git a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java index b66c2e4..a4a69d7 100644 --- a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java +++ b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java @@ -265,6 +265,26 @@ public class IntegrationTestMojo @Parameter( property = "failsafe.runOrder", defaultValue = "filesystem" ) protected String runOrder; + /** + * A file containing include patterns. Blank lines, or lines starting with # are ignored. If {@code includes} are + * also specified, these patterns are appended. Example with path, simple and regex includes:<br/> + * */test/*<br/> + * **/NotIncludedByDefault.java<br/> + * %regex[.*Test.*|.*Not.*]<br/> + */ + @Parameter( property = "failsafe.includesFile" ) + private File includesFile; + + /** + * A file containing exclude patterns. Blank lines, or lines starting with # are ignored. If {@code excludes} are + * also specified, these patterns are appended. Example with path, simple and regex excludes:<br/> + * */test/*<br/> + * **/DontRunTest.*<br/> + * %regex[.*Test.*|.*Not.*]<br/> + */ + @Parameter( property = "failsafe.excludesFile" ) + private File excludesFile; + protected int getRerunFailingTestsCount() { return rerunFailingTestsCount; @@ -620,4 +640,16 @@ public class IntegrationTestMojo { this.runOrder = runOrder; } + + @Override + public File getIncludesFile() + { + return includesFile; + } + + @Override + public File getExcludesFile() + { + return excludesFile; + } } http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6e06d2aa/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java ---------------------------------------------------------------------- diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java index fcbd47e..e0c96d7 100644 --- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java +++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java @@ -209,13 +209,6 @@ public abstract class AbstractSurefireMojo protected File testSourceDirectory; /** - * A file containing include patterns. Blank lines, or lines starting with # are ignored. If {@code includes} are - * also specified these patterns are appended. - */ - @Parameter - protected File includesFile; - - /** * A list of <exclude> elements specifying the tests (by pattern) that should be excluded in testing. When not * specified and when the <code>test</code> parameter is not specified, the default excludes will be <code><br/> * <excludes><br/> @@ -236,13 +229,6 @@ public abstract class AbstractSurefireMojo protected List<String> excludes; /** - * A file containing exclude patterns. Blank lines, or lines starting with # are ignored. If {@code excludes} are - * also specified these patterns are appended. - */ - @Parameter - protected File excludesFile; - - /** * ArtifactRepository of the localRepository. To obtain the directory of localRepository in unit tests use * System.getProperty("localRepository"). */ @@ -2491,10 +2477,7 @@ public abstract class AbstractSurefireMojo public abstract List<String> getIncludes(); - public File getIncludesFile() - { - return includesFile; - } + public abstract File getIncludesFile(); public abstract void setIncludes( List<String> includes ); @@ -2503,10 +2486,7 @@ public abstract class AbstractSurefireMojo return excludes; } - public File getExcludesFile() - { - return excludesFile; - } + public abstract File getExcludesFile(); public void setExcludes( List<String> excludes ) { http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/6e06d2aa/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java ---------------------------------------------------------------------- diff --git a/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java b/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java index c0d9f78..6356c41 100644 --- a/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java +++ b/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java @@ -241,6 +241,26 @@ public class SurefirePlugin @Parameter( property = "surefire.runOrder", defaultValue = "filesystem" ) protected String runOrder; + /** + * A file containing include patterns. Blank lines, or lines starting with # are ignored. If {@code includes} are + * also specified, these patterns are appended. Example with path, simple and regex includes:<br/> + * */test/*<br/> + * **/NotIncludedByDefault.java<br/> + * %regex[.*Test.*|.*Not.*]<br/> + */ + @Parameter( property = "surefire.includesFile" ) + private File includesFile; + + /** + * A file containing exclude patterns. Blank lines, or lines starting with # are ignored. If {@code excludes} are + * also specified, these patterns are appended. Example with path, simple and regex excludes:<br/> + * */test/*<br/> + * **/DontRunTest.*<br/> + * %regex[.*Test.*|.*Not.*]<br/> + */ + @Parameter( property = "surefire.excludesFile" ) + private File excludesFile; + protected int getRerunFailingTestsCount() { return rerunFailingTestsCount; @@ -569,4 +589,16 @@ public class SurefirePlugin { this.runOrder = runOrder; } + + @Override + public File getIncludesFile() + { + return includesFile; + } + + @Override + public File getExcludesFile() + { + return excludesFile; + } }