Merge branch 'master' of git://github.com/apache/maven-surefire into run-individual-methods-with-junit48
Conflicts: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java surefire-integration-tests/src/test/resources/junit48-multiple-methods/pom.xml surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48/FilterFactory.java surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/ca9eb3d1 Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/ca9eb3d1 Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/ca9eb3d1 Branch: refs/heads/master Commit: ca9eb3d1a344813457a959481c3ff73bde074721 Parents: 947abde a577d09 Author: Tibor17 <tibo...@lycos.com> Authored: Thu Mar 26 00:14:32 2015 +0100 Committer: Tibor17 <tibo...@lycos.com> Committed: Thu Mar 26 00:14:32 2015 +0100 ---------------------------------------------------------------------- maven-failsafe-plugin/pom.xml | 29 +--- .../jetty-war-test-failing/invoker.properties | 3 + .../jetty-war-test-passing/invoker.properties | 3 + .../plugin/failsafe/IntegrationTestMojo.java | 82 ++++++++-- maven-surefire-common/pom.xml | 2 +- .../plugin/surefire/AbstractSurefireMojo.java | 69 ++++---- .../booterclient/ForkConfiguration.java | 18 ++- .../surefire/booterclient/ForkStarter.java | 55 +++---- .../OutputStreamFlushableCommandline.java | 2 +- .../TestProvidingInputStream.java | 14 +- .../booterclient/output/ForkClient.java | 39 ++++- .../surefire/report/DirectConsoleOutput.java | 16 +- .../booterclient/ForkConfigurationTest.java | 100 +++++++++++- .../booterclient/ForkingRunListenerTest.java | 6 +- .../report/StatelessXmlReporterTest.java | 4 +- maven-surefire-plugin/pom.xml | 7 +- .../maven/plugin/surefire/SurefirePlugin.java | 68 ++++++-- .../apt/examples/configuring-classpath.apt.vm | 8 +- .../fork-options-and-parallel-execution.apt.vm | 11 +- .../src/site/apt/examples/junit.apt.vm | 4 + .../src/site/apt/examples/single-test.apt.vm | 6 +- maven-surefire-report-plugin/pom.xml | 23 --- .../src/site/apt/index.apt | 3 + pom.xml | 73 +++++---- surefire-api/pom.xml | 2 +- .../surefire/booter/ForkingRunListener.java | 80 ++++----- .../surefire/report/ConsoleOutputCapture.java | 8 +- .../surefire/util/internal/StringUtils.java | 57 +++++-- .../surefire/util/internal/StringUtilsTest.java | 9 +- surefire-booter/pom.xml | 2 +- .../maven/surefire/booter/ForkedBooter.java | 24 ++- .../maven/surefire/booter/LazyTestsToRun.java | 44 +++-- surefire-grouper/pom.xml | 2 +- surefire-integration-tests/pom.xml | 8 +- .../maven/surefire/its/ConsoleOutputIT.java | 65 +++++++- .../surefire/its/fixture/OutputValidator.java | 14 +- .../maven/surefire/its/fixture/TestFile.java | 2 +- ...urefire1136CwdPropagationInForkedModeIT.java | 46 ++++++ ...refire855AllowFailsafeUseArtifactFileIT.java | 58 +++++++ .../jiras/Surefire995CategoryInheritanceIT.java | 90 +++++++++++ .../src/test/resources/consoleOutput/pom.xml | 17 +- .../src/test/java/consoleOutput/Test1.java | 17 +- .../surefire-1055-parallelTestCount/pom.xml | 17 +- .../pom.xml | 77 +++++++++ ...CurrentWorkingDirectoryInForkedModeTest.java | 51 ++++++ .../surefire-855-failsafe-use-bundle/pom.xml | 129 +++++++++++++++ .../src/main/java/pkg/AClassInOSGiBundle.java | 24 +++ .../main/resources/main/surefire855.properties | 1 + .../java/jiras/surefre855/bundle/FooIT.java | 146 +++++++++++++++++ .../bundle/properties/surefire855.properties | 1 + .../surefire-855-failsafe-use-jar/pom.xml | 123 ++++++++++++++ .../src/main/java/pkg/ToRunJavadoc.java | 8 + .../main/resources/main/surefire855.properties | 1 + .../test/java/jiras/surefire855/jar/FooIT.java | 162 +++++++++++++++++++ .../jar/properties/surefire855.properties | 1 + .../surefire-855-failsafe-use-war/pom.xml | 126 +++++++++++++++ .../main/java/pkg/ToCreateClassesDirectory.java | 24 +++ .../main/resources/main/surefire855.properties | 1 + .../test/java/jiras/surefire855/war/FooIT.java | 142 ++++++++++++++++ .../war/properties/surefire855.properties | 1 + .../surefire-995-categoryInheritance/pom.xml | 97 +++++++++++ .../java/jiras/surefire955/CategorizedTest.java | 35 ++++ .../java/jiras/surefire955/NotIncludedTest.java | 33 ++++ .../java/jiras/surefire955/SomeCategory.java | 24 +++ .../surefire955/SpecialCategorizedTest.java | 34 ++++ .../surefire955/SpecialNonCategoryTest.java | 33 ++++ .../java/listeners/MarkAsFailureListener.java | 18 +-- surefire-providers/common-junit4/pom.xml | 1 + surefire-providers/common-junit48/pom.xml | 9 -- surefire-providers/pom.xml | 4 +- surefire-providers/surefire-junit4/pom.xml | 6 - .../maven/surefire/junit4/JUnit4Provider.java | 1 - surefire-providers/surefire-junit47/pom.xml | 10 -- .../surefire-testng-utils/pom.xml | 39 +---- surefire-providers/surefire-testng/pom.xml | 39 +---- surefire-report-parser/pom.xml | 2 +- surefire-setup-integration-tests/pom.xml | 2 +- surefire-shadefire/pom.xml | 8 +- 78 files changed, 2163 insertions(+), 457 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/ca9eb3d1/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/ca9eb3d1/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/ca9eb3d1/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/ca9eb3d1/maven-surefire-plugin/src/site/apt/examples/single-test.apt.vm ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/ca9eb3d1/surefire-booter/src/main/java/org/apache/maven/surefire/booter/ForkedBooter.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/ca9eb3d1/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java ---------------------------------------------------------------------- diff --cc surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java index f30f895,8edad4d..a9cab65 --- a/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java +++ b/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4/JUnit4Provider.java @@@ -297,27 -284,30 +297,26 @@@ public class JUnit4Provide } } - /** - * Return testMethods from String like - * "com/xx/ImmutablePairTest#testBasic,com/xx/StopWatchTest#testLang315+testStopWatchSimpleGet" <br> - * and we need to think about cases that 2 or more method in 1 class. We should choose the correct method - * - * @param testClass the testclass - * @param testMethodStr the test method string - * @return a string ;) - */ - private static String getMethod( Class testClass, String testMethodStr ) + private static class FailedMethodFilter + implements Filter { - - final String className = testClass.getName().replace( '.', '/' ); + private final String[] methodPatterns; + + private FailedMethodFilter( String[] methodPatterns ) + { + this.methodPatterns = methodPatterns; + } - if ( !testMethodStr.contains( "#" ) && !testMethodStr.contains( "," ) ) + public boolean shouldRun( Class<?> clazz, Method method ) { - return testMethodStr; + for ( String methodPattern : methodPatterns ) + { + if ( SelectorUtils.match( methodPattern, method.getName() ) ) + { + return true; + } + } + return false; } - testMethodStr += ","; // for the bellow split code - final int beginIndex = testMethodStr.indexOf( className ); - final int endIndex = testMethodStr.indexOf( ",", beginIndex ); - final String classMethodStr = - testMethodStr.substring( beginIndex, endIndex ); // String like "StopWatchTest#testLang315" - - final int index = classMethodStr.indexOf( '#' ); - return index >= 0 ? classMethodStr.substring( index + 1, classMethodStr.length() ) : null; } }