Author: stephenc Date: Mon Jun 27 15:00:13 2011 New Revision: 1140192 URL: http://svn.apache.org/viewvc?rev=1140192&view=rev Log: getting to a smaller diff set in the docs
Added: maven/surefire/trunk/maven-failsafe-plugin/src/site/apt/examples/junit.apt.vm - copied, changed from r1140122, maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/junit.apt.vm maven/surefire/trunk/maven-failsafe-plugin/src/site/apt/examples/pojo-test.apt.vm - copied unchanged from r1140185, maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/pojo-test.apt.vm maven/surefire/trunk/maven-failsafe-plugin/src/site/apt/examples/providers.apt.vm - copied unchanged from r1140122, maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/providers.apt.vm Modified: maven/surefire/trunk/maven-failsafe-plugin/src/site/apt/examples/single-test.apt.vm maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/junit.apt.vm maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/single-test.apt.vm maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/skipping-test.apt.vm Copied: maven/surefire/trunk/maven-failsafe-plugin/src/site/apt/examples/junit.apt.vm (from r1140122, maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/junit.apt.vm) URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-failsafe-plugin/src/site/apt/examples/junit.apt.vm?p2=maven/surefire/trunk/maven-failsafe-plugin/src/site/apt/examples/junit.apt.vm&p1=maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/junit.apt.vm&r1=1140122&r2=1140192&rev=1140192&view=diff ============================================================================== --- maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/junit.apt.vm (original) +++ maven/surefire/trunk/maven-failsafe-plugin/src/site/apt/examples/junit.apt.vm Mon Jun 27 15:00:13 2011 @@ -87,7 +87,7 @@ else ** Manually specifying a provider - You can also manually force a specific provider by adding it as a dependency to surefire itself: + You can also manually force a specific provider by adding it as a dependency to ${thisPlugin} itself: +---+ [...] Modified: maven/surefire/trunk/maven-failsafe-plugin/src/site/apt/examples/single-test.apt.vm URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-failsafe-plugin/src/site/apt/examples/single-test.apt.vm?rev=1140192&r1=1140191&r2=1140192&view=diff ============================================================================== --- maven/surefire/trunk/maven-failsafe-plugin/src/site/apt/examples/single-test.apt.vm (original) +++ maven/surefire/trunk/maven-failsafe-plugin/src/site/apt/examples/single-test.apt.vm Mon Jun 27 15:00:13 2011 @@ -7,25 +7,25 @@ 2011-02-26 ------ -~~ 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. + ~~ 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. -~~ NOTE: For help with the syntax of this file, see: -~~ http://maven.apache.org/doxia/references/apt-format.html + ~~ NOTE: For help with the syntax of this file, see: + ~~ http://maven.apache.org/doxia/references/apt-format.html Running a Single Test Modified: maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/junit.apt.vm URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/junit.apt.vm?rev=1140192&r1=1140191&r2=1140192&view=diff ============================================================================== --- maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/junit.apt.vm (original) +++ maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/junit.apt.vm Mon Jun 27 15:00:13 2011 @@ -87,7 +87,7 @@ else ** Manually specifying a provider - You can also manually force a specific provider by adding it as a dependency to surefire itself: + You can also manually force a specific provider by adding it as a dependency to ${thisPlugin} itself: +---+ [...] Modified: maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/single-test.apt.vm URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/single-test.apt.vm?rev=1140192&r1=1140191&r2=1140192&view=diff ============================================================================== --- maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/single-test.apt.vm (original) +++ maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/single-test.apt.vm Mon Jun 27 15:00:13 2011 @@ -4,7 +4,7 @@ Allan Ramirez Olivier Lamy ------ - 2011-02-24 + 2011-02-26 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one @@ -29,6 +29,7 @@ Running a Single Test +#{if}(${project.artifactId}=="maven-surefire-plugin") During development, you may run a single test class repeatedly. To run this through Maven, set the <<<test>>> property to a specific test case. @@ -37,18 +38,40 @@ mvn -Dtest=TestCircle test +---+ The value for the <<<test>>> parameter is the name of the test class (without the extension; we'll strip off the extension if you accidentally provide one). +#{else} + During development, you may run a single test class repeatedly. To run this + through Maven, set the <<<it.test>>> property to a specific test case. + ++---+ +mvn -Dit.test=ITCircle verify ++---+ + + The value for the <<<it.test>>> parameter is the name of the test class (without the extension; we'll strip off the extension if you accidentally provide one). +#{end} You may also use patterns to run a number of tests: +#{if}(${project.artifactId}=="maven-surefire-plugin") +---+ mvn -Dtest=TestCi*le test +---+ +#{else} ++---+ +mvn -Dit.test=ITCi*le verify ++---+ +#{end} And you may use multiple names/patterns, separated by commas: +#{if}(${project.artifactId}=="maven-surefire-plugin") +---+ mvn -Dtest=TestSquare,TestCi*le test +---+ +#{else} ++---+ +mvn -Dit.test=ITSquare,ITCi*le verify ++---+ +#{end} Running a set of methods in a Single Test Class @@ -58,12 +81,24 @@ Running a set of methods in a Single Tes You must use the following syntax +#{if}(${project.artifactId}=="maven-surefire-plugin") +---+ mvn -Dtest=TestCircle#mytest test +---+ +#{else} ++---+ +mvn -Dit.test=ITCircle#mytest verify ++---+ +#{end} You can use patterns too +#{if}(${project.artifactId}=="maven-surefire-plugin") ++---+ +mvn -Dtest=TestCircle#test* test ++---+ +#{else} ++---+ +mvn -Dit.test=ITCircle#test* verify +---+ -mvn -Dtest=TestCircle#*test* test -+---+ \ No newline at end of file +#{end} Modified: maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/skipping-test.apt.vm URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/skipping-test.apt.vm?rev=1140192&r1=1140191&r2=1140192&view=diff ============================================================================== --- maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/skipping-test.apt.vm (original) +++ maven/surefire/trunk/maven-surefire-plugin/src/site/apt/examples/skipping-test.apt.vm Mon Jun 27 15:00:13 2011 @@ -26,7 +26,7 @@ ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: - ~~ http://maven.apache.org/doxia/references/apt-format.html + ~~ http://maven.apache.org/doxia/references/apt-format.html Skipping Tests @@ -58,6 +58,16 @@ Skipping Tests mvn install -DskipTests +---+ +#{if}(${project.artifactId}=="maven-failsafe-plugin") + Since <<<skipTests>>> is also followed by the ${thatPlugin} Plugin, this will have the effect + of not running any tests. If, instead, you want to skip only the integration tests + being run by the ${thisPlugin} Plugin, you would use the <<<skipITs>>> property + ++---+ +mvn install -DskipITs ++---+ + +#{end} If you absolutely must, you can also use the <<<maven.test.skip>>> property to skip compiling the tests. <<<maven.test.skip>>> is honored by Surefire, Failsafe and the Compiler Plugin. @@ -71,12 +81,14 @@ Skipping by default command line, you need to go via a properties section in the pom: +---+ -<properties> - <skipTests>true</skipTests> -</properties> - -<build> - <plugins> +<project> + [...] + <properties> + <skipTests>true</skipTests> + </properties> + [...] + <build> + <plugins> <plugin> <groupId>${project.groupId}</groupId> <artifactId>${project.artifactId}</artifactId> @@ -84,9 +96,11 @@ Skipping by default <configuration> <skipTests>${skipTests}</skipTests> </configuration> - </plugin> -</plugins> -</build> + </plugin> + </plugins> + </build> + [...] +</project> +---+ This will allow you to run with tests disabled by default and to run them with this command: