pax_global_header00006660000000000000000000000064133075610460014517gustar00rootroot0000000000000052 comment=8cfffce8c36f6f22cd1a78fcd241d246da977a6c maven-surefire-surefire-2.22.0/000077500000000000000000000000001330756104600163545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/.gitattributes000066400000000000000000000003401330756104600212440ustar00rootroot00000000000000# Auto detect text files and perform LF normalization * text eol=lf *.xml text diff=xml *.java text diff=java *.html text diff=html *.vm text *.fml text *.md text *.css text *.js text *.sql text maven-surefire-surefire-2.22.0/.gitignore000066400000000000000000000002201330756104600203360ustar00rootroot00000000000000*.iml *.ipr target *.iws .classpath dependency-reduced-pom.xml build .classpath .project .settings .idea .surefire-* .DS_Store *.versionsBackup maven-surefire-surefire-2.22.0/.travis.yml000066400000000000000000000004741330756104600204720ustar00rootroot00000000000000language: java jdk: - oraclejdk8 # - oraclejdk9 script: "rm -rf .repository && mvn --show-version --errors --batch-mode -Prun-its clean install -Dmaven.repo.local=.repository -Denforcer.skip=true -e" install: true branches: except: - gh-pages notifications: email: - olamy@apache.org maven-surefire-surefire-2.22.0/CONTRIBUTING.md000066400000000000000000000017471330756104600206160ustar00rootroot00000000000000 Guidelines for contributing =========== The general guidelines for contributing to maven can be found here http://maven.apache.org/guides/development/guide-helping.html Pay particular attention to "Developer Conventions" section. maven-surefire-surefire-2.22.0/Jenkinsfile000066400000000000000000000246351330756104600205520ustar00rootroot00000000000000#!/usr/bin/env groovy /* * 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. */ properties( [ buildDiscarder(logRotator(artifactDaysToKeepStr: env.BRANCH_NAME == 'master' ? '30' : '7', artifactNumToKeepStr: '10', daysToKeepStr: env.BRANCH_NAME == 'master' ? '30' : '7', numToKeepStr: '10') ), disableConcurrentBuilds() ] ) final def oses = ['linux':'ubuntu', 'windows':'Windows && !windows-2012-3'] final def mavens = env.BRANCH_NAME == 'master' ? ['3.2.x', '3.3.x', '3.5.x'] : ['3.5.x'] final def jdks = [7, 8, 9, 10] final def options = ['-e', '-V', '-B', '-nsu', '-P', 'run-its'] final def goals = ['clean', 'install', 'jacoco:report'] final Map stages = [:] oses.eachWithIndex { osMapping, indexOfOs -> mavens.eachWithIndex { maven, indexOfMaven -> jdks.eachWithIndex { jdk, indexOfJdk -> def os = osMapping.key def label = osMapping.value final String jdkTestName = jenkinsEnv.jdkFromVersion(os, jdk.toString()) final String jdkName = jenkinsEnv.jdkFromVersion(os, '8') final String mvnName = jenkinsEnv.mvnFromVersion(os, maven) final String stageKey = "${os}-jdk${jdk}-maven${maven}" def mavenOpts = '-server -XX:+UseG1GC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:+UseNUMA \ -Xms64m -Djava.awt.headless=true' if (jdk > 7) { mavenOpts += ' -XX:+UseStringDeduplication' } mavenOpts += (os == 'linux' ? ' -Xmx1g' : ' -Xmx256m') if (label == null || jdkTestName == null || mvnName == null) { println "Skipping ${stageKey} as unsupported by Jenkins Environment." return; } println "${stageKey} ==> Label: ${label}, JDK: ${jdkTestName}, Maven: ${mvnName}." stages[stageKey] = { node(label) { timestamps { //https://github.com/jacoco/jacoco/issues/629 def boolean makeReports = os == 'linux' && indexOfMaven == mavens.size() - 1 && jdk == 9 def failsafeItPort = 8000 + 100 * indexOfMaven + 10 * indexOfJdk def allOptions = options + ["-Dfailsafe-integration-test-port=${failsafeItPort}", "-Dfailsafe-integration-test-stop-port=${1 + failsafeItPort}"] buildProcess(stageKey, jdkName, jdkTestName, mvnName, goals, allOptions, mavenOpts, makeReports) } } } } } } timeout(time: 12, unit: 'HOURS') { try { parallel(stages) // JENKINS-34376 seems to make it hard to detect the aborted builds } catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) { println "org.jenkinsci.plugins.workflow.steps.FlowInterruptedException: ${e}" // this ambiguous condition means a user probably aborted if (e.causes.size() == 0) { currentBuild.result = 'ABORTED' } else { currentBuild.result = 'FAILURE' } throw e } catch (hudson.AbortException e) { println "hudson.AbortException: ${e}" // this ambiguous condition means during a shell step, user probably aborted if (e.getMessage().contains('script returned exit code 143')) { currentBuild.result = 'ABORTED' } else { currentBuild.result = 'FAILURE' } throw e } catch (InterruptedException e) { println "InterruptedException: ${e}" currentBuild.result = 'ABORTED' throw e } catch (Throwable e) { println "Throwable: ${e}" currentBuild.result = 'FAILURE' throw e } finally { stage("notifications") { //jenkinsNotify() } } } def buildProcess(String stageKey, String jdkName, String jdkTestName, String mvnName, goals, options, mavenOpts, boolean makeReports) { cleanWs() try { def mvnLocalRepoDir = null if (isUnix()) { sh 'mkdir -p .m2' mvnLocalRepoDir = "${pwd()}/.m2" } else { bat 'mkdir .m2' mvnLocalRepoDir = "${pwd()}\\.m2" } println "Maven Local Repository = ${mvnLocalRepoDir}." assert mvnLocalRepoDir != null : 'Local Maven Repository is undefined.' stage("checkout ${stageKey}") { checkout scm } def properties = ["-Djacoco.skip=${!makeReports}", "\"-Dmaven.repo.local=${mvnLocalRepoDir}\""] println "Setting JDK for testing ${jdkName}" def cmd = ['mvn'] + goals + options + properties stage("build ${stageKey}") { if (isUnix()) { withEnv(["JAVA_HOME=${tool(jdkName)}", "JAVA_HOME_IT=${tool(jdkTestName)}", "MAVEN_OPTS=${mavenOpts}", "PATH+MAVEN=${tool(mvnName)}/bin:${env.JAVA_HOME}/bin" ]) { sh 'echo JAVA_HOME=$JAVA_HOME, JAVA_HOME_IT=$JAVA_HOME_IT' def script = cmd + ['\"-Djdk.home=$JAVA_HOME_IT\"'] sh script.join(' ') } } else { withEnv(["JAVA_HOME=${tool(jdkName)}", "JAVA_HOME_IT=${tool(jdkTestName)}", "MAVEN_OPTS=${mavenOpts}", "PATH+MAVEN=${tool(mvnName)}\\bin;${env.JAVA_HOME}\\bin" ]) { bat 'echo JAVA_HOME=%JAVA_HOME%, JAVA_HOME_IT=%JAVA_HOME_IT%' def script = cmd + ['\"-Djdk.home=%JAVA_HOME_IT%\"'] bat script.join(' ') } } } } finally { stage("reporting ${stageKey}") { if (makeReports) { openTasks(ignoreCase: true, canComputeNew: false, defaultEncoding: 'UTF-8', pattern: sourcesPatternCsv(), high: tasksViolationHigh(), normal: tasksViolationNormal(), low: tasksViolationLow()) jacoco(changeBuildStatus: false, execPattern: '**/*.exec', sourcePattern: sourcesPatternCsv(), classPattern: classPatternCsv()) junit(healthScaleFactor: 0.0, allowEmptyResults: true, keepLongStdio: true, testResults: testReportsPatternCsv()) if (currentBuild.result == 'UNSTABLE') { currentBuild.result = 'FAILURE' } } if (fileExists('maven-failsafe-plugin/target/it')) { zip(zipFile: "maven-failsafe-plugin--${stageKey}.zip", dir: 'maven-failsafe-plugin/target/it', archive: true) } if (fileExists('surefire-its/target')) { zip(zipFile: "surefire-its--${stageKey}.zip", dir: 'surefire-its/target', archive: true) } archiveArtifacts(artifacts: "*--${stageKey}.zip", allowEmptyArchive: true, onlyIfSuccessful: false) } stage("cleanup ${stageKey}") { // clean up after ourselves to reduce disk space cleanWs() } } } @NonCPS static def sourcesPatternCsv() { return '**/maven-failsafe-plugin/src/main/java,' + '**/maven-surefire-common/src/main/java,' + '**/maven-surefire-plugin/src/main/java,' + '**/maven-surefire-report-plugin/src/main/java,' + '**/surefire-api/src/main/java,' + '**/surefire-booter/src/main/java,' + '**/surefire-grouper/src/main/java,' + '**/surefire-its/src/main/java,' + '**/surefire-logger-api/src/main/java,' + '**/surefire-providers/**/src/main/java,' + '**/surefire-report-parser/src/main/java' } @NonCPS static def classPatternCsv() { return '**/maven-failsafe-plugin/target/classes,' + '**/maven-surefire-common/target/classes,' + '**/maven-surefire-plugin/target/classes,' + '**/maven-surefire-report-plugin/target/classes,' + '**/surefire-api/target/classes,' + '**/surefire-booter/target/classes,' + '**/surefire-grouper/target/classes,' + '**/surefire-its/target/classes,' + '**/surefire-logger-api/target/classes,' + '**/surefire-providers/**/target/classes,' + '**/surefire-report-parser/target/classes' } @NonCPS static def tasksViolationLow() { return '@SuppressWarnings' } @NonCPS static def tasksViolationNormal() { return 'TODO,FIXME,@deprecated' } @NonCPS static def tasksViolationHigh() { return 'finalize(),Locale.setDefault,TimeZone.setDefault,\ System.out,System.err,System.setOut,System.setErr,System.setIn,System.exit,System.gc,System.runFinalization,System.load' } @NonCPS static def testReportsPatternCsv() { return '**/maven-failsafe-plugin/target/surefire-reports/*.xml,' + '**/maven-surefire-common/target/surefire-reports/*.xml,' + '**/maven-surefire-plugin/target/surefire-reports/*.xml,' + '**/maven-surefire-report-plugin/target/surefire-reports/*.xml,' + '**/surefire-api/target/surefire-reports/*.xml,' + '**/surefire-booter/target/surefire-reports/*.xml,' + '**/surefire-grouper/target/surefire-reports/*.xml,' + '**/surefire-its/target/surefire-reports/*.xml,' + '**/surefire-logger-api/target/surefire-reports/*.xml,' + '**/surefire-providers/**/target/surefire-reports/*.xml,' + '**/surefire-report-parser/target/surefire-reports/*.xml,' + '**/surefire-its/target/failsafe-reports/*.xml' } maven-surefire-surefire-2.22.0/README.md000066400000000000000000000075021330756104600176370ustar00rootroot00000000000000[![Built with Maven](http://maven.apache.org/images/logos/maven-feather.png)](https://maven.apache.org/surefire/) [![CI](https://img.shields.io/badge/CI-Jenkins-red.svg?style=flat-square)](https://jenkins-ci.org/) [![forks](https://img.shields.io/github/forks/apache/maven-surefire.svg?style=social&label=Fork)](https://github.com/apache/maven-surefire/) # The Maven Community [![chat](https://www.irccloud.com/invite-svg?channel=maven&hostname=irc.freenode.net&port=6697&ssl=1)](https://maven.apache.org/community.html) [Join us @ irc://freenode/maven] or [Webchat with us @channel maven] # Release Notes [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.maven.surefire/surefire/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/org.apache.maven.surefire/surefire) [JIRA Change Log] Usage of [maven-surefire-plugin], [maven-failsafe-plugin], [maven-surefire-report-plugin]. # Project Documentation [![documentation](https://img.shields.io/badge/maven%20site-documentation-blue.svg?style=plastic)](https://maven.apache.org/surefire/) # Build Status [![dependencies](https://www.versioneye.com/java/org.apache.maven.plugins:maven-surefire-plugin/badge.svg?style=plastic)](https://builds.apache.org/job/maven-wip/job/maven-surefire/depgraph-view/) Maven 2.2.1 Plugin API [![license](http://img.shields.io/:license-apache-red.svg?style=plastic)](http://www.apache.org/licenses/LICENSE-2.0.html) [![tests](https://img.shields.io/jenkins/t/https/builds.apache.org/job/maven-wip/job/maven-surefire/job/master.svg?style=plastic)](https://builds.apache.org/job/maven-wip/job/maven-surefire/job/master/lastBuild/testReport/) [![Build Status](https://builds.apache.org/job/maven-wip/job/maven-surefire/job/master/badge/icon?style=plastic)](https://builds.apache.org/job/maven-wip/job/maven-surefire/job/master/) # Development Information In order to build Surefire project use **Maven 3.1.0+** and **JDK 1.8**. But in order to run IT tests, you can do: * In order to run tests for a release check during the vote the following memory requirements are needed: **(on Linux/Unix)** *export MAVEN_OPTS="-server -Xmx512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:SoftRefLRUPolicyMSPerMB=50 -Djava.awt.headless=true -Dhttps.protocols=TLSv1"* **(on Windows)** *set MAVEN_OPTS="-server -Xmx256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:SoftRefLRUPolicyMSPerMB=50 -Djava.awt.headless=true -Dhttps.protocols=TLSv1"* * In order to run the build with **JDK 9** **on Windows** (**on Linux/Unix modify system property jdk.home**): *mvn install site site:stage -P reporting,run-its "-Djdk.home=e:\Program Files\Java\jdk9\"* * In order to run the build with **JDK 10** disable JaCoCo due to a [bug in JaCoCo](https://github.com/jacoco/jacoco/issues/629) *mvn install site site:stage -P reporting,run-its -Djacoco.skip=true "-Djdk.home=e:\Program Files\Java\jdk10\"* ### Deploying web site See http://maven.apache.org/developers/website/deploy-component-reference-documentation.html [Join us @ irc://freenode/maven]: https://www.irccloud.com/invite?channel=maven&hostname=irc.freenode.net&port=6697&ssl=1 [Webchat with us @channel maven]: http://webchat.freenode.net/?channels=%23maven [JIRA Change Log]: https://issues.apache.org/jira/browse/SUREFIRE/?selectedTab=com.atlassian.jira.jira-projects-plugin:changelog-panel [maven-surefire-plugin]: https://maven.apache.org/surefire/maven-surefire-plugin/usage.html [maven-failsafe-plugin]: https://maven.apache.org/surefire/maven-failsafe-plugin/usage.html [maven-surefire-report-plugin]: https://maven.apache.org/surefire/maven-surefire-report-plugin/usage.html maven-surefire-surefire-2.22.0/deploySite.sh000066400000000000000000000015431330756104600210340ustar00rootroot00000000000000#!/bin/sh # # 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. # mvn -Preporting site site:stage $@ mvn scm-publish:publish-scm $@ maven-surefire-surefire-2.22.0/maven-failsafe-plugin/000077500000000000000000000000001330756104600225265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/pom.xml000066400000000000000000000274101330756104600240470ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire 2.22.0 org.apache.maven.plugins maven-failsafe-plugin maven-plugin Maven Failsafe Plugin Maven Failsafe MOJO in maven-failsafe-plugin. 2.2.1 Failsafe Surefire 8084 8085 org.apache.maven.surefire maven-surefire-common org.apache.maven.plugins maven-surefire-plugin ${project.version} provided zip site-source org.apache.maven.shared maven-shared-utils org.apache.commons commons-lang3 commons-io commons-io org.mockito mockito-core test org.apache.maven.plugins maven-plugin-plugin true mojo-descriptor process-classes descriptor help-goal helpmojo maven-surefire-plugin org.apache.maven.surefire surefire-shadefire 2.12.4 **/JUnit4SuiteTest.java maven-dependency-plugin site-site pre-site unpack-dependencies maven-surefire-plugin provided zip site-source ${project.build.directory}/source-site true maven-resources-plugin copy-resources pre-site copy-resources ${basedir}/../target/source-site ${basedir}/../src/site false org.apache.maven.plugins maven-antrun-plugin 1.8 generate-test-report pre-site run org.apache.maven.plugins maven-site-plugin ${project.build.directory}/source-site org.apache.maven.plugins maven-shade-plugin package shade true org.apache.maven.shared:maven-shared-utils commons-io:commons-io org.apache.commons:commons-lang3 org.apache.maven.shared org.apache.maven.surefire.shade.org.apache.maven.shared org.apache.commons.io org.apache.maven.surefire.shade.org.apache.commons.io org.apache.commons.lang3 org.apache.maven.surefire.shade.org.apache.commons.lang3 org.apache.maven.plugins maven-plugin-plugin ${mavenPluginPluginVersion} ci enableCiProfile true maven-docck-plugin 1.0 check run-its false verify org.apache.maven.plugins maven-invoker-plugin pre-its pre-integration-test install ${skipTests} integration-test run src/it ${project.build.directory}/it clean verify -nsu dummy-*/pom.xml */pom.xml verify src/it/settings.xml ${skipTests} false true ${failsafe-integration-test-port} ${failsafe-integration-test-stop-port} ${jdk.home} ${project.build.directory}/local-repo reporting org.apache.maven.plugins maven-changes-plugin false jira-report maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/000077500000000000000000000000001330756104600233155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/000077500000000000000000000000001330756104600237315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/000077500000000000000000000000001330756104600302435ustar00rootroot00000000000000invoker.properties000066400000000000000000000016001330756104600337540ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing# # 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. # invoker.buildResult=failure # build project if JRE version is 1.7 or higher invoker.java.version = 1.7+ maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/pom.xml000066400000000000000000000107721330756104600315670ustar00rootroot00000000000000 4.0.0 localhost jetty-war-test-failing 1.0 war run failing tests in jetty container javax.servlet servlet-api 2.5 provided junit junit 3.8.2 test net.sourceforge.htmlunit htmlunit 2.3 test true integration-test.properties ${basedir}/src/test/resources false integration-test.properties ${basedir}/src/test/resources org.eclipse.jetty jetty-maven-plugin ${jetty-version} ${integration-test-stop-port} STOP ${integration-test-port} 60000 start-jetty pre-integration-test stop run-exploded 0 true stop-jetty post-integration-test stop @project.groupId@ @project.artifactId@ @project.version@ integration-test integration-test verify verify UTF-8 UTF-8 8083 18009 9.2.2.v20140723 1.7 1.7 maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/src/000077500000000000000000000000001330756104600310325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/src/main/000077500000000000000000000000001330756104600317565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/src/main/webapp/000077500000000000000000000000001330756104600332345ustar00rootroot00000000000000WEB-INF/000077500000000000000000000000001330756104600342045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/src/main/webappweb.xml000066400000000000000000000021551330756104600355060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/src/main/webapp/WEB-INF index.html000066400000000000000000000016371330756104600351610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/src/main/webapp Hello World

Hello World

maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/src/test/000077500000000000000000000000001330756104600320115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/src/test/java/000077500000000000000000000000001330756104600327325ustar00rootroot00000000000000basic/000077500000000000000000000000001330756104600337345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/src/test/javaBasicIT.java000066400000000000000000000034661330756104600360660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/src/test/java/basicpackage basic; /* * 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. */ import java.io.IOException; import java.util.Properties; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; import junit.framework.TestCase; public class BasicIT extends TestCase { private WebClient client; private String baseUrl; private final Properties properties = new Properties(); public void setUp() throws IOException { client = new WebClient(); properties.load( getClass().getResourceAsStream( "/integration-test.properties" ) ); baseUrl = properties.getProperty( "baseUrl" ); } public void tearDown() { if ( client != null ) { client.closeAllWindows(); client = null; } } public void testSmokes() throws Exception { client.setThrowExceptionOnFailingStatusCode( false ); HtmlPage page = client.getPage( baseUrl + "index.html" ); assertFalse( page.asText().contains( "Hello World" ) ); } } resources/000077500000000000000000000000001330756104600337445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/src/testintegration-test.properties000066400000000000000000000015771330756104600413740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/src/test/resources# # 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. # # # The url where the web-app has been deployed to # baseUrl=http://localhost:${integration-test-port}/maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-failing/verify.bsh000066400000000000000000000022201330756104600322410ustar00rootroot00000000000000/* * 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. */ import java.io.*; import java.util.*; try { File file = new File(basedir, "target/failsafe-reports/failsafe-summary.xml"); if (!file.exists() || file.isDirectory()) { System.err.println("Could not find failsafe summary: " + file); return false; } } catch (Throwable t) { t.printStackTrace(); return false; } return true;maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/000077500000000000000000000000001330756104600302765ustar00rootroot00000000000000invoker.properties000066400000000000000000000016001330756104600340070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing# # 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. # invoker.buildResult=success # build project if JRE version is 1.7 or higher invoker.java.version = 1.7+ maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/pom.xml000066400000000000000000000107621330756104600316210ustar00rootroot00000000000000 4.0.0 localhost jetty-war-test 1.0 war run passing tests in jetty container javax.servlet servlet-api 2.5 provided junit junit 3.8.2 test net.sourceforge.htmlunit htmlunit 2.3 test true integration-test.properties ${basedir}/src/test/resources false integration-test.properties ${basedir}/src/test/resources org.eclipse.jetty jetty-maven-plugin ${jetty-version} ${integration-test-stop-port} STOP ${integration-test-port} 60000 start-jetty pre-integration-test stop run-exploded 0 true stop-jetty post-integration-test stop @project.groupId@ @project.artifactId@ @project.version@ integration-test integration-test verify verify UTF-8 UTF-8 8083 18009 9.2.2.v20140723 1.7 1.7 maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/src/000077500000000000000000000000001330756104600310655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/src/main/000077500000000000000000000000001330756104600320115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/src/main/webapp/000077500000000000000000000000001330756104600332675ustar00rootroot00000000000000WEB-INF/000077500000000000000000000000001330756104600342375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/src/main/webappweb.xml000066400000000000000000000021551330756104600355410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/src/main/webapp/WEB-INF index.html000066400000000000000000000016371330756104600352140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/src/main/webapp Hello World

Hello World

maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/src/test/000077500000000000000000000000001330756104600320445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/src/test/java/000077500000000000000000000000001330756104600327655ustar00rootroot00000000000000basic/000077500000000000000000000000001330756104600337675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/src/test/javaBasicIT.java000066400000000000000000000034651330756104600361200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/src/test/java/basicpackage basic; /* * 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. */ import java.io.IOException; import java.util.Properties; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; import junit.framework.TestCase; public class BasicIT extends TestCase { private WebClient client; private String baseUrl; private final Properties properties = new Properties(); public void setUp() throws IOException { client = new WebClient(); properties.load( getClass().getResourceAsStream( "/integration-test.properties" ) ); baseUrl = properties.getProperty( "baseUrl" ); } public void tearDown() { if ( client != null ) { client.closeAllWindows(); client = null; } } public void testSmokes() throws Exception { client.setThrowExceptionOnFailingStatusCode( false ); HtmlPage page = client.getPage( baseUrl + "index.html" ); assertTrue( page.asText().contains( "Hello World" ) ); } } resources/000077500000000000000000000000001330756104600337775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/src/testintegration-test.properties000066400000000000000000000015771330756104600414270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/src/test/resources# # 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. # # # The url where the web-app has been deployed to # baseUrl=http://localhost:${integration-test-port}/maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/jetty-war-test-passing/verify.bsh000066400000000000000000000022201330756104600322740ustar00rootroot00000000000000/* * 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. */ import java.io.*; import java.util.*; try { File file = new File(basedir, "target/failsafe-reports/failsafe-summary.xml"); if (!file.exists() || file.isDirectory()) { System.err.println("Could not find failsafe summary: " + file); return false; } } catch (Throwable t) { t.printStackTrace(); return false; } return true;maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/multiple-summaries-failing/000077500000000000000000000000001330756104600311765ustar00rootroot00000000000000invoker.properties000066400000000000000000000014631330756104600347160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/multiple-summaries-failing# # 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. # invoker.buildResult=failure maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/multiple-summaries-failing/pom.xml000066400000000000000000000062361330756104600325220ustar00rootroot00000000000000 4.0.0 localhost working-directory-test 1.0 Run tests multiple times 1.6 1.6 junit junit 3.8.2 test @project.groupId@ @project.artifactId@ @project.version@ integration-test integration-test ${project.build.directory}/failsafe-reports/failsafe-summary-1.xml acceptance-test integration-test **/AT*.java **/*AT.java **/*ATCase.java ${project.build.directory}/failsafe-reports/failsafe-summary-2.xml verify verify ${project.build.directory}/failsafe-reports/failsafe-summary-1.xml ${project.build.directory}/failsafe-reports/failsafe-summary-2.xml maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/multiple-summaries-failing/src/000077500000000000000000000000001330756104600317655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/multiple-summaries-failing/src/test/000077500000000000000000000000001330756104600327445ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600336065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/multiple-summaries-failing/src/testMyAT.java000066400000000000000000000016771330756104600352760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/multiple-summaries-failing/src/test/java/* * 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. */ import junit.framework.TestCase; public class MyAT extends TestCase { public void testSomething() { assertTrue( false ); } } MyIT.java000066400000000000000000000016761330756104600353050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/multiple-summaries-failing/src/test/java/* * 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. */ import junit.framework.TestCase; public class MyIT extends TestCase { public void testSomething() { assertTrue( true ); } } maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/multiple-summaries/000077500000000000000000000000001330756104600275675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/multiple-summaries/pom.xml000066400000000000000000000057351330756104600311160ustar00rootroot00000000000000 4.0.0 localhost working-directory-test 1.0 Run tests multiple times 1.6 1.6 junit junit 3.8.2 test @project.groupId@ @project.artifactId@ @project.version@ integration-test1 integration-test ${project.build.directory}/failsafe-reports/failsafe-summary-1.xml integration-test2 integration-test ${project.build.directory}/failsafe-reports/failsafe-summary-2.xml verify verify ${project.build.directory}/failsafe-reports/failsafe-summary-1.xml ${project.build.directory}/failsafe-reports/failsafe-summary-2.xml maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/multiple-summaries/src/000077500000000000000000000000001330756104600303565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/multiple-summaries/src/test/000077500000000000000000000000001330756104600313355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/multiple-summaries/src/test/java/000077500000000000000000000000001330756104600322565ustar00rootroot00000000000000MyIT.java000066400000000000000000000016761330756104600336760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/multiple-summaries/src/test/java/* * 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. */ import junit.framework.TestCase; public class MyIT extends TestCase { public void testSomething() { assertTrue( true ); } } maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/settings.xml000066400000000000000000000032741330756104600263210ustar00rootroot00000000000000 it-repo true local.central @localRepositoryUrl@ true true local.central @localRepositoryUrl@ true true maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/working-directory/000077500000000000000000000000001330756104600274135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/working-directory/pom.xml000066400000000000000000000042731330756104600307360ustar00rootroot00000000000000 4.0.0 localhost working-directory-test 1.0 Run tests in a nonexistent working directory 1.6 1.6 junit junit 3.8.2 test @project.groupId@ @project.artifactId@ @project.version@ integration-test integration-test ${project.build.directory}/failsafe-working-directory maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/working-directory/src/000077500000000000000000000000001330756104600302025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/working-directory/src/test/000077500000000000000000000000001330756104600311615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/working-directory/src/test/java/000077500000000000000000000000001330756104600321025ustar00rootroot00000000000000MyIT.java000066400000000000000000000016761330756104600335220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/it/working-directory/src/test/java/* * 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. */ import junit.framework.TestCase; public class MyIT extends TestCase { public void testSomething() { assertTrue( true ); } } maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/main/000077500000000000000000000000001330756104600242415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/main/java/000077500000000000000000000000001330756104600251625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/main/java/org/000077500000000000000000000000001330756104600257515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/main/java/org/apache/000077500000000000000000000000001330756104600271725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600303005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/000077500000000000000000000000001330756104600315765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/000077500000000000000000000000001330756104600333505ustar00rootroot00000000000000IntegrationTestMojo.java000066400000000000000000000651211330756104600401110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafepackage org.apache.maven.plugin.failsafe; /* * 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. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.surefire.AbstractSurefireMojo; import org.apache.maven.plugin.surefire.booterclient.ChecksumCalculator; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.surefire.suite.RunResult; import java.io.File; import java.io.IOException; import java.nio.charset.Charset; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Locale; import java.util.Map; import static org.apache.maven.plugin.failsafe.util.FailsafeSummaryXmlUtils.writeSummary; /** * Run integration tests using Surefire. * * @author Jason van Zyl * @author Stephen Connolly */ @Mojo( name = "integration-test", requiresProject = true, requiresDependencyResolution = ResolutionScope.TEST, defaultPhase = LifecyclePhase.INTEGRATION_TEST, threadSafe = true ) public class IntegrationTestMojo extends AbstractSurefireMojo { private static final String FAILSAFE_IN_PROGRESS_CONTEXT_KEY = "failsafe-in-progress"; /** * The path representing project JAR file, if exists; Otherwise the directory containing generated * classes of the project being tested. This will be included after the test classes in the test classpath. * Defaults to built artifact JAR file or ${project.build.outputDirectory}. */ @Parameter private File classesDirectory; @Parameter( readonly = true, defaultValue = "${project.build.outputDirectory}" ) private File defaultClassesDirectory; /** * Set this to "true" to skip running integration tests, but still compile them. Its use is NOT RECOMMENDED, but * quite convenient on occasion. * * @since 2.4.3-alpha-2 */ @Parameter( property = "skipITs" ) private boolean skipITs; /** * Base directory where all reports are written to. */ @Parameter( defaultValue = "${project.build.directory}/failsafe-reports" ) private File reportsDirectory; @SuppressWarnings( "checkstyle:linelength" ) /** * Specify this parameter to run individual tests by file name, overriding parameter {@code includes} and * {@code excludes}. Each pattern you specify here will be used to create an include pattern formatted like * **{@literal /}${it.test}.java, so you can just type {@code -Dit.test=MyIT} to run * a single test file called "foo/MyIT.java". The test patterns prefixed with a ! will be excluded. *
* This parameter overrides the parameter {@code includes} and {@code excludes}, and the TestNG parameter * {@code suiteXmlFiles}. *
* Since 2.7.3 You can execute a limited number of methods in the test with adding #myMethod or * #my*ethod. E.g. type {@code -Dit.test=MyIT#myMethod} supported for junit 4.x and TestNg. *
* Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): *
"-Dit.test=???IT, !Unstable*, pkg{@literal /}**{@literal /}Ci*leIT.java, *IT#test*One+testTwo?????, #fast*+slowTest"
* or e.g. *
*
"-Dit.test=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyIT.class#one.*|two.*], %regex[#fast.*|slow.*]"
*
* The Parameterized JUnit runner {@code describes} test methods using an index in brackets, so the non-regex * method pattern would become: {@code #testMethod[*]}. If using @Parameters(name="{index}: fib({0})={1}") * and selecting the index e.g. 5 in pattern, the non-regex method pattern would become {@code #testMethod[5:*]}. */ @Parameter( property = "it.test" ) private String test; /** * The summary file to write integration test results to. */ @Parameter( defaultValue = "${project.build.directory}/failsafe-reports/failsafe-summary.xml", required = true ) private File summaryFile; /** * Option to print summary of test suites or just print the test cases that have errors. */ @Parameter( property = "failsafe.printSummary", defaultValue = "true" ) private boolean printSummary; /** * Selects the formatting for the test report to be generated. Can be set as "brief" or "plain". * Only applies to the output format of the output files (target/surefire-reports/testName.txt) */ @Parameter( property = "failsafe.reportFormat", defaultValue = "brief" ) private String reportFormat; /** * Option to generate a file test report or just output the test report to the console. */ @Parameter( property = "failsafe.useFile", defaultValue = "true" ) private boolean useFile; /** * Set this to "true" to cause a failure if none of the tests specified in -Dtest=... are run. Defaults to * "true". * * @since 2.12 */ @Parameter( property = "it.failIfNoSpecifiedTests" ) private Boolean failIfNoSpecifiedTests; /** * Attach a debugger to the forked JVM. If set to "true", the process will suspend and wait for a debugger to attach * on port 5005. If set to some other string, that string will be appended to the argLine, allowing you to configure * arbitrary debugging ability options (without overwriting the other options specified through the {@code argLine} * parameter). * * @since 2.4 */ @Parameter( property = "maven.failsafe.debug" ) private String debugForkedProcess; /** * Kill the forked test process after a certain number of seconds. If set to 0, wait forever for the process, never * timing out. * * @since 2.4 */ @Parameter( property = "failsafe.timeout" ) private int forkedProcessTimeoutInSeconds; /** * Forked process is normally terminated without any significant delay after given tests have completed. * If the particular tests started non-daemon Thread(s), the process hangs instead of been properly terminated * by {@code System.exit()}. Use this parameter in order to determine the timeout of terminating the process. * see the documentation: * http://maven.apache.org/surefire/maven-failsafe-plugin/examples/shutdown.html * * @since 2.20 */ @Parameter( property = "failsafe.exitTimeout", defaultValue = "30" ) private int forkedProcessExitTimeoutInSeconds; /** * Stop executing queued parallel JUnit tests after a certain number of seconds. *
* Example values: "3.5", "4"
*
* If set to 0, wait forever, never timing out. * Makes sense with specified {@code parallel} different from "none". * * @since 2.16 */ @Parameter( property = "failsafe.parallel.timeout" ) private double parallelTestsTimeoutInSeconds; /** * Stop executing queued parallel JUnit tests * and interrupt currently running tests after a certain number of seconds. *
* Example values: "3.5", "4"
*
* If set to 0, wait forever, never timing out. * Makes sense with specified {@code parallel} different from "none". * * @since 2.16 */ @Parameter( property = "failsafe.parallel.forcedTimeout" ) private double parallelTestsTimeoutForcedInSeconds; @SuppressWarnings( "checkstyle:linelength" ) /** * A list of {@literal } elements specifying the test filter (by pattern) of tests which should be * included in testing. If it is not specified and the {@code test} parameter is unspecified as well, the default * includes is *

     * {@literal }
     *     {@literal }**{@literal /}IT*.java{@literal }
     *     {@literal }**{@literal /}*IT.java{@literal }
     *     {@literal }**{@literal /}*ITCase.java{@literal }
     * {@literal }
     * 
*
* Each include item may also contain a comma-separated sublist of items, which will be treated as multiple * {@literal } entries.
* Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): *

     * {@literal }%regex[.*[Cat|Dog].*], Basic????, !Unstable*{@literal }
     * {@literal }%regex[.*[Cat|Dog].*], !%regex[pkg.*Slow.*.class], pkg{@literal /}**{@literal /}*Fast*.java{@literal }
     * 
*
* This parameter is ignored if the TestNG {@code suiteXmlFiles} parameter is specified.
*
* Notice that these values are relative to the directory containing generated test classes of the project * being tested. This directory is declared by the parameter {@code testClassesDirectory} which defaults * to the POM property ${project.build.testOutputDirectory}, typically * {@literal src/test/java} unless overridden. */ @Parameter private List includes; /** * Option to pass dependencies to the system's classloader instead of using an isolated class loader when forking. * Prevents problems with JDKs which implement the service provider lookup mechanism by using the system's * classloader. * * @since 2.3 */ @Parameter( property = "failsafe.useSystemClassLoader", defaultValue = "true" ) private boolean useSystemClassLoader; /** * By default, Surefire forks your tests using a manifest-only JAR; set this parameter to "false" to force it to * launch your tests with a plain old Java classpath. (See the * * http://maven.apache.org/plugins/maven-failsafe-plugin/examples/class-loading.html * for a more detailed explanation of manifest-only JARs and their benefits.) *
* Beware, setting this to "false" may cause your tests to fail on Windows if your classpath is too long. * * @since 2.4.3 */ @Parameter( property = "failsafe.useManifestOnlyJar", defaultValue = "true" ) private boolean useManifestOnlyJar; /** * The character encoding scheme to be applied while generating test report * files (see target/surefire-reports/yourTestName.txt). * The report output files (*-out.txt) are still encoded with JVM's encoding used in standard out/err pipes. * * @since 3.0.0-M1 */ @Parameter( property = "encoding", defaultValue = "${project.reporting.outputEncoding}" ) private String encoding; /** * (JUnit 4+ providers) * The number of times each failing test will be rerun. If set larger than 0, rerun failing tests immediately after * they fail. If a failing test passes in any of those reruns, it will be marked as pass and reported as a "flake". * However, all the failing attempts will be recorded. */ @Parameter( property = "failsafe.rerunFailingTestsCount", defaultValue = "0" ) private int rerunFailingTestsCount; /** * (TestNG) List of <suiteXmlFile> elements specifying TestNG suite xml file locations. Note that * {@code suiteXmlFiles} is incompatible with several other parameters of this plugin, like * {@code includes} and {@code excludes}.
* This parameter is ignored if the {@code test} parameter is specified (allowing you to run a single test * instead of an entire suite). * * @since 2.2 */ @Parameter( property = "failsafe.suiteXmlFiles" ) private File[] suiteXmlFiles; /** * Defines the order the tests will be run in. Supported values are {@code alphabetical}, * {@code reversealphabetical}, {@code random}, {@code hourly} (alphabetical on even hours, reverse alphabetical * on odd hours), {@code failedfirst}, {@code balanced} and {@code filesystem}. *
*
* Odd/Even for hourly is determined at the time the of scanning the classpath, meaning it could change during a * multi-module build. *
*
* Failed first will run tests that failed on previous run first, as well as new tests for this run. *
*
* Balanced is only relevant with parallel=classes, and will try to optimize the run-order of the tests reducing the * overall execution time. Initially a statistics file is created and every next test run will reorder classes. *
*
* Note that the statistics are stored in a file named .surefire-XXXXXXXXX beside pom.xml and * should not be checked into version control. The "XXXXX" is the SHA1 checksum of the entire surefire * configuration, so different configurations will have different statistics files, meaning if you change any * configuration settings you will re-run once before new statistics data can be established. * * @since 2.7 */ @Parameter( property = "failsafe.runOrder", defaultValue = "filesystem" ) private String runOrder; /** * A file containing include patterns, each in a next line. 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: *

     * *{@literal /}it{@literal /}*
     * **{@literal /}NotIncludedByDefault.java
     * %regex[.*IT.*|.*Not.*]
     * 
*/ @Parameter( property = "failsafe.includesFile" ) private File includesFile; /** * A file containing exclude patterns, each in a next line. 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: *

     * *{@literal /}it{@literal /}*
     * **{@literal /}DontRunIT.*
     * %regex[.*IT.*|.*Not.*]
     * 
*/ @Parameter( property = "failsafe.excludesFile" ) private File excludesFile; /** * Set to error/failure count in order to skip remaining tests. * Due to race conditions in parallel/forked execution this may not be fully guaranteed.
* Enable with system property {@code -Dfailsafe.skipAfterFailureCount=1} or any number greater than zero. * Defaults to "0".
* See the prerequisites and limitations in documentation:
* * http://maven.apache.org/plugins/maven-failsafe-plugin/examples/skip-after-failure.html * * @since 2.19 */ @Parameter( property = "failsafe.skipAfterFailureCount", defaultValue = "0" ) private int skipAfterFailureCount; /** * After the plugin process is shutdown by sending SIGTERM signal (CTRL+C), SHUTDOWN command is * received by every forked JVM. *
* By default ({@code shutdown=testset}) forked JVM would not continue with new test which means that * the current test may still continue to run. *
* The parameter can be configured with other two values {@code exit} and {@code kill}. *
* Using {@code exit} forked JVM executes {@code System.exit(1)} after the plugin process has received * SIGTERM signal. *
* Using {@code kill} the JVM executes {@code Runtime.halt(1)} and kills itself. * * @since 2.19 */ @Parameter( property = "failsafe.shutdown", defaultValue = "testset" ) private String shutdown; @Override protected int getRerunFailingTestsCount() { return rerunFailingTestsCount; } @Override @SuppressWarnings( "unchecked" ) protected void handleSummary( RunResult summary, Exception firstForkException ) throws MojoExecutionException, MojoFailureException { File summaryFile = getSummaryFile(); if ( !summaryFile.getParentFile().isDirectory() ) { //noinspection ResultOfMethodCallIgnored summaryFile.getParentFile().mkdirs(); } try { Object token = getPluginContext().get( FAILSAFE_IN_PROGRESS_CONTEXT_KEY ); writeSummary( summary, summaryFile, token != null ); } catch ( Exception e ) { throw new MojoExecutionException( e.getMessage(), e ); } getPluginContext().put( FAILSAFE_IN_PROGRESS_CONTEXT_KEY, FAILSAFE_IN_PROGRESS_CONTEXT_KEY ); } private boolean isJarArtifact( File artifactFile ) { return artifactFile != null && artifactFile.isFile() && artifactFile.getName().toLowerCase().endsWith( ".jar" ); } private static File toAbsoluteCanonical( File f ) { try { return f == null ? null : f.getAbsoluteFile().getCanonicalFile(); } catch ( IOException e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } } @Override @SuppressWarnings( "deprecation" ) protected boolean isSkipExecution() { return isSkip() || isSkipTests() || isSkipITs() || isSkipExec(); } @Override protected String getPluginName() { return "failsafe"; } @Override protected String[] getDefaultIncludes() { return new String[]{ "**/IT*.java", "**/*IT.java", "**/*ITCase.java" }; } @Override protected String getReportSchemaLocation() { return "https://maven.apache.org/surefire/maven-failsafe-plugin/xsd/failsafe-test-report.xsd"; } @Override protected Artifact getMojoArtifact() { final Map pluginArtifactMap = getPluginArtifactMap(); return pluginArtifactMap.get( "org.apache.maven.plugins:maven-failsafe-plugin" ); } @Override public boolean isSkipTests() { return skipTests; } @Override public void setSkipTests( boolean skipTests ) { this.skipTests = skipTests; } public boolean isSkipITs() { return skipITs; } public void setSkipITs( boolean skipITs ) { this.skipITs = skipITs; } @Override @SuppressWarnings( "deprecation" ) @Deprecated public boolean isSkipExec() { return skipExec; } @Override @SuppressWarnings( "deprecation" ) @Deprecated public void setSkipExec( boolean skipExec ) { this.skipExec = skipExec; } @Override public boolean isSkip() { return skip; } @Override public void setSkip( boolean skip ) { this.skip = skip; } @Override public File getBasedir() { return basedir; } @Override public void setBasedir( File basedir ) { this.basedir = basedir; } @Override public File getTestClassesDirectory() { return testClassesDirectory; } @Override public void setTestClassesDirectory( File testClassesDirectory ) { this.testClassesDirectory = testClassesDirectory; } /** * @return Output directory, or artifact file if artifact type is "jar". If not forking the JVM, parameter * {@link #useSystemClassLoader} is ignored and the {@link org.apache.maven.surefire.booter.IsolatedClassLoader} is * used instead. See the resolution of {@link #getClassLoaderConfiguration() ClassLoaderConfiguration}. */ @Override public File getClassesDirectory() { File artifact = getProject().getArtifact().getFile(); boolean isDefaultClsDir = classesDirectory == null; return isDefaultClsDir ? ( isJarArtifact( artifact ) ? artifact : defaultClassesDirectory ) : classesDirectory; } @Override public void setClassesDirectory( File classesDirectory ) { this.classesDirectory = toAbsoluteCanonical( classesDirectory ); } public void setDefaultClassesDirectory( File defaultClassesDirectory ) { this.defaultClassesDirectory = toAbsoluteCanonical( defaultClassesDirectory ); } @Override public File getReportsDirectory() { return reportsDirectory; } @Override public void setReportsDirectory( File reportsDirectory ) { this.reportsDirectory = reportsDirectory; } @Override public String getTest() { return test; } @Override public void setTest( String test ) { this.test = test; } public File getSummaryFile() { return summaryFile; } public void setSummaryFile( File summaryFile ) { this.summaryFile = summaryFile; } @Override public boolean isPrintSummary() { return printSummary; } @Override public void setPrintSummary( boolean printSummary ) { this.printSummary = printSummary; } @Override public String getReportFormat() { return reportFormat; } @Override public void setReportFormat( String reportFormat ) { this.reportFormat = reportFormat; } @Override public boolean isUseFile() { return useFile; } @Override public void setUseFile( boolean useFile ) { this.useFile = useFile; } @Override public String getDebugForkedProcess() { return debugForkedProcess; } @Override public void setDebugForkedProcess( String debugForkedProcess ) { this.debugForkedProcess = debugForkedProcess; } @Override public int getForkedProcessTimeoutInSeconds() { return forkedProcessTimeoutInSeconds; } @Override public void setForkedProcessTimeoutInSeconds( int forkedProcessTimeoutInSeconds ) { this.forkedProcessTimeoutInSeconds = forkedProcessTimeoutInSeconds; } @Override public int getForkedProcessExitTimeoutInSeconds() { return forkedProcessExitTimeoutInSeconds; } @Override public void setForkedProcessExitTimeoutInSeconds( int forkedProcessExitTimeoutInSeconds ) { this.forkedProcessExitTimeoutInSeconds = forkedProcessExitTimeoutInSeconds; } @Override public double getParallelTestsTimeoutInSeconds() { return parallelTestsTimeoutInSeconds; } @Override public void setParallelTestsTimeoutInSeconds( double parallelTestsTimeoutInSeconds ) { this.parallelTestsTimeoutInSeconds = parallelTestsTimeoutInSeconds; } @Override public double getParallelTestsTimeoutForcedInSeconds() { return parallelTestsTimeoutForcedInSeconds; } @Override public void setParallelTestsTimeoutForcedInSeconds( double parallelTestsTimeoutForcedInSeconds ) { this.parallelTestsTimeoutForcedInSeconds = parallelTestsTimeoutForcedInSeconds; } @Override public boolean isUseSystemClassLoader() { return useSystemClassLoader; } @Override public void setUseSystemClassLoader( boolean useSystemClassLoader ) { this.useSystemClassLoader = useSystemClassLoader; } @Override public boolean isUseManifestOnlyJar() { return useManifestOnlyJar; } @Override public void setUseManifestOnlyJar( boolean useManifestOnlyJar ) { this.useManifestOnlyJar = useManifestOnlyJar; } @Override public String getEncoding() { return encoding; } @Override public void setEncoding( String encoding ) { this.encoding = encoding; } // the following will be refactored out once the common code is all in one place public boolean isTestFailureIgnore() { return true; // ignore } public void setTestFailureIgnore( boolean testFailureIgnore ) { // ignore } @Override protected void addPluginSpecificChecksumItems( ChecksumCalculator checksum ) { checksum.add( skipITs ); checksum.add( summaryFile ); } @Override public Boolean getFailIfNoSpecifiedTests() { return failIfNoSpecifiedTests; } @Override public void setFailIfNoSpecifiedTests( boolean failIfNoSpecifiedTests ) { this.failIfNoSpecifiedTests = failIfNoSpecifiedTests; } @Override public int getSkipAfterFailureCount() { return skipAfterFailureCount; } @Override public String getShutdown() { return shutdown; } @Override public List getIncludes() { return includes; } @Override public void setIncludes( List includes ) { this.includes = includes; } @Override public File[] getSuiteXmlFiles() { return suiteXmlFiles.clone(); } @Override @SuppressWarnings( "UnusedDeclaration" ) public void setSuiteXmlFiles( File[] suiteXmlFiles ) { this.suiteXmlFiles = suiteXmlFiles.clone(); } @Override public String getRunOrder() { return runOrder; } @Override @SuppressWarnings( "UnusedDeclaration" ) public void setRunOrder( String runOrder ) { this.runOrder = runOrder; } @Override public File getIncludesFile() { return includesFile; } @Override public File getExcludesFile() { return excludesFile; } @Override protected final List suiteXmlFiles() { return hasSuiteXmlFiles() ? Arrays.asList( suiteXmlFiles ) : Collections.emptyList(); } @Override protected final boolean hasSuiteXmlFiles() { return suiteXmlFiles != null && suiteXmlFiles.length != 0; } static Charset toCharset( String encoding ) { return Charset.forName( Charset.isSupported( encoding ) ? encoding : encoding.toUpperCase( Locale.ROOT ) ); } } VerifyMojo.java000066400000000000000000000245011330756104600362270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafepackage org.apache.maven.plugin.failsafe; /* * 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. */ import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.failsafe.util.FailsafeSummaryXmlUtils; import org.apache.maven.plugin.surefire.SurefireHelper; import org.apache.maven.plugin.surefire.SurefireReportParameters; import org.apache.maven.plugin.surefire.log.PluginConsoleLogger; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.surefire.cli.CommandLineOption; import org.apache.maven.surefire.suite.RunResult; import org.codehaus.plexus.logging.Logger; import java.io.File; import java.util.Collection; import static org.apache.maven.plugin.surefire.SurefireHelper.reportExecution; import static org.apache.maven.shared.utils.StringUtils.capitalizeFirstLetter; import static org.apache.maven.surefire.suite.RunResult.noTestsRun; /** * Verify integration tests ran using Surefire. * * @author Stephen Connolly * @author Jason van Zyl */ @SuppressWarnings( "unused" ) @Mojo( name = "verify", defaultPhase = LifecyclePhase.VERIFY, requiresProject = true, threadSafe = true ) public class VerifyMojo extends AbstractMojo implements SurefireReportParameters { /** * Set this to 'true' to skip running tests, but still compile them. Its use is NOT RECOMMENDED, but quite * convenient on occasion. * * @since 2.4 */ @Parameter( property = "skipTests" ) private boolean skipTests; /** * Set this to 'true' to skip running integration tests, but still compile them. Its use is NOT RECOMMENDED, but * quite convenient on occasion. * * @since 2.4.3-alpha-2 */ @Parameter( property = "skipITs" ) private boolean skipITs; /** * This old parameter is just like skipTests, but bound to the old property maven.test.skip.exec. * * @since 2.3 * @deprecated Use -DskipTests instead. */ @Deprecated @Parameter( property = "maven.test.skip.exec" ) private boolean skipExec; /** * Set this to 'true' to bypass unit tests entirely. Its use is NOT RECOMMENDED, especially if you * enable it using the "maven.test.skip" property, because maven.test.skip disables both running the * tests and compiling the tests. Consider using the skipTests parameter instead. */ @Parameter( property = "maven.test.skip", defaultValue = "false" ) private boolean skip; /** * Set this to true to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on * occasion. */ @Parameter( property = "maven.test.failure.ignore", defaultValue = "false" ) private boolean testFailureIgnore; /** * The base directory of the project being tested. This can be obtained in your unit test by * System.getProperty("basedir"). */ @Parameter( defaultValue = "${basedir}" ) private File basedir; /** * The directory containing generated test classes of the project being tested. * This will be included at the beginning the test classpath. */ @Parameter( defaultValue = "${project.build.testOutputDirectory}" ) private File testClassesDirectory; /** * Base directory where all reports are written to. */ @Parameter( defaultValue = "${project.build.directory}/failsafe-reports" ) private File reportsDirectory; /** * The summary file to read integration test results from. */ @Parameter( defaultValue = "${project.build.directory}/failsafe-reports/failsafe-summary.xml", required = true ) private File summaryFile; /** * Additional summary files to read integration test results from. * @since 2.6 */ @Parameter private File[] summaryFiles; /** * Set this to "true" to cause a failure if there are no tests to run. * * @since 2.4 */ @Parameter( property = "failIfNoTests" ) private Boolean failIfNoTests; /** * The character encoding scheme to be applied. * Deprecated since 2.20.1 and used encoding UTF-8 in failsafe-summary.xml. * * @deprecated since of 2.20.1 */ @Parameter( property = "encoding", defaultValue = "${project.reporting.outputEncoding}" ) private String encoding; /** * The current build session instance. */ @Component private MavenSession session; @Component private Logger logger; private Collection cli; private volatile PluginConsoleLogger consoleLogger; @Override public void execute() throws MojoExecutionException, MojoFailureException { cli = commandLineOptions(); if ( verifyParameters() ) { logDebugOrCliShowErrors( capitalizeFirstLetter( getPluginName() ) + " report directory: " + getReportsDirectory() ); RunResult summary; try { summary = existsSummaryFile() ? readSummary( summaryFile ) : noTestsRun(); if ( existsSummaryFiles() ) { for ( final File summaryFile : summaryFiles ) { summary = summary.aggregate( readSummary( summaryFile ) ); } } } catch ( Exception e ) { throw new MojoExecutionException( e.getMessage(), e ); } reportExecution( this, summary, getConsoleLogger(), null ); } } private PluginConsoleLogger getConsoleLogger() { if ( consoleLogger == null ) { synchronized ( this ) { if ( consoleLogger == null ) { consoleLogger = new PluginConsoleLogger( logger ); } } } return consoleLogger; } private RunResult readSummary( File summaryFile ) throws Exception { return FailsafeSummaryXmlUtils.toRunResult( summaryFile ); } protected boolean verifyParameters() throws MojoFailureException { if ( isSkip() || isSkipTests() || isSkipITs() || isSkipExec() ) { getConsoleLogger().info( "Tests are skipped." ); return false; } if ( !getTestClassesDirectory().exists() ) { if ( getFailIfNoTests() != null && getFailIfNoTests() ) { throw new MojoFailureException( "No tests to run!" ); } } if ( !existsSummary() ) { getConsoleLogger().info( "No tests to run." ); return false; } return true; } protected String getPluginName() { return "failsafe"; } protected String[] getDefaultIncludes() { return null; } @Override public boolean isSkipTests() { return skipTests; } @Override public void setSkipTests( boolean skipTests ) { this.skipTests = skipTests; } public boolean isSkipITs() { return skipITs; } public void setSkipITs( boolean skipITs ) { this.skipITs = skipITs; } @Override @Deprecated public boolean isSkipExec() { return skipExec; } @Override @Deprecated public void setSkipExec( boolean skipExec ) { this.skipExec = skipExec; } @Override public boolean isSkip() { return skip; } @Override public void setSkip( boolean skip ) { this.skip = skip; } @Override public boolean isTestFailureIgnore() { return testFailureIgnore; } @Override public void setTestFailureIgnore( boolean testFailureIgnore ) { this.testFailureIgnore = testFailureIgnore; } @Override public File getBasedir() { return basedir; } @Override public void setBasedir( File basedir ) { this.basedir = basedir; } @Override public File getTestClassesDirectory() { return testClassesDirectory; } @Override public void setTestClassesDirectory( File testClassesDirectory ) { this.testClassesDirectory = testClassesDirectory; } @Override public File getReportsDirectory() { return reportsDirectory; } @Override public void setReportsDirectory( File reportsDirectory ) { this.reportsDirectory = reportsDirectory; } @Override public Boolean getFailIfNoTests() { return failIfNoTests; } @Override public void setFailIfNoTests( boolean failIfNoTests ) { this.failIfNoTests = failIfNoTests; } private boolean existsSummaryFile() { return summaryFile != null && summaryFile.isFile(); } private boolean existsSummaryFiles() { return summaryFiles != null && summaryFiles.length != 0; } private boolean existsSummary() { return existsSummaryFile() || existsSummaryFiles(); } private Collection commandLineOptions() { return SurefireHelper.commandLineOptions( session, getConsoleLogger() ); } private void logDebugOrCliShowErrors( String s ) { SurefireHelper.logDebugOrCliShowErrors( s, getConsoleLogger(), cli ); } } package.html000066400000000000000000000017561330756104600355630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe

Provides Mojo goals for running integration tests and subsequently failing the build in a safe way.

util/000077500000000000000000000000001330756104600342465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafeFailsafeSummaryXmlUtils.java000066400000000000000000000135321330756104600417070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/utilpackage org.apache.maven.plugin.failsafe.util; /* * 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. */ import org.apache.commons.io.IOUtils; import org.apache.maven.surefire.suite.RunResult; import org.w3c.dom.Node; import org.xml.sax.InputSource; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathFactory; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.Locale; import static java.lang.Boolean.parseBoolean; import static java.lang.Integer.parseInt; import static org.apache.commons.lang3.StringEscapeUtils.escapeXml10; import static org.apache.commons.lang3.StringEscapeUtils.unescapeXml; import static org.apache.maven.surefire.util.internal.StringUtils.UTF_8; import static org.apache.maven.surefire.util.internal.StringUtils.isBlank; /** * @author Tibor Digana (tibor17) * @since 2.20 */ public final class FailsafeSummaryXmlUtils { private static final String FAILSAFE_SUMMARY_XML_SCHEMA_LOCATION = "https://maven.apache.org/surefire/maven-surefire-plugin/xsd/failsafe-summary.xsd"; private static final String FAILSAFE_SUMMARY_XML_NIL_ATTR = " xsi:nil=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""; private static final String FAILSAFE_SUMMARY_XML_TEMPLATE = "\n" + "\n" + " %d\n" + " %d\n" + " %d\n" + " %d\n" + " %s\n" + ""; private FailsafeSummaryXmlUtils() { throw new IllegalStateException( "No instantiable constructor." ); } public static RunResult toRunResult( File failsafeSummaryXml ) throws Exception { XPathFactory xpathFactory = XPathFactory.newInstance(); XPath xpath = xpathFactory.newXPath(); FileInputStream is = new FileInputStream( failsafeSummaryXml ); try { Node root = (Node) xpath.evaluate( "/", new InputSource( is ), XPathConstants.NODE ); String completed = xpath.evaluate( "/failsafe-summary/completed", root ); String errors = xpath.evaluate( "/failsafe-summary/errors", root ); String failures = xpath.evaluate( "/failsafe-summary/failures", root ); String skipped = xpath.evaluate( "/failsafe-summary/skipped", root ); String failureMessage = xpath.evaluate( "/failsafe-summary/failureMessage", root ); String timeout = xpath.evaluate( "/failsafe-summary/@timeout", root ); return new RunResult( parseInt( completed ), parseInt( errors ), parseInt( failures ), parseInt( skipped ), isBlank( failureMessage ) ? null : unescapeXml( failureMessage ), parseBoolean( timeout ) ); } finally { is.close(); } } public static void fromRunResultToFile( RunResult fromRunResult, File toFailsafeSummaryXml ) throws IOException { String failure = fromRunResult.getFailure(); String xml = String.format( Locale.ROOT, FAILSAFE_SUMMARY_XML_TEMPLATE, fromRunResult.getFailsafeCode(), String.valueOf( fromRunResult.isTimeout() ), fromRunResult.getCompletedCount(), fromRunResult.getErrors(), fromRunResult.getFailures(), fromRunResult.getSkipped(), isBlank( failure ) ? FAILSAFE_SUMMARY_XML_NIL_ATTR : "", isBlank( failure ) ? "" : escapeXml10( failure ) ); FileOutputStream os = new FileOutputStream( toFailsafeSummaryXml ); try { IOUtils.write( xml, os, UTF_8 ); } finally { os.close(); } } public static void writeSummary( RunResult mergedSummary, File mergedSummaryFile, boolean inProgress ) throws Exception { if ( !mergedSummaryFile.getParentFile().isDirectory() ) { //noinspection ResultOfMethodCallIgnored mergedSummaryFile.getParentFile().mkdirs(); } if ( mergedSummaryFile.exists() && inProgress ) { RunResult runResult = toRunResult( mergedSummaryFile ); mergedSummary = mergedSummary.aggregate( runResult ); } fromRunResultToFile( mergedSummary, mergedSummaryFile ); } } maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/000077500000000000000000000000001330756104600242745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/java/000077500000000000000000000000001330756104600252155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/java/org/000077500000000000000000000000001330756104600260045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/java/org/apache/000077500000000000000000000000001330756104600272255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600303335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/000077500000000000000000000000001330756104600316315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/000077500000000000000000000000001330756104600334035ustar00rootroot00000000000000IntegrationTestMojoTest.java000066400000000000000000000057471330756104600410140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafepackage org.apache.maven.plugin.failsafe; /* * 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. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DefaultArtifact; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.project.MavenProject; import org.junit.Before; import org.junit.Test; import java.io.File; import java.io.IOException; import static org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; import static org.fest.assertions.Assertions.assertThat; /** * @since 2.20 */ public class IntegrationTestMojoTest { private IntegrationTestMojo mojo; @Before public void init() throws InvalidVersionSpecificationException, IOException { Artifact artifact = new DefaultArtifact( "g", "a", createFromVersionSpec( "1.0" ), "compile", "jar", "", null ); artifact.setFile( new File( "./target/tmp/a-1.0.jar" ) ); new File( "./target/tmp" ).mkdir(); artifact.getFile().createNewFile(); mojo = spy( IntegrationTestMojo.class ); MavenProject project = mock( MavenProject.class ); when( project.getArtifact() ).thenReturn( artifact ); when( mojo.getProject() ).thenReturn( project ); } @Test public void shouldBeJar() { mojo.setDefaultClassesDirectory( new File( "./target/classes" ) ); File binaries = mojo.getClassesDirectory(); assertThat( binaries.getName() ).isEqualTo( "a-1.0.jar" ); } @Test public void shouldBeAnotherJar() { mojo.setClassesDirectory( new File( "./target/another-1.0.jar" ) ); mojo.setDefaultClassesDirectory( new File( "./target/classes" ) ); File binaries = mojo.getClassesDirectory(); assertThat( binaries.getName() ).isEqualTo( "another-1.0.jar" ); } @Test public void shouldBeClasses() { mojo.setClassesDirectory( new File( "./target/classes" ) ); mojo.setDefaultClassesDirectory( new File( "./target/classes" ) ); File binaries = mojo.getClassesDirectory(); assertThat( binaries.getName() ).isEqualTo( "classes" ); } } JUnit4SuiteTest.java000066400000000000000000000026761330756104600371710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafepackage org.apache.maven.plugin.failsafe; /* * 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. */ import junit.framework.JUnit4TestAdapter; import junit.framework.Test; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; /** * Adapt the JUnit4 tests which use only annotations to the JUnit3 test suite. * * @author Tibor Digana (tibor17) * @since 2.21.0 */ @SuiteClasses( { IntegrationTestMojoTest.class, MarshallerUnmarshallerTest.class, RunResultTest.class } ) @RunWith( Suite.class ) public class JUnit4SuiteTest { public static Test suite() { return new JUnit4TestAdapter( JUnit4SuiteTest.class ); } } MarshallerUnmarshallerTest.java000066400000000000000000000073371330756104600415110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafepackage org.apache.maven.plugin.failsafe; /* * 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. */ import org.apache.maven.plugin.failsafe.util.FailsafeSummaryXmlUtils; import org.apache.maven.surefire.suite.RunResult; import org.junit.Test; import java.io.File; import static org.fest.assertions.Assertions.assertThat; public class MarshallerUnmarshallerTest { @Test public void shouldUnmarshallExistingXmlFile() throws Exception { File xml = new File( "target/test-classes/org/apache/maven/plugin/failsafe/failsafe-summary.xml" ); RunResult summary = FailsafeSummaryXmlUtils.toRunResult( xml ); assertThat( summary.getCompletedCount() ) .isEqualTo( 7 ); assertThat( summary.getErrors() ) .isEqualTo( 1 ); assertThat( summary.getFailures() ) .isEqualTo( 2 ); assertThat( summary.getSkipped() ) .isEqualTo( 3 ); assertThat( summary.getFailure() ) .contains( "There was an error in the forked processtest " + "subsystem#no method RuntimeException Hi There!" ); assertThat( summary.getFailure() ) .contains( "There was an error in the forked processtest " + "subsystem#no method RuntimeException Hi There! $&>>" + "\n\tat org.apache.maven.plugin.surefire.booterclient.ForkStarter" + ".awaitResultsDone(ForkStarter.java:489)" ); } @Test public void shouldMarshallAndUnmarshallSameXml() throws Exception { RunResult expected = new RunResult( 7, 1, 2, 3, 2, "There was an error in the forked processtest " + "subsystem#no method RuntimeException Hi There! $&>>" + "\n\tat org.apache.maven.plugin.surefire.booterclient.ForkStarter" + ".awaitResultsDone(ForkStarter.java:489)", true ); File xml = File.createTempFile( "failsafe-summary", ".xml" ); FailsafeSummaryXmlUtils.writeSummary( expected, xml, false ); RunResult actual = FailsafeSummaryXmlUtils.toRunResult( xml ); assertThat( actual.getFailures() ) .isEqualTo( expected.getFailures() ); assertThat( actual.isTimeout() ) .isEqualTo( expected.isTimeout() ); assertThat( actual.getCompletedCount() ) .isEqualTo( expected.getCompletedCount() ); assertThat( actual.getErrors() ) .isEqualTo( expected.getErrors() ); assertThat( actual.getFailures() ) .isEqualTo( expected.getFailures() ); assertThat( actual.getSkipped() ) .isEqualTo( expected.getSkipped() ); assertThat( actual.getFailure() ) .isEqualTo( expected.getFailure() ); } } RunResultTest.java000066400000000000000000000106361330756104600370000ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafepackage org.apache.maven.plugin.failsafe; /* * 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. */ import org.apache.maven.plugin.failsafe.util.FailsafeSummaryXmlUtils; import org.apache.maven.surefire.suite.RunResult; import org.junit.Test; import java.io.File; import java.nio.charset.Charset; import static org.fest.assertions.Assertions.assertThat; /** * @author Tibor Digana (tibor17) * @since 2.20 */ public class RunResultTest { @Test public void testAggregatedValues() { RunResult simple = getSimpleAggregate(); assertThat( simple.getCompletedCount() ) .isEqualTo( 20 ); assertThat( simple.getErrors() ) .isEqualTo( 3 ); assertThat( simple.getFailures() ) .isEqualTo( 7 ); assertThat( simple.getSkipped() ) .isEqualTo( 4 ); assertThat( simple.getFlakes() ) .isEqualTo( 2 ); } @Test public void testSerialization() throws Exception { writeReadCheck( getSimpleAggregate() ); } @Test public void testFailures() throws Exception { writeReadCheck( new RunResult( 0, 1, 2, 3, "stacktraceHere", false ) ); } @Test public void testSkipped() throws Exception { writeReadCheck( new RunResult( 3, 2, 1, 0, null, true ) ); } @Test public void testAppendSerialization() throws Exception { RunResult simpleAggregate = getSimpleAggregate(); RunResult additional = new RunResult( 2, 1, 2, 2, "msg " + ( (char) 0x0E01 ), true ); File summary = File.createTempFile( "failsafe", "test" ); FailsafeSummaryXmlUtils.writeSummary( simpleAggregate, summary, false ); FailsafeSummaryXmlUtils.writeSummary( additional, summary, true ); RunResult actual = FailsafeSummaryXmlUtils.toRunResult( summary ); //noinspection ResultOfMethodCallIgnored summary.delete(); RunResult expected = simpleAggregate.aggregate( additional ); assertThat( expected.getCompletedCount() ) .isEqualTo( 22 ); assertThat( expected.getErrors() ) .isEqualTo( 4 ); assertThat( expected.getFailures() ) .isEqualTo( 9 ); assertThat( expected.getSkipped() ) .isEqualTo( 6 ); assertThat( expected.getFlakes() ) .isEqualTo( 2 ); assertThat( expected.getFailure() ) .isEqualTo( "msg " + ( (char) 0x0E01 ) ); assertThat( expected.isTimeout() ) .isTrue(); assertThat( actual ) .isEqualTo( expected ); } @Test public void shouldAcceptAliasCharset() { Charset charset1 = IntegrationTestMojo.toCharset( "UTF8" ); assertThat( charset1.name() ).isEqualTo( "UTF-8" ); Charset charset2 = IntegrationTestMojo.toCharset( "utf8" ); assertThat( charset2.name() ).isEqualTo( "UTF-8" ); } private void writeReadCheck( RunResult expected ) throws Exception { File tmp = File.createTempFile( "test", "xml" ); FailsafeSummaryXmlUtils.fromRunResultToFile( expected, tmp ); RunResult actual = FailsafeSummaryXmlUtils.toRunResult( tmp ); //noinspection ResultOfMethodCallIgnored tmp.delete(); assertThat( actual ) .isEqualTo( expected ); } private RunResult getSimpleAggregate() { RunResult resultOne = new RunResult( 10, 1, 3, 2, 1 ); RunResult resultTwo = new RunResult( 10, 2, 4, 2, 1 ); return resultOne.aggregate( resultTwo ); } } maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/resources/000077500000000000000000000000001330756104600263065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/resources/org/000077500000000000000000000000001330756104600270755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/resources/org/apache/000077500000000000000000000000001330756104600303165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/resources/org/apache/maven/000077500000000000000000000000001330756104600314245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/resources/org/apache/maven/plugin/000077500000000000000000000000001330756104600327225ustar00rootroot00000000000000failsafe/000077500000000000000000000000001330756104600344155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/resources/org/apache/maven/pluginfailsafe-summary.xml000066400000000000000000000106541330756104600404120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-failsafe-plugin/src/test/resources/org/apache/maven/plugin/failsafe 7 1 2 3 maven-surefire-surefire-2.22.0/maven-surefire-common/000077500000000000000000000000001330756104600225725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/pom.xml000066400000000000000000000172651330756104600241220ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire 2.22.0 maven-surefire-common Maven Surefire Common API used in Surefire and Failsafe MOJO. 2.2.1 org.apache.maven maven-plugin-api org.apache.maven.plugin-tools maven-plugin-annotations org.apache.maven.surefire surefire-api org.apache.maven.surefire surefire-booter org.apache.maven.shared maven-shared-utils org.apache.maven maven-artifact org.apache.maven maven-plugin-descriptor org.apache.maven maven-project commons-io commons-io org.apache.maven maven-model org.apache.maven maven-core org.apache.maven maven-toolchain org.apache.commons commons-lang3 com.google.code.findbugs jsr305 provided org.apache.maven.shared maven-common-artifact-filters org.fusesource.jansi jansi provided org.codehaus.plexus plexus-java org.mockito mockito-core test org.powermock powermock-core test org.powermock powermock-module-junit4 test org.powermock powermock-api-mockito2 test org.codehaus.mojo build-helper-maven-plugin add-source generate-sources add-source ${project.build.directory}/generated-sources maven-dependency-plugin shared-logging-generated-sources generate-sources unpack ${project.build.directory}/generated-sources false org.apache.maven.shared:maven-shared-utils:3.1.0:jar:sources org/apache/maven/shared/utils/logging/*.java maven-surefire-plugin **/JUnit4SuiteTest.java org.apache.maven.surefire surefire-shadefire 2.12.4 org.apache.maven.plugins maven-shade-plugin package shade true org.apache.maven.shared:maven-shared-utils org.apache.maven.shared:maven-common-artifact-filters commons-io:commons-io org.apache.commons:commons-lang3 org.apache.maven.shared org.apache.maven.surefire.shade.org.apache.maven.shared org.apache.commons.io org.apache.maven.surefire.shade.org.apache.commons.io org.apache.commons.lang3 org.apache.maven.surefire.shade.org.apache.commons.lang3 maven-surefire-surefire-2.22.0/maven-surefire-common/src/000077500000000000000000000000001330756104600233615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/000077500000000000000000000000001330756104600243055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/000077500000000000000000000000001330756104600252265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/000077500000000000000000000000001330756104600260155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/000077500000000000000000000000001330756104600272365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600303445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/000077500000000000000000000000001330756104600316425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/000077500000000000000000000000001330756104600334665ustar00rootroot00000000000000AbstractSurefireMojo.java000066400000000000000000004200611330756104600403520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire// CHECKSTYLE_OFF: FileLength|RegexpHeader package org.apache.maven.plugin.surefire; /* * 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. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.metadata.ArtifactMetadataSource; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.AbstractArtifactResolutionException; import org.apache.maven.artifact.resolver.ArtifactNotFoundException; import org.apache.maven.artifact.resolver.ArtifactResolutionException; import org.apache.maven.artifact.resolver.ArtifactResolutionResult; import org.apache.maven.artifact.resolver.ArtifactResolver; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter; import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter; import org.apache.maven.artifact.versioning.ArtifactVersion; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.apache.maven.plugin.surefire.booterclient.ChecksumCalculator; import org.apache.maven.plugin.surefire.booterclient.ForkConfiguration; import org.apache.maven.plugin.surefire.booterclient.ForkStarter; import org.apache.maven.plugin.surefire.booterclient.ClasspathForkConfiguration; import org.apache.maven.plugin.surefire.booterclient.JarManifestForkConfiguration; import org.apache.maven.plugin.surefire.booterclient.ModularClasspathForkConfiguration; import org.apache.maven.plugin.surefire.booterclient.Platform; import org.apache.maven.plugin.surefire.booterclient.ProviderDetector; import org.apache.maven.plugin.surefire.log.PluginConsoleLogger; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.util.DependencyScanner; import org.apache.maven.plugin.surefire.util.DirectoryScanner; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.apache.maven.shared.artifact.filter.PatternIncludesArtifactFilter; import org.apache.maven.shared.utils.io.FileUtils; import org.apache.maven.surefire.booter.ClassLoaderConfiguration; import org.apache.maven.surefire.booter.Classpath; import org.apache.maven.surefire.booter.ClasspathConfiguration; import org.apache.maven.surefire.booter.KeyValueSource; import org.apache.maven.surefire.booter.ModularClasspath; import org.apache.maven.surefire.booter.ModularClasspathConfiguration; import org.apache.maven.surefire.booter.ProviderConfiguration; import org.apache.maven.surefire.booter.ProviderParameterNames; import org.apache.maven.surefire.booter.Shutdown; import org.apache.maven.surefire.booter.StartupConfiguration; import org.apache.maven.surefire.booter.SurefireBooterForkException; import org.apache.maven.surefire.booter.SurefireExecutionException; import org.apache.maven.surefire.cli.CommandLineOption; import org.apache.maven.surefire.providerapi.SurefireProvider; import org.apache.maven.surefire.report.ReporterConfiguration; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.DirectoryScannerParameters; import org.apache.maven.surefire.testset.RunOrderParameters; import org.apache.maven.surefire.testset.TestArtifactInfo; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.testset.TestRequest; import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.DefaultScanResult; import org.apache.maven.surefire.util.RunOrder; import org.apache.maven.surefire.util.SurefireReflectionException; import org.apache.maven.toolchain.DefaultToolchain; import org.apache.maven.toolchain.Toolchain; import org.apache.maven.toolchain.ToolchainManager; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.languages.java.jpms.LocationManager; import org.codehaus.plexus.languages.java.jpms.ResolvePathsRequest; import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult; import javax.annotation.Nonnull; import java.io.File; import java.io.IOException; import java.lang.reflect.Array; import java.lang.reflect.Method; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; import java.util.concurrent.ConcurrentHashMap; import static java.lang.Thread.currentThread; import static java.util.Arrays.asList; import static java.util.Collections.addAll; import static java.util.Collections.singletonList; import static java.util.Collections.singletonMap; import static org.apache.commons.lang3.StringUtils.substringBeforeLast; import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS; import static org.apache.maven.plugin.surefire.util.DependencyScanner.filter; import static org.apache.maven.shared.utils.StringUtils.capitalizeFirstLetter; import static org.apache.maven.shared.utils.StringUtils.isEmpty; import static org.apache.maven.shared.utils.StringUtils.isNotBlank; import static org.apache.maven.shared.utils.StringUtils.isNotEmpty; import static org.apache.maven.shared.utils.StringUtils.split; import static org.apache.maven.surefire.booter.SystemUtils.JAVA_SPECIFICATION_VERSION; import static org.apache.maven.surefire.booter.SystemUtils.endsWithJavaPath; import static org.apache.maven.surefire.booter.SystemUtils.isBuiltInJava7AtLeast; import static org.apache.maven.surefire.booter.SystemUtils.isBuiltInJava9AtLeast; import static org.apache.maven.surefire.booter.SystemUtils.isJava9AtLeast; import static org.apache.maven.surefire.booter.SystemUtils.toJdkHomeFromJvmExec; import static org.apache.maven.surefire.booter.SystemUtils.toJdkVersionFromReleaseFile; import static org.apache.maven.surefire.suite.RunResult.failure; import static org.apache.maven.surefire.suite.RunResult.noTestsRun; import static org.apache.maven.surefire.util.ReflectionUtils.invokeGetter; import static org.apache.maven.surefire.util.ReflectionUtils.invokeStaticMethod; import static org.apache.maven.surefire.util.ReflectionUtils.tryLoadClass; /** * Abstract base class for running tests using Surefire. * * @author Stephen Connolly * @version $Id: SurefirePlugin.java 945065 2010-05-17 10:26:22Z stephenc $ */ public abstract class AbstractSurefireMojo extends AbstractMojo implements SurefireExecutionParameters { private static final String FORK_ONCE = "once"; private static final String FORK_ALWAYS = "always"; private static final String FORK_NEVER = "never"; private static final String FORK_PERTHREAD = "perthread"; private static final Map JAVA_9_MATCHER_OLD_NOTATION = singletonMap( "version", "[1.9,)" ); private static final Map JAVA_9_MATCHER = singletonMap( "version", "[9,)" ); private static final Platform PLATFORM = new Platform(); private static final File SYSTEM_TMP_DIR = new File( System.getProperty( "java.io.tmpdir" ) ); private final ProviderDetector providerDetector = new ProviderDetector(); /** * Information about this plugin, mainly used to lookup this plugin's configuration from the currently executing * project. * * @since 2.12 */ @Parameter( defaultValue = "${plugin}", readonly = true ) private PluginDescriptor pluginDescriptor; /** * Set this to "true" to skip running tests, but still compile them. Its use is NOT RECOMMENDED, but quite * convenient on occasion. * * @since 2.4 */ @Parameter( property = "skipTests", defaultValue = "false" ) protected boolean skipTests; /** * This old parameter is just like {@code skipTests}, but bound to the old property "maven.test.skip.exec". * * @since 2.3 * @deprecated Use skipTests instead. */ @Deprecated @Parameter( property = "maven.test.skip.exec" ) protected boolean skipExec; /** * Set this to "true" to bypass unit tests entirely. Its use is NOT RECOMMENDED, especially if you enable it using * the "maven.test.skip" property, because maven.test.skip disables both running the tests and compiling the tests. * Consider using the {@code skipTests} parameter instead. */ @Parameter( property = "maven.test.skip", defaultValue = "false" ) protected boolean skip; /** * The Maven Project Object. */ @Component private MavenProject project; /** * The base directory of the project being tested. This can be obtained in your integration test via * System.getProperty("basedir"). */ @Parameter( defaultValue = "${basedir}" ) protected File basedir; /** * The directory containing generated test classes of the project being tested. This will be included at the * beginning of the test classpath. * */ @Parameter( defaultValue = "${project.build.testOutputDirectory}" ) protected File testClassesDirectory; /** * List of dependencies to exclude from the test classpath. Each dependency string must follow the format * groupId:artifactId. For example: org.acme:project-a * * @since 2.6 */ @Parameter( property = "maven.test.dependency.excludes" ) private String[] classpathDependencyExcludes; /** * A dependency scope to exclude from the test classpath. The scope should be one of the scopes defined by * org.apache.maven.artifact.Artifact. This includes the following: *
*
    *
  • compile - system, provided, compile *
  • runtime - compile, runtime *
  • compile+runtime - system, provided, compile, runtime *
  • runtime+system - system, compile, runtime *
  • test - system, provided, compile, runtime, test *
* * @since 2.6 */ @Parameter( defaultValue = "" ) private String classpathDependencyScopeExclude; /** * Additional elements to be appended to the classpath. * * @since 2.4 */ @Parameter( property = "maven.test.additionalClasspath" ) private String[] additionalClasspathElements; /** * The test source directory containing test class sources. * * @since 2.2 */ @Parameter( defaultValue = "${project.build.testSourceDirectory}", required = true ) private File testSourceDirectory; /** * A list of <exclude> elements specifying the tests (by pattern) that should be excluded in testing. When not * specified and when the {@code test} parameter is not specified, the default excludes will be
*

     * {@literal }
     *     {@literal }**{@literal /}*$*{@literal }
     * {@literal }
     * 
* (which excludes all inner classes). *
* This parameter is ignored if the TestNG {@code suiteXmlFiles} parameter is specified. *
* Each exclude item may also contain a comma-separated sub-list of items, which will be treated as multiple *  <exclude> entries.
* Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): *

     * {@literal }%regex[pkg.*Slow.*.class], Unstable*{@literal }
     * 
*
* Notice that these values are relative to the directory containing generated test classes of the project * being tested. This directory is declared by the parameter {@code testClassesDirectory} which defaults * to the POM property ${project.build.testOutputDirectory}, typically * {@literal src/test/java} unless overridden. */ @Parameter // TODO use regex for fully qualified class names in 3.0 and change the filtering abilities private List excludes; /** * ArtifactRepository of the localRepository. To obtain the directory of localRepository in unit tests use * System.getProperty("localRepository"). */ @Parameter( defaultValue = "${localRepository}", required = true, readonly = true ) private ArtifactRepository localRepository; /** * List of System properties to pass to the JUnit tests. * * @deprecated Use systemPropertyVariables instead. */ @Deprecated @Parameter private Properties systemProperties; /** * List of System properties to pass to the JUnit tests. * * @since 2.5 */ @Parameter private Map systemPropertyVariables; /** * List of System properties, loaded from a file, to pass to the JUnit tests. * * @since 2.8.2 */ @Parameter private File systemPropertiesFile; /** * List of properties for configuring all TestNG related configurations. This is the new preferred method of * configuring TestNG. * * @since 2.4 */ @Parameter private Properties properties; /** * Map of plugin artifacts. */ // olamy: would make more sense using defaultValue but doesn't work with maven 2.x @Parameter( property = "plugin.artifactMap", required = true, readonly = true ) private Map pluginArtifactMap; /** * Map of project artifacts. */ // olamy: would make more sense using defaultValue but doesn't work with maven 2.x @Parameter( property = "project.artifactMap", readonly = true, required = true ) private Map projectArtifactMap; /** * Add custom text into report filename: TEST-testClassName-reportNameSuffix.xml, * testClassName-reportNameSuffix.txt and testClassName-reportNameSuffix-output.txt. * File TEST-testClassName-reportNameSuffix.xml has changed attributes 'testsuite'--'name' * and 'testcase'--'classname' - reportNameSuffix is added to the attribute value. */ @Parameter( property = "surefire.reportNameSuffix", defaultValue = "" ) private String reportNameSuffix; /** * Set this to "true" to redirect the unit test standard output to a file (found in * reportsDirectory/testName-output.txt). * * @since 2.3 */ @Parameter( property = "maven.test.redirectTestOutputToFile", defaultValue = "false" ) private boolean redirectTestOutputToFile; /** * Set this to "true" to cause a failure if there are no tests to run. Defaults to "false". * * @since 2.4 */ @Parameter( property = "failIfNoTests" ) private Boolean failIfNoTests; /** * DEPRECATED since version 2.14. Use {@code forkCount} and {@code reuseForks} instead. *
*
* Option to specify the forking mode. Can be {@code never}, {@code once}, {@code always}, {@code perthread}.
* The {@code none} and {@code pertest} are also accepted for backwards compatibility.
* The {@code always} forks for each test-class.
* The {@code perthread} creates the number of parallel forks specified by {@code threadCount}, where each forked * JVM is executing one test-class. See also the parameter {@code reuseForks} for the lifetime of JVM. * * @since 2.1 */ @Parameter( property = "forkMode", defaultValue = "once" ) private String forkMode; /** * Relative path to temporary-surefire-boot directory containing internal Surefire temporary files. *
* The temporary-surefire-boot directory is project.build.directory on most platforms or * system default temporary-directory specified by the system property {@code java.io.tmpdir} * on Windows (see SUREFIRE-1400). *
* It is deleted after the test set has completed. * * @since 2.20 */ @Parameter( property = "tempDir", defaultValue = "surefire" ) private String tempDir; /** * Option to specify the jvm (or path to the java executable) to use with the forking options. For the default, the * jvm will be a new instance of the same VM as the one used to run Maven. JVM settings are not inherited from * MAVEN_OPTS. * * @since 2.1 */ @Parameter( property = "jvm" ) private String jvm; /** * Arbitrary JVM options to set on the command line. *
*
* Since the Version 2.17 using an alternate syntax for {@code argLine}, @{...} allows late replacement * of properties when the plugin is executed, so properties that have been modified by other plugins will be picked * up correctly. * See the Frequently Asked Questions page with more details:
* * http://maven.apache.org/surefire/maven-surefire-plugin/faq.html *
* * http://maven.apache.org/surefire/maven-failsafe-plugin/faq.html * * @since 2.1 */ @Parameter( property = "argLine" ) private String argLine; /** * Additional environment variables to set on the command line. * * @since 2.1.3 */ @Parameter private Map environmentVariables = new HashMap(); /** * Command line working directory. * * @since 2.1.3 */ @Parameter( property = "basedir" ) private File workingDirectory; /** * When false it makes tests run using the standard classloader delegation instead of the default Maven isolated * classloader. Only used when forking ({@code forkMode} is not {@code none}).
* Setting it to false helps with some problems caused by conflicts between xml parsers in the classpath and the * Java 5 provider parser. * * @since 2.1 */ @Parameter( property = "childDelegation", defaultValue = "false" ) private boolean childDelegation; /** * (TestNG/JUnit47 provider with JUnit4.8+ only) Groups for this test. Only classes/methods/etc decorated with one * of the groups specified here will be included in test run, if specified.
* For JUnit, this parameter forces the use of the 4.7 provider
* This parameter is ignored if the {@code suiteXmlFiles} parameter is specified.
* Since version 2.18.1 and JUnit 4.12, the {@code @Category} annotation type is automatically inherited from * superclasses, see {@code @java.lang.annotation.Inherited}. Make sure that test class inheritance still makes * sense together with {@code @Category} annotation of the JUnit 4.12 or higher appeared in superclass. * * @since 2.2 */ @Parameter( property = "groups" ) private String groups; /** * (TestNG/JUnit47 provider with JUnit4.8+ only) Excluded groups. Any methods/classes/etc with one of the groups * specified in this list will specifically not be run.
* For JUnit, this parameter forces the use of the 4.7 provider.
* This parameter is ignored if the {@code suiteXmlFiles} parameter is specified.
* Since version 2.18.1 and JUnit 4.12, the {@code @Category} annotation type is automatically inherited from * superclasses, see {@code @java.lang.annotation.Inherited}. Make sure that test class inheritance still makes * sense together with {@code @Category} annotation of the JUnit 4.12 or higher appeared in superclass. * * @since 2.2 */ @Parameter( property = "excludedGroups" ) private String excludedGroups; /** * Allows you to specify the name of the JUnit artifact. If not set, {@code junit:junit} will be used. * * @since 2.3.1 */ @Parameter( property = "junitArtifactName", defaultValue = "junit:junit" ) private String junitArtifactName; /** * Allows you to specify the name of the JUnit Platform artifact. * If not set, {@code org.junit.platform:junit-platform-engine} will be used. * * @since 2.22.0 */ @Parameter( property = "junitPlatformArtifactName", defaultValue = "org.junit.platform:junit-platform-engine" ) private String junitPlatformArtifactName; /** * Allows you to specify the name of the TestNG artifact. If not set, {@code org.testng:testng} will be used. * * @since 2.3.1 */ @Parameter( property = "testNGArtifactName", defaultValue = "org.testng:testng" ) private String testNGArtifactName; /** * (TestNG/JUnit 4.7 provider) The attribute thread-count allows you to specify how many threads should be * allocated for this execution. Only makes sense to use in conjunction with the {@code parallel} parameter. * * @since 2.2 */ @Parameter( property = "threadCount" ) private int threadCount; /** * Option to specify the number of VMs to fork in parallel in order to execute the tests. When terminated with "C", * the number part is multiplied with the number of CPU cores. Floating point value are only accepted together with * "C". If set to "0", no VM is forked and all tests are executed within the main process.
*
* Example values: "1.5C", "4"
*
* The system properties and the {@code argLine} of the forked processes may contain the place holder string * ${surefire.forkNumber}, which is replaced with a fixed number for each of the parallel forks, * ranging from 1 to the effective value of {@code forkCount} times the maximum number of parallel * Surefire executions in maven parallel builds, i.e. the effective value of the -T command line * argument of maven core. * * @since 2.14 */ @Parameter( property = "forkCount", defaultValue = "1" ) private String forkCount; /** * Indicates if forked VMs can be reused. If set to "false", a new VM is forked for each test class to be executed. * If set to "true", up to {@code forkCount} VMs will be forked and then reused to execute all tests. * * @since 2.13 */ @Parameter( property = "reuseForks", defaultValue = "true" ) private boolean reuseForks; /** * (JUnit 4.7 provider) Indicates that threadCount, threadCountSuites, threadCountClasses, threadCountMethods * are per cpu core. * * @since 2.5 */ @Parameter( property = "perCoreThreadCount", defaultValue = "true" ) private boolean perCoreThreadCount; /** * (JUnit 4.7 provider) Indicates that the thread pool will be unlimited. The {@code parallel} parameter and * the actual number of classes/methods will decide. Setting this to "true" effectively disables * {@code perCoreThreadCount} and {@code threadCount}. Defaults to "false". * * @since 2.5 */ @Parameter( property = "useUnlimitedThreads", defaultValue = "false" ) private boolean useUnlimitedThreads; /** * (TestNG provider) When you use the parameter {@code parallel}, TestNG will try to run all your test methods * in separate threads, except for methods that depend on each other, which will be run in the same thread in order * to respect their order of execution. *
* (JUnit 4.7 provider) Supports values {@code classes}, {@code methods}, {@code both} to run * in separate threads been controlled by {@code threadCount}. *
*
* Since version 2.16 (JUnit 4.7 provider), the value {@code both} is DEPRECATED. * Use {@code classesAndMethods} instead. *
*
* Since version 2.16 (JUnit 4.7 provider), additional vales are available: *
* {@code suites}, {@code suitesAndClasses}, {@code suitesAndMethods}, {@code classesAndMethods}, {@code all}. * * @since 2.2 */ @Parameter( property = "parallel" ) private String parallel; /** * (JUnit 4.7 / provider only) The thread counts do not exceed the number of parallel suite, class runners and * average number of methods per class if set to true. *
* True by default. * * @since 2.17 */ @Parameter( property = "parallelOptimized", defaultValue = "true" ) private boolean parallelOptimized; /** * (JUnit 4.7 provider) This attribute allows you to specify the concurrency in test suites, i.e.: *
    *
  • number of concurrent suites if {@code threadCount} is 0 or unspecified
  • *
  • limited suites concurrency if {@code useUnlimitedThreads} is set to true
  • *
  • if {@code threadCount} and certain thread-count parameters are > 0 for {@code parallel}, the * concurrency is computed from ratio. For instance {@code parallel=all} and the ratio between * {@code threadCountSuites}:{@code threadCountClasses}:{@code threadCountMethods} is * 2:3:5, there is 20% of {@code threadCount} which appeared in concurrent suites.
  • *
* * Only makes sense to use in conjunction with the {@code parallel} parameter. * The default value 0 behaves same as unspecified one. * * @since 2.16 */ @Parameter( property = "threadCountSuites", defaultValue = "0" ) private int threadCountSuites; /** * (JUnit 4.7 provider) This attribute allows you to specify the concurrency in test classes, i.e.: *
    *
  • number of concurrent classes if {@code threadCount} is 0 or unspecified
  • *
  • limited classes concurrency if {@code useUnlimitedThreads} is set to true
  • *
  • if {@code threadCount} and certain thread-count parameters are > 0 for {@code parallel}, the * concurrency is computed from ratio. For instance {@code parallel=all} and the ratio between * {@code threadCountSuites}:{@code threadCountClasses}:{@code threadCountMethods} is * 2:3:5, there is 30% of {@code threadCount} in concurrent classes.
  • *
  • as in the previous case but without this leaf thread-count. Example: {@code parallel=suitesAndClasses}, * {@code threadCount=16}, {@code threadCountSuites=5}, {@code threadCountClasses} is unspecified leaf, the number * of concurrent classes is varying from >= 11 to 14 or 15. The {@code threadCountSuites} become * given number of threads.
  • *
* * Only makes sense to use in conjunction with the {@code parallel} parameter. * The default value 0 behaves same as unspecified one. * * @since 2.16 */ @Parameter( property = "threadCountClasses", defaultValue = "0" ) private int threadCountClasses; /** * (JUnit 4.7 provider) This attribute allows you to specify the concurrency in test methods, i.e.: *
    *
  • number of concurrent methods if {@code threadCount} is 0 or unspecified
  • *
  • limited concurrency of methods if {@code useUnlimitedThreads} is set to true
  • *
  • if {@code threadCount} and certain thread-count parameters are > 0 for {@code parallel}, the * concurrency is computed from ratio. For instance parallel=all and the ratio between * {@code threadCountSuites}:{@code threadCountClasses}:{@code threadCountMethods} is 2:3:5, * there is 50% of {@code threadCount} which appears in concurrent methods.
  • *
  • as in the previous case but without this leaf thread-count. Example: {@code parallel=all}, * {@code threadCount=16}, {@code threadCountSuites=2}, {@code threadCountClasses=3}, but {@code threadCountMethods} * is unspecified leaf, the number of concurrent methods is varying from >= 11 to 14 or 15. * The {@code threadCountSuites} and {@code threadCountClasses} become given number of threads.
  • *
* Only makes sense to use in conjunction with the {@code parallel} parameter. The default value 0 * behaves same as unspecified one. * * @since 2.16 */ @Parameter( property = "threadCountMethods", defaultValue = "0" ) private int threadCountMethods; /** * Whether to trim the stack trace in the reports to just the lines within the test, or show the full trace. * * @since 2.2 */ @Parameter( property = "trimStackTrace", defaultValue = "true" ) private boolean trimStackTrace; /** * Resolves the artifacts needed. */ @Component private ArtifactResolver artifactResolver; /** * Creates the artifact. */ @Component private ArtifactFactory artifactFactory; /** * The remote plugin repositories declared in the POM. * * @since 2.2 */ @Parameter( defaultValue = "${project.pluginArtifactRepositories}" ) private List remoteRepositories; /** * For retrieval of artifact's metadata. */ @Component private ArtifactMetadataSource metadataSource; /** * Flag to disable the generation of report files in xml format. * * @since 2.2 */ @Parameter( property = "disableXmlReport", defaultValue = "false" ) private boolean disableXmlReport; /** * By default, Surefire enables JVM assertions for the execution of your test cases. To disable the assertions, set * this flag to "false". * * @since 2.3.1 */ @Parameter( property = "enableAssertions", defaultValue = "true" ) private boolean enableAssertions; /** * The current build session instance. */ @Component private MavenSession session; @Component private Logger logger; /** * (TestNG only) Define the factory class used to create all test instances. * * @since 2.5 */ @Parameter( property = "objectFactory" ) private String objectFactory; /** * */ @Parameter( defaultValue = "${session.parallel}", readonly = true ) private Boolean parallelMavenExecution; /** * Read-only parameter with value of Maven property project.build.directory. * @since 2.20 */ @Parameter( defaultValue = "${project.build.directory}", readonly = true ) private File projectBuildDirectory; /** * List of dependencies to scan for test classes to include in the test run. * The child elements of this element must be <dependency> elements, and the * contents of each of these elements must be a string which follows the format: *
* groupId:artifactId. For example: org.acme:project-a. *
* Since version 2.22.0 you can scan for test classes from a project * dependency of your multi-module project. * * @since 2.15 */ @Parameter( property = "dependenciesToScan" ) private String[] dependenciesToScan; /** * */ @Component private ToolchainManager toolchainManager; // todo use in 3.0.0 with java 1.7 and substitute new LocationManager() with component in underneath code // @Component // private LocationManager locationManager; private Artifact surefireBooterArtifact; private Toolchain toolchain; private int effectiveForkCount = -1; /** * The placeholder that is replaced by the executing thread's running number. The thread number * range starts with 1 * Deprecated. */ public static final String THREAD_NUMBER_PLACEHOLDER = "${surefire.threadNumber}"; /** * The placeholder that is replaced by the executing fork's running number. The fork number * range starts with 1 */ public static final String FORK_NUMBER_PLACEHOLDER = "${surefire.forkNumber}"; protected abstract String getPluginName(); protected abstract int getRerunFailingTestsCount(); @Override public abstract List getIncludes(); public abstract File getIncludesFile(); @Override public abstract void setIncludes( List includes ); public abstract File getExcludesFile(); /** * Calls {@link #getSuiteXmlFiles()} as {@link List list}. * Never returns null. * * @return list of TestNG suite XML files provided by MOJO */ protected abstract List suiteXmlFiles(); /** * @return {@code true} if {@link #getSuiteXmlFiles() suite-xml files array} is not empty. */ protected abstract boolean hasSuiteXmlFiles(); public abstract File[] getSuiteXmlFiles(); public abstract void setSuiteXmlFiles( File[] suiteXmlFiles ); public abstract String getRunOrder(); public abstract void setRunOrder( String runOrder ); protected abstract void handleSummary( RunResult summary, Exception firstForkException ) throws MojoExecutionException, MojoFailureException; protected abstract boolean isSkipExecution(); protected abstract String[] getDefaultIncludes(); protected abstract String getReportSchemaLocation(); protected abstract Artifact getMojoArtifact(); private String getDefaultExcludes() { return "**/*$*"; } private SurefireDependencyResolver dependencyResolver; private TestListResolver specificTests; private TestListResolver includedExcludedTests; private List cli; private volatile PluginConsoleLogger consoleLogger; @Override public void execute() throws MojoExecutionException, MojoFailureException { cli = commandLineOptions(); // Stuff that should have been final setupStuff(); if ( verifyParameters() && !hasExecutedBefore() ) { DefaultScanResult scan = scanForTestClasses(); if ( !hasSuiteXmlFiles() && scan.isEmpty() ) { if ( getEffectiveFailIfNoTests() ) { throw new MojoFailureException( "No tests were executed! (Set -DfailIfNoTests=false to ignore this error.)" ); } handleSummary( noTestsRun(), null ); return; } logReportsDirectory(); executeAfterPreconditionsChecked( scan ); } } @Nonnull protected final PluginConsoleLogger getConsoleLogger() { if ( consoleLogger == null ) { synchronized ( this ) { if ( consoleLogger == null ) { consoleLogger = new PluginConsoleLogger( logger ); } } } return consoleLogger; } private void setupStuff() { createDependencyResolver(); surefireBooterArtifact = getSurefireBooterArtifact(); toolchain = getToolchain(); } @Nonnull private DefaultScanResult scanForTestClasses() throws MojoFailureException { DefaultScanResult scan = scanDirectories(); DefaultScanResult scanDeps = scanDependencies(); return scan.append( scanDeps ); } private DefaultScanResult scanDirectories() throws MojoFailureException { DirectoryScanner scanner = new DirectoryScanner( getTestClassesDirectory(), getIncludedAndExcludedTests() ); return scanner.scan(); } @SuppressWarnings( "unchecked" ) List getProjectTestArtifacts() { return project.getTestArtifacts(); } DefaultScanResult scanDependencies() throws MojoFailureException { if ( getDependenciesToScan() == null ) { return null; } else { try { DefaultScanResult result = null; List dependenciesToScan = filter( getProjectTestArtifacts(), asList( getDependenciesToScan() ) ); for ( Artifact artifact : dependenciesToScan ) { String type = artifact.getType(); File out = artifact.getFile(); if ( out == null || !out.exists() || !( "jar".equals( type ) || out.isDirectory() || out.getName().endsWith( ".jar" ) ) ) { continue; } if ( out.isFile() ) { DependencyScanner scanner = new DependencyScanner( singletonList( out ), getIncludedAndExcludedTests() ); result = result == null ? scanner.scan() : result.append( scanner.scan() ); } else if ( out.isDirectory() ) { DirectoryScanner scanner = new DirectoryScanner( out, getIncludedAndExcludedTests() ); result = result == null ? scanner.scan() : result.append( scanner.scan() ); } } return result; } catch ( Exception e ) { throw new MojoFailureException( e.getLocalizedMessage(), e ); } } } boolean verifyParameters() throws MojoFailureException, MojoExecutionException { setProperties( new SurefireProperties( getProperties() ) ); if ( isSkipExecution() ) { getConsoleLogger().info( "Tests are skipped." ); return false; } String jvmToUse = getJvm(); if ( toolchain != null ) { getConsoleLogger().info( "Toolchain in maven-" + getPluginName() + "-plugin: " + toolchain ); if ( jvmToUse != null ) { getConsoleLogger().warning( "Toolchains are ignored, 'jvm' parameter is set to " + jvmToUse ); } } if ( !getTestClassesDirectory().exists() && ( getDependenciesToScan() == null || getDependenciesToScan().length == 0 ) ) { if ( Boolean.TRUE.equals( getFailIfNoTests() ) ) { throw new MojoFailureException( "No tests to run!" ); } getConsoleLogger().info( "No tests to run." ); } else { convertDeprecatedForkMode(); ensureWorkingDirectoryExists(); ensureParallelRunningCompatibility(); ensureThreadCountWithPerThread(); warnIfUselessUseSystemClassLoaderParameter(); warnIfDefunctGroupsCombinations(); warnIfRerunClashes(); warnIfWrongShutdownValue(); warnIfNotApplicableSkipAfterFailureCount(); warnIfIllegalTempDir(); } return true; } private void executeAfterPreconditionsChecked( @Nonnull DefaultScanResult scanResult ) throws MojoExecutionException, MojoFailureException { List providers = createProviders(); RunResult current = noTestsRun(); Exception firstForkException = null; for ( ProviderInfo provider : providers ) { try { current = current.aggregate( executeProvider( provider, scanResult ) ); } catch ( SurefireBooterForkException e ) { if ( firstForkException == null ) { firstForkException = e; } } catch ( SurefireExecutionException e ) { if ( firstForkException == null ) { firstForkException = e; } } catch ( TestSetFailedException e ) { if ( firstForkException == null ) { firstForkException = e; } } } if ( firstForkException != null ) { current = failure( current, firstForkException ); } handleSummary( current, firstForkException ); } private void createDependencyResolver() { dependencyResolver = new SurefireDependencyResolver( getArtifactResolver(), getArtifactFactory(), getConsoleLogger(), getLocalRepository(), getRemoteRepositories(), getMetadataSource(), getPluginName() ); } protected List createProviders() throws MojoFailureException, MojoExecutionException { Artifact junitDepArtifact = getJunitDepArtifact(); return new ProviderList( new DynamicProviderInfo( null ), new TestNgProviderInfo( getTestNgArtifact() ), new JUnitPlatformProviderInfo( getJunitPlatformArtifact() ), new JUnitCoreProviderInfo( getJunitArtifact(), junitDepArtifact ), new JUnit4ProviderInfo( getJunitArtifact(), junitDepArtifact ), new JUnit3ProviderInfo() ) .resolve(); } private SurefireProperties setupProperties() { SurefireProperties sysProps = null; try { sysProps = SurefireProperties.loadProperties( systemPropertiesFile ); } catch ( IOException e ) { String msg = "The system property file '" + systemPropertiesFile.getAbsolutePath() + "' can't be read."; if ( getConsoleLogger().isDebugEnabled() ) { getConsoleLogger().debug( msg, e ); } else { getConsoleLogger().warning( msg ); } } SurefireProperties result = SurefireProperties.calculateEffectiveProperties( getSystemProperties(), getSystemPropertyVariables(), getUserProperties(), sysProps ); result.setProperty( "basedir", getBasedir().getAbsolutePath() ); result.setProperty( "user.dir", getWorkingDirectory().getAbsolutePath() ); result.setProperty( "localRepository", getLocalRepository().getBasedir() ); if ( isForking() ) { for ( Object o : result.propertiesThatCannotBeSetASystemProperties() ) { if ( getArgLine() == null || !getArgLine().contains( "-D" + o + "=" ) ) { getConsoleLogger().warning( o + " cannot be set as system property, use -D" + o + "=... instead" ); } } for ( Object systemPropertyMatchingArgLine : systemPropertiesMatchingArgLine( result ) ) { getConsoleLogger() .warning( "The system property " + systemPropertyMatchingArgLine + " is configured twice! " + "The property appears in and any of , " + " or user property." ); } } if ( getConsoleLogger().isDebugEnabled() ) { showToLog( result, getConsoleLogger() ); } return result; } private Set systemPropertiesMatchingArgLine( SurefireProperties result ) { Set intersection = new HashSet(); if ( isNotBlank( getArgLine() ) ) { for ( Object systemProperty : result.getStringKeySet() ) { if ( getArgLine().contains( "-D" + systemProperty + "=" ) ) { intersection.add( systemProperty ); } } Set ignored = result.propertiesThatCannotBeSetASystemProperties(); intersection.removeAll( ignored ); } return intersection; } private void showToLog( SurefireProperties props, ConsoleLogger log ) { for ( Object key : props.getStringKeySet() ) { String value = props.getProperty( (String) key ); log.debug( "Setting system property [" + key + "]=[" + value + "]" ); } } @Nonnull private RunResult executeProvider( @Nonnull ProviderInfo provider, @Nonnull DefaultScanResult scanResult ) throws MojoExecutionException, MojoFailureException, SurefireExecutionException, SurefireBooterForkException, TestSetFailedException { SurefireProperties effectiveProperties = setupProperties(); ClassLoaderConfiguration classLoaderConfiguration = getClassLoaderConfiguration(); provider.addProviderProperties(); RunOrderParameters runOrderParameters = new RunOrderParameters( getRunOrder(), getStatisticsFile( getConfigChecksum() ) ); if ( isNotForking() ) { createCopyAndReplaceForkNumPlaceholder( effectiveProperties, 1 ).copyToSystemProperties(); InPluginVMSurefireStarter surefireStarter = createInprocessStarter( provider, classLoaderConfiguration, runOrderParameters, scanResult ); return surefireStarter.runSuitesInProcess( scanResult ); } else { ForkConfiguration forkConfiguration = getForkConfiguration(); if ( getConsoleLogger().isDebugEnabled() ) { showMap( getEnvironmentVariables(), "environment variable" ); } Properties originalSystemProperties = (Properties) System.getProperties().clone(); ForkStarter forkStarter = null; try { forkStarter = createForkStarter( provider, forkConfiguration, classLoaderConfiguration, runOrderParameters, getConsoleLogger(), scanResult ); return forkStarter.run( effectiveProperties, scanResult ); } catch ( SurefireExecutionException e ) { forkStarter.killOrphanForks(); throw e; } catch ( SurefireBooterForkException e ) { forkStarter.killOrphanForks(); throw e; } finally { System.setProperties( originalSystemProperties ); cleanupForkConfiguration( forkConfiguration ); } } } public static SurefireProperties createCopyAndReplaceForkNumPlaceholder( SurefireProperties effectiveSystemProperties, int threadNumber ) { SurefireProperties filteredProperties = new SurefireProperties( ( KeyValueSource) effectiveSystemProperties ); String threadNumberString = String.valueOf( threadNumber ); for ( Entry entry : effectiveSystemProperties.entrySet() ) { if ( entry.getValue() instanceof String ) { String value = (String) entry.getValue(); value = value.replace( THREAD_NUMBER_PLACEHOLDER, threadNumberString ); value = value.replace( FORK_NUMBER_PLACEHOLDER, threadNumberString ); filteredProperties.put( entry.getKey(), value ); } } return filteredProperties; } protected void cleanupForkConfiguration( ForkConfiguration forkConfiguration ) { if ( !getConsoleLogger().isDebugEnabled() && forkConfiguration != null ) { File tempDirectory = forkConfiguration.getTempDirectory(); try { FileUtils.deleteDirectory( tempDirectory ); } catch ( IOException e ) { getConsoleLogger() .warning( "Could not delete temp directory " + tempDirectory + " because " + e.getMessage() ); } } } protected void logReportsDirectory() { logDebugOrCliShowErrors( capitalizeFirstLetter( getPluginName() ) + " report directory: " + getReportsDirectory() ); } final Toolchain getToolchain() { Toolchain tc = null; if ( getToolchainManager() != null ) { tc = getToolchainManager().getToolchainFromBuildContext( "jdk", getSession() ); } return tc; } private boolean existsModuleDescriptor() { return getModuleDescriptor().isFile(); } private File getModuleDescriptor() { return new File( getClassesDirectory(), "module-info.class" ); } /** * Converts old TestNG configuration parameters over to new properties based configuration * method. (if any are defined the old way) */ private void convertTestNGParameters() throws MojoExecutionException { if ( this.getParallel() != null ) { getProperties().setProperty( ProviderParameterNames.PARALLEL_PROP, this.getParallel() ); } convertGroupParameters(); if ( this.getThreadCount() > 0 ) { getProperties().setProperty( ProviderParameterNames.THREADCOUNT_PROP, Integer.toString( this.getThreadCount() ) ); } if ( this.getObjectFactory() != null ) { getProperties().setProperty( "objectfactory", this.getObjectFactory() ); } if ( this.getTestClassesDirectory() != null ) { getProperties().setProperty( "testng.test.classpath", getTestClassesDirectory().getAbsolutePath() ); } Artifact testNgArtifact = getTestNgArtifact(); if ( testNgArtifact != null ) { DefaultArtifactVersion defaultArtifactVersion = new DefaultArtifactVersion( testNgArtifact.getVersion() ); getProperties().setProperty( "testng.configurator", getConfiguratorName( defaultArtifactVersion, getConsoleLogger() ) ); } } private static String getConfiguratorName( ArtifactVersion version, PluginConsoleLogger log ) throws MojoExecutionException { try { VersionRange range = VersionRange.createFromVersionSpec( "[4.7,5.2)" ); if ( range.containsVersion( version ) ) { return "org.apache.maven.surefire.testng.conf.TestNG4751Configurator"; } range = VersionRange.createFromVersionSpec( "[5.2,5.3)" ); if ( range.containsVersion( version ) ) { return "org.apache.maven.surefire.testng.conf.TestNG52Configurator"; } range = VersionRange.createFromVersionSpec( "[5.3,5.10)" ); if ( range.containsVersion( version ) ) { return "org.apache.maven.surefire.testng.conf.TestNGMapConfigurator"; } range = VersionRange.createFromVersionSpec( "[5.10,5.13)" ); if ( range.containsVersion( version ) ) { return "org.apache.maven.surefire.testng.conf.TestNG510Configurator"; } range = VersionRange.createFromVersionSpec( "[5.13,5.14.1)" ); if ( range.containsVersion( version ) ) { return "org.apache.maven.surefire.testng.conf.TestNG513Configurator"; } range = VersionRange.createFromVersionSpec( "[5.14.1,5.14.3)" ); if ( range.containsVersion( version ) ) { log.warning( "The 'reporter' or 'listener' may not work properly in TestNG 5.14.1 and 5.14.2." ); return "org.apache.maven.surefire.testng.conf.TestNG5141Configurator"; } range = VersionRange.createFromVersionSpec( "[5.14.3,6.0)" ); if ( range.containsVersion( version ) ) { if ( version.equals( new DefaultArtifactVersion( "[5.14.3,5.14.5]" ) ) ) { throw new MojoExecutionException( "TestNG 5.14.3-5.14.5 is not supported. " + "System dependency org.testng:guice missed path." ); } return "org.apache.maven.surefire.testng.conf.TestNG5143Configurator"; } range = VersionRange.createFromVersionSpec( "[6.0,)" ); if ( range.containsVersion( version ) ) { return "org.apache.maven.surefire.testng.conf.TestNG60Configurator"; } throw new MojoExecutionException( "Unknown TestNG version " + version ); } catch ( InvalidVersionSpecificationException invsex ) { throw new MojoExecutionException( "Bug in plugin. Please report it with the attached stacktrace", invsex ); } } private void convertGroupParameters() { if ( this.getExcludedGroups() != null ) { getProperties().setProperty( ProviderParameterNames.TESTNG_EXCLUDEDGROUPS_PROP, this.getExcludedGroups() ); } if ( this.getGroups() != null ) { getProperties().setProperty( ProviderParameterNames.TESTNG_GROUPS_PROP, this.getGroups() ); } } protected boolean isAnyConcurrencySelected() { return getParallel() != null && !getParallel().trim().isEmpty(); } protected boolean isAnyGroupsSelected() { return this.getGroups() != null || this.getExcludedGroups() != null; } /** * Converts old JUnit configuration parameters over to new properties based configuration * method. (if any are defined the old way) */ private void convertJunitCoreParameters() throws MojoExecutionException { checkThreadCountEntity( getThreadCountSuites(), "suites" ); checkThreadCountEntity( getThreadCountClasses(), "classes" ); checkThreadCountEntity( getThreadCountMethods(), "methods" ); String usedParallel = ( getParallel() != null ) ? getParallel() : "none"; if ( !"none".equals( usedParallel ) ) { checkNonForkedThreads( parallel ); } getProperties().setProperty( ProviderParameterNames.PARALLEL_PROP, usedParallel ); getProperties().setProperty( ProviderParameterNames.THREADCOUNT_PROP, Integer.toString( getThreadCount() ) ); getProperties().setProperty( "perCoreThreadCount", Boolean.toString( getPerCoreThreadCount() ) ); getProperties().setProperty( "useUnlimitedThreads", Boolean.toString( getUseUnlimitedThreads() ) ); getProperties().setProperty( ProviderParameterNames.THREADCOUNTSUITES_PROP, Integer.toString( getThreadCountSuites() ) ); getProperties().setProperty( ProviderParameterNames.THREADCOUNTCLASSES_PROP, Integer.toString( getThreadCountClasses() ) ); getProperties().setProperty( ProviderParameterNames.THREADCOUNTMETHODS_PROP, Integer.toString( getThreadCountMethods() ) ); getProperties().setProperty( ProviderParameterNames.PARALLEL_TIMEOUT_PROP, Double.toString( getParallelTestsTimeoutInSeconds() ) ); getProperties().setProperty( ProviderParameterNames.PARALLEL_TIMEOUTFORCED_PROP, Double.toString( getParallelTestsTimeoutForcedInSeconds() ) ); getProperties().setProperty( ProviderParameterNames.PARALLEL_OPTIMIZE_PROP, Boolean.toString( isParallelOptimized() ) ); String message = "parallel='" + usedParallel + '\'' + ", perCoreThreadCount=" + getPerCoreThreadCount() + ", threadCount=" + getThreadCount() + ", useUnlimitedThreads=" + getUseUnlimitedThreads() + ", threadCountSuites=" + getThreadCountSuites() + ", threadCountClasses=" + getThreadCountClasses() + ", threadCountMethods=" + getThreadCountMethods() + ", parallelOptimized=" + isParallelOptimized(); logDebugOrCliShowErrors( message ); } private void checkNonForkedThreads( String parallel ) throws MojoExecutionException { if ( "suites".equals( parallel ) ) { if ( !( getUseUnlimitedThreads() || getThreadCount() > 0 ^ getThreadCountSuites() > 0 ) ) { throw new MojoExecutionException( "Use threadCount or threadCountSuites > 0 or useUnlimitedThreads=true for parallel='suites'" ); } setThreadCountClasses( 0 ); setThreadCountMethods( 0 ); } else if ( "classes".equals( parallel ) ) { if ( !( getUseUnlimitedThreads() || getThreadCount() > 0 ^ getThreadCountClasses() > 0 ) ) { throw new MojoExecutionException( "Use threadCount or threadCountClasses > 0 or useUnlimitedThreads=true for parallel='classes'" ); } setThreadCountSuites( 0 ); setThreadCountMethods( 0 ); } else if ( "methods".equals( parallel ) ) { if ( !( getUseUnlimitedThreads() || getThreadCount() > 0 ^ getThreadCountMethods() > 0 ) ) { throw new MojoExecutionException( "Use threadCount or threadCountMethods > 0 or useUnlimitedThreads=true for parallel='methods'" ); } setThreadCountSuites( 0 ); setThreadCountClasses( 0 ); } else if ( "suitesAndClasses".equals( parallel ) ) { if ( !( getUseUnlimitedThreads() || onlyThreadCount() || getThreadCountSuites() > 0 && getThreadCountClasses() > 0 && getThreadCount() == 0 && getThreadCountMethods() == 0 || getThreadCount() > 0 && getThreadCountSuites() > 0 && getThreadCountClasses() > 0 && getThreadCountMethods() == 0 || getThreadCount() > 0 && getThreadCountSuites() > 0 && getThreadCount() > getThreadCountSuites() && getThreadCountClasses() == 0 && getThreadCountMethods() == 0 ) ) { throw new MojoExecutionException( "Use useUnlimitedThreads=true, " + "or only threadCount > 0, " + "or (threadCountSuites > 0 and threadCountClasses > 0), " + "or (threadCount > 0 and threadCountSuites > 0 and threadCountClasses > 0) " + "or (threadCount > 0 and threadCountSuites > 0 and threadCount > threadCountSuites) " + "for parallel='suitesAndClasses' or 'both'" ); } setThreadCountMethods( 0 ); } else if ( "suitesAndMethods".equals( parallel ) ) { if ( !( getUseUnlimitedThreads() || onlyThreadCount() || getThreadCountSuites() > 0 && getThreadCountMethods() > 0 && getThreadCount() == 0 && getThreadCountClasses() == 0 || getThreadCount() > 0 && getThreadCountSuites() > 0 && getThreadCountMethods() > 0 && getThreadCountClasses() == 0 || getThreadCount() > 0 && getThreadCountSuites() > 0 && getThreadCount() > getThreadCountSuites() && getThreadCountClasses() == 0 && getThreadCountMethods() == 0 ) ) { throw new MojoExecutionException( "Use useUnlimitedThreads=true, " + "or only threadCount > 0, " + "or (threadCountSuites > 0 and threadCountMethods > 0), " + "or (threadCount > 0 and threadCountSuites > 0 and threadCountMethods > 0), " + "or (threadCount > 0 and threadCountSuites > 0 and threadCount > threadCountSuites) " + "for parallel='suitesAndMethods'" ); } setThreadCountClasses( 0 ); } else if ( "both".equals( parallel ) || "classesAndMethods".equals( parallel ) ) { if ( !( getUseUnlimitedThreads() || onlyThreadCount() || getThreadCountClasses() > 0 && getThreadCountMethods() > 0 && getThreadCount() == 0 && getThreadCountSuites() == 0 || getThreadCount() > 0 && getThreadCountClasses() > 0 && getThreadCountMethods() > 0 && getThreadCountSuites() == 0 || getThreadCount() > 0 && getThreadCountClasses() > 0 && getThreadCount() > getThreadCountClasses() && getThreadCountSuites() == 0 && getThreadCountMethods() == 0 ) ) { throw new MojoExecutionException( "Use useUnlimitedThreads=true, " + "or only threadCount > 0, " + "or (threadCountClasses > 0 and threadCountMethods > 0), " + "or (threadCount > 0 and threadCountClasses > 0 and threadCountMethods > 0), " + "or (threadCount > 0 and threadCountClasses > 0 and threadCount > threadCountClasses) " + "for parallel='both' or parallel='classesAndMethods'" ); } setThreadCountSuites( 0 ); } else if ( "all".equals( parallel ) ) { if ( !( getUseUnlimitedThreads() || onlyThreadCount() || getThreadCountSuites() > 0 && getThreadCountClasses() > 0 && getThreadCountMethods() > 0 || getThreadCount() > 0 && getThreadCountSuites() > 0 && getThreadCountClasses() > 0 && getThreadCountMethods() == 0 && getThreadCount() > ( getThreadCountSuites() + getThreadCountClasses() ) ) ) { throw new MojoExecutionException( "Use useUnlimitedThreads=true, " + "or only threadCount > 0, " + "or (threadCountSuites > 0 and threadCountClasses > 0 and threadCountMethods > 0), " + "or every thread-count is specified, " + "or (threadCount > 0 and threadCountSuites > 0 and threadCountClasses > 0 " + "and threadCount > threadCountSuites + threadCountClasses) " + "for parallel='all'" ); } } else { throw new MojoExecutionException( "Illegal parallel='" + parallel + "'" ); } } private boolean onlyThreadCount() { return getThreadCount() > 0 && getThreadCountSuites() == 0 && getThreadCountClasses() == 0 && getThreadCountMethods() == 0; } private static void checkThreadCountEntity( int count, String entity ) throws MojoExecutionException { if ( count < 0 ) { throw new MojoExecutionException( "parallel maven execution does not allow negative thread-count" + entity ); } } private boolean isJunit47Compatible( Artifact artifact ) { return dependencyResolver.isWithinVersionSpec( artifact, "[4.7,)" ); } private boolean isAnyJunit4( Artifact artifact ) { return dependencyResolver.isWithinVersionSpec( artifact, "[4.0,)" ); } private static boolean isForkModeNever( String forkMode ) { return FORK_NEVER.equals( forkMode ); } protected boolean isForking() { return 0 < getEffectiveForkCount(); } String getEffectiveForkMode() { String forkMode1 = getForkMode(); if ( toolchain != null && isForkModeNever( forkMode1 ) ) { return FORK_ONCE; } return getEffectiveForkMode( forkMode1 ); } private List getRunOrders() { String runOrderString = getRunOrder(); RunOrder[] runOrder = runOrderString == null ? RunOrder.DEFAULT : RunOrder.valueOfMulti( runOrderString ); return asList( runOrder ); } private boolean requiresRunHistory() { final List runOrders = getRunOrders(); return runOrders.contains( RunOrder.BALANCED ) || runOrders.contains( RunOrder.FAILEDFIRST ); } private boolean getEffectiveFailIfNoTests() { if ( isSpecificTestSpecified() ) { if ( getFailIfNoSpecifiedTests() != null ) { return getFailIfNoSpecifiedTests(); } else if ( getFailIfNoTests() != null ) { return getFailIfNoTests(); } else { return true; } } else { return getFailIfNoTests() != null && getFailIfNoTests(); } } private ProviderConfiguration createProviderConfiguration( RunOrderParameters runOrderParameters ) throws MojoExecutionException, MojoFailureException { final ReporterConfiguration reporterConfiguration = new ReporterConfiguration( getReportsDirectory(), isTrimStackTrace() ); final Artifact testNgArtifact = getTestNgArtifact(); final boolean isTestNg = testNgArtifact != null; final TestArtifactInfo testNg = isTestNg ? new TestArtifactInfo( testNgArtifact.getVersion(), testNgArtifact.getClassifier() ) : null; final TestRequest testSuiteDefinition = new TestRequest( suiteXmlFiles(), getTestSourceDirectory(), getSpecificTests(), getRerunFailingTestsCount() ); final boolean actualFailIfNoTests; DirectoryScannerParameters directoryScannerParameters = null; if ( hasSuiteXmlFiles() && !isSpecificTestSpecified() ) { actualFailIfNoTests = getFailIfNoTests() != null && getFailIfNoTests(); if ( !isTestNg ) { throw new MojoExecutionException( "suiteXmlFiles is configured, but there is no TestNG dependency" ); } } else { if ( isSpecificTestSpecified() ) { actualFailIfNoTests = getEffectiveFailIfNoTests(); setFailIfNoTests( actualFailIfNoTests ); } else { actualFailIfNoTests = getFailIfNoTests() != null && getFailIfNoTests(); } // @todo remove these three params and use DirectoryScannerParameters to pass into DirectoryScanner only // @todo or remove it in next major version :: 3.0 // @todo remove deprecated methods in ProviderParameters => included|excluded|specificTests not needed here List actualIncludes = getIncludeList(); // Collections.emptyList(); behaves same List actualExcludes = getExcludeList(); // Collections.emptyList(); behaves same // Collections.emptyList(); behaves same List specificTests = Collections.emptyList(); directoryScannerParameters = new DirectoryScannerParameters( getTestClassesDirectory(), actualIncludes, actualExcludes, specificTests, actualFailIfNoTests, getRunOrder() ); } Map providerProperties = toStringProperties( getProperties() ); return new ProviderConfiguration( directoryScannerParameters, runOrderParameters, actualFailIfNoTests, reporterConfiguration, testNg, // Not really used in provider. Limited to de/serializer. testSuiteDefinition, providerProperties, null, false, cli, getSkipAfterFailureCount(), Shutdown.parameterOf( getShutdown() ), getForkedProcessExitTimeoutInSeconds() ); } private static Map toStringProperties( Properties properties ) { Map h = new ConcurrentHashMap( properties.size() ); for ( Enumeration e = properties.keys() ; e.hasMoreElements() ; ) { Object k = e.nextElement(); Object v = properties.get( k ); if ( k.getClass() == String.class && v.getClass() == String.class ) { h.put( (String) k, (String) v ); } } return h; } public File getStatisticsFile( String configurationHash ) { return new File( getBasedir(), ".surefire-" + configurationHash ); } private StartupConfiguration createStartupConfiguration( @Nonnull ProviderInfo provider, boolean isInprocess, @Nonnull ClassLoaderConfiguration classLoaderConfiguration, @Nonnull DefaultScanResult scanResult ) throws MojoExecutionException, MojoFailureException { try { // cache the provider lookup String providerName = provider.getProviderName(); Classpath providerClasspath = ClasspathCache.getCachedClassPath( providerName ); if ( providerClasspath == null ) { // todo: 100 milli seconds, try to fetch List within classpath asynchronously providerClasspath = provider.getProviderClasspath(); ClasspathCache.setCachedClasspath( providerName, providerClasspath ); } Artifact surefireArtifact = getCommonArtifact(); Classpath inprocClassPath = providerClasspath.addClassPathElementUrl( surefireArtifact.getFile().getAbsolutePath() ) .addClassPathElementUrl( getApiArtifact().getFile().getAbsolutePath() ); File moduleDescriptor = getModuleDescriptor(); if ( moduleDescriptor.exists() && !isInprocess ) { return newStartupConfigForModularClasspath( classLoaderConfiguration, providerClasspath, providerName, moduleDescriptor, scanResult ); } else { return newStartupConfigForNonModularClasspath( classLoaderConfiguration, providerClasspath, inprocClassPath, providerName ); } } catch ( AbstractArtifactResolutionException e ) { throw new MojoExecutionException( "Unable to generate classpath: " + e, e ); } catch ( InvalidVersionSpecificationException e ) { throw new MojoExecutionException( "Unable to generate classpath: " + e, e ); } catch ( IOException e ) { throw new MojoExecutionException( e.getMessage(), e ); } } private StartupConfiguration newStartupConfigForNonModularClasspath( @Nonnull ClassLoaderConfiguration classLoaderConfiguration, @Nonnull Classpath providerClasspath, @Nonnull Classpath inprocClasspath, @Nonnull String providerName ) throws MojoExecutionException, MojoFailureException, InvalidVersionSpecificationException, AbstractArtifactResolutionException { Classpath testClasspath = generateTestClasspath(); getConsoleLogger().debug( testClasspath.getLogMessage( "test classpath:" ) ); getConsoleLogger().debug( providerClasspath.getLogMessage( "provider classpath:" ) ); getConsoleLogger().debug( testClasspath.getCompactLogMessage( "test(compact) classpath:" ) ); getConsoleLogger().debug( providerClasspath.getCompactLogMessage( "provider(compact) classpath:" ) ); ClasspathConfiguration classpathConfiguration = new ClasspathConfiguration( testClasspath, providerClasspath, inprocClasspath, effectiveIsEnableAssertions(), isChildDelegation() ); return new StartupConfiguration( providerName, classpathConfiguration, classLoaderConfiguration, isForking(), false ); } private Object getLocationManager() { return new LocationManager(); } private StartupConfiguration newStartupConfigForModularClasspath( @Nonnull ClassLoaderConfiguration classLoaderConfiguration, @Nonnull Classpath providerClasspath, @Nonnull String providerName, @Nonnull File moduleDescriptor, @Nonnull DefaultScanResult scanResult ) throws MojoExecutionException, MojoFailureException, InvalidVersionSpecificationException, AbstractArtifactResolutionException, IOException { ResolvePathsRequest req = ResolvePathsRequest.withStrings( generateTestClasspath().getClassPath() ) .setMainModuleDescriptor( moduleDescriptor.getAbsolutePath() ); ResolvePathsResult result = ( (LocationManager) getLocationManager() ).resolvePaths( req ); Classpath testClasspath = new Classpath( result.getClasspathElements() ); Classpath testModulepath = new Classpath( result.getModulepathElements().keySet() ); SortedSet packages = new TreeSet(); for ( String className : scanResult.getClasses() ) { packages.add( substringBeforeLast( className, "." ) ); } ModularClasspath modularClasspath = new ModularClasspath( moduleDescriptor, testModulepath.getClassPath(), packages, getTestClassesDirectory() ); ModularClasspathConfiguration classpathConfiguration = new ModularClasspathConfiguration( modularClasspath, testClasspath, providerClasspath, effectiveIsEnableAssertions(), isChildDelegation() ); getConsoleLogger().debug( testClasspath.getLogMessage( "test classpath:" ) ); getConsoleLogger().debug( testModulepath.getLogMessage( "test modulepath:" ) ); getConsoleLogger().debug( providerClasspath.getLogMessage( "provider classpath:" ) ); getConsoleLogger().debug( testClasspath.getCompactLogMessage( "test(compact) classpath:" ) ); getConsoleLogger().debug( testModulepath.getCompactLogMessage( "test(compact) modulepath:" ) ); getConsoleLogger().debug( providerClasspath.getCompactLogMessage( "provider(compact) classpath:" ) ); return new StartupConfiguration( providerName, classpathConfiguration, classLoaderConfiguration, isForking(), false ); } private Artifact getCommonArtifact() { return getPluginArtifactMap().get( "org.apache.maven.surefire:maven-surefire-common" ); } private Artifact getApiArtifact() { return getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-api" ); } private StartupReportConfiguration getStartupReportConfiguration( String configChecksum ) { return new StartupReportConfiguration( isUseFile(), isPrintSummary(), getReportFormat(), isRedirectTestOutputToFile(), isDisableXmlReport(), getReportsDirectory(), isTrimStackTrace(), getReportNameSuffix(), getStatisticsFile( configChecksum ), requiresRunHistory(), getRerunFailingTestsCount(), getReportSchemaLocation(), getEncoding() ); } private boolean isSpecificTestSpecified() { return isNotBlank( getTest() ); } @Nonnull private List readListFromFile( @Nonnull final File file ) { getConsoleLogger().debug( "Reading list from: " + file ); if ( !file.exists() ) { throw new RuntimeException( "Failed to load list from file: " + file ); } try { List list = FileUtils.loadFile( file ); if ( getConsoleLogger().isDebugEnabled() ) { getConsoleLogger().debug( "List contents:" ); for ( String entry : list ) { getConsoleLogger().debug( " " + entry ); } } return list; } catch ( IOException e ) { throw new RuntimeException( "Failed to load list from file: " + file, e ); } } private void maybeAppendList( List base, List list ) { if ( list != null ) { base.addAll( list ); } } @Nonnull private List getExcludeList() throws MojoFailureException { List actualExcludes = null; if ( isSpecificTestSpecified() ) { actualExcludes = Collections.emptyList(); } else { if ( getExcludesFile() != null ) { actualExcludes = readListFromFile( getExcludesFile() ); } if ( actualExcludes == null ) { actualExcludes = getExcludes(); } else { maybeAppendList( actualExcludes, getExcludes() ); } checkMethodFilterInIncludesExcludes( actualExcludes ); if ( actualExcludes == null || actualExcludes.isEmpty() ) { actualExcludes = Collections.singletonList( getDefaultExcludes() ); } } return filterNulls( actualExcludes ); } private List getIncludeList() throws MojoFailureException { List includes = null; if ( isSpecificTestSpecified() ) { includes = new ArrayList(); addAll( includes, split( getTest(), "," ) ); } else { if ( getIncludesFile() != null ) { includes = readListFromFile( getIncludesFile() ); } if ( includes == null ) { includes = getIncludes(); } else { maybeAppendList( includes, getIncludes() ); } checkMethodFilterInIncludesExcludes( includes ); if ( includes == null || includes.isEmpty() ) { includes = asList( getDefaultIncludes() ); } } return filterNulls( includes ); } private void checkMethodFilterInIncludesExcludes( Iterable patterns ) throws MojoFailureException { if ( patterns != null ) { for ( String pattern : patterns ) { if ( pattern != null && pattern.contains( "#" ) ) { throw new MojoFailureException( "Method filter prohibited in " + "includes|excludes|includesFile|excludesFile parameter: " + pattern ); } } } } private TestListResolver getIncludedAndExcludedTests() throws MojoFailureException { if ( includedExcludedTests == null ) { includedExcludedTests = new TestListResolver( getIncludeList(), getExcludeList() ); } return includedExcludedTests; } public TestListResolver getSpecificTests() { if ( specificTests == null ) { specificTests = new TestListResolver( getTest() ); } return specificTests; } @Nonnull private List filterNulls( @Nonnull List toFilter ) { List result = new ArrayList( toFilter.size() ); for ( String item : toFilter ) { if ( item != null ) { item = item.trim(); if ( !item.isEmpty() ) { result.add( item ); } } } return result; } private Artifact getTestNgArtifact() throws MojoExecutionException { Artifact artifact = getProjectArtifactMap().get( getTestNGArtifactName() ); Artifact projectArtifact = project.getArtifact(); String projectArtifactName = projectArtifact.getGroupId() + ":" + projectArtifact.getArtifactId(); if ( artifact != null ) { VersionRange range = createVersionRange(); if ( !range.containsVersion( new DefaultArtifactVersion( artifact.getVersion() ) ) ) { throw new MojoExecutionException( "TestNG support requires version 4.7 or above. You have declared version " + artifact.getVersion() ); } } else if ( projectArtifactName.equals( getTestNGArtifactName() ) ) { artifact = projectArtifact; } return artifact; } private VersionRange createVersionRange() { try { return VersionRange.createFromVersionSpec( "[4.7,)" ); } catch ( InvalidVersionSpecificationException e ) { throw new RuntimeException( e ); } } private Artifact getJunitArtifact() { Artifact artifact = getProjectArtifactMap().get( getJunitArtifactName() ); Artifact projectArtifact = project.getArtifact(); String projectArtifactName = projectArtifact.getGroupId() + ":" + projectArtifact.getArtifactId(); if ( artifact == null && projectArtifactName.equals( getJunitArtifactName() ) ) { artifact = projectArtifact; } return artifact; } private Artifact getJunitDepArtifact() { return getProjectArtifactMap().get( "junit:junit-dep" ); } private Artifact getJunitPlatformArtifact() { Artifact artifact = getProjectArtifactMap().get( getJunitPlatformArtifactName() ); Artifact projectArtifact = project.getArtifact(); String projectArtifactName = projectArtifact.getGroupId() + ":" + projectArtifact.getArtifactId(); if ( artifact == null && projectArtifactName.equals( getJunitPlatformArtifactName() ) ) { artifact = projectArtifact; } return artifact; } private ForkStarter createForkStarter( @Nonnull ProviderInfo provider, @Nonnull ForkConfiguration forkConfiguration, @Nonnull ClassLoaderConfiguration classLoaderConfiguration, @Nonnull RunOrderParameters runOrderParameters, @Nonnull ConsoleLogger log, @Nonnull DefaultScanResult scanResult ) throws MojoExecutionException, MojoFailureException { StartupConfiguration startupConfiguration = createStartupConfiguration( provider, false, classLoaderConfiguration, scanResult ); String configChecksum = getConfigChecksum(); StartupReportConfiguration startupReportConfiguration = getStartupReportConfiguration( configChecksum ); ProviderConfiguration providerConfiguration = createProviderConfiguration( runOrderParameters ); return new ForkStarter( providerConfiguration, startupConfiguration, forkConfiguration, getForkedProcessTimeoutInSeconds(), startupReportConfiguration, log ); } private InPluginVMSurefireStarter createInprocessStarter( @Nonnull ProviderInfo provider, @Nonnull ClassLoaderConfiguration classLoaderConfiguration, @Nonnull RunOrderParameters runOrderParameters, @Nonnull DefaultScanResult scanResult ) throws MojoExecutionException, MojoFailureException { StartupConfiguration startupConfiguration = createStartupConfiguration( provider, true, classLoaderConfiguration, scanResult ); String configChecksum = getConfigChecksum(); StartupReportConfiguration startupReportConfiguration = getStartupReportConfiguration( configChecksum ); ProviderConfiguration providerConfiguration = createProviderConfiguration( runOrderParameters ); return new InPluginVMSurefireStarter( startupConfiguration, providerConfiguration, startupReportConfiguration, getConsoleLogger() ); } @Nonnull private ForkConfiguration getForkConfiguration() throws MojoFailureException { File tmpDir = getSurefireTempDir(); Artifact shadeFire = getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-shadefire" ); // todo: 150 milli seconds, try to fetch List within classpath asynchronously Classpath bootClasspath = getArtifactClasspath( shadeFire != null ? shadeFire : surefireBooterArtifact ); Platform platform = PLATFORM.withJdkExecAttributesForTests( getEffectiveJvm() ); if ( platform.getJdkExecAttributesForTests().isJava9AtLeast() && existsModuleDescriptor() ) { return new ModularClasspathForkConfiguration( bootClasspath, tmpDir, getEffectiveDebugForkedProcess(), getWorkingDirectory() != null ? getWorkingDirectory() : getBasedir(), getProject().getModel().getProperties(), getArgLine(), getEnvironmentVariables(), getConsoleLogger().isDebugEnabled(), getEffectiveForkCount(), reuseForks, platform, getConsoleLogger() ); } else if ( getClassLoaderConfiguration().isManifestOnlyJarRequestedAndUsable() ) { return new JarManifestForkConfiguration( bootClasspath, tmpDir, getEffectiveDebugForkedProcess(), getWorkingDirectory() != null ? getWorkingDirectory() : getBasedir(), getProject().getModel().getProperties(), getArgLine(), getEnvironmentVariables(), getConsoleLogger().isDebugEnabled(), getEffectiveForkCount(), reuseForks, platform, getConsoleLogger() ); } else { return new ClasspathForkConfiguration( bootClasspath, tmpDir, getEffectiveDebugForkedProcess(), getWorkingDirectory() != null ? getWorkingDirectory() : getBasedir(), getProject().getModel().getProperties(), getArgLine(), getEnvironmentVariables(), getConsoleLogger().isDebugEnabled(), getEffectiveForkCount(), reuseForks, platform, getConsoleLogger() ); } } private void convertDeprecatedForkMode() { String effectiveForkMode = getEffectiveForkMode(); // FORK_ONCE (default) is represented by the default values of forkCount and reuseForks if ( FORK_PERTHREAD.equals( effectiveForkMode ) ) { forkCount = String.valueOf( threadCount ); } else if ( FORK_NEVER.equals( effectiveForkMode ) ) { forkCount = "0"; } else if ( FORK_ALWAYS.equals( effectiveForkMode ) ) { forkCount = "1"; reuseForks = false; } if ( !FORK_ONCE.equals( getForkMode() ) ) { getConsoleLogger().warning( "The parameter forkMode is deprecated since version 2.14. " + "Use forkCount and reuseForks instead." ); } } @SuppressWarnings( "checkstyle:emptyblock" ) protected int getEffectiveForkCount() { if ( effectiveForkCount < 0 ) { try { effectiveForkCount = convertWithCoreCount( forkCount ); } catch ( NumberFormatException ignored ) { } if ( effectiveForkCount < 0 ) { throw new IllegalArgumentException( "Fork count " + forkCount.trim() + " is not a legal value." ); } } return effectiveForkCount; } protected int convertWithCoreCount( String count ) { String trimmed = count.trim(); if ( trimmed.endsWith( "C" ) ) { double multiplier = Double.parseDouble( trimmed.substring( 0, trimmed.length() - 1 ) ); double calculated = multiplier * ( (double) Runtime.getRuntime().availableProcessors() ); return calculated > 0d ? Math.max( (int) calculated, 1 ) : 0; } else { return Integer.parseInt( trimmed ); } } private String getEffectiveDebugForkedProcess() { String debugForkedProcess = getDebugForkedProcess(); if ( "true".equals( debugForkedProcess ) ) { return "-Xdebug -Xnoagent -Djava.compiler=NONE" + " -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"; } return debugForkedProcess; } private JdkAttributes getEffectiveJvm() throws MojoFailureException { if ( isNotEmpty( jvm ) ) { File pathToJava = new File( jvm ).getAbsoluteFile(); if ( !endsWithJavaPath( pathToJava.getPath() ) ) { throw new MojoFailureException( "Given path does not end with java executor \"" + pathToJava.getPath() + "\"." ); } if ( !( pathToJava.isFile() || "java".equals( pathToJava.getName() ) && pathToJava.getParentFile().isDirectory() ) ) { throw new MojoFailureException( "Given path to java executor does not exist \"" + pathToJava.getPath() + "\"." ); } File jdkHome = toJdkHomeFromJvmExec( pathToJava.getPath() ); BigDecimal version = jdkHome == null ? null : toJdkVersionFromReleaseFile( jdkHome ); boolean javaVersion9 = version == null ? isJava9AtLeast( pathToJava.getPath() ) : isJava9AtLeast( version ); return new JdkAttributes( pathToJava.getPath(), javaVersion9 ); } if ( toolchain != null ) { String jvmToUse = toolchain.findTool( "java" ); if ( isNotEmpty( jvmToUse ) ) { boolean javaVersion9 = false; if ( toolchain instanceof DefaultToolchain ) { DefaultToolchain defaultToolchain = (DefaultToolchain) toolchain; javaVersion9 = defaultToolchain.matchesRequirements( JAVA_9_MATCHER ) || defaultToolchain.matchesRequirements( JAVA_9_MATCHER_OLD_NOTATION ); } if ( !javaVersion9 ) { javaVersion9 = isJava9AtLeast( jvmToUse ); } return new JdkAttributes( jvmToUse, javaVersion9 ); } } // use the same JVM as the one used to run Maven (the "java.home" one) String jvmToUse = System.getProperty( "java.home" ) + File.separator + "bin" + File.separator + "java"; getConsoleLogger().debug( "Using JVM: " + jvmToUse + " with Java version " + JAVA_SPECIFICATION_VERSION.toPlainString() ); return new JdkAttributes( jvmToUse, isBuiltInJava9AtLeast() ); } private Artifact getSurefireBooterArtifact() { Artifact artifact = getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-booter" ); if ( artifact == null ) { throw new RuntimeException( "Unable to locate surefire-booter in the list of plugin artifacts" ); } artifact.isSnapshot(); // MNG-2961: before Maven 2.0.8, fixes getBaseVersion to be -SNAPSHOT if needed return artifact; } /** * Where surefire stores its own temp files * * @return A file pointing to the location of surefire's own temp files */ File getSurefireTempDir() { return IS_OS_WINDOWS ? createSurefireBootDirectoryInTemp() : createSurefireBootDirectoryInBuild(); } /** * Operates on raw plugin parameters, not the "effective" values. * * @return The checksum */ private String getConfigChecksum() { ChecksumCalculator checksum = new ChecksumCalculator(); checksum.add( getPluginName() ); checksum.add( isSkipTests() ); checksum.add( isSkipExec() ); checksum.add( isSkip() ); checksum.add( getTestClassesDirectory() ); checksum.add( getClassesDirectory() ); checksum.add( getClasspathDependencyExcludes() ); checksum.add( getClasspathDependencyScopeExclude() ); checksum.add( getAdditionalClasspathElements() ); checksum.add( getReportsDirectory() ); checksum.add( getProjectBuildDirectory() ); checksum.add( getTestSourceDirectory() ); checksum.add( getTest() ); checksum.add( getIncludes() ); checksum.add( getSkipAfterFailureCount() ); checksum.add( getShutdown() ); checksum.add( getExcludes() ); checksum.add( getLocalRepository() ); checksum.add( getSystemProperties() ); checksum.add( getSystemPropertyVariables() ); checksum.add( getSystemPropertiesFile() ); checksum.add( getProperties() ); checksum.add( isPrintSummary() ); checksum.add( getReportFormat() ); checksum.add( getReportNameSuffix() ); checksum.add( isUseFile() ); checksum.add( isRedirectTestOutputToFile() ); checksum.add( getForkMode() ); checksum.add( getForkCount() ); checksum.add( isReuseForks() ); checksum.add( getJvm() ); checksum.add( getArgLine() ); checksum.add( getDebugForkedProcess() ); checksum.add( getForkedProcessTimeoutInSeconds() ); checksum.add( getParallelTestsTimeoutInSeconds() ); checksum.add( getParallelTestsTimeoutForcedInSeconds() ); checksum.add( getEnvironmentVariables() ); checksum.add( getWorkingDirectory() ); checksum.add( isChildDelegation() ); checksum.add( getGroups() ); checksum.add( getExcludedGroups() ); checksum.add( getSuiteXmlFiles() ); checksum.add( getJunitArtifact() ); checksum.add( getTestNGArtifactName() ); checksum.add( getThreadCount() ); checksum.add( getThreadCountSuites() ); checksum.add( getThreadCountClasses() ); checksum.add( getThreadCountMethods() ); checksum.add( getPerCoreThreadCount() ); checksum.add( getUseUnlimitedThreads() ); checksum.add( getParallel() ); checksum.add( isParallelOptimized() ); checksum.add( isTrimStackTrace() ); checksum.add( getRemoteRepositories() ); checksum.add( isDisableXmlReport() ); checksum.add( isUseSystemClassLoader() ); checksum.add( isUseManifestOnlyJar() ); checksum.add( getEncoding() ); checksum.add( isEnableAssertions() ); checksum.add( getObjectFactory() ); checksum.add( getFailIfNoTests() ); checksum.add( getRunOrder() ); checksum.add( getDependenciesToScan() ); checksum.add( getForkedProcessExitTimeoutInSeconds() ); checksum.add( getRerunFailingTestsCount() ); checksum.add( getTempDir() ); addPluginSpecificChecksumItems( checksum ); return checksum.getSha1(); } protected void addPluginSpecificChecksumItems( ChecksumCalculator checksum ) { } protected boolean hasExecutedBefore() { // A tribute to Linus Torvalds String configChecksum = getConfigChecksum(); @SuppressWarnings( "unchecked" ) Map pluginContext = getPluginContext(); if ( pluginContext.containsKey( configChecksum ) ) { getConsoleLogger() .info( "Skipping execution of surefire because it has already been run for this configuration" ); return true; } pluginContext.put( configChecksum, configChecksum ); return false; } @Nonnull protected ClassLoaderConfiguration getClassLoaderConfiguration() { return isForking() ? new ClassLoaderConfiguration( isUseSystemClassLoader(), isUseManifestOnlyJar() ) : new ClassLoaderConfiguration( false, false ); } /** * Generate the test classpath. * * @return List containing the classpath elements * @throws InvalidVersionSpecificationException * when it happens * @throws MojoFailureException when it happens * @throws ArtifactNotFoundException when it happens * @throws ArtifactResolutionException when it happens */ private Classpath generateTestClasspath() throws InvalidVersionSpecificationException, MojoFailureException, ArtifactResolutionException, ArtifactNotFoundException, MojoExecutionException { List classpath = new ArrayList( 2 + getProject().getArtifacts().size() ); classpath.add( getTestClassesDirectory().getAbsolutePath() ); classpath.add( getClassesDirectory().getAbsolutePath() ); @SuppressWarnings( "unchecked" ) Set classpathArtifacts = getProject().getArtifacts(); if ( getClasspathDependencyScopeExclude() != null && !getClasspathDependencyScopeExclude().isEmpty() ) { ArtifactFilter dependencyFilter = new ScopeArtifactFilter( getClasspathDependencyScopeExclude() ); classpathArtifacts = filterArtifacts( classpathArtifacts, dependencyFilter ); } if ( getClasspathDependencyExcludes() != null ) { List excludedDependencies = asList( getClasspathDependencyExcludes() ); ArtifactFilter dependencyFilter = new PatternIncludesArtifactFilter( excludedDependencies ); classpathArtifacts = filterArtifacts( classpathArtifacts, dependencyFilter ); } for ( Artifact artifact : classpathArtifacts ) { if ( artifact.getArtifactHandler().isAddedToClasspath() ) { File file = artifact.getFile(); if ( file != null ) { classpath.add( file.getPath() ); } } } // Add additional configured elements to the classpath if ( getAdditionalClasspathElements() != null ) { for ( String classpathElement : getAdditionalClasspathElements() ) { if ( classpathElement != null ) { addAll( classpath, split( classpathElement, "," ) ); } } } // adding TestNG MethodSelector to the classpath // Todo: move if ( getTestNgArtifact() != null ) { addTestNgUtilsArtifacts( classpath ); } return new Classpath( classpath ); } private void addTestNgUtilsArtifacts( List classpath ) throws ArtifactResolutionException, ArtifactNotFoundException { Artifact surefireArtifact = getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-booter" ); String surefireVersion = surefireArtifact.getBaseVersion(); Artifact[] extraTestNgArtifacts = { getArtifactFactory().createArtifact( "org.apache.maven.surefire", "surefire-testng-utils", surefireVersion, "runtime", "jar" ), getArtifactFactory().createArtifact( "org.apache.maven.surefire", "surefire-grouper", surefireVersion, "runtime", "jar" ) }; for ( Artifact artifact : extraTestNgArtifacts ) { getArtifactResolver().resolve( artifact, getRemoteRepositories(), getLocalRepository() ); String path = artifact.getFile().getPath(); classpath.add( path ); } } /** * Return a new set containing only the artifacts accepted by the given filter. * * @param artifacts The unfiltered artifacts * @param filter The filter to apply * @return The filtered result */ private static Set filterArtifacts( Set artifacts, ArtifactFilter filter ) { Set filteredArtifacts = new LinkedHashSet(); for ( Artifact artifact : artifacts ) { if ( !filter.include( artifact ) ) { filteredArtifacts.add( artifact ); } } return filteredArtifacts; } private void showMap( Map map, String setting ) { for ( Object o : map.keySet() ) { String key = (String) o; String value = (String) map.get( key ); getConsoleLogger().debug( "Setting " + setting + " [" + key + "]=[" + value + "]" ); } } private ArtifactResolutionResult resolveArtifact( Artifact filteredArtifact, Artifact providerArtifact ) { ArtifactFilter filter = null; if ( filteredArtifact != null ) { filter = new ExcludesArtifactFilter( Collections.singletonList( filteredArtifact.getGroupId() + ":" + filteredArtifact.getArtifactId() ) ); } Artifact originatingArtifact = getArtifactFactory().createBuildArtifact( "dummy", "dummy", "1.0", "jar" ); try { return getArtifactResolver().resolveTransitively( Collections.singleton( providerArtifact ), originatingArtifact, getLocalRepository(), getRemoteRepositories(), getMetadataSource(), filter ); } catch ( ArtifactResolutionException e ) { throw new RuntimeException( e ); } catch ( ArtifactNotFoundException e ) { throw new RuntimeException( e ); } } private Classpath getArtifactClasspath( Artifact surefireArtifact ) { Classpath existing = ClasspathCache.getCachedClassPath( surefireArtifact.getArtifactId() ); if ( existing == null ) { ArtifactResolutionResult result = resolveArtifact( null, surefireArtifact ); List items = new ArrayList(); for ( Object o : result.getArtifacts() ) { Artifact artifact = (Artifact) o; getConsoleLogger().debug( "Adding to " + getPluginName() + " booter test classpath: " + artifact.getFile().getAbsolutePath() + " Scope: " + artifact.getScope() ); items.add( artifact.getFile().getAbsolutePath() ); } existing = new Classpath( items ); ClasspathCache.setCachedClasspath( surefireArtifact.getArtifactId(), existing ); } return existing; } private Properties getUserProperties() { Properties props = null; try { // try calling MavenSession.getUserProperties() from Maven 2.1.0-M1+ Method getUserProperties = getSession().getClass().getMethod( "getUserProperties" ); props = (Properties) getUserProperties.invoke( getSession() ); } catch ( Exception e ) { String msg = "Build uses Maven 2.0.x, cannot propagate system properties" + " from command line to tests (cf. SUREFIRE-121)"; if ( getConsoleLogger().isDebugEnabled() ) { getConsoleLogger().debug( msg, e ); } else { getConsoleLogger().warning( msg ); } } if ( props == null ) { props = new Properties(); } return props; } private void ensureWorkingDirectoryExists() throws MojoFailureException { if ( getWorkingDirectory() == null ) { throw new MojoFailureException( "workingDirectory cannot be null" ); } if ( isForking() ) { // Postpone directory creation till forked JVM creation // see ForkConfiguration.createCommandLine return; } if ( !getWorkingDirectory().exists() ) { if ( !getWorkingDirectory().mkdirs() ) { throw new MojoFailureException( "Cannot create workingDirectory " + getWorkingDirectory() ); } } if ( !getWorkingDirectory().isDirectory() ) { throw new MojoFailureException( "workingDirectory " + getWorkingDirectory() + " exists and is not a directory" ); } } private void ensureParallelRunningCompatibility() throws MojoFailureException { if ( isMavenParallel() && isNotForking() ) { throw new MojoFailureException( "parallel maven execution is not compatible with surefire forkCount 0" ); } } private void ensureThreadCountWithPerThread() throws MojoFailureException { if ( FORK_PERTHREAD.equals( getEffectiveForkMode() ) && getThreadCount() < 1 ) { throw new MojoFailureException( "Fork mode perthread requires a thread count" ); } } private void warnIfUselessUseSystemClassLoaderParameter() { if ( isUseSystemClassLoader() && isNotForking() ) { getConsoleLogger().warning( "useSystemClassloader setting has no effect when not forking" ); } } private boolean isNotForking() { return !isForking(); } private List commandLineOptions() { return SurefireHelper.commandLineOptions( getSession(), getConsoleLogger() ); } private void warnIfDefunctGroupsCombinations() throws MojoFailureException, MojoExecutionException { if ( isAnyGroupsSelected() ) { if ( getTestNgArtifact() == null ) { Artifact junitArtifact = getJunitArtifact(); boolean junit47Compatible = isJunit47Compatible( junitArtifact ); boolean junit5PlatformCompatible = getJunitPlatformArtifact() != null; if ( !junit47Compatible && !junit5PlatformCompatible ) { if ( junitArtifact != null ) { throw new MojoFailureException( "groups/excludedGroups are specified but JUnit version on " + "classpath is too old to support groups. " + "Check your dependency:tree to see if your project " + "is picking up an old junit version" ); } throw new MojoFailureException( "groups/excludedGroups require TestNG, JUnit48+ or JUnit 5 " + "on project test classpath" ); } } } } private void warnIfRerunClashes() throws MojoFailureException { if ( getRerunFailingTestsCount() < 0 ) { throw new MojoFailureException( "Parameter \"rerunFailingTestsCount\" should not be negative." ); } if ( getSkipAfterFailureCount() < 0 ) { throw new MojoFailureException( "Parameter \"skipAfterFailureCount\" should not be negative." ); } } private void warnIfWrongShutdownValue() throws MojoFailureException { if ( !Shutdown.isKnown( getShutdown() ) ) { throw new MojoFailureException( "Parameter \"shutdown\" should have values " + Shutdown.listParameters() ); } } private void warnIfNotApplicableSkipAfterFailureCount() throws MojoFailureException { int skipAfterFailureCount = getSkipAfterFailureCount(); if ( skipAfterFailureCount < 0 ) { throw new MojoFailureException( "Parameter \"skipAfterFailureCount\" should not be negative." ); } else if ( skipAfterFailureCount > 0 ) { try { Artifact testng = getTestNgArtifact(); if ( testng != null ) { VersionRange range = VersionRange.createFromVersionSpec( "[5.10,)" ); if ( !range.containsVersion( new DefaultArtifactVersion( testng.getVersion() ) ) ) { throw new MojoFailureException( "Parameter \"skipAfterFailureCount\" expects TestNG Version 5.10 or higher. " + "java.lang.NoClassDefFoundError: org/testng/IInvokedMethodListener" ); } } else { // TestNG is dependent on JUnit Artifact junit = getJunitArtifact(); if ( junit != null ) { VersionRange range = VersionRange.createFromVersionSpec( "[4.0,)" ); if ( !range.containsVersion( new DefaultArtifactVersion( junit.getVersion() ) ) ) { throw new MojoFailureException( "Parameter \"skipAfterFailureCount\" expects JUnit Version 4.0 or higher. " + "java.lang.NoSuchMethodError: " + "org.junit.runner.notification.RunNotifier.pleaseStop()V" ); } } } } catch ( MojoExecutionException e ) { throw new MojoFailureException( e.getLocalizedMessage() ); } catch ( InvalidVersionSpecificationException e ) { throw new RuntimeException( e ); } } } private void warnIfIllegalTempDir() throws MojoFailureException { if ( isEmpty( getTempDir() ) ) { throw new MojoFailureException( "Parameter 'tempDir' should not be blank string." ); } } final class TestNgProviderInfo implements ProviderInfo { private final Artifact testNgArtifact; TestNgProviderInfo( Artifact testNgArtifact ) { this.testNgArtifact = testNgArtifact; } @Override @Nonnull public String getProviderName() { return "org.apache.maven.surefire.testng.TestNGProvider"; } @Override public boolean isApplicable() { return testNgArtifact != null; } @Override public void addProviderProperties() throws MojoExecutionException { convertTestNGParameters(); } @Override @Nonnull public Classpath getProviderClasspath() throws ArtifactResolutionException, ArtifactNotFoundException { Artifact surefireArtifact = getPluginArtifactMap().get( "org.apache.maven.surefire:surefire-booter" ); return dependencyResolver.getProviderClasspath( "surefire-testng", surefireArtifact.getBaseVersion(), testNgArtifact ); } } final class JUnit3ProviderInfo implements ProviderInfo { @Override @Nonnull public String getProviderName() { return "org.apache.maven.surefire.junit.JUnit3Provider"; } @Override public boolean isApplicable() { return true; } @Override public void addProviderProperties() throws MojoExecutionException { } @Override @Nonnull public Classpath getProviderClasspath() throws ArtifactResolutionException, ArtifactNotFoundException { // add the JUnit provider as default - it doesn't require JUnit to be present, // since it supports POJO tests. return dependencyResolver.getProviderClasspath( "surefire-junit3", surefireBooterArtifact.getBaseVersion(), null ); } } final class JUnit4ProviderInfo implements ProviderInfo { private final Artifact junitArtifact; private final Artifact junitDepArtifact; JUnit4ProviderInfo( Artifact junitArtifact, Artifact junitDepArtifact ) { this.junitArtifact = junitArtifact; this.junitDepArtifact = junitDepArtifact; } @Override @Nonnull public String getProviderName() { return "org.apache.maven.surefire.junit4.JUnit4Provider"; } @Override public boolean isApplicable() { return junitDepArtifact != null || isAnyJunit4( junitArtifact ); } @Override public void addProviderProperties() throws MojoExecutionException { } @Override @Nonnull public Classpath getProviderClasspath() throws ArtifactResolutionException, ArtifactNotFoundException { return dependencyResolver.getProviderClasspath( "surefire-junit4", surefireBooterArtifact.getBaseVersion(), null ); } } final class JUnitPlatformProviderInfo implements ProviderInfo { private final Artifact junitArtifact; JUnitPlatformProviderInfo( Artifact junitArtifact ) { this.junitArtifact = junitArtifact; } @Nonnull public String getProviderName() { return "org.apache.maven.surefire.junitplatform.JUnitPlatformProvider"; } public boolean isApplicable() { return junitArtifact != null; } public void addProviderProperties() throws MojoExecutionException { convertGroupParameters(); } public Classpath getProviderClasspath() throws ArtifactResolutionException, ArtifactNotFoundException { return dependencyResolver.getProviderClasspath( "surefire-junit-platform", surefireBooterArtifact.getBaseVersion(), null ); } } final class JUnitCoreProviderInfo implements ProviderInfo { private final Artifact junitArtifact; private final Artifact junitDepArtifact; JUnitCoreProviderInfo( Artifact junitArtifact, Artifact junitDepArtifact ) { this.junitArtifact = junitArtifact; this.junitDepArtifact = junitDepArtifact; } @Override @Nonnull public String getProviderName() { return "org.apache.maven.surefire.junitcore.JUnitCoreProvider"; } private boolean is47CompatibleJunitDep() { return junitDepArtifact != null && isJunit47Compatible( junitDepArtifact ); } @Override public boolean isApplicable() { final boolean isJunitArtifact47 = isAnyJunit4( junitArtifact ) && isJunit47Compatible( junitArtifact ); final boolean isAny47ProvidersForcers = isAnyConcurrencySelected() || isAnyGroupsSelected(); return isAny47ProvidersForcers && ( isJunitArtifact47 || is47CompatibleJunitDep() ); } @Override public void addProviderProperties() throws MojoExecutionException { convertJunitCoreParameters(); convertGroupParameters(); } @Override @Nonnull public Classpath getProviderClasspath() throws ArtifactResolutionException, ArtifactNotFoundException { return dependencyResolver.getProviderClasspath( "surefire-junit47", surefireBooterArtifact.getBaseVersion(), null ); } } /** * Provides the Provider information for manually configured providers. */ final class DynamicProviderInfo implements ConfigurableProviderInfo { final String providerName; DynamicProviderInfo( String providerName ) { this.providerName = providerName; } @Override public ProviderInfo instantiate( String providerName ) { return new DynamicProviderInfo( providerName ); } @Override @Nonnull public String getProviderName() { return providerName; } @Override public boolean isApplicable() { return true; } @Override public void addProviderProperties() throws MojoExecutionException { // Ok this is a bit lazy. convertJunitCoreParameters(); convertTestNGParameters(); } @Override @Nonnull public Classpath getProviderClasspath() throws ArtifactResolutionException, ArtifactNotFoundException { return dependencyResolver.addProviderToClasspath( pluginArtifactMap, getMojoArtifact() ); } } /** * @author Kristian Rosenvold */ final class ProviderList { private final ProviderInfo[] wellKnownProviders; private final ConfigurableProviderInfo dynamicProvider; ProviderList( ConfigurableProviderInfo dynamicProviderInfo, ProviderInfo... wellKnownProviders ) { this.wellKnownProviders = wellKnownProviders; this.dynamicProvider = dynamicProviderInfo; } @Nonnull List resolve() { List providersToRun = new ArrayList(); Set manuallyConfiguredProviders = getManuallyConfiguredProviders(); for ( String name : manuallyConfiguredProviders ) { ProviderInfo wellKnown = findByName( name ); ProviderInfo providerToAdd = wellKnown != null ? wellKnown : dynamicProvider.instantiate( name ); logDebugOrCliShowErrors( "Using configured provider " + providerToAdd.getProviderName() ); providersToRun.add( providerToAdd ); } return manuallyConfiguredProviders.isEmpty() ? autoDetectOneProvider() : providersToRun; } @Nonnull private List autoDetectOneProvider() { List providersToRun = new ArrayList(); for ( ProviderInfo wellKnownProvider : wellKnownProviders ) { if ( wellKnownProvider.isApplicable() ) { providersToRun.add( wellKnownProvider ); return providersToRun; } } return providersToRun; } private Set getManuallyConfiguredProviders() { try { ClassLoader cl = currentThread().getContextClassLoader(); return providerDetector.lookupServiceNames( SurefireProvider.class, cl ); } catch ( IOException e ) { throw new RuntimeException( e ); } } private ProviderInfo findByName( String providerClassName ) { for ( ProviderInfo wellKnownProvider : wellKnownProviders ) { if ( wellKnownProvider.getProviderName().equals( providerClassName ) ) { return wellKnownProvider; } } return null; } } File createSurefireBootDirectoryInBuild() { File tmp = new File( getProjectBuildDirectory(), getTempDir() ); //noinspection ResultOfMethodCallIgnored tmp.mkdirs(); return tmp; } // todo use Java7 java.nio.file.Files.createTempDirectory() File createSurefireBootDirectoryInTemp() { if ( isBuiltInJava7AtLeast() ) { try { return new File( SYSTEM_TMP_DIR, createTmpDirectoryNameWithJava7( getTempDir() ) ); } catch ( IOException e ) { return createSurefireBootDirectoryInBuild(); } } else { try { File tmp = File.createTempFile( getTempDir(), null ); //noinspection ResultOfMethodCallIgnored tmp.delete(); return tmp.mkdirs() ? tmp : createSurefireBootDirectoryInBuild(); } catch ( IOException e ) { return createSurefireBootDirectoryInBuild(); } } } /** * Reflection call of java.nio.file.Files.createTempDirectory( "surefire" ). * @return Java 7 NIO Path */ static Object createTmpDirectoryWithJava7( String directoryPrefix ) throws IOException { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Class filesType = tryLoadClass( classLoader, "java.nio.file.Files" ); Class fileAttributeType = tryLoadClass( classLoader, "java.nio.file.attribute.FileAttribute" ); Object attrs = Array.newInstance( fileAttributeType, 0 ); try { return invokeStaticMethod( filesType, "createTempDirectory", new Class[]{ String.class, attrs.getClass() }, new Object[]{ directoryPrefix, attrs } ); } catch ( SurefireReflectionException e ) { Throwable cause = e.getCause(); throw cause instanceof IOException ? (IOException) cause : new IOException( cause ); } } static String createTmpDirectoryNameWithJava7( String directoryPrefix ) throws IOException { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Class pathType = tryLoadClass( classLoader, "java.nio.file.Path" ); Object path = createTmpDirectoryWithJava7( directoryPrefix ); return invokeGetter( pathType, path, "getFileName" ).toString(); } @Override public List getExcludes() { return excludes; } @Override public void setExcludes( List excludes ) { this.excludes = excludes; } @Override public ArtifactRepository getLocalRepository() { return localRepository; } @Override public void setLocalRepository( ArtifactRepository localRepository ) { this.localRepository = localRepository; } public Properties getSystemProperties() { return systemProperties; } @SuppressWarnings( { "UnusedDeclaration", "deprecation" } ) public void setSystemProperties( Properties systemProperties ) { this.systemProperties = systemProperties; } public Map getSystemPropertyVariables() { return systemPropertyVariables; } @SuppressWarnings( "UnusedDeclaration" ) public void setSystemPropertyVariables( Map systemPropertyVariables ) { this.systemPropertyVariables = systemPropertyVariables; } public File getSystemPropertiesFile() { return systemPropertiesFile; } @SuppressWarnings( "UnusedDeclaration" ) public void setSystemPropertiesFile( File systemPropertiesFile ) { this.systemPropertiesFile = systemPropertiesFile; } private Properties getProperties() { return properties; } public void setProperties( Properties properties ) { this.properties = properties; } public Map getPluginArtifactMap() { return pluginArtifactMap; } @SuppressWarnings( "UnusedDeclaration" ) public void setPluginArtifactMap( Map pluginArtifactMap ) { this.pluginArtifactMap = pluginArtifactMap; } public Map getProjectArtifactMap() { return projectArtifactMap; } @SuppressWarnings( "UnusedDeclaration" ) public void setProjectArtifactMap( Map projectArtifactMap ) { this.projectArtifactMap = projectArtifactMap; } public String getReportNameSuffix() { return reportNameSuffix; } @SuppressWarnings( "UnusedDeclaration" ) public void setReportNameSuffix( String reportNameSuffix ) { this.reportNameSuffix = reportNameSuffix; } public boolean isRedirectTestOutputToFile() { return redirectTestOutputToFile; } @SuppressWarnings( "UnusedDeclaration" ) public void setRedirectTestOutputToFile( boolean redirectTestOutputToFile ) { this.redirectTestOutputToFile = redirectTestOutputToFile; } public Boolean getFailIfNoTests() { return failIfNoTests; } public void setFailIfNoTests( boolean failIfNoTests ) { this.failIfNoTests = failIfNoTests; } public String getForkMode() { return forkMode; } @SuppressWarnings( "UnusedDeclaration" ) public void setForkMode( String forkMode ) { this.forkMode = forkMode; } public String getJvm() { return jvm; } public String getArgLine() { return argLine; } @SuppressWarnings( "UnusedDeclaration" ) public void setArgLine( String argLine ) { this.argLine = argLine; } public Map getEnvironmentVariables() { return environmentVariables; } @SuppressWarnings( "UnusedDeclaration" ) public void setEnvironmentVariables( Map environmentVariables ) { this.environmentVariables = environmentVariables; } public File getWorkingDirectory() { return workingDirectory; } @SuppressWarnings( "UnusedDeclaration" ) public void setWorkingDirectory( File workingDirectory ) { this.workingDirectory = workingDirectory; } public boolean isChildDelegation() { return childDelegation; } @SuppressWarnings( "UnusedDeclaration" ) public void setChildDelegation( boolean childDelegation ) { this.childDelegation = childDelegation; } public String getGroups() { return groups; } @SuppressWarnings( "UnusedDeclaration" ) public void setGroups( String groups ) { this.groups = groups; } public String getExcludedGroups() { return excludedGroups; } @SuppressWarnings( "UnusedDeclaration" ) public void setExcludedGroups( String excludedGroups ) { this.excludedGroups = excludedGroups; } public String getJunitArtifactName() { return junitArtifactName; } @SuppressWarnings( "UnusedDeclaration" ) public void setJunitArtifactName( String junitArtifactName ) { this.junitArtifactName = junitArtifactName; } public String getJunitPlatformArtifactName() { return junitPlatformArtifactName; } @SuppressWarnings( "UnusedDeclaration" ) public void setJunitPlatformArtifactName( String junitPlatformArtifactName ) { this.junitPlatformArtifactName = junitPlatformArtifactName; } public String getTestNGArtifactName() { return testNGArtifactName; } @SuppressWarnings( "UnusedDeclaration" ) public void setTestNGArtifactName( String testNGArtifactName ) { this.testNGArtifactName = testNGArtifactName; } public int getThreadCount() { return threadCount; } @SuppressWarnings( "UnusedDeclaration" ) public void setThreadCount( int threadCount ) { this.threadCount = threadCount; } public boolean getPerCoreThreadCount() { return perCoreThreadCount; } @SuppressWarnings( "UnusedDeclaration" ) public void setPerCoreThreadCount( boolean perCoreThreadCount ) { this.perCoreThreadCount = perCoreThreadCount; } public boolean getUseUnlimitedThreads() { return useUnlimitedThreads; } @SuppressWarnings( "UnusedDeclaration" ) public void setUseUnlimitedThreads( boolean useUnlimitedThreads ) { this.useUnlimitedThreads = useUnlimitedThreads; } public String getParallel() { return parallel; } @SuppressWarnings( "UnusedDeclaration" ) public void setParallel( String parallel ) { this.parallel = parallel; } public boolean isParallelOptimized() { return parallelOptimized; } @SuppressWarnings( "UnusedDeclaration" ) public void setParallelOptimized( boolean parallelOptimized ) { this.parallelOptimized = parallelOptimized; } public int getThreadCountSuites() { return threadCountSuites; } public void setThreadCountSuites( int threadCountSuites ) { this.threadCountSuites = threadCountSuites; } public int getThreadCountClasses() { return threadCountClasses; } public void setThreadCountClasses( int threadCountClasses ) { this.threadCountClasses = threadCountClasses; } public int getThreadCountMethods() { return threadCountMethods; } public void setThreadCountMethods( int threadCountMethods ) { this.threadCountMethods = threadCountMethods; } public boolean isTrimStackTrace() { return trimStackTrace; } @SuppressWarnings( "UnusedDeclaration" ) public void setTrimStackTrace( boolean trimStackTrace ) { this.trimStackTrace = trimStackTrace; } public ArtifactResolver getArtifactResolver() { return artifactResolver; } @SuppressWarnings( "UnusedDeclaration" ) public void setArtifactResolver( ArtifactResolver artifactResolver ) { this.artifactResolver = artifactResolver; } public ArtifactFactory getArtifactFactory() { return artifactFactory; } @SuppressWarnings( "UnusedDeclaration" ) public void setArtifactFactory( ArtifactFactory artifactFactory ) { this.artifactFactory = artifactFactory; } public List getRemoteRepositories() { return remoteRepositories; } @SuppressWarnings( "UnusedDeclaration" ) public void setRemoteRepositories( List remoteRepositories ) { this.remoteRepositories = remoteRepositories; } public ArtifactMetadataSource getMetadataSource() { return metadataSource; } @SuppressWarnings( "UnusedDeclaration" ) public void setMetadataSource( ArtifactMetadataSource metadataSource ) { this.metadataSource = metadataSource; } public boolean isDisableXmlReport() { return disableXmlReport; } @SuppressWarnings( "UnusedDeclaration" ) public void setDisableXmlReport( boolean disableXmlReport ) { this.disableXmlReport = disableXmlReport; } public boolean isEnableAssertions() { return enableAssertions; } public boolean effectiveIsEnableAssertions() { if ( getArgLine() != null ) { List args = asList( getArgLine().split( " " ) ); if ( args.contains( "-da" ) || args.contains( "-disableassertions" ) ) { return false; } } return isEnableAssertions(); } @SuppressWarnings( "UnusedDeclaration" ) public void setEnableAssertions( boolean enableAssertions ) { this.enableAssertions = enableAssertions; } public MavenSession getSession() { return session; } @SuppressWarnings( "UnusedDeclaration" ) public void setSession( MavenSession session ) { this.session = session; } public String getObjectFactory() { return objectFactory; } @SuppressWarnings( "UnusedDeclaration" ) public void setObjectFactory( String objectFactory ) { this.objectFactory = objectFactory; } public ToolchainManager getToolchainManager() { return toolchainManager; } @SuppressWarnings( "UnusedDeclaration" ) public void setToolchainManager( ToolchainManager toolchainManager ) { this.toolchainManager = toolchainManager; } public boolean isMavenParallel() { return parallelMavenExecution != null && parallelMavenExecution; } public String[] getDependenciesToScan() { return dependenciesToScan; } public void setDependenciesToScan( String[] dependenciesToScan ) { this.dependenciesToScan = dependenciesToScan; } public PluginDescriptor getPluginDescriptor() { return pluginDescriptor; } public MavenProject getProject() { return project; } @SuppressWarnings( "UnusedDeclaration" ) public void setProject( MavenProject project ) { this.project = project; } @Override public File getTestSourceDirectory() { return testSourceDirectory; } @Override public void setTestSourceDirectory( File testSourceDirectory ) { this.testSourceDirectory = testSourceDirectory; } public String getForkCount() { return forkCount; } public boolean isReuseForks() { return reuseForks; } public String[] getAdditionalClasspathElements() { return additionalClasspathElements; } public void setAdditionalClasspathElements( String[] additionalClasspathElements ) { this.additionalClasspathElements = additionalClasspathElements; } public String[] getClasspathDependencyExcludes() { return classpathDependencyExcludes; } public void setClasspathDependencyExcludes( String[] classpathDependencyExcludes ) { this.classpathDependencyExcludes = classpathDependencyExcludes; } public String getClasspathDependencyScopeExclude() { return classpathDependencyScopeExclude; } public void setClasspathDependencyScopeExclude( String classpathDependencyScopeExclude ) { this.classpathDependencyScopeExclude = classpathDependencyScopeExclude; } public File getProjectBuildDirectory() { return projectBuildDirectory; } public void setProjectBuildDirectory( File projectBuildDirectory ) { this.projectBuildDirectory = projectBuildDirectory; } protected void logDebugOrCliShowErrors( String s ) { SurefireHelper.logDebugOrCliShowErrors( s, getConsoleLogger(), cli ); } public String getTempDir() { return tempDir; } public void setTempDir( String tempDir ) { this.tempDir = tempDir; } private static String getEffectiveForkMode( String forkMode ) { if ( "pertest".equalsIgnoreCase( forkMode ) ) { return FORK_ALWAYS; } else if ( "none".equalsIgnoreCase( forkMode ) ) { return FORK_NEVER; } else if ( forkMode.equals( FORK_NEVER ) || forkMode.equals( FORK_ONCE ) || forkMode.equals( FORK_ALWAYS ) || forkMode.equals( FORK_PERTHREAD ) ) { return forkMode; } else { throw new IllegalArgumentException( "Fork mode " + forkMode + " is not a legal value" ); } } } ClasspathCache.java000066400000000000000000000027001330756104600371170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import java.util.concurrent.ConcurrentHashMap; import org.apache.maven.surefire.booter.Classpath; import javax.annotation.Nonnull; /** * @author Kristian Rosenvold */ public class ClasspathCache { private static final ConcurrentHashMap CLASSPATHS = new ConcurrentHashMap( 4 ); public static Classpath getCachedClassPath( @Nonnull String artifactId ) { return CLASSPATHS.get( artifactId ); } public static void setCachedClasspath( @Nonnull String key, @Nonnull Classpath classpath ) { CLASSPATHS.put( key, classpath ); } } CommonReflector.java000066400000000000000000000100561330756104600373520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import java.io.File; import java.lang.reflect.Constructor; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import org.apache.maven.surefire.booter.SurefireReflector; import org.apache.maven.surefire.util.SurefireReflectionException; import javax.annotation.Nonnull; import static org.apache.maven.surefire.util.ReflectionUtils.getConstructor; import static org.apache.maven.surefire.util.ReflectionUtils.instantiateObject; import static org.apache.maven.surefire.util.ReflectionUtils.newInstance; /** * @author Kristian Rosenvold */ public class CommonReflector { private final Class startupReportConfiguration; private final Class consoleLogger; private final ClassLoader surefireClassLoader; public CommonReflector( @Nonnull ClassLoader surefireClassLoader ) { this.surefireClassLoader = surefireClassLoader; try { startupReportConfiguration = surefireClassLoader.loadClass( StartupReportConfiguration.class.getName() ); consoleLogger = surefireClassLoader.loadClass( ConsoleLogger.class.getName() ); } catch ( ClassNotFoundException e ) { throw new SurefireReflectionException( e ); } } public Object createReportingReporterFactory( @Nonnull StartupReportConfiguration startupReportConfiguration, @Nonnull ConsoleLogger consoleLogger ) { Class[] args = { this.startupReportConfiguration, this.consoleLogger }; Object src = createStartupReportConfiguration( startupReportConfiguration ); Object logger = SurefireReflector.createConsoleLogger( consoleLogger, surefireClassLoader ); Object[] params = { src, logger }; return instantiateObject( DefaultReporterFactory.class.getName(), args, params, surefireClassLoader ); } private Object createStartupReportConfiguration( @Nonnull StartupReportConfiguration reporterConfiguration ) { Constructor constructor = getConstructor( startupReportConfiguration, boolean.class, boolean.class, String.class, boolean.class, boolean.class, File.class, boolean.class, String.class, File.class, boolean.class, int.class, String.class, String.class ); //noinspection BooleanConstructorCall Object[] params = { reporterConfiguration.isUseFile(), reporterConfiguration.isPrintSummary(), reporterConfiguration.getReportFormat(), reporterConfiguration.isRedirectTestOutputToFile(), reporterConfiguration.isDisableXmlReport(), reporterConfiguration.getReportsDirectory(), reporterConfiguration.isTrimStackTrace(), reporterConfiguration.getReportNameSuffix(), reporterConfiguration.getStatisticsFile(), reporterConfiguration.isRequiresRunHistory(), reporterConfiguration.getRerunFailingTestsCount(), reporterConfiguration.getXsdSchemaLocation(), reporterConfiguration.getEncoding().name() }; return newInstance( constructor, params ); } } ConfigurableProviderInfo.java000066400000000000000000000017611330756104600412060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ /** * @author Kristian Rosenvold */ interface ConfigurableProviderInfo extends ProviderInfo { ProviderInfo instantiate( String providerName ); } InPluginVMSurefireStarter.java000066400000000000000000000074371330756104600413270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.surefire.booter.ClasspathConfiguration; import org.apache.maven.surefire.booter.ProviderConfiguration; import org.apache.maven.surefire.booter.StartupConfiguration; import org.apache.maven.surefire.booter.SurefireExecutionException; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.DefaultScanResult; import javax.annotation.Nonnull; import java.lang.reflect.InvocationTargetException; import java.util.Map; import static org.apache.maven.surefire.booter.ProviderFactory.invokeProvider; /** * Starts the provider in the same VM as the surefire plugin. *
* This part of the booter is always guaranteed to be in the * same vm as the tests will be run in. * * @author Jason van Zyl * @author Brett Porter * @author Emmanuel Venisse * @author Dan Fabulich * @author Kristian Rosenvold */ public class InPluginVMSurefireStarter { private final StartupConfiguration startupConfig; private final StartupReportConfiguration startupReportConfig; private final ProviderConfiguration providerConfig; private final ConsoleLogger consoleLogger; public InPluginVMSurefireStarter( @Nonnull StartupConfiguration startupConfig, @Nonnull ProviderConfiguration providerConfig, @Nonnull StartupReportConfiguration startupReportConfig, @Nonnull ConsoleLogger consoleLogger ) { this.startupConfig = startupConfig; this.startupReportConfig = startupReportConfig; this.providerConfig = providerConfig; this.consoleLogger = consoleLogger; } public RunResult runSuitesInProcess( @Nonnull DefaultScanResult scanResult ) throws SurefireExecutionException, TestSetFailedException { // The test classloader must be constructed first to avoid issues with commons-logging until we properly // separate the TestNG classloader Map providerProperties = providerConfig.getProviderProperties(); scanResult.writeTo( providerProperties ); startupConfig.writeSurefireTestClasspathProperty(); ClassLoader testClassLoader = startupConfig.getClasspathConfiguration() .toRealPath( ClasspathConfiguration.class ) .createMergedClassLoader(); CommonReflector surefireReflector = new CommonReflector( testClassLoader ); Object factory = surefireReflector.createReportingReporterFactory( startupReportConfig, consoleLogger ); try { return invokeProvider( null, testClassLoader, factory, providerConfig, false, startupConfig, true ); } catch ( InvocationTargetException e ) { throw new SurefireExecutionException( "Exception in provider", e.getTargetException() ); } } } JdkAttributes.java000066400000000000000000000027771330756104600370460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import static org.apache.maven.surefire.util.internal.ObjectUtils.requireNonNull; /** * @author Tibor Digana (tibor17) * @since 2.20.1 */ public final class JdkAttributes { private final String jvmExecutable; private final boolean java9AtLeast; public JdkAttributes( String jvmExecutable, boolean java9AtLeast ) { this.jvmExecutable = requireNonNull( jvmExecutable, "null path to java executable" ); this.java9AtLeast = java9AtLeast; } public String getJvmExecutable() { return jvmExecutable; } public boolean isJava9AtLeast() { return java9AtLeast; } } ProviderInfo.java000066400000000000000000000026721330756104600366670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import org.apache.maven.artifact.resolver.ArtifactNotFoundException; import org.apache.maven.artifact.resolver.ArtifactResolutionException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.surefire.booter.Classpath; import javax.annotation.Nonnull; /** * @author Kristian Rosenvold */ public interface ProviderInfo { @Nonnull String getProviderName(); boolean isApplicable(); @Nonnull Classpath getProviderClasspath() throws ArtifactResolutionException, ArtifactNotFoundException; void addProviderProperties() throws MojoExecutionException; } StartupReportConfiguration.java000066400000000000000000000153021330756104600416410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import org.apache.maven.plugin.surefire.report.ConsoleOutputFileReporter; import org.apache.maven.plugin.surefire.report.DirectConsoleOutput; import org.apache.maven.plugin.surefire.report.FileReporter; import org.apache.maven.plugin.surefire.report.StatelessXmlReporter; import org.apache.maven.plugin.surefire.report.TestcycleConsoleOutputReceiver; import org.apache.maven.plugin.surefire.report.WrappedReportEntry; import org.apache.maven.plugin.surefire.runorder.StatisticsReporter; import javax.annotation.Nonnull; import java.io.File; import java.io.PrintStream; import java.nio.charset.Charset; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import static org.apache.maven.plugin.surefire.report.ConsoleReporter.BRIEF; import static org.apache.maven.plugin.surefire.report.ConsoleReporter.PLAIN; import static org.apache.commons.lang3.StringUtils.trimToNull; /** * All the parameters used to construct reporters *
* * @author Kristian Rosenvold */ public final class StartupReportConfiguration { public static final String BRIEF_REPORT_FORMAT = BRIEF; public static final String PLAIN_REPORT_FORMAT = PLAIN; private final PrintStream originalSystemOut; private final PrintStream originalSystemErr; private final boolean useFile; private final boolean printSummary; private final String reportFormat; private final String reportNameSuffix; private final File statisticsFile; private final boolean requiresRunHistory; private final boolean redirectTestOutputToFile; private final boolean disableXmlReport; private final File reportsDirectory; private final boolean trimStackTrace; private final int rerunFailingTestsCount; private final String xsdSchemaLocation; private final Map>> testClassMethodRunHistory = new ConcurrentHashMap>>(); private final Charset encoding; private StatisticsReporter statisticsReporter; @SuppressWarnings( "checkstyle:parameternumber" ) public StartupReportConfiguration( boolean useFile, boolean printSummary, String reportFormat, boolean redirectTestOutputToFile, boolean disableXmlReport, @Nonnull File reportsDirectory, boolean trimStackTrace, String reportNameSuffix, File statisticsFile, boolean requiresRunHistory, int rerunFailingTestsCount, String xsdSchemaLocation, String encoding ) { this.useFile = useFile; this.printSummary = printSummary; this.reportFormat = reportFormat; this.redirectTestOutputToFile = redirectTestOutputToFile; this.disableXmlReport = disableXmlReport; this.reportsDirectory = reportsDirectory; this.trimStackTrace = trimStackTrace; this.reportNameSuffix = reportNameSuffix; this.statisticsFile = statisticsFile; this.requiresRunHistory = requiresRunHistory; this.originalSystemOut = System.out; this.originalSystemErr = System.err; this.rerunFailingTestsCount = rerunFailingTestsCount; this.xsdSchemaLocation = xsdSchemaLocation; String charset = trimToNull( encoding ); this.encoding = charset == null ? Charset.defaultCharset() : Charset.forName( charset ); } public boolean isUseFile() { return useFile; } public boolean isPrintSummary() { return printSummary; } public String getReportFormat() { return reportFormat; } public String getReportNameSuffix() { return reportNameSuffix; } public boolean isRedirectTestOutputToFile() { return redirectTestOutputToFile; } public boolean isDisableXmlReport() { return disableXmlReport; } public File getReportsDirectory() { return reportsDirectory; } public int getRerunFailingTestsCount() { return rerunFailingTestsCount; } public StatelessXmlReporter instantiateStatelessXmlReporter() { return isDisableXmlReport() ? null : new StatelessXmlReporter( reportsDirectory, reportNameSuffix, trimStackTrace, rerunFailingTestsCount, testClassMethodRunHistory, xsdSchemaLocation ); } public FileReporter instantiateFileReporter() { return isUseFile() && isBriefOrPlainFormat() ? new FileReporter( reportsDirectory, getReportNameSuffix(), encoding ) : null; } public boolean isBriefOrPlainFormat() { String fmt = getReportFormat(); return BRIEF_REPORT_FORMAT.equals( fmt ) || PLAIN_REPORT_FORMAT.equals( fmt ); } public TestcycleConsoleOutputReceiver instantiateConsoleOutputFileReporter() { return isRedirectTestOutputToFile() ? new ConsoleOutputFileReporter( reportsDirectory, getReportNameSuffix() ) : new DirectConsoleOutput( originalSystemOut, originalSystemErr ); } public synchronized StatisticsReporter getStatisticsReporter() { if ( statisticsReporter == null ) { statisticsReporter = requiresRunHistory ? new StatisticsReporter( getStatisticsFile() ) : null; } return statisticsReporter; } public File getStatisticsFile() { return statisticsFile; } public boolean isTrimStackTrace() { return trimStackTrace; } public boolean isRequiresRunHistory() { return requiresRunHistory; } public PrintStream getOriginalSystemOut() { return originalSystemOut; } public String getXsdSchemaLocation() { return xsdSchemaLocation; } public Charset getEncoding() { return encoding; } } SurefireDependencyResolver.java000066400000000000000000000170341330756104600415640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.metadata.ArtifactMetadataSource; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactNotFoundException; import org.apache.maven.artifact.resolver.ArtifactResolutionException; import org.apache.maven.artifact.resolver.ArtifactResolutionResult; import org.apache.maven.artifact.resolver.ArtifactResolver; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.artifact.versioning.OverConstrainedVersionException; import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.surefire.booter.Classpath; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import javax.annotation.Nonnull; import javax.annotation.Nullable; /** * Does dependency resolution and artifact handling for the surefire plugin. * * @author Stephen Connolly * @author Kristian Rosenvold */ public class SurefireDependencyResolver { private final ArtifactResolver artifactResolver; private final ArtifactFactory artifactFactory; private final ConsoleLogger log; private final ArtifactRepository localRepository; private final List remoteRepositories; private final ArtifactMetadataSource artifactMetadataSource; private final String pluginName; protected SurefireDependencyResolver( ArtifactResolver artifactResolver, ArtifactFactory artifactFactory, ConsoleLogger log, ArtifactRepository localRepository, List remoteRepositories, ArtifactMetadataSource artifactMetadataSource, String pluginName ) { this.artifactResolver = artifactResolver; this.artifactFactory = artifactFactory; this.log = log; this.localRepository = localRepository; this.remoteRepositories = remoteRepositories; this.artifactMetadataSource = artifactMetadataSource; this.pluginName = pluginName; } public boolean isWithinVersionSpec( @Nullable Artifact artifact, @Nonnull String versionSpec ) { if ( artifact == null ) { return false; } try { VersionRange range = VersionRange.createFromVersionSpec( versionSpec ); try { return range.containsVersion( artifact.getSelectedVersion() ); } catch ( NullPointerException e ) { return range.containsVersion( new DefaultArtifactVersion( artifact.getBaseVersion() ) ); } } catch ( InvalidVersionSpecificationException e ) { throw new RuntimeException( "Bug in plugin. Please report with stacktrace" ); } catch ( OverConstrainedVersionException e ) { throw new RuntimeException( "Bug in plugin. Please report with stacktrace" ); } } private ArtifactResolutionResult resolveArtifact( Artifact filteredArtifact, Artifact providerArtifact ) throws ArtifactResolutionException, ArtifactNotFoundException { ArtifactFilter filter = null; if ( filteredArtifact != null ) { filter = new ExcludesArtifactFilter( Collections.singletonList( filteredArtifact.getGroupId() + ":" + filteredArtifact.getArtifactId() ) ); } Artifact originatingArtifact = artifactFactory.createBuildArtifact( "dummy", "dummy", "1.0", "jar" ); return artifactResolver.resolveTransitively( Collections.singleton( providerArtifact ), originatingArtifact, localRepository, remoteRepositories, artifactMetadataSource, filter ); } @Nonnull public Classpath getProviderClasspath( String provider, String version, Artifact filteredArtifact ) throws ArtifactNotFoundException, ArtifactResolutionException { Classpath classPath = ClasspathCache.getCachedClassPath( provider ); if ( classPath == null ) { Artifact providerArtifact = artifactFactory.createDependencyArtifact( "org.apache.maven.surefire", provider, VersionRange.createFromVersion( version ), "jar", null, Artifact.SCOPE_TEST ); ArtifactResolutionResult result = resolveArtifact( filteredArtifact, providerArtifact ); List files = new ArrayList(); for ( Object o : result.getArtifacts() ) { Artifact artifact = (Artifact) o; log.debug( "Adding to " + pluginName + " test classpath: " + artifact.getFile().getAbsolutePath() + " Scope: " + artifact.getScope() ); files.add( artifact.getFile().getAbsolutePath() ); } classPath = new Classpath( files ); ClasspathCache.setCachedClasspath( provider, classPath ); } return classPath; } public Classpath addProviderToClasspath( Map pluginArtifactMap, Artifact surefireArtifact ) throws ArtifactResolutionException, ArtifactNotFoundException { List files = new ArrayList(); if ( surefireArtifact != null ) { final ArtifactResolutionResult artifactResolutionResult = resolveArtifact( null, surefireArtifact ); for ( Artifact artifact : pluginArtifactMap.values() ) { if ( !artifactResolutionResult.getArtifacts().contains( artifact ) ) { files.add( artifact.getFile().getAbsolutePath() ); } } } else { // Bit of a brute force strategy if not found. Should probably be improved for ( Artifact artifact : pluginArtifactMap.values() ) { files.add( artifact.getFile().getPath() ); } } return new Classpath( files ); } } SurefireExecutionParameters.java000066400000000000000000000066251330756104600417570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import java.io.File; import java.util.List; import org.apache.maven.artifact.repository.ArtifactRepository; /** * This interface contains all the common parameters that have different implementations in Surefire vs IntegrationTest * * @author Stephen Connolly */ public interface SurefireExecutionParameters { boolean isSkipTests(); void setSkipTests( boolean skipTests ); boolean isSkipExec(); void setSkipExec( boolean skipExec ); boolean isSkip(); void setSkip( boolean skip ); File getBasedir(); void setBasedir( File basedir ); File getTestClassesDirectory(); void setTestClassesDirectory( File testClassesDirectory ); File getClassesDirectory(); void setClassesDirectory( File classesDirectory ); File getReportsDirectory(); void setReportsDirectory( File reportsDirectory ); File getTestSourceDirectory(); void setTestSourceDirectory( File testSourceDirectory ); String getTest(); void setTest( String test ); List getIncludes(); void setIncludes( List includes ); List getExcludes(); void setExcludes( List excludes ); ArtifactRepository getLocalRepository(); void setLocalRepository( ArtifactRepository localRepository ); boolean isPrintSummary(); void setPrintSummary( boolean printSummary ); String getReportFormat(); void setReportFormat( String reportFormat ); boolean isUseFile(); void setUseFile( boolean useFile ); String getDebugForkedProcess(); void setDebugForkedProcess( String debugForkedProcess ); int getForkedProcessTimeoutInSeconds(); void setForkedProcessTimeoutInSeconds( int forkedProcessTimeoutInSeconds ); int getForkedProcessExitTimeoutInSeconds(); void setForkedProcessExitTimeoutInSeconds( int forkedProcessTerminationTimeoutInSeconds ); double getParallelTestsTimeoutInSeconds(); void setParallelTestsTimeoutInSeconds( double parallelTestsTimeoutInSeconds ); double getParallelTestsTimeoutForcedInSeconds(); void setParallelTestsTimeoutForcedInSeconds( double parallelTestsTimeoutForcedInSeconds ); boolean isUseSystemClassLoader(); void setUseSystemClassLoader( boolean useSystemClassLoader ); boolean isUseManifestOnlyJar(); void setUseManifestOnlyJar( boolean useManifestOnlyJar ); String getEncoding(); void setEncoding( String encoding ); Boolean getFailIfNoSpecifiedTests(); void setFailIfNoSpecifiedTests( boolean failIfNoSpecifiedTests ); int getSkipAfterFailureCount(); String getShutdown(); } SurefireHelper.java000066400000000000000000000244411330756104600372030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import org.apache.maven.execution.MavenExecutionRequest; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.surefire.log.PluginConsoleLogger; import org.apache.maven.surefire.cli.CommandLineOption; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.internal.DumpFileUtils; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; import java.util.List; import static java.util.Collections.unmodifiableList; import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS; import static org.apache.maven.surefire.booter.DumpErrorSingleton.DUMPSTREAM_FILE_EXT; import static org.apache.maven.surefire.booter.DumpErrorSingleton.DUMP_FILE_EXT; import static org.apache.maven.surefire.cli.CommandLineOption.LOGGING_LEVEL_DEBUG; import static org.apache.maven.surefire.cli.CommandLineOption.LOGGING_LEVEL_ERROR; import static org.apache.maven.surefire.cli.CommandLineOption.LOGGING_LEVEL_INFO; import static org.apache.maven.surefire.cli.CommandLineOption.LOGGING_LEVEL_WARN; import static org.apache.maven.surefire.cli.CommandLineOption.SHOW_ERRORS; /** * Helper class for surefire plugins */ public final class SurefireHelper { private static final String DUMP_FILE_DATE = DumpFileUtils.newFormattedDateFileName(); public static final String DUMP_FILE_PREFIX = DUMP_FILE_DATE + "-jvmRun"; public static final String DUMPSTREAM_FILENAME_FORMATTER = DUMP_FILE_PREFIX + "%d" + DUMPSTREAM_FILE_EXT; /** * The maximum path that does not require long path prefix on Windows.
* See {@code sun/nio/fs/WindowsPath} in * * OpenJDK * and MSDN article. *
* The maximum path is 260 minus 1 (NUL) but for directories it is 260 * minus 12 minus 1 (to allow for the creation of a 8.3 file in the directory). */ private static final int MAX_PATH_LENGTH_WINDOWS = 247; private static final String[] DUMP_FILES_PRINT = { "[date]-jvmRun[N]" + DUMP_FILE_EXT, "[date]" + DUMPSTREAM_FILE_EXT, "[date]-jvmRun[N]" + DUMPSTREAM_FILE_EXT }; /** * Do not instantiate. */ private SurefireHelper() { throw new IllegalAccessError( "Utility class" ); } public static String[] getDumpFilesToPrint() { return DUMP_FILES_PRINT.clone(); } public static void reportExecution( SurefireReportParameters reportParameters, RunResult result, PluginConsoleLogger log, Exception firstForkException ) throws MojoFailureException, MojoExecutionException { if ( firstForkException == null && !result.isTimeout() && result.isErrorFree() ) { if ( result.getCompletedCount() == 0 && failIfNoTests( reportParameters ) ) { throw new MojoFailureException( "No tests were executed! " + "(Set -DfailIfNoTests=false to ignore this error.)" ); } return; } if ( reportParameters.isTestFailureIgnore() ) { log.error( createErrorMessage( reportParameters, result, firstForkException ) ); } else { throwException( reportParameters, result, firstForkException ); } } public static List commandLineOptions( MavenSession session, PluginConsoleLogger log ) { List cli = new ArrayList(); if ( log.isErrorEnabled() ) { cli.add( LOGGING_LEVEL_ERROR ); } if ( log.isWarnEnabled() ) { cli.add( LOGGING_LEVEL_WARN ); } if ( log.isInfoEnabled() ) { cli.add( LOGGING_LEVEL_INFO ); } if ( log.isDebugEnabled() ) { cli.add( LOGGING_LEVEL_DEBUG ); } try { Method getRequestMethod = session.getClass().getMethod( "getRequest" ); MavenExecutionRequest request = (MavenExecutionRequest) getRequestMethod.invoke( session ); if ( request.isShowErrors() ) { cli.add( SHOW_ERRORS ); } String f = getFailureBehavior( request ); if ( f != null ) { // compatible with enums Maven 3.0 cli.add( CommandLineOption.valueOf( f.startsWith( "REACTOR_" ) ? f : "REACTOR_" + f ) ); } } catch ( Exception e ) { // don't need to log the exception that Maven 2 does not have getRequest() method in Maven Session } return unmodifiableList( cli ); } public static void logDebugOrCliShowErrors( String s, PluginConsoleLogger log, Collection cli ) { if ( cli.contains( LOGGING_LEVEL_DEBUG ) ) { log.debug( s ); } else if ( cli.contains( SHOW_ERRORS ) ) { if ( log.isDebugEnabled() ) { log.debug( s ); } else { log.info( s ); } } } /** * Escape file path for Windows when the path is too long; otherwise returns {@code path}. *
* See * sun/nio/fs/WindowsPath for "long path" value explanation (=247), and * MSDN article * for detailed escaping strategy explanation: in short, {@code \\?\} prefix for path with drive letter * or {@code \\?\UNC\} for UNC path. * * @param path source path * @return escaped to platform path */ public static String escapeToPlatformPath( String path ) { if ( IS_OS_WINDOWS && path.length() > MAX_PATH_LENGTH_WINDOWS ) { path = path.startsWith( "\\\\" ) ? "\\\\?\\UNC\\" + path.substring( 2 ) : "\\\\?\\" + path; } return path; } private static String getFailureBehavior( MavenExecutionRequest request ) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { try { return request.getFailureBehavior(); } catch ( NoSuchMethodError e ) { return (String) request.getClass() .getMethod( "getReactorFailureBehavior" ) .invoke( request ); } } private static boolean failIfNoTests( SurefireReportParameters reportParameters ) { return reportParameters.getFailIfNoTests() != null && reportParameters.getFailIfNoTests(); } private static boolean isFatal( Exception firstForkException ) { return firstForkException != null && !( firstForkException instanceof TestSetFailedException ); } private static void throwException( SurefireReportParameters reportParameters, RunResult result, Exception firstForkException ) throws MojoFailureException, MojoExecutionException { if ( isFatal( firstForkException ) || result.isInternalError() ) { throw new MojoExecutionException( createErrorMessage( reportParameters, result, firstForkException ), firstForkException ); } else { throw new MojoFailureException( createErrorMessage( reportParameters, result, firstForkException ), firstForkException ); } } private static String createErrorMessage( SurefireReportParameters reportParameters, RunResult result, Exception firstForkException ) { StringBuilder msg = new StringBuilder( 512 ); if ( result.isTimeout() ) { msg.append( "There was a timeout or other error in the fork" ); } else { msg.append( "There are test failures.\n\nPlease refer to " ) .append( reportParameters.getReportsDirectory() ) .append( " for the individual test results." ) .append( '\n' ) .append( "Please refer to dump files (if any exist) " ) .append( DUMP_FILES_PRINT[0] ) .append( ", " ) .append( DUMP_FILES_PRINT[1] ) .append( " and " ) .append( DUMP_FILES_PRINT[2] ) .append( "." ); } if ( firstForkException != null && firstForkException.getLocalizedMessage() != null ) { msg.append( '\n' ) .append( firstForkException.getLocalizedMessage() ); } if ( result.isFailure() ) { msg.append( '\n' ) .append( result.getFailure() ); } return msg.toString(); } } SurefireProperties.java000066400000000000000000000170321330756104600401160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Collection; import java.util.Collections; import java.util.Enumeration; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import org.apache.maven.surefire.booter.Classpath; import org.apache.maven.surefire.booter.KeyValueSource; import org.apache.maven.surefire.util.internal.StringUtils; import static java.util.Arrays.asList; /** * A properties implementation that preserves insertion order. */ public class SurefireProperties extends Properties implements KeyValueSource { private static final Collection KEYS_THAT_CANNOT_BE_USED_AS_SYSTEM_PROPERTIES = asList( "java.library.path", "file.encoding", "jdk.map.althashing.threshold", "line.separator" ); private final LinkedHashSet items = new LinkedHashSet(); public SurefireProperties() { } public SurefireProperties( Properties source ) { if ( source != null ) { putAll( source ); } } public SurefireProperties( KeyValueSource source ) { if ( source != null ) { source.copyTo( this ); } } @Override public synchronized void putAll( Map t ) { for ( Map.Entry entry : t.entrySet() ) { put( entry.getKey(), entry.getValue() ); } } @Override public synchronized Object put( Object key, Object value ) { items.add( key ); return super.put( key, value ); } @Override public synchronized Object remove( Object key ) { items.remove( key ); return super.remove( key ); } @Override public synchronized void clear() { items.clear(); super.clear(); } @Override public synchronized Enumeration keys() { return Collections.enumeration( items ); } public void copyPropertiesFrom( Properties source ) { if ( source != null ) { putAll( source ); } } public Iterable getStringKeySet() { //noinspection unchecked return keySet(); } public Set propertiesThatCannotBeSetASystemProperties() { Set result = new HashSet(); for ( Object key : getStringKeySet() ) { if ( KEYS_THAT_CANNOT_BE_USED_AS_SYSTEM_PROPERTIES.contains( key ) ) { result.add( key ); } } return result; } public void copyToSystemProperties() { //noinspection unchecked for ( Object o : items ) { String key = (String) o; String value = getProperty( key ); System.setProperty( key, value ); } } static SurefireProperties calculateEffectiveProperties( Properties systemProperties, Map systemPropertyVariables, Properties userProperties, SurefireProperties props ) { SurefireProperties result = new SurefireProperties(); result.copyPropertiesFrom( systemProperties ); result.copyPropertiesFrom( props ); copyProperties( result, systemPropertyVariables ); // We used to take all of our system properties and dump them in with the // user specified properties for SUREFIRE-121, causing SUREFIRE-491. // Not gonna do THAT any more... instead, we only propagate those system properties // that have been explicitly specified by the user via -Dkey=value on the CLI result.copyPropertiesFrom( userProperties ); return result; } public static void copyProperties( Properties target, Map source ) { if ( source != null ) { for ( String key : source.keySet() ) { String value = source.get( key ); target.setProperty( key, value == null ? "" : value ); } } } @Override public void copyTo( Map target ) { target.putAll( this ); } public void setProperty( String key, File file ) { if ( file != null ) { setProperty( key, file.toString() ); } } public void setProperty( String key, Boolean aBoolean ) { if ( aBoolean != null ) { setProperty( key, aBoolean.toString() ); } } public void setProperty( String key, Long value ) { if ( value != null ) { setProperty( key, value.toString() ); } } public void addList( List items, String propertyPrefix ) { if ( items != null && !items.isEmpty() ) { int i = 0; for ( Object item : items ) { if ( item == null ) { throw new NullPointerException( propertyPrefix + i + " has null value" ); } String[] stringArray = StringUtils.split( item.toString(), "," ); for ( String aStringArray : stringArray ) { setProperty( propertyPrefix + i, aStringArray ); i++; } } } } public void setClasspath( String prefix, Classpath classpath ) { List classpathElements = classpath.getClassPath(); for ( int i = 0; i < classpathElements.size(); ++i ) { String element = classpathElements.get( i ); setProperty( prefix + i, element ); } } private static SurefireProperties loadProperties( InputStream inStream ) throws IOException { try { Properties p = new Properties(); p.load( inStream ); return new SurefireProperties( p ); } finally { close( inStream ); } } public static SurefireProperties loadProperties( File file ) throws IOException { return file == null ? new SurefireProperties() : loadProperties( new FileInputStream( file ) ); } private static void close( InputStream inputStream ) { try { inputStream.close(); } catch ( IOException ex ) { // ignore } } public void setNullableProperty( String key, String value ) { if ( value != null ) { super.setProperty( key, value ); } } } SurefireReportParameters.java000066400000000000000000000031721330756104600412610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import java.io.File; /** * The parameters required to report on a surefire execution. * * @author Stephen Connolly */ public interface SurefireReportParameters { boolean isSkipTests(); void setSkipTests( boolean skipTests ); boolean isSkipExec(); void setSkipExec( boolean skipExec ); boolean isSkip(); void setSkip( boolean skip ); boolean isTestFailureIgnore(); void setTestFailureIgnore( boolean testFailureIgnore ); File getBasedir(); void setBasedir( File basedir ); File getTestClassesDirectory(); void setTestClassesDirectory( File testClassesDirectory ); File getReportsDirectory(); void setReportsDirectory( File reportsDirectory ); Boolean getFailIfNoTests(); void setFailIfNoTests( boolean failIfNoTests ); } booterclient/000077500000000000000000000000001330756104600361005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefireAbstractClasspathForkConfiguration.java000066400000000000000000000047661330756104600457400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.surefire.booter.Classpath; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.io.File; import java.util.Map; import java.util.Properties; /** * @author Tibor Digana (tibor17) * @since 2.21.0.Jigsaw */ abstract class AbstractClasspathForkConfiguration extends DefaultForkConfiguration { @SuppressWarnings( "checkstyle:parameternumber" ) AbstractClasspathForkConfiguration( @Nonnull Classpath bootClasspath, @Nonnull File tempDirectory, @Nullable String debugLine, @Nonnull File workingDirectory, @Nonnull Properties modelProperties, @Nullable String argLine, @Nonnull Map environmentVariables, boolean debug, int forkCount, boolean reuseForks, @Nonnull Platform pluginPlatform, @Nonnull ConsoleLogger log ) { super( bootClasspath, tempDirectory, debugLine, workingDirectory, modelProperties, argLine, environmentVariables, debug, forkCount, reuseForks, pluginPlatform, log ); } @Override @Nonnull protected String extendJvmArgLine( @Nonnull String jvmArgLine ) { return jvmArgLine; } } BooterSerializer.java000066400000000000000000000240631330756104600422340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.plugin.surefire.SurefireProperties; import org.apache.maven.surefire.booter.AbstractPathConfiguration; import org.apache.maven.surefire.booter.ClassLoaderConfiguration; import org.apache.maven.surefire.booter.KeyValueSource; import org.apache.maven.surefire.booter.ProviderConfiguration; import org.apache.maven.surefire.booter.StartupConfiguration; import org.apache.maven.surefire.cli.CommandLineOption; import org.apache.maven.surefire.report.ReporterConfiguration; import org.apache.maven.surefire.testset.DirectoryScannerParameters; import org.apache.maven.surefire.testset.RunOrderParameters; import org.apache.maven.surefire.testset.TestArtifactInfo; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.testset.TestRequest; import org.apache.maven.surefire.util.RunOrder; import java.io.File; import java.io.IOException; import java.util.List; import static org.apache.maven.surefire.booter.AbstractPathConfiguration.CHILD_DELEGATION; import static org.apache.maven.surefire.booter.AbstractPathConfiguration.CLASSPATH; import static org.apache.maven.surefire.booter.AbstractPathConfiguration.ENABLE_ASSERTIONS; import static org.apache.maven.surefire.booter.AbstractPathConfiguration.SUREFIRE_CLASSPATH; import static org.apache.maven.surefire.booter.BooterConstants.EXCLUDES_PROPERTY_PREFIX; import static org.apache.maven.surefire.booter.BooterConstants.FAIL_FAST_COUNT; import static org.apache.maven.surefire.booter.BooterConstants.FAILIFNOTESTS; import static org.apache.maven.surefire.booter.BooterConstants.FORKTESTSET; import static org.apache.maven.surefire.booter.BooterConstants.FORKTESTSET_PREFER_TESTS_FROM_IN_STREAM; import static org.apache.maven.surefire.booter.BooterConstants.INCLUDES_PROPERTY_PREFIX; import static org.apache.maven.surefire.booter.BooterConstants.ISTRIMSTACKTRACE; import static org.apache.maven.surefire.booter.BooterConstants.MAIN_CLI_OPTIONS; import static org.apache.maven.surefire.booter.BooterConstants.PLUGIN_PID; import static org.apache.maven.surefire.booter.BooterConstants.PROVIDER_CONFIGURATION; import static org.apache.maven.surefire.booter.BooterConstants.REPORTSDIRECTORY; import static org.apache.maven.surefire.booter.BooterConstants.REQUESTEDTEST; import static org.apache.maven.surefire.booter.BooterConstants.RERUN_FAILING_TESTS_COUNT; import static org.apache.maven.surefire.booter.BooterConstants.RUN_ORDER; import static org.apache.maven.surefire.booter.BooterConstants.RUN_STATISTICS_FILE; import static org.apache.maven.surefire.booter.BooterConstants.SHUTDOWN; import static org.apache.maven.surefire.booter.BooterConstants.SOURCE_DIRECTORY; import static org.apache.maven.surefire.booter.BooterConstants.SPECIFIC_TEST_PROPERTY_PREFIX; import static org.apache.maven.surefire.booter.BooterConstants.SYSTEM_EXIT_TIMEOUT; import static org.apache.maven.surefire.booter.BooterConstants.TEST_CLASSES_DIRECTORY; import static org.apache.maven.surefire.booter.BooterConstants.TEST_SUITE_XML_FILES; import static org.apache.maven.surefire.booter.BooterConstants.TESTARTIFACT_CLASSIFIER; import static org.apache.maven.surefire.booter.BooterConstants.TESTARTIFACT_VERSION; import static org.apache.maven.surefire.booter.BooterConstants.USEMANIFESTONLYJAR; import static org.apache.maven.surefire.booter.BooterConstants.USESYSTEMCLASSLOADER; import static org.apache.maven.surefire.booter.SystemPropertyManager.writePropertiesFile; /** * Knows how to serialize and deserialize the booter configuration. *
* The internal serialization format is through a properties file. The long-term goal of this * class is not to expose this implementation information to its clients. This still leaks somewhat, * and there are some cases where properties are being accessed as "Properties" instead of * more representative domain objects. *
* * @author Jason van Zyl * @author Emmanuel Venisse * @author Brett Porter * @author Dan Fabulich * @author Kristian Rosenvold */ class BooterSerializer { private final ForkConfiguration forkConfiguration; BooterSerializer( ForkConfiguration forkConfiguration ) { this.forkConfiguration = forkConfiguration; } /** * Does not modify sourceProperties */ File serialize( KeyValueSource sourceProperties, ProviderConfiguration booterConfiguration, StartupConfiguration providerConfiguration, Object testSet, boolean readTestsFromInStream, Long pid ) throws IOException { SurefireProperties properties = new SurefireProperties( sourceProperties ); properties.setProperty( PLUGIN_PID, pid ); AbstractPathConfiguration cp = providerConfiguration.getClasspathConfiguration(); properties.setClasspath( CLASSPATH, cp.getTestClasspath() ); properties.setClasspath( SUREFIRE_CLASSPATH, cp.getProviderClasspath() ); properties.setProperty( ENABLE_ASSERTIONS, toString( cp.isEnableAssertions() ) ); properties.setProperty( CHILD_DELEGATION, toString( cp.isChildDelegation() ) ); TestArtifactInfo testNg = booterConfiguration.getTestArtifact(); if ( testNg != null ) { properties.setProperty( TESTARTIFACT_VERSION, testNg.getVersion() ); properties.setNullableProperty( TESTARTIFACT_CLASSIFIER, testNg.getClassifier() ); } properties.setProperty( FORKTESTSET_PREFER_TESTS_FROM_IN_STREAM, readTestsFromInStream ); properties.setNullableProperty( FORKTESTSET, getTypeEncoded( testSet ) ); TestRequest testSuiteDefinition = booterConfiguration.getTestSuiteDefinition(); if ( testSuiteDefinition != null ) { properties.setProperty( SOURCE_DIRECTORY, testSuiteDefinition.getTestSourceDirectory() ); properties.addList( testSuiteDefinition.getSuiteXmlFiles(), TEST_SUITE_XML_FILES ); TestListResolver testFilter = testSuiteDefinition.getTestListResolver(); properties.setProperty( REQUESTEDTEST, testFilter == null ? "" : testFilter.getPluginParameterTest() ); int rerunFailingTestsCount = testSuiteDefinition.getRerunFailingTestsCount(); properties.setNullableProperty( RERUN_FAILING_TESTS_COUNT, toString( rerunFailingTestsCount ) ); } DirectoryScannerParameters directoryScannerParameters = booterConfiguration.getDirScannerParams(); if ( directoryScannerParameters != null ) { properties.setProperty( FAILIFNOTESTS, toString( directoryScannerParameters.isFailIfNoTests() ) ); properties.addList( directoryScannerParameters.getIncludes(), INCLUDES_PROPERTY_PREFIX ); properties.addList( directoryScannerParameters.getExcludes(), EXCLUDES_PROPERTY_PREFIX ); properties.addList( directoryScannerParameters.getSpecificTests(), SPECIFIC_TEST_PROPERTY_PREFIX ); properties.setProperty( TEST_CLASSES_DIRECTORY, directoryScannerParameters.getTestClassesDirectory() ); } final RunOrderParameters runOrderParameters = booterConfiguration.getRunOrderParameters(); if ( runOrderParameters != null ) { properties.setProperty( RUN_ORDER, RunOrder.asString( runOrderParameters.getRunOrder() ) ); properties.setProperty( RUN_STATISTICS_FILE, runOrderParameters.getRunStatisticsFile() ); } ReporterConfiguration reporterConfiguration = booterConfiguration.getReporterConfiguration(); boolean rep = reporterConfiguration.isTrimStackTrace(); properties.setProperty( ISTRIMSTACKTRACE, rep ); properties.setProperty( REPORTSDIRECTORY, reporterConfiguration.getReportsDirectory() ); ClassLoaderConfiguration classLoaderConfig = providerConfiguration.getClassLoaderConfiguration(); properties.setProperty( USESYSTEMCLASSLOADER, toString( classLoaderConfig.isUseSystemClassLoader() ) ); properties.setProperty( USEMANIFESTONLYJAR, toString( classLoaderConfig.isUseManifestOnlyJar() ) ); properties.setProperty( FAILIFNOTESTS, toString( booterConfiguration.isFailIfNoTests() ) ); properties.setProperty( PROVIDER_CONFIGURATION, providerConfiguration.getProviderClassName() ); properties.setProperty( FAIL_FAST_COUNT, toString( booterConfiguration.getSkipAfterFailureCount() ) ); properties.setProperty( SHUTDOWN, booterConfiguration.getShutdown().name() ); List mainCliOptions = booterConfiguration.getMainCliOptions(); if ( mainCliOptions != null ) { properties.addList( mainCliOptions, MAIN_CLI_OPTIONS ); } properties.setNullableProperty( SYSTEM_EXIT_TIMEOUT, toString( booterConfiguration.getSystemExitTimeout() ) ); File surefireTmpDir = forkConfiguration.getTempDirectory(); boolean debug = forkConfiguration.isDebug(); return writePropertiesFile( properties, surefireTmpDir, "surefire", debug ); } private static String getTypeEncoded( Object value ) { if ( value == null ) { return null; } String valueToUse = value instanceof Class ? ( (Class) value ).getName() : value.toString(); return value.getClass().getName() + "|" + valueToUse; } private static String toString( Object o ) { return String.valueOf( o ); } } ChecksumCalculator.java000066400000000000000000000101301330756104600425120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; import java.io.File; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.List; import java.util.Map; import static org.apache.maven.surefire.util.internal.StringUtils.ISO_8859_1; /** * @author Kristian Rosenvold */ public class ChecksumCalculator { private static final String HEX = "0123456789ABCDEF"; private final List checksumItems = new ArrayList(); private void appendObject( Object item ) { checksumItems.add( item ); } public void add( boolean value ) { checksumItems.add( value ); } public void add( int value ) { checksumItems.add( value ); } public void add( double value ) { checksumItems.add( value ); } public void add( Map map ) { if ( map != null ) { appendObject( map.toString() ); } } public void add( String string ) { appendObject( string ); } public void add( File workingDirectory ) { appendObject( workingDirectory ); } public void add( ArtifactRepository localRepository ) { appendObject( localRepository ); } public void add( List items ) { if ( items != null ) { for ( Object item : items ) { appendObject( item ); } } else { appendObject( null ); } } public void add( Object[] items ) { if ( items != null ) { for ( Object item : items ) { appendObject( item ); } } else { appendObject( null ); } } public void add( Artifact artifact ) { appendObject( artifact != null ? artifact.getId() : null ); } public void add( Boolean aBoolean ) { appendObject( aBoolean ); } @SuppressWarnings( "checkstyle:magicnumber" ) private static String asHexString( byte[] bytes ) { if ( bytes == null ) { return null; } final StringBuilder result = new StringBuilder( 2 * bytes.length ); for ( byte b : bytes ) { result.append( HEX.charAt( ( b & 0xF0 ) >> 4 ) ).append( HEX.charAt( ( b & 0x0F ) ) ); } return result.toString(); } private String getConfig() { StringBuilder result = new StringBuilder(); for ( Object checksumItem : checksumItems ) { result.append( checksumItem != null ? checksumItem.toString() : "null" ); } return result.toString(); } public String getSha1() { try { MessageDigest md = MessageDigest.getInstance( "SHA-1" ); String configValue = getConfig(); md.update( configValue.getBytes( ISO_8859_1 ), 0, configValue.length() ); byte[] sha1hash = md.digest(); return asHexString( sha1hash ); } catch ( NoSuchAlgorithmException e ) { throw new RuntimeException( e ); } } } ClasspathForkConfiguration.java000066400000000000000000000056161330756104600442470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.OutputStreamFlushableCommandline; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.surefire.booter.Classpath; import org.apache.maven.surefire.booter.StartupConfiguration; import org.apache.maven.surefire.booter.SurefireBooterForkException; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.io.File; import java.util.Map; import java.util.Properties; import static org.apache.maven.shared.utils.StringUtils.join; /** * @author Tibor Digana (tibor17) * @since 2.21.0.Jigsaw */ public final class ClasspathForkConfiguration extends AbstractClasspathForkConfiguration { @SuppressWarnings( "checkstyle:parameternumber" ) public ClasspathForkConfiguration( @Nonnull Classpath bootClasspath, @Nonnull File tempDirectory, @Nullable String debugLine, @Nonnull File workingDirectory, @Nonnull Properties modelProperties, @Nullable String argLine, @Nonnull Map environmentVariables, boolean debug, int forkCount, boolean reuseForks, @Nonnull Platform pluginPlatform, @Nonnull ConsoleLogger log ) { super( bootClasspath, tempDirectory, debugLine, workingDirectory, modelProperties, argLine, environmentVariables, debug, forkCount, reuseForks, pluginPlatform, log ); } @Override protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, @Nonnull String booterThatHasMainMethod, @Nonnull StartupConfiguration config ) throws SurefireBooterForkException { cli.addEnvironment( "CLASSPATH", join( toCompleteClasspath( config ).iterator(), File.pathSeparator ) ); cli.createArg().setValue( booterThatHasMainMethod ); } } DefaultForkConfiguration.java000066400000000000000000000263701330756104600437110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.plugin.surefire.JdkAttributes; import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.OutputStreamFlushableCommandline; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.surefire.booter.AbstractPathConfiguration; import org.apache.maven.surefire.booter.Classpath; import org.apache.maven.surefire.booter.StartupConfiguration; import org.apache.maven.surefire.booter.SurefireBooterForkException; import org.apache.maven.surefire.util.internal.ImmutableMap; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.io.File; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import static org.apache.maven.plugin.surefire.AbstractSurefireMojo.FORK_NUMBER_PLACEHOLDER; import static org.apache.maven.plugin.surefire.AbstractSurefireMojo.THREAD_NUMBER_PLACEHOLDER; import static org.apache.maven.plugin.surefire.util.Relocator.relocate; import static org.apache.maven.surefire.booter.Classpath.join; /** * Basic framework which constructs CLI. * * @author Tibor Digana (tibor17) * @since 2.21.0.Jigsaw */ public abstract class DefaultForkConfiguration extends ForkConfiguration { @Nonnull private final Classpath booterClasspath; @Nonnull private final File tempDirectory; @Nullable private final String debugLine; @Nonnull private final File workingDirectory; @Nonnull private final Properties modelProperties; @Nullable private final String argLine; @Nonnull private final Map environmentVariables; private final boolean debug; private final int forkCount; private final boolean reuseForks; @Nonnull private final Platform pluginPlatform; @Nonnull private final ConsoleLogger log; @SuppressWarnings( "checkstyle:parameternumber" ) protected DefaultForkConfiguration( @Nonnull Classpath booterClasspath, @Nonnull File tempDirectory, @Nullable String debugLine, @Nonnull File workingDirectory, @Nonnull Properties modelProperties, @Nullable String argLine, @Nonnull Map environmentVariables, boolean debug, int forkCount, boolean reuseForks, @Nonnull Platform pluginPlatform, @Nonnull ConsoleLogger log ) { this.booterClasspath = booterClasspath; this.tempDirectory = tempDirectory; this.debugLine = debugLine; this.workingDirectory = workingDirectory; this.modelProperties = modelProperties; this.argLine = argLine; this.environmentVariables = toImmutable( environmentVariables ); this.debug = debug; this.forkCount = forkCount; this.reuseForks = reuseForks; this.pluginPlatform = pluginPlatform; this.log = log; } protected abstract void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, @Nonnull String booterThatHasMainMethod, @Nonnull StartupConfiguration config ) throws SurefireBooterForkException; @Nonnull protected String extendJvmArgLine( @Nonnull String jvmArgLine ) { return jvmArgLine; } /** * @param config The startup configuration * @param forkNumber index of forked JVM, to be the replacement in the argLine * @return CommandLine able to flush entire command going to be sent to forked JVM * @throws org.apache.maven.surefire.booter.SurefireBooterForkException when unable to perform the fork */ @Nonnull @Override public OutputStreamFlushableCommandline createCommandLine( @Nonnull StartupConfiguration config, int forkNumber ) throws SurefireBooterForkException { OutputStreamFlushableCommandline cli = new OutputStreamFlushableCommandline(); cli.setWorkingDirectory( getWorkingDirectory( forkNumber ).getAbsolutePath() ); for ( Entry entry : getEnvironmentVariables().entrySet() ) { String value = entry.getValue(); cli.addEnvironment( entry.getKey(), value == null ? "" : value ); } cli.setExecutable( getJdkForTests().getJvmExecutable() ); String jvmArgLine = newJvmArgLine( forkNumber ); if ( !jvmArgLine.isEmpty() ) { cli.createArg() .setLine( jvmArgLine ); } if ( getDebugLine() != null && !getDebugLine().isEmpty() ) { cli.createArg() .setLine( getDebugLine() ); } resolveClasspath( cli, findStartClass( config ), config ); return cli; } @Nonnull protected List toCompleteClasspath( StartupConfiguration conf ) throws SurefireBooterForkException { AbstractPathConfiguration pathConfig = conf.getClasspathConfiguration(); if ( pathConfig.isClassPathConfig() == pathConfig.isModularPathConfig() ) { throw new SurefireBooterForkException( "Could not find class-path config nor modular class-path either." ); } Classpath bootClasspath = getBooterClasspath(); Classpath testClasspath = pathConfig.getTestClasspath(); Classpath providerClasspath = pathConfig.getProviderClasspath(); Classpath completeClasspath = join( join( bootClasspath, testClasspath ), providerClasspath ); log.debug( completeClasspath.getLogMessage( "boot classpath:" ) ); log.debug( completeClasspath.getCompactLogMessage( "boot(compact) classpath:" ) ); return completeClasspath.getClassPath(); } @Nonnull private File getWorkingDirectory( int forkNumber ) throws SurefireBooterForkException { File cwd = new File( replaceThreadNumberPlaceholder( getWorkingDirectory().getAbsolutePath(), forkNumber ) ); if ( !cwd.exists() && !cwd.mkdirs() ) { throw new SurefireBooterForkException( "Cannot create workingDirectory " + cwd.getAbsolutePath() ); } if ( !cwd.isDirectory() ) { throw new SurefireBooterForkException( "WorkingDirectory " + cwd.getAbsolutePath() + " exists and is not a directory" ); } return cwd; } @Nonnull private static String replaceThreadNumberPlaceholder( @Nonnull String argLine, int threadNumber ) { String threadNumberAsString = String.valueOf( threadNumber ); return argLine.replace( THREAD_NUMBER_PLACEHOLDER, threadNumberAsString ) .replace( FORK_NUMBER_PLACEHOLDER, threadNumberAsString ); } /** * Replaces expressions
@{property-name}
with the corresponding properties * from the model. This allows late evaluation of property values when the plugin is executed (as compared * to evaluation when the pom is parsed as is done with
${property-name}
expressions). * * This allows other plugins to modify or set properties with the changes getting picked up by surefire. */ @Nonnull private String interpolateArgLineWithPropertyExpressions() { if ( getArgLine() == null ) { return ""; } String resolvedArgLine = getArgLine().trim(); if ( resolvedArgLine.isEmpty() ) { return ""; } for ( final String key : getModelProperties().stringPropertyNames() ) { String field = "@{" + key + "}"; if ( getArgLine().contains( field ) ) { resolvedArgLine = resolvedArgLine.replace( field, getModelProperties().getProperty( key, "" ) ); } } return resolvedArgLine; } @Nonnull private static String stripNewLines( @Nonnull String argLine ) { return argLine.replace( "\n", " " ).replace( "\r", " " ); } /** * Immutable map. * * @param map immutable map copies elements from map * @param key type * @param value type * @return never returns null */ @Nonnull private static Map toImmutable( @Nullable Map map ) { return map == null ? Collections.emptyMap() : new ImmutableMap( map ); } @Override @Nonnull public File getTempDirectory() { return tempDirectory; } @Override @Nullable protected String getDebugLine() { return debugLine; } @Override @Nonnull protected File getWorkingDirectory() { return workingDirectory; } @Override @Nonnull protected Properties getModelProperties() { return modelProperties; } @Override @Nullable protected String getArgLine() { return argLine; } @Override @Nonnull protected Map getEnvironmentVariables() { return environmentVariables; } @Override protected boolean isDebug() { return debug; } @Override protected int getForkCount() { return forkCount; } @Override protected boolean isReuseForks() { return reuseForks; } @Override @Nonnull protected Platform getPluginPlatform() { return pluginPlatform; } @Override @Nonnull protected JdkAttributes getJdkForTests() { return getPluginPlatform().getJdkExecAttributesForTests(); } @Override @Nonnull protected Classpath getBooterClasspath() { return booterClasspath; } @Nonnull private String newJvmArgLine( int forks ) { String interpolatedArgs = stripNewLines( interpolateArgLineWithPropertyExpressions() ); String argsWithReplacedForkNumbers = replaceThreadNumberPlaceholder( interpolatedArgs, forks ); return extendJvmArgLine( argsWithReplacedForkNumbers ); } @Nonnull private static String findStartClass( StartupConfiguration config ) { return config.isShadefire() ? relocate( DEFAULT_PROVIDER_CLASS ) : DEFAULT_PROVIDER_CLASS; } } ForkConfiguration.java000066400000000000000000000055271330756104600424050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.plugin.surefire.JdkAttributes; import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.OutputStreamFlushableCommandline; import org.apache.maven.surefire.booter.Classpath; import org.apache.maven.surefire.booter.ForkedBooter; import org.apache.maven.surefire.booter.StartupConfiguration; import org.apache.maven.surefire.booter.SurefireBooterForkException; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.io.File; import java.util.Map; import java.util.Properties; /** * Configuration for forking tests. */ public abstract class ForkConfiguration { static final String DEFAULT_PROVIDER_CLASS = ForkedBooter.class.getName(); @Nonnull public abstract File getTempDirectory(); @Nullable protected abstract String getDebugLine(); @Nonnull protected abstract File getWorkingDirectory(); @Nonnull protected abstract Properties getModelProperties(); @Nullable protected abstract String getArgLine(); @Nonnull protected abstract Map getEnvironmentVariables(); protected abstract boolean isDebug(); protected abstract int getForkCount(); protected abstract boolean isReuseForks(); @Nonnull protected abstract Platform getPluginPlatform(); @Nonnull protected abstract JdkAttributes getJdkForTests(); @Nonnull protected abstract Classpath getBooterClasspath(); /** * @param config The startup configuration * @param forkNumber index of forked JVM, to be the replacement in the argLine * @return CommandLine able to flush entire command going to be sent to forked JVM * @throws org.apache.maven.surefire.booter.SurefireBooterForkException * when unable to perform the fork */ @Nonnull public abstract OutputStreamFlushableCommandline createCommandLine( @Nonnull StartupConfiguration config, int forkNumber ) throws SurefireBooterForkException; } ForkNumberBucket.java000066400000000000000000000055021330756104600421550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicInteger; /** * A bucket from which fork numbers can be drawn. Any drawn number needs to be returned to the bucket, in order to keep * the range of provided values delivered as small as possible. * * @author Andreas Gudian */ public final class ForkNumberBucket { private static final ForkNumberBucket INSTANCE = new ForkNumberBucket(); private final Queue qFree = new ConcurrentLinkedQueue(); private final AtomicInteger highWaterMark = new AtomicInteger( 1 ); /** * Non-public constructor */ private ForkNumberBucket() { } /** * @return a fork number that is not currently in use. The value must be returned to the bucket using * {@link #returnNumber(int)}. */ public static int drawNumber() { return getInstance().drawNumberInternal(); } /** * @param number the number to return to the bucket so that it can be reused. */ public static void returnNumber( int number ) { getInstance().returnNumberInternal( number ); } /** * @return a singleton instance */ private static ForkNumberBucket getInstance() { return INSTANCE; } /** * @return a fork number that is not currently in use. The value must be returned to the bucket using * {@link #returnNumber(int)}. */ private int drawNumberInternal() { Integer nextFree = qFree.poll(); return nextFree == null ? highWaterMark.getAndIncrement() : nextFree; } /** * @return the highest number that has been drawn */ private int getHighestDrawnNumber() { return highWaterMark.get() - 1; } /** * @param number the number to return to the bucket so that it can be reused. */ private void returnNumberInternal( int number ) { qFree.add( number ); } } ForkStarter.java000066400000000000000000001037701330756104600412210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.plugin.surefire.CommonReflector; import org.apache.maven.plugin.surefire.StartupReportConfiguration; import org.apache.maven.plugin.surefire.SurefireProperties; import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.AbstractForkInputStream; import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.NotifiableTestStream; import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.OutputStreamFlushableCommandline; import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestLessInputStream; import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestProvidingInputStream; import org.apache.maven.plugin.surefire.booterclient.output.ForkClient; import org.apache.maven.plugin.surefire.booterclient.output.InPluginProcessDumpSingleton; import org.apache.maven.plugin.surefire.booterclient.output.NativeStdErrStreamConsumer; import org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import org.apache.maven.shared.utils.cli.CommandLineCallable; import org.apache.maven.shared.utils.cli.CommandLineException; import org.apache.maven.surefire.booter.AbstractPathConfiguration; import org.apache.maven.surefire.booter.KeyValueSource; import org.apache.maven.surefire.booter.PropertiesWrapper; import org.apache.maven.surefire.booter.ProviderConfiguration; import org.apache.maven.surefire.booter.ProviderFactory; import org.apache.maven.surefire.booter.Shutdown; import org.apache.maven.surefire.booter.StartupConfiguration; import org.apache.maven.surefire.booter.SurefireBooterForkException; import org.apache.maven.surefire.booter.SurefireExecutionException; import org.apache.maven.surefire.providerapi.SurefireProvider; import org.apache.maven.surefire.report.StackTraceWriter; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.TestRequest; import org.apache.maven.surefire.util.DefaultScanResult; import javax.annotation.Nonnull; import java.io.Closeable; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Map; import java.util.Queue; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import static java.lang.StrictMath.min; import static java.lang.System.currentTimeMillis; import static java.lang.Thread.currentThread; import static java.util.Collections.addAll; import static java.util.concurrent.Executors.newScheduledThreadPool; import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.TimeUnit.SECONDS; import static org.apache.maven.plugin.surefire.AbstractSurefireMojo.createCopyAndReplaceForkNumPlaceholder; import static org.apache.maven.plugin.surefire.SurefireHelper.DUMP_FILE_PREFIX; import static org.apache.maven.plugin.surefire.booterclient.ForkNumberBucket.drawNumber; import static org.apache.maven.plugin.surefire.booterclient.ForkNumberBucket.returnNumber; import static org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestLessInputStream .TestLessInputStreamBuilder; import static org.apache.maven.shared.utils.cli.CommandLineUtils.executeCommandLineAsCallable; import static org.apache.maven.shared.utils.cli.ShutdownHookUtils.addShutDownHook; import static org.apache.maven.shared.utils.cli.ShutdownHookUtils.removeShutdownHook; import static org.apache.maven.surefire.booter.SystemPropertyManager.writePropertiesFile; import static org.apache.maven.surefire.suite.RunResult.SUCCESS; import static org.apache.maven.surefire.suite.RunResult.failure; import static org.apache.maven.surefire.suite.RunResult.timeout; import static org.apache.maven.surefire.util.internal.ConcurrencyUtils.countDownToZero; import static org.apache.maven.surefire.util.internal.DaemonThreadFactory.newDaemonThread; import static org.apache.maven.surefire.util.internal.DaemonThreadFactory.newDaemonThreadFactory; import static org.apache.maven.surefire.util.internal.ObjectUtils.requireNonNull; import static org.apache.maven.surefire.util.internal.StringUtils.ISO_8859_1; /** * Starts the fork or runs in-process. *
* Lives only on the plugin-side (not present in remote vms) *
* Knows how to fork new vms and also how to delegate non-forking invocation to SurefireStarter directly * * @author Jason van Zyl * @author Emmanuel Venisse * @author Brett Porter * @author Dan Fabulich * @author Carlos Sanchez * @author Kristian Rosenvold */ public class ForkStarter { private static final String EXECUTION_EXCEPTION = "ExecutionException"; private static final long PING_IN_SECONDS = 10; private static final int TIMEOUT_CHECK_PERIOD_MILLIS = 100; private static final ThreadFactory FORKED_JVM_DAEMON_THREAD_FACTORY = newDaemonThreadFactory( "surefire-fork-starter" ); private static final ThreadFactory SHUTDOWN_HOOK_THREAD_FACTORY = newDaemonThreadFactory( "surefire-jvm-killer-shutdownhook" ); private static final AtomicInteger SYSTEM_PROPERTIES_FILE_COUNTER = new AtomicInteger(); private final ScheduledExecutorService pingThreadScheduler = createPingScheduler(); private final ScheduledExecutorService timeoutCheckScheduler; private final Queue currentForkClients; private final int forkedProcessTimeoutInSeconds; private final ProviderConfiguration providerConfiguration; private final StartupConfiguration startupConfiguration; private final ForkConfiguration forkConfiguration; private final StartupReportConfiguration startupReportConfiguration; private final ConsoleLogger log; private final DefaultReporterFactory defaultReporterFactory; private final Collection defaultReporterFactories; /** * Closes stuff, with a shutdown hook to make sure things really get closed. */ private final class CloseableCloser implements Runnable, Closeable { private final int jvmRun; private final Queue testProvidingInputStream; private final Thread inputStreamCloserHook; CloseableCloser( int jvmRun, Closeable... testProvidingInputStream ) { this.jvmRun = jvmRun; this.testProvidingInputStream = new ConcurrentLinkedQueue(); addAll( this.testProvidingInputStream, testProvidingInputStream ); if ( this.testProvidingInputStream.isEmpty() ) { inputStreamCloserHook = null; } else { inputStreamCloserHook = newDaemonThread( this, "closer-shutdown-hook" ); addShutDownHook( inputStreamCloserHook ); } } @Override @SuppressWarnings( "checkstyle:innerassignment" ) public void run() { for ( Closeable closeable; ( closeable = testProvidingInputStream.poll() ) != null; ) { try { closeable.close(); } catch ( IOException e ) { // This error does not fail a test and does not necessarily mean that the forked JVM std/out stream // was not closed, see ThreadedStreamConsumer. This error means that JVM wrote messages to a native // stream which could not be parsed or report failed. The tests may still correctly run nevertheless // this exception happened => warning on console. The user would see hint to check dump file only // if tests failed, but if this does not happen then printing warning to console is the only way to // inform the users. String msg = "ForkStarter IOException: " + e.getLocalizedMessage() + "."; File dump = InPluginProcessDumpSingleton.getSingleton() .dumpException( e, msg, defaultReporterFactory, jvmRun ); log.warning( msg + " See the dump file " + dump.getAbsolutePath() ); } } } @Override public void close() { run(); if ( inputStreamCloserHook != null ) { removeShutdownHook( inputStreamCloserHook ); } } } public ForkStarter( ProviderConfiguration providerConfiguration, StartupConfiguration startupConfiguration, ForkConfiguration forkConfiguration, int forkedProcessTimeoutInSeconds, StartupReportConfiguration startupReportConfiguration, ConsoleLogger log ) { this.forkConfiguration = forkConfiguration; this.providerConfiguration = providerConfiguration; this.forkedProcessTimeoutInSeconds = forkedProcessTimeoutInSeconds; this.startupConfiguration = startupConfiguration; this.startupReportConfiguration = startupReportConfiguration; this.log = log; defaultReporterFactory = new DefaultReporterFactory( startupReportConfiguration, log ); defaultReporterFactory.runStarting(); defaultReporterFactories = new ConcurrentLinkedQueue(); currentForkClients = new ConcurrentLinkedQueue(); timeoutCheckScheduler = createTimeoutCheckScheduler(); triggerTimeoutCheck(); } public RunResult run( @Nonnull SurefireProperties effectiveSystemProperties, @Nonnull DefaultScanResult scanResult ) throws SurefireBooterForkException, SurefireExecutionException { try { Map providerProperties = providerConfiguration.getProviderProperties(); scanResult.writeTo( providerProperties ); return isForkOnce() ? run( effectiveSystemProperties, providerProperties ) : run( effectiveSystemProperties ); } finally { defaultReporterFactory.mergeFromOtherFactories( defaultReporterFactories ); defaultReporterFactory.close(); pingThreadScheduler.shutdownNow(); timeoutCheckScheduler.shutdownNow(); } } public void killOrphanForks() { for ( ForkClient fork : currentForkClients ) { fork.kill(); } } private RunResult run( SurefireProperties effectiveSystemProperties, Map providerProperties ) throws SurefireBooterForkException { DefaultReporterFactory forkedReporterFactory = new DefaultReporterFactory( startupReportConfiguration, log ); defaultReporterFactories.add( forkedReporterFactory ); TestLessInputStreamBuilder builder = new TestLessInputStreamBuilder(); PropertiesWrapper props = new PropertiesWrapper( providerProperties ); TestLessInputStream stream = builder.build(); ForkClient forkClient = new ForkClient( forkedReporterFactory, stream, log, new AtomicBoolean() ); Thread shutdown = createImmediateShutdownHookThread( builder, providerConfiguration.getShutdown() ); ScheduledFuture ping = triggerPingTimerForShutdown( builder ); try { addShutDownHook( shutdown ); return fork( null, props, forkClient, effectiveSystemProperties, stream, false ); } finally { removeShutdownHook( shutdown ); ping.cancel( true ); builder.removeStream( stream ); } } private RunResult run( SurefireProperties effectiveSystemProperties ) throws SurefireBooterForkException { return forkConfiguration.isReuseForks() ? runSuitesForkOnceMultiple( effectiveSystemProperties, forkConfiguration.getForkCount() ) : runSuitesForkPerTestSet( effectiveSystemProperties, forkConfiguration.getForkCount() ); } private boolean isForkOnce() { return forkConfiguration.isReuseForks() && ( forkConfiguration.getForkCount() == 1 || hasSuiteXmlFiles() ); } private boolean hasSuiteXmlFiles() { TestRequest testSuiteDefinition = providerConfiguration.getTestSuiteDefinition(); return testSuiteDefinition != null && !testSuiteDefinition.getSuiteXmlFiles().isEmpty(); } @SuppressWarnings( "checkstyle:magicnumber" ) private RunResult runSuitesForkOnceMultiple( final SurefireProperties effectiveSystemProperties, int forkCount ) throws SurefireBooterForkException { ThreadPoolExecutor executorService = new ThreadPoolExecutor( forkCount, forkCount, 60, SECONDS, new ArrayBlockingQueue( forkCount ) ); executorService.setThreadFactory( FORKED_JVM_DAEMON_THREAD_FACTORY ); final Queue tests = new ConcurrentLinkedQueue(); for ( Class clazz : getSuitesIterator() ) { tests.add( clazz.getName() ); } final Queue testStreams = new ConcurrentLinkedQueue(); for ( int forkNum = 0, total = min( forkCount, tests.size() ); forkNum < total; forkNum++ ) { testStreams.add( new TestProvidingInputStream( tests ) ); } ScheduledFuture ping = triggerPingTimerForShutdown( testStreams ); Thread shutdown = createShutdownHookThread( testStreams, providerConfiguration.getShutdown() ); try { addShutDownHook( shutdown ); int failFastCount = providerConfiguration.getSkipAfterFailureCount(); final AtomicInteger notifyStreamsToSkipTestsJustNow = new AtomicInteger( failFastCount ); final Collection> results = new ArrayList>( forkCount ); final AtomicBoolean printedErrorStream = new AtomicBoolean(); for ( final TestProvidingInputStream testProvidingInputStream : testStreams ) { Callable pf = new Callable() { @Override public RunResult call() throws Exception { DefaultReporterFactory reporter = new DefaultReporterFactory( startupReportConfiguration, log ); defaultReporterFactories.add( reporter ); ForkClient forkClient = new ForkClient( reporter, testProvidingInputStream, log, printedErrorStream ) { @Override protected void stopOnNextTest() { if ( countDownToZero( notifyStreamsToSkipTestsJustNow ) ) { notifyStreamsToSkipTests( testStreams ); } } }; return fork( null, new PropertiesWrapper( providerConfiguration.getProviderProperties() ), forkClient, effectiveSystemProperties, testProvidingInputStream, true ); } }; results.add( executorService.submit( pf ) ); } return awaitResultsDone( results, executorService ); } finally { removeShutdownHook( shutdown ); ping.cancel( true ); closeExecutor( executorService ); } } private static void notifyStreamsToSkipTests( Collection notifiableTestStreams ) { for ( NotifiableTestStream notifiableTestStream : notifiableTestStreams ) { notifiableTestStream.skipSinceNextTest(); } } @SuppressWarnings( "checkstyle:magicnumber" ) private RunResult runSuitesForkPerTestSet( final SurefireProperties effectiveSystemProperties, int forkCount ) throws SurefireBooterForkException { ArrayList> results = new ArrayList>( 500 ); ThreadPoolExecutor executorService = new ThreadPoolExecutor( forkCount, forkCount, 60, SECONDS, new LinkedBlockingQueue() ); executorService.setThreadFactory( FORKED_JVM_DAEMON_THREAD_FACTORY ); final TestLessInputStreamBuilder builder = new TestLessInputStreamBuilder(); ScheduledFuture ping = triggerPingTimerForShutdown( builder ); Thread shutdown = createCachableShutdownHookThread( builder, providerConfiguration.getShutdown() ); try { addShutDownHook( shutdown ); int failFastCount = providerConfiguration.getSkipAfterFailureCount(); final AtomicInteger notifyStreamsToSkipTestsJustNow = new AtomicInteger( failFastCount ); final AtomicBoolean printedErrorStream = new AtomicBoolean(); for ( final Object testSet : getSuitesIterator() ) { Callable pf = new Callable() { @Override public RunResult call() throws Exception { DefaultReporterFactory forkedReporterFactory = new DefaultReporterFactory( startupReportConfiguration, log ); defaultReporterFactories.add( forkedReporterFactory ); ForkClient forkClient = new ForkClient( forkedReporterFactory, builder.getImmediateCommands(), log, printedErrorStream ) { @Override protected void stopOnNextTest() { if ( countDownToZero( notifyStreamsToSkipTestsJustNow ) ) { builder.getCachableCommands().skipSinceNextTest(); } } }; TestLessInputStream stream = builder.build(); try { return fork( testSet, new PropertiesWrapper( providerConfiguration.getProviderProperties() ), forkClient, effectiveSystemProperties, stream, false ); } finally { builder.removeStream( stream ); } } }; results.add( executorService.submit( pf ) ); } return awaitResultsDone( results, executorService ); } finally { removeShutdownHook( shutdown ); ping.cancel( true ); closeExecutor( executorService ); } } private static RunResult awaitResultsDone( Collection> results, ExecutorService executorService ) throws SurefireBooterForkException { RunResult globalResult = new RunResult( 0, 0, 0, 0 ); SurefireBooterForkException exception = null; for ( Future result : results ) { try { RunResult cur = result.get(); if ( cur != null ) { globalResult = globalResult.aggregate( cur ); } else { throw new SurefireBooterForkException( "No results for " + result.toString() ); } } catch ( InterruptedException e ) { executorService.shutdownNow(); currentThread().interrupt(); throw new SurefireBooterForkException( "Interrupted", e ); } catch ( ExecutionException e ) { Throwable realException = e.getCause(); if ( realException == null ) { if ( exception == null ) { exception = new SurefireBooterForkException( EXECUTION_EXCEPTION ); } } else { String previousError = ""; if ( exception != null && !EXECUTION_EXCEPTION.equals( exception.getLocalizedMessage().trim() ) ) { previousError = exception.getLocalizedMessage() + "\n"; } String error = previousError + EXECUTION_EXCEPTION + " " + realException.getLocalizedMessage(); exception = new SurefireBooterForkException( error, realException ); } } } if ( exception != null ) { throw exception; } return globalResult; } @SuppressWarnings( "checkstyle:magicnumber" ) private void closeExecutor( ExecutorService executorService ) throws SurefireBooterForkException { executorService.shutdown(); try { // Should stop immediately, as we got all the results if we are here executorService.awaitTermination( 60 * 60, SECONDS ); } catch ( InterruptedException e ) { currentThread().interrupt(); throw new SurefireBooterForkException( "Interrupted", e ); } } private RunResult fork( Object testSet, KeyValueSource providerProperties, ForkClient forkClient, SurefireProperties effectiveSystemProperties, AbstractForkInputStream testProvidingInputStream, boolean readTestsFromInStream ) throws SurefireBooterForkException { int forkNumber = drawNumber(); forkClient.setForkNumber( forkNumber ); try { return fork( testSet, providerProperties, forkClient, effectiveSystemProperties, forkNumber, testProvidingInputStream, readTestsFromInStream ); } finally { returnNumber( forkNumber ); } } private RunResult fork( Object testSet, KeyValueSource providerProperties, ForkClient forkClient, SurefireProperties effectiveSystemProperties, int forkNumber, AbstractForkInputStream testProvidingInputStream, boolean readTestsFromInStream ) throws SurefireBooterForkException { final String tempDir; final File surefireProperties; final File systPropsFile; try { tempDir = forkConfiguration.getTempDirectory().getCanonicalPath(); BooterSerializer booterSerializer = new BooterSerializer( forkConfiguration ); Long pluginPid = forkConfiguration.getPluginPlatform().getPluginPid(); surefireProperties = booterSerializer.serialize( providerProperties, providerConfiguration, startupConfiguration, testSet, readTestsFromInStream, pluginPid ); log.debug( "Determined Maven Process ID " + pluginPid ); if ( effectiveSystemProperties != null ) { SurefireProperties filteredProperties = createCopyAndReplaceForkNumPlaceholder( effectiveSystemProperties, forkNumber ); systPropsFile = writePropertiesFile( filteredProperties, forkConfiguration.getTempDirectory(), "surefire_" + SYSTEM_PROPERTIES_FILE_COUNTER.getAndIncrement(), forkConfiguration.isDebug() ); } else { systPropsFile = null; } } catch ( IOException e ) { throw new SurefireBooterForkException( "Error creating properties files for forking", e ); } OutputStreamFlushableCommandline cli = forkConfiguration.createCommandLine( startupConfiguration, forkNumber ); if ( testProvidingInputStream != null ) { testProvidingInputStream.setFlushReceiverProvider( cli ); } cli.createArg().setValue( tempDir ); cli.createArg().setValue( DUMP_FILE_PREFIX + forkNumber ); cli.createArg().setValue( surefireProperties.getName() ); if ( systPropsFile != null ) { cli.createArg().setValue( systPropsFile.getName() ); } final ThreadedStreamConsumer threadedStreamConsumer = new ThreadedStreamConsumer( forkClient ); final CloseableCloser closer = new CloseableCloser( forkNumber, threadedStreamConsumer, requireNonNull( testProvidingInputStream, "null param" ) ); log.debug( "Forking command line: " + cli ); Integer result = null; RunResult runResult = null; SurefireBooterForkException booterForkException = null; try { NativeStdErrStreamConsumer stdErrConsumer = new NativeStdErrStreamConsumer( forkClient.getDefaultReporterFactory() ); CommandLineCallable future = executeCommandLineAsCallable( cli, testProvidingInputStream, threadedStreamConsumer, stdErrConsumer, 0, closer, ISO_8859_1 ); currentForkClients.add( forkClient ); result = future.call(); if ( forkClient.hadTimeout() ) { runResult = timeout( forkClient.getDefaultReporterFactory().getGlobalRunStatistics().getRunResult() ); } else if ( result == null || result != SUCCESS ) { booterForkException = new SurefireBooterForkException( "Error occurred in starting fork, check output in log" ); } } catch ( CommandLineException e ) { runResult = failure( forkClient.getDefaultReporterFactory().getGlobalRunStatistics().getRunResult(), e ); String cliErr = e.getLocalizedMessage(); Throwable cause = e.getCause(); booterForkException = new SurefireBooterForkException( "Error while executing forked tests.", cliErr, cause, runResult ); } finally { currentForkClients.remove( forkClient ); closer.close(); if ( runResult == null ) { runResult = forkClient.getDefaultReporterFactory().getGlobalRunStatistics().getRunResult(); } forkClient.close( runResult.isTimeout() ); if ( !runResult.isTimeout() ) { Throwable cause = booterForkException == null ? null : booterForkException.getCause(); String detail = booterForkException == null ? "" : "\n" + booterForkException.getMessage(); if ( forkClient.isErrorInFork() ) { StackTraceWriter errorInFork = forkClient.getErrorInFork(); // noinspection ThrowFromFinallyBlock throw new SurefireBooterForkException( "There was an error in the forked process" + detail + '\n' + errorInFork.getThrowable().getLocalizedMessage(), cause ); } if ( !forkClient.isSaidGoodBye() ) { String errorCode = result == null ? "" : "\nProcess Exit Code: " + result; String testsInProgress = forkClient.hasTestsInProgress() ? "\nCrashed tests:" : ""; for ( String test : forkClient.testsInProgress() ) { testsInProgress += "\n" + test; } // noinspection ThrowFromFinallyBlock throw new SurefireBooterForkException( "The forked VM terminated without properly saying goodbye. VM crash or System.exit called?" + "\nCommand was " + cli.toString() + detail + errorCode + testsInProgress, cause ); } } if ( booterForkException != null ) { // noinspection ThrowFromFinallyBlock throw booterForkException; } } return runResult; } private Iterable> getSuitesIterator() throws SurefireBooterForkException { try { AbstractPathConfiguration classpathConfiguration = startupConfiguration.getClasspathConfiguration(); ClassLoader unifiedClassLoader = classpathConfiguration.createMergedClassLoader(); CommonReflector commonReflector = new CommonReflector( unifiedClassLoader ); Object reporterFactory = commonReflector.createReportingReporterFactory( startupReportConfiguration, log ); ProviderFactory providerFactory = new ProviderFactory( startupConfiguration, providerConfiguration, unifiedClassLoader, reporterFactory ); SurefireProvider surefireProvider = providerFactory.createProvider( false ); return surefireProvider.getSuites(); } catch ( SurefireExecutionException e ) { throw new SurefireBooterForkException( "Unable to create classloader to find test suites", e ); } } private static Thread createImmediateShutdownHookThread( final TestLessInputStreamBuilder builder, final Shutdown shutdownType ) { return SHUTDOWN_HOOK_THREAD_FACTORY.newThread( new Runnable() { @Override public void run() { builder.getImmediateCommands().shutdown( shutdownType ); } } ); } private static Thread createCachableShutdownHookThread( final TestLessInputStreamBuilder builder, final Shutdown shutdownType ) { return SHUTDOWN_HOOK_THREAD_FACTORY.newThread( new Runnable() { @Override public void run() { builder.getCachableCommands().shutdown( shutdownType ); } } ); } private static Thread createShutdownHookThread( final Iterable streams, final Shutdown shutdownType ) { return SHUTDOWN_HOOK_THREAD_FACTORY.newThread( new Runnable() { @Override public void run() { for ( TestProvidingInputStream stream : streams ) { stream.shutdown( shutdownType ); } } } ); } private static ScheduledExecutorService createPingScheduler() { ThreadFactory threadFactory = newDaemonThreadFactory( "ping-timer-" + PING_IN_SECONDS + "s" ); return newScheduledThreadPool( 1, threadFactory ); } private static ScheduledExecutorService createTimeoutCheckScheduler() { ThreadFactory threadFactory = newDaemonThreadFactory( "timeout-check-timer" ); return newScheduledThreadPool( 1, threadFactory ); } private ScheduledFuture triggerPingTimerForShutdown( final TestLessInputStreamBuilder builder ) { return pingThreadScheduler.scheduleAtFixedRate( new Runnable() { @Override public void run() { builder.getImmediateCommands().noop(); } }, 0, PING_IN_SECONDS, SECONDS ); } private ScheduledFuture triggerPingTimerForShutdown( final Iterable streams ) { return pingThreadScheduler.scheduleAtFixedRate( new Runnable() { @Override public void run() { for ( TestProvidingInputStream stream : streams ) { stream.noop(); } } }, 0, PING_IN_SECONDS, SECONDS ); } private ScheduledFuture triggerTimeoutCheck() { return timeoutCheckScheduler.scheduleAtFixedRate( new Runnable() { @Override public void run() { long systemTime = currentTimeMillis(); for ( ForkClient forkClient : currentForkClients ) { forkClient.tryToTimeout( systemTime, forkedProcessTimeoutInSeconds ); } } }, 0, TIMEOUT_CHECK_PERIOD_MILLIS, MILLISECONDS ); } } JarManifestForkConfiguration.java000066400000000000000000000127741330756104600445330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.OutputStreamFlushableCommandline; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.surefire.booter.Classpath; import org.apache.maven.surefire.booter.StartupConfiguration; import org.apache.maven.surefire.booter.SurefireBooterForkException; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; import java.util.jar.Manifest; import static org.apache.maven.plugin.surefire.SurefireHelper.escapeToPlatformPath; /** * @author Tibor Digana (tibor17) * @since 2.21.0.Jigsaw */ public final class JarManifestForkConfiguration extends AbstractClasspathForkConfiguration { @SuppressWarnings( "checkstyle:parameternumber" ) public JarManifestForkConfiguration( @Nonnull Classpath bootClasspath, @Nonnull File tempDirectory, @Nullable String debugLine, @Nonnull File workingDirectory, @Nonnull Properties modelProperties, @Nullable String argLine, @Nonnull Map environmentVariables, boolean debug, int forkCount, boolean reuseForks, @Nonnull Platform pluginPlatform, @Nonnull ConsoleLogger log ) { super( bootClasspath, tempDirectory, debugLine, workingDirectory, modelProperties, argLine, environmentVariables, debug, forkCount, reuseForks, pluginPlatform, log ); } @Override protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, @Nonnull String booterThatHasMainMethod, @Nonnull StartupConfiguration config ) throws SurefireBooterForkException { try { File jar = createJar( toCompleteClasspath( config ), booterThatHasMainMethod ); cli.createArg().setValue( "-jar" ); cli.createArg().setValue( escapeToPlatformPath( jar.getAbsolutePath() ) ); } catch ( IOException e ) { throw new SurefireBooterForkException( "Error creating archive file", e ); } } /** * Create a jar with just a manifest containing a Main-Class entry for BooterConfiguration and a Class-Path entry * for all classpath elements. * * @param classPath List<String> of all classpath elements. * @param startClassName The class name to start (main-class) * @return file of the jar * @throws IOException When a file operation fails. */ @Nonnull private File createJar( @Nonnull List classPath, @Nonnull String startClassName ) throws IOException { File file = File.createTempFile( "surefirebooter", ".jar", getTempDirectory() ); if ( !isDebug() ) { file.deleteOnExit(); } FileOutputStream fos = new FileOutputStream( file ); JarOutputStream jos = new JarOutputStream( fos ); try { jos.setLevel( JarOutputStream.STORED ); JarEntry je = new JarEntry( "META-INF/MANIFEST.MF" ); jos.putNextEntry( je ); Manifest man = new Manifest(); // we can't use StringUtils.join here since we need to add a '/' to // the end of directory entries - otherwise the jvm will ignore them. StringBuilder cp = new StringBuilder(); for ( Iterator it = classPath.iterator(); it.hasNext(); ) { File file1 = new File( it.next() ); String uri = file1.toURI().toASCIIString(); cp.append( uri ); if ( file1.isDirectory() && !uri.endsWith( "/" ) ) { cp.append( '/' ); } if ( it.hasNext() ) { cp.append( ' ' ); } } man.getMainAttributes().putValue( "Manifest-Version", "1.0" ); man.getMainAttributes().putValue( "Class-Path", cp.toString().trim() ); man.getMainAttributes().putValue( "Main-Class", startClassName ); man.write( jos ); jos.closeEntry(); jos.flush(); return file; } finally { jos.close(); } } } ModularClasspathForkConfiguration.java000066400000000000000000000205651330756104600455730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.OutputStreamFlushableCommandline; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.surefire.booter.AbstractPathConfiguration; import org.apache.maven.surefire.booter.Classpath; import org.apache.maven.surefire.booter.ModularClasspath; import org.apache.maven.surefire.booter.ModularClasspathConfiguration; import org.apache.maven.surefire.booter.StartupConfiguration; import org.apache.maven.surefire.booter.SurefireBooterForkException; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.ModuleVisitor; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileWriter; import java.io.IOException; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import static java.io.File.createTempFile; import static java.io.File.pathSeparatorChar; import static org.apache.maven.plugin.surefire.SurefireHelper.escapeToPlatformPath; import static org.objectweb.asm.Opcodes.ASM6; /** * @author Tibor Digana (tibor17) * @since 2.21.0.Jigsaw */ public class ModularClasspathForkConfiguration extends DefaultForkConfiguration { @SuppressWarnings( "checkstyle:parameternumber" ) public ModularClasspathForkConfiguration( @Nonnull Classpath bootClasspath, @Nonnull File tempDirectory, @Nullable String debugLine, @Nonnull File workingDirectory, @Nonnull Properties modelProperties, @Nullable String argLine, @Nonnull Map environmentVariables, boolean debug, @Nonnegative int forkCount, boolean reuseForks, @Nonnull Platform pluginPlatform, @Nonnull ConsoleLogger log ) { super( bootClasspath, tempDirectory, debugLine, workingDirectory, modelProperties, argLine, environmentVariables, debug, forkCount, reuseForks, pluginPlatform, log ); } @Override protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, @Nonnull String startClass, @Nonnull StartupConfiguration config ) throws SurefireBooterForkException { try { AbstractPathConfiguration pathConfig = config.getClasspathConfiguration(); ModularClasspathConfiguration modularClasspathConfiguration = pathConfig.toRealPath( ModularClasspathConfiguration.class ); ModularClasspath modularClasspath = modularClasspathConfiguration.getModularClasspath(); File descriptor = modularClasspath.getModuleDescriptor(); List modulePath = modularClasspath.getModulePath(); Collection packages = modularClasspath.getPackages(); File patchFile = modularClasspath.getPatchFile(); List classpath = toCompleteClasspath( config ); File argsFile = createArgsFile( descriptor, modulePath, classpath, packages, patchFile, startClass ); cli.createArg().setValue( "@" + escapeToPlatformPath( argsFile.getAbsolutePath() ) ); } catch ( IOException e ) { throw new SurefireBooterForkException( "Error creating args file", e ); } } @Nonnull File createArgsFile( @Nonnull File moduleDescriptor, @Nonnull List modulePath, @Nonnull List classPath, @Nonnull Collection packages, @Nonnull File patchFile, @Nonnull String startClassName ) throws IOException { File surefireArgs = createTempFile( "surefireargs", "", getTempDirectory() ); if ( !isDebug() ) { surefireArgs.deleteOnExit(); } BufferedWriter writer = null; try { writer = new BufferedWriter( new FileWriter( surefireArgs ) ); if ( !modulePath.isEmpty() ) { writer.write( "--module-path" ); writer.newLine(); for ( Iterator it = modulePath.iterator(); it.hasNext(); ) { writer.append( it.next() ); if ( it.hasNext() ) { writer.append( pathSeparatorChar ); } } writer.newLine(); } if ( !classPath.isEmpty() ) { writer.write( "--class-path" ); writer.newLine(); for ( Iterator it = classPath.iterator(); it.hasNext(); ) { writer.append( it.next() ); if ( it.hasNext() ) { writer.append( pathSeparatorChar ); } } writer.newLine(); } final String moduleName = toModuleName( moduleDescriptor ); writer.write( "--patch-module" ); writer.newLine(); writer.append( moduleName ) .append( '=' ) .append( patchFile.getPath() ); writer.newLine(); for ( String pkg : packages ) { writer.write( "--add-exports" ); writer.newLine(); writer.append( moduleName ) .append( '/' ) .append( pkg ) .append( '=' ) .append( "ALL-UNNAMED" ); writer.newLine(); } writer.write( "--add-modules" ); writer.newLine(); writer.append( moduleName ); writer.newLine(); writer.write( "--add-reads" ); writer.newLine(); writer.append( moduleName ) .append( '=' ) .append( "ALL-UNNAMED" ); writer.newLine(); writer.write( startClassName ); writer.newLine(); } finally { if ( writer != null ) { writer.close(); } } return surefireArgs; } @Nonnull String toModuleName( @Nonnull File moduleDescriptor ) throws IOException { if ( !moduleDescriptor.isFile() ) { throw new IOException( "No such Jigsaw module-descriptor exists " + moduleDescriptor.getAbsolutePath() ); } final StringBuilder sb = new StringBuilder(); new ClassReader( new FileInputStream( moduleDescriptor ) ).accept( new ClassVisitor( ASM6 ) { @Override public ModuleVisitor visitModule( String name, int access, String version ) { sb.setLength( 0 ); sb.append( name ); return super.visitModule( name, access, version ); } }, 0 ); return sb.toString(); } } Platform.java000066400000000000000000000046261330756104600405370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.plugin.surefire.JdkAttributes; import org.apache.maven.surefire.booter.SystemUtils; import java.util.concurrent.Callable; import java.util.concurrent.FutureTask; import java.util.concurrent.RunnableFuture; import static org.apache.maven.surefire.util.internal.DaemonThreadFactory.newDaemonThread; /** * Loads platform specifics. * * @author Tibor Digana (tibor17) * @since 2.20.1 */ public final class Platform { private final RunnableFuture pluginPidJob; private volatile JdkAttributes jdk; public Platform() { // the job may take 50 or 80 ms this( new FutureTask( pidJob() ), null ); newDaemonThread( pluginPidJob ).start(); } private Platform( RunnableFuture pluginPidJob, JdkAttributes jdk ) { this.pluginPidJob = pluginPidJob; this.jdk = jdk; } public Long getPluginPid() { try { return pluginPidJob.get(); } catch ( Exception e ) { return null; } } public JdkAttributes getJdkExecAttributesForTests() { return jdk; } public Platform withJdkExecAttributesForTests( JdkAttributes jdk ) { return new Platform( pluginPidJob, jdk ); } private static Callable pidJob() { return new Callable() { @Override public Long call() throws Exception { return SystemUtils.pid(); } }; } } ProviderDetector.java000066400000000000000000000025271330756104600422350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.surefire.providerapi.ServiceLoader; import javax.annotation.Nonnull; import java.io.IOException; import java.util.Set; /** * @author Stephen Conolly * @author Kristian Rosenvold */ public final class ProviderDetector { private final ServiceLoader spi = new ServiceLoader(); @Nonnull public Set lookupServiceNames( Class clazz, ClassLoader classLoader ) throws IOException { return spi.lookup( clazz, classLoader ); } } lazytestprovider/000077500000000000000000000000001330756104600415325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclientAbstractCommandStream.java000066400000000000000000000064451330756104600466240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestproviderpackage org.apache.maven.plugin.surefire.booterclient.lazytestprovider; /* * 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. */ import org.apache.maven.surefire.booter.Command; import org.apache.maven.surefire.booter.MasterProcessCommand; import java.io.IOException; /** * Reader stream sends commands to forked jvm std-{@link java.io.InputStream input-stream}. * * @author Tibor Digana (tibor17) * @since 2.19 * @see org.apache.maven.surefire.booter.Command */ public abstract class AbstractCommandStream extends AbstractForkInputStream { private byte[] currentBuffer; private int currentPos; protected abstract boolean isClosed(); /** * Opposite to {@link #isClosed()}. * @return {@code true} if not closed */ protected boolean canContinue() { return !isClosed(); } /** * Possibly waiting for next command (see {@link #nextCommand()}) unless the stream is atomically * closed (see {@link #isClosed()} returns {@code true}) before this method has returned. * * @throws IOException stream error while waiting for notification regarding next test required by forked jvm */ protected void beforeNextCommand() throws IOException { } protected abstract Command nextCommand(); /** * Returns quietly and immediately. */ protected final void invalidateInternalBuffer() { currentBuffer = null; currentPos = 0; } /** * Used by single thread in StreamFeeder class. * * @return {@inheritDoc} * @throws IOException {@inheritDoc} */ @SuppressWarnings( "checkstyle:magicnumber" ) @Override public int read() throws IOException { if ( isClosed() ) { tryFlush(); return -1; } if ( currentBuffer == null ) { tryFlush(); if ( !canContinue() ) { close(); return -1; } beforeNextCommand(); if ( isClosed() ) { return -1; } Command cmd = nextCommand(); MasterProcessCommand cmdType = cmd.getCommandType(); currentBuffer = cmdType.hasDataType() ? cmdType.encode( cmd.getData() ) : cmdType.encode(); } int b = currentBuffer[currentPos++] & 0xff; if ( currentPos == currentBuffer.length ) { currentBuffer = null; currentPos = 0; } return b; } } AbstractForkInputStream.java000066400000000000000000000037601330756104600471640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestproviderpackage org.apache.maven.plugin.surefire.booterclient.lazytestprovider; /* * 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. */ import java.io.IOException; import java.io.InputStream; import static org.apache.maven.surefire.util.internal.ObjectUtils.requireNonNull; /** * Reader stream sends bytes to forked jvm std-{@link InputStream input-stream}. * * @author Tibor Digana (tibor17) * @since 2.19 */ public abstract class AbstractForkInputStream extends InputStream implements NotifiableTestStream { private volatile FlushReceiverProvider flushReceiverProvider; /** * @param flushReceiverProvider the provider for a flush receiver. */ public void setFlushReceiverProvider( FlushReceiverProvider flushReceiverProvider ) { this.flushReceiverProvider = requireNonNull( flushReceiverProvider ); } protected boolean tryFlush() throws IOException { if ( flushReceiverProvider != null ) { FlushReceiver flushReceiver = flushReceiverProvider.getFlushReceiver(); if ( flushReceiver != null ) { flushReceiver.flush(); return true; } } return false; } } FlushReceiver.java000066400000000000000000000022701330756104600451440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestproviderpackage org.apache.maven.plugin.surefire.booterclient.lazytestprovider; /* * 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. */ import java.io.IOException; /** * Something that can be flushed. * * @author Andreas Gudian */ public interface FlushReceiver { /** * Performs a flush, releasing any buffered resources. * * @throws IOException in case the flush operation failed */ void flush() throws IOException; } FlushReceiverProvider.java000066400000000000000000000021061330756104600466550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestproviderpackage org.apache.maven.plugin.surefire.booterclient.lazytestprovider; /* * 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. */ /** * Provides a {@link FlushReceiver}. * * @author Andreas Gudian */ public interface FlushReceiverProvider { /** * @return a {@link FlushReceiver} */ FlushReceiver getFlushReceiver(); }NotifiableTestStream.java000066400000000000000000000032071330756104600464670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestproviderpackage org.apache.maven.plugin.surefire.booterclient.lazytestprovider; /* * 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. */ import org.apache.maven.surefire.booter.Shutdown; /** * Forked jvm notifies master process to provide a new test. * * @author Tibor Digana (tibor17) * @since 2.19 * @see TestProvidingInputStream */ public interface NotifiableTestStream { /** * Notifies {@link TestProvidingInputStream} in order to dispatch a new test back to the forked * jvm (particular fork which hits this call); or do nothing in {@link TestLessInputStream}. */ void provideNewTest(); /** * Sends an event to a fork jvm in order to skip tests. * Returns immediately without blocking. */ void skipSinceNextTest(); void shutdown( Shutdown shutdownType ); void noop(); void acknowledgeByeEventReceived(); } OutputStreamFlushableCommandline.java000066400000000000000000000044411330756104600510510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestproviderpackage org.apache.maven.plugin.surefire.booterclient.lazytestprovider; /* * 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. */ import java.io.IOException; import java.io.OutputStream; import org.apache.maven.shared.utils.cli.CommandLineException; import org.apache.maven.shared.utils.cli.Commandline; /** * A {@link Commandline} implementation that provides the output stream of * the executed process in form of a {@link FlushReceiver}, for it to be * flushed on demand. * * @author Andreas Gudian */ public class OutputStreamFlushableCommandline extends Commandline implements FlushReceiverProvider { /** * Wraps an output stream in order to delegate a flush. */ private final class OutputStreamFlushReceiver implements FlushReceiver { private final OutputStream outputStream; private OutputStreamFlushReceiver( OutputStream outputStream ) { this.outputStream = outputStream; } @Override public void flush() throws IOException { outputStream.flush(); } } private volatile FlushReceiver flushReceiver; @Override public Process execute() throws CommandLineException { Process process = super.execute(); if ( process.getOutputStream() != null ) { flushReceiver = new OutputStreamFlushReceiver( process.getOutputStream() ); } return process; } @Override public FlushReceiver getFlushReceiver() { return flushReceiver; } }TestLessInputStream.java000066400000000000000000000330531330756104600463430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestproviderpackage org.apache.maven.plugin.surefire.booterclient.lazytestprovider; /* * 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. */ import org.apache.maven.surefire.booter.Command; import org.apache.maven.surefire.booter.Shutdown; import java.io.IOException; import java.util.Iterator; import java.util.NoSuchElementException; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.Semaphore; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantReadWriteLock; import static org.apache.maven.surefire.booter.Command.BYE_ACK; import static org.apache.maven.surefire.booter.Command.NOOP; import static org.apache.maven.surefire.booter.Command.SKIP_SINCE_NEXT_TEST; import static org.apache.maven.surefire.booter.Command.toShutdown; /** * Dispatches commands without tests. * * @author Tibor Digana (tibor17) * @since 2.19 */ public final class TestLessInputStream extends AbstractCommandStream { private final Semaphore barrier = new Semaphore( 0 ); private final AtomicBoolean closed = new AtomicBoolean(); private final Queue immediateCommands = new ConcurrentLinkedQueue(); private final TestLessInputStreamBuilder builder; private Iterator cachableCommands; private TestLessInputStream( TestLessInputStreamBuilder builder ) { this.builder = builder; } @Override public void provideNewTest() { } @Override public void skipSinceNextTest() { if ( canContinue() ) { immediateCommands.add( SKIP_SINCE_NEXT_TEST ); barrier.release(); } } @Override public void shutdown( Shutdown shutdownType ) { if ( canContinue() ) { immediateCommands.add( toShutdown( shutdownType ) ); barrier.release(); } } @Override public void noop() { if ( canContinue() ) { immediateCommands.add( NOOP ); barrier.release(); } } @Override public void acknowledgeByeEventReceived() { if ( canContinue() ) { immediateCommands.add( BYE_ACK ); barrier.release(); } } @Override protected boolean isClosed() { return closed.get(); } @Override protected Command nextCommand() { Command cmd = immediateCommands.poll(); if ( cmd == null ) { if ( cachableCommands == null ) { cachableCommands = builder.getIterableCachable().iterator(); } cmd = cachableCommands.next(); } return cmd; } @Override protected void beforeNextCommand() throws IOException { awaitNextCommand(); } @Override public void close() { if ( closed.compareAndSet( false, true ) ) { invalidateInternalBuffer(); barrier.drainPermits(); barrier.release(); } } /** * For testing purposes only. * * @return permits used internally by {@link #beforeNextCommand()} */ int availablePermits() { return barrier.availablePermits(); } private void awaitNextCommand() throws IOException { try { barrier.acquire(); } catch ( InterruptedException e ) { // help GC to free this object because StreamFeeder Thread cannot read it anyway after IOE invalidateInternalBuffer(); throw new IOException( e.getLocalizedMessage() ); } } /** * Builds {@link TestLessInputStream streams}, registers cachable commands * and provides accessible API to dispatch immediate commands to all atomically * alive streams. */ public static final class TestLessInputStreamBuilder { private final ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(); private final Queue aliveStreams = new ConcurrentLinkedQueue(); private final ImmediateCommands immediateCommands = new ImmediateCommands(); private final CachableCommands cachableCommands = new CachableCommands(); private final Node head = new Node( null ); private final Iterable iterableCachable; public TestLessInputStreamBuilder() { iterableCachable = new Iterable() { @Override public Iterator iterator() { return new CIt(); } }; } public TestLessInputStream build() { Lock lock = rwLock.writeLock(); lock.lock(); try { TestLessInputStream is = new TestLessInputStream( this ); aliveStreams.offer( is ); return is; } finally { lock.unlock(); } } public void removeStream( TestLessInputStream is ) { Lock lock = rwLock.writeLock(); lock.lock(); try { aliveStreams.remove( is ); } finally { lock.unlock(); } } public NotifiableTestStream getImmediateCommands() { return immediateCommands; } public NotifiableTestStream getCachableCommands() { return cachableCommands; } /** * The iterator is not thread safe. */ Iterable getIterableCachable() { return iterableCachable; } @SuppressWarnings( "checkstyle:innerassignment" ) private boolean addTailNodeIfAbsent( Command command ) { Node newTail = new Node( command ); Node currentTail = head; do { for ( Node successor; ( successor = currentTail.next.get() ) != null; ) { currentTail = successor; if ( command.equals( currentTail.command ) ) { return false; } } } while ( !currentTail.next.compareAndSet( null, newTail ) ); return true; } private static Node nextCachedNode( Node current ) { return current.next.get(); } private final class CIt implements Iterator { private Node node = TestLessInputStreamBuilder.this.head; @Override public boolean hasNext() { return examineNext( false ) != null; } @Override public Command next() { Command command = examineNext( true ); if ( command == null ) { throw new NoSuchElementException(); } return command; } @Override public void remove() { throw new UnsupportedOperationException(); } private Command examineNext( boolean store ) { Node next = nextCachedNode( node ); if ( store && next != null ) { node = next; } return next == null ? null : next.command; } } /** * Event is called just now for all alive streams and command is not persisted. */ private final class ImmediateCommands implements NotifiableTestStream { @Override public void provideNewTest() { } @Override public void skipSinceNextTest() { Lock lock = rwLock.readLock(); lock.lock(); try { for ( TestLessInputStream aliveStream : TestLessInputStreamBuilder.this.aliveStreams ) { aliveStream.skipSinceNextTest(); } } finally { lock.unlock(); } } @Override public void shutdown( Shutdown shutdownType ) { Lock lock = rwLock.readLock(); lock.lock(); try { for ( TestLessInputStream aliveStream : TestLessInputStreamBuilder.this.aliveStreams ) { aliveStream.shutdown( shutdownType ); } } finally { lock.unlock(); } } @Override public void noop() { Lock lock = rwLock.readLock(); lock.lock(); try { for ( TestLessInputStream aliveStream : TestLessInputStreamBuilder.this.aliveStreams ) { aliveStream.noop(); } } finally { lock.unlock(); } } @Override public void acknowledgeByeEventReceived() { Lock lock = rwLock.readLock(); lock.lock(); try { for ( TestLessInputStream aliveStream : TestLessInputStreamBuilder.this.aliveStreams ) { aliveStream.acknowledgeByeEventReceived(); } } finally { lock.unlock(); } } } /** * Event is persisted. */ private final class CachableCommands implements NotifiableTestStream { @Override public void provideNewTest() { } @Override public void skipSinceNextTest() { Lock lock = rwLock.readLock(); lock.lock(); try { if ( TestLessInputStreamBuilder.this.addTailNodeIfAbsent( SKIP_SINCE_NEXT_TEST ) ) { release(); } } finally { lock.unlock(); } } @Override public void shutdown( Shutdown shutdownType ) { Lock lock = rwLock.readLock(); lock.lock(); try { if ( TestLessInputStreamBuilder.this.addTailNodeIfAbsent( toShutdown( shutdownType ) ) ) { release(); } } finally { lock.unlock(); } } @Override public void noop() { Lock lock = rwLock.readLock(); lock.lock(); try { if ( TestLessInputStreamBuilder.this.addTailNodeIfAbsent( NOOP ) ) { release(); } } finally { lock.unlock(); } } @Override public void acknowledgeByeEventReceived() { Lock lock = rwLock.readLock(); lock.lock(); try { if ( TestLessInputStreamBuilder.this.addTailNodeIfAbsent( BYE_ACK ) ) { release(); } } finally { lock.unlock(); } } private void release() { for ( TestLessInputStream aliveStream : TestLessInputStreamBuilder.this.aliveStreams ) { aliveStream.barrier.release(); } } } private static class Node { private final AtomicReference next = new AtomicReference(); private final Command command; Node( Command command ) { this.command = command; } } } } TestProvidingInputStream.java000066400000000000000000000120261330756104600473730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/lazytestproviderpackage org.apache.maven.plugin.surefire.booterclient.lazytestprovider; /* * 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. */ import org.apache.maven.surefire.booter.Command; import org.apache.maven.surefire.booter.Shutdown; import java.io.IOException; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.Semaphore; import java.util.concurrent.atomic.AtomicBoolean; import static org.apache.maven.surefire.booter.Command.BYE_ACK; import static org.apache.maven.surefire.booter.Command.NOOP; import static org.apache.maven.surefire.booter.Command.SKIP_SINCE_NEXT_TEST; import static org.apache.maven.surefire.booter.Command.toRunClass; import static org.apache.maven.surefire.booter.Command.toShutdown; /** * An {@link java.io.InputStream} that, when read, provides test class names out of a queue. *
* The Stream provides only one test at a time, but only after {@link #provideNewTest()} has been invoked. *
* After providing each test class name, followed by a newline character, a flush is performed on the * {@link FlushReceiver} provided by the {@link FlushReceiverProvider} that can be set using * {@link #setFlushReceiverProvider(FlushReceiverProvider)}. *
* The instance is used only in reusable forks in {@link org.apache.maven.plugin.surefire.booterclient.ForkStarter} * by one Thread. * * @author Andreas Gudian * @author Tibor Digana (tibor17) */ public final class TestProvidingInputStream extends AbstractCommandStream { private final Semaphore barrier = new Semaphore( 0 ); private final Queue commands = new ConcurrentLinkedQueue(); private final AtomicBoolean closed = new AtomicBoolean(); private final Queue testClassNames; /** * C'tor * * @param testClassNames source of the tests to be read from this stream */ public TestProvidingInputStream( Queue testClassNames ) { this.testClassNames = testClassNames; } /** * For testing purposes. */ void testSetFinished() { if ( canContinue() ) { commands.add( Command.TEST_SET_FINISHED ); barrier.release(); } } @Override public void skipSinceNextTest() { if ( canContinue() ) { commands.add( SKIP_SINCE_NEXT_TEST ); barrier.release(); } } @Override public void shutdown( Shutdown shutdownType ) { if ( canContinue() ) { commands.add( toShutdown( shutdownType ) ); barrier.release(); } } @Override public void noop() { if ( canContinue() ) { commands.add( NOOP ); barrier.release(); } } @Override public void acknowledgeByeEventReceived() { if ( canContinue() ) { commands.add( BYE_ACK ); barrier.release(); } } @Override protected Command nextCommand() { Command cmd = commands.poll(); if ( cmd == null ) { String cmdData = testClassNames.poll(); return cmdData == null ? Command.TEST_SET_FINISHED : toRunClass( cmdData ); } else { return cmd; } } @Override protected void beforeNextCommand() throws IOException { awaitNextTest(); } @Override protected boolean isClosed() { return closed.get(); } /** * Signal that a new test is to be provided. */ @Override public void provideNewTest() { if ( canContinue() ) { barrier.release(); } } @Override public void close() { if ( closed.compareAndSet( false, true ) ) { invalidateInternalBuffer(); barrier.drainPermits(); barrier.release(); } } private void awaitNextTest() throws IOException { try { barrier.acquire(); } catch ( InterruptedException e ) { // help GC to free this object because StreamFeeder Thread cannot read it anyway after IOE invalidateInternalBuffer(); throw new IOException( e.getLocalizedMessage() ); } } }output/000077500000000000000000000000001330756104600374405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclientDeserializedStacktraceWriter.java000066400000000000000000000040361330756104600461140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/outputpackage org.apache.maven.plugin.surefire.booterclient.output; /* * 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. */ import org.apache.maven.surefire.report.SafeThrowable; import org.apache.maven.surefire.report.StackTraceWriter; /** * Represents a deserialize stacktracewriter that has been * marshalled across to the plugin from the fork. *
* Might be better to represent this whole thing differently * * @author Kristian Rosenvold */ public class DeserializedStacktraceWriter implements StackTraceWriter { private final String message; private final String smartTrimmed; private final String stackTrace; public DeserializedStacktraceWriter( String message, String smartTrimmed, String stackTrace ) { this.message = message; this.smartTrimmed = smartTrimmed; this.stackTrace = stackTrace; } @Override public String smartTrimmedStackTrace() { return smartTrimmed; } // Trimming or not is decided on the forking side @Override public String writeTraceToString() { return stackTrace; } @Override public String writeTrimmedTraceToString() { return stackTrace; } @Override public SafeThrowable getThrowable() { return new SafeThrowable( message ); } } ForkClient.java000066400000000000000000000461441330756104600423540ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/outputpackage org.apache.maven.plugin.surefire.booterclient.output; /* * 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. */ import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.NotifiableTestStream; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import org.apache.maven.shared.utils.cli.StreamConsumer; import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.StackTraceWriter; import org.apache.maven.surefire.report.TestSetReportEntry; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.StringReader; import java.nio.ByteBuffer; import java.util.Collections; import java.util.Map; import java.util.Queue; import java.util.Set; import java.util.StringTokenizer; import java.util.TreeSet; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import static java.lang.Integer.decode; import static java.lang.System.currentTimeMillis; import static java.util.Collections.unmodifiableMap; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_BYE; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_CONSOLE; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_DEBUG; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_ERROR; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_NEXT_TEST; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_STDERR; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_STDOUT; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_STOP_ON_NEXT_TEST; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_SYSPROPS; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_TESTSET_COMPLETED; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_TESTSET_STARTING; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_TEST_ASSUMPTIONFAILURE; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_TEST_ERROR; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_TEST_FAILED; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_TEST_SKIPPED; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_TEST_STARTING; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_TEST_SUCCEEDED; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_WARNING; import static org.apache.maven.surefire.booter.Shutdown.KILL; import static org.apache.maven.surefire.report.CategorizedReportEntry.reportEntry; import static org.apache.maven.surefire.util.internal.StringUtils.isNotBlank; import static org.apache.maven.surefire.util.internal.StringUtils.unescapeBytes; import static org.apache.maven.surefire.util.internal.StringUtils.unescapeString; // todo move to the same package with ForkStarter /** * Knows how to reconstruct *all* the state transmitted over stdout by the forked process. * * @author Kristian Rosenvold */ public class ForkClient implements StreamConsumer { private static final String PRINTABLE_JVM_NATIVE_STREAM = "Listening for transport dt_socket at address:"; private static final long START_TIME_ZERO = 0L; private static final long START_TIME_NEGATIVE_TIMEOUT = -1L; private final DefaultReporterFactory defaultReporterFactory; private final Map testVmSystemProperties = new ConcurrentHashMap(); private final NotifiableTestStream notifiableTestStream; private final Queue testsInProgress = new ConcurrentLinkedQueue(); /** * {@code testSetStartedAt} is set to non-zero after received * {@link org.apache.maven.surefire.booter.ForkingRunListener#BOOTERCODE_TESTSET_STARTING test-set}. */ private final AtomicLong testSetStartedAt = new AtomicLong( START_TIME_ZERO ); private final ConsoleLogger log; /** * prevents from printing same warning */ private final AtomicBoolean printedErrorStream; /** * Used by single Thread started by {@link ThreadedStreamConsumer} and therefore does not need to be volatile. */ private RunListener testSetReporter; /** * Written by one Thread and read by another: Main Thread and ForkStarter's Thread. */ private volatile boolean saidGoodBye; private volatile StackTraceWriter errorInFork; private volatile int forkNumber; public ForkClient( DefaultReporterFactory defaultReporterFactory, NotifiableTestStream notifiableTestStream, ConsoleLogger log, AtomicBoolean printedErrorStream ) { this.defaultReporterFactory = defaultReporterFactory; this.notifiableTestStream = notifiableTestStream; this.log = log; this.printedErrorStream = printedErrorStream; } protected void stopOnNextTest() { } public void kill() { if ( !saidGoodBye ) { notifiableTestStream.shutdown( KILL ); } } /** * Called in concurrent Thread. * Will shutdown if timeout was reached. * * @param currentTimeMillis current time in millis seconds * @param forkedProcessTimeoutInSeconds timeout in seconds given by MOJO */ public final void tryToTimeout( long currentTimeMillis, int forkedProcessTimeoutInSeconds ) { if ( forkedProcessTimeoutInSeconds > 0 ) { final long forkedProcessTimeoutInMillis = 1000 * forkedProcessTimeoutInSeconds; final long startedAt = testSetStartedAt.get(); if ( startedAt > START_TIME_ZERO && currentTimeMillis - startedAt >= forkedProcessTimeoutInMillis ) { testSetStartedAt.set( START_TIME_NEGATIVE_TIMEOUT ); notifiableTestStream.shutdown( KILL ); } } } public final DefaultReporterFactory getDefaultReporterFactory() { return defaultReporterFactory; } @Override public final void consumeLine( String s ) { if ( isNotBlank( s ) ) { processLine( s ); } } private void setCurrentStartTime() { if ( testSetStartedAt.get() == START_TIME_ZERO ) // JIT can optimize <= no JNI call { // Not necessary to call JNI library library #currentTimeMillis // which may waste 10 - 30 machine cycles in callback. Callbacks should be fast. testSetStartedAt.compareAndSet( START_TIME_ZERO, currentTimeMillis() ); } } public final boolean hadTimeout() { return testSetStartedAt.get() == START_TIME_NEGATIVE_TIMEOUT; } private RunListener getTestSetReporter() { if ( testSetReporter == null ) { testSetReporter = defaultReporterFactory.createReporter(); } return testSetReporter; } private void processLine( String event ) { final OperationalData op; try { op = new OperationalData( event ); } catch ( RuntimeException e ) { logStreamWarning( e, event ); return; } final String remaining = op.getData(); switch ( op.getOperationId() ) { case BOOTERCODE_TESTSET_STARTING: getTestSetReporter().testSetStarting( createReportEntry( remaining ) ); setCurrentStartTime(); break; case BOOTERCODE_TESTSET_COMPLETED: testsInProgress.clear(); getTestSetReporter().testSetCompleted( createReportEntry( remaining, testVmSystemProperties ) ); break; case BOOTERCODE_TEST_STARTING: ReportEntry reportEntry = createReportEntry( remaining ); testsInProgress.offer( reportEntry.getSourceName() ); getTestSetReporter().testStarting( createReportEntry( remaining ) ); break; case BOOTERCODE_TEST_SUCCEEDED: reportEntry = createReportEntry( remaining ); testsInProgress.remove( reportEntry.getSourceName() ); getTestSetReporter().testSucceeded( createReportEntry( remaining ) ); break; case BOOTERCODE_TEST_FAILED: reportEntry = createReportEntry( remaining ); testsInProgress.remove( reportEntry.getSourceName() ); getTestSetReporter().testFailed( createReportEntry( remaining ) ); break; case BOOTERCODE_TEST_SKIPPED: reportEntry = createReportEntry( remaining ); testsInProgress.remove( reportEntry.getSourceName() ); getTestSetReporter().testSkipped( createReportEntry( remaining ) ); break; case BOOTERCODE_TEST_ERROR: reportEntry = createReportEntry( remaining ); testsInProgress.remove( reportEntry.getSourceName() ); getTestSetReporter().testError( createReportEntry( remaining ) ); break; case BOOTERCODE_TEST_ASSUMPTIONFAILURE: reportEntry = createReportEntry( remaining ); testsInProgress.remove( reportEntry.getSourceName() ); getTestSetReporter().testAssumptionFailure( createReportEntry( remaining ) ); break; case BOOTERCODE_SYSPROPS: int keyEnd = remaining.indexOf( "," ); StringBuilder key = new StringBuilder(); StringBuilder value = new StringBuilder(); unescapeString( key, remaining.substring( 0, keyEnd ) ); unescapeString( value, remaining.substring( keyEnd + 1 ) ); testVmSystemProperties.put( key.toString(), value.toString() ); break; case BOOTERCODE_STDOUT: writeTestOutput( remaining, true ); break; case BOOTERCODE_STDERR: writeTestOutput( remaining, false ); break; case BOOTERCODE_CONSOLE: getOrCreateConsoleLogger() .info( createConsoleMessage( remaining ) ); break; case BOOTERCODE_NEXT_TEST: notifiableTestStream.provideNewTest(); break; case BOOTERCODE_ERROR: errorInFork = deserializeStackTraceWriter( new StringTokenizer( remaining, "," ) ); break; case BOOTERCODE_BYE: saidGoodBye = true; notifiableTestStream.acknowledgeByeEventReceived(); break; case BOOTERCODE_STOP_ON_NEXT_TEST: stopOnNextTest(); break; case BOOTERCODE_DEBUG: getOrCreateConsoleLogger() .debug( createConsoleMessage( remaining ) ); break; case BOOTERCODE_WARNING: getOrCreateConsoleLogger() .warning( createConsoleMessage( remaining ) ); break; default: logStreamWarning( event ); } } private void logStreamWarning( String event ) { logStreamWarning( null, event ); } private void logStreamWarning( Throwable e, String event ) { if ( event == null || !event.contains( PRINTABLE_JVM_NATIVE_STREAM ) ) { String msg = "Corrupted STDOUT by directly writing to native stream in forked JVM " + forkNumber + "."; InPluginProcessDumpSingleton util = InPluginProcessDumpSingleton.getSingleton(); File dump = e == null ? util.dumpText( msg + " Stream '" + event + "'.", defaultReporterFactory, forkNumber ) : util.dumpException( e, msg + " Stream '" + event + "'.", defaultReporterFactory, forkNumber ); if ( printedErrorStream.compareAndSet( false, true ) ) { log.warning( msg + " See FAQ web page and the dump file " + dump.getAbsolutePath() ); } if ( log.isDebugEnabled() && event != null ) { log.debug( event ); } } else { if ( log.isDebugEnabled() ) { log.debug( event ); } else if ( log.isInfoEnabled() ) { log.info( event ); } else { // In case of debugging forked JVM, see PRINTABLE_JVM_NATIVE_STREAM. System.out.println( event ); } } } private void writeTestOutput( String remaining, boolean isStdout ) { int csNameEnd = remaining.indexOf( ',' ); String charsetName = remaining.substring( 0, csNameEnd ); String byteEncoded = remaining.substring( csNameEnd + 1 ); ByteBuffer unescaped = unescapeBytes( byteEncoded, charsetName ); if ( unescaped.hasArray() ) { byte[] convertedBytes = unescaped.array(); getOrCreateConsoleOutputReceiver() .writeTestOutput( convertedBytes, unescaped.position(), unescaped.remaining(), isStdout ); } else { byte[] convertedBytes = new byte[unescaped.remaining()]; unescaped.get( convertedBytes, 0, unescaped.remaining() ); getOrCreateConsoleOutputReceiver() .writeTestOutput( convertedBytes, 0, convertedBytes.length, isStdout ); } } public final void consumeMultiLineContent( String s ) throws IOException { BufferedReader stringReader = new BufferedReader( new StringReader( s ) ); for ( String s1 = stringReader.readLine(); s1 != null; s1 = stringReader.readLine() ) { consumeLine( s1 ); } } private String createConsoleMessage( String remaining ) { return unescape( remaining ); } private TestSetReportEntry createReportEntry( String untokenized ) { return createReportEntry( untokenized, Collections.emptyMap() ); } private TestSetReportEntry createReportEntry( String untokenized, Map systemProperties ) { StringTokenizer tokens = new StringTokenizer( untokenized, "," ); try { String source = nullableCsv( tokens.nextToken() ); String name = nullableCsv( tokens.nextToken() ); String group = nullableCsv( tokens.nextToken() ); String message = nullableCsv( tokens.nextToken() ); String elapsedStr = tokens.nextToken(); Integer elapsed = "null".equals( elapsedStr ) ? null : decode( elapsedStr ); final StackTraceWriter stackTraceWriter = tokens.hasMoreTokens() ? deserializeStackTraceWriter( tokens ) : null; return reportEntry( source, name, group, stackTraceWriter, elapsed, message, systemProperties ); } catch ( RuntimeException e ) { throw new RuntimeException( untokenized, e ); } } private StackTraceWriter deserializeStackTraceWriter( StringTokenizer tokens ) { String stackTraceMessage = nullableCsv( tokens.nextToken() ); String smartStackTrace = nullableCsv( tokens.nextToken() ); String stackTrace = tokens.hasMoreTokens() ? nullableCsv( tokens.nextToken() ) : null; boolean hasTrace = stackTrace != null; return hasTrace ? new DeserializedStacktraceWriter( stackTraceMessage, smartStackTrace, stackTrace ) : null; } private String nullableCsv( String source ) { return "null".equals( source ) ? null : unescape( source ); } private String unescape( String source ) { StringBuilder stringBuffer = new StringBuilder( source.length() ); unescapeString( stringBuffer, source ); return stringBuffer.toString(); } public final Map getTestVmSystemProperties() { return unmodifiableMap( testVmSystemProperties ); } /** * Used when getting reporters on the plugin side of a fork. * Used by testing purposes only. May not be volatile variable. * * @return A mock provider reporter */ public final RunListener getReporter() { return getTestSetReporter(); } private ConsoleOutputReceiver getOrCreateConsoleOutputReceiver() { return (ConsoleOutputReceiver) getTestSetReporter(); } private ConsoleLogger getOrCreateConsoleLogger() { return (ConsoleLogger) getTestSetReporter(); } public void close( boolean hadTimeout ) { // no op } public final boolean isSaidGoodBye() { return saidGoodBye; } public final StackTraceWriter getErrorInFork() { return errorInFork; } public final boolean isErrorInFork() { return errorInFork != null; } public Set testsInProgress() { return new TreeSet( testsInProgress ); } public boolean hasTestsInProgress() { return !testsInProgress.isEmpty(); } public void setForkNumber( int forkNumber ) { assert this.forkNumber == 0; this.forkNumber = forkNumber; } private static final class OperationalData { private final byte operationId; private final String data; OperationalData( String event ) { operationId = (byte) event.charAt( 0 ); int comma = event.indexOf( ",", 3 ); if ( comma < 0 ) { throw new IllegalArgumentException( "Stream stdin corrupted. Expected comma after third character " + "in command '" + event + "'." ); } int rest = event.indexOf( ",", comma ); data = event.substring( rest + 1 ); } byte getOperationId() { return operationId; } String getData() { return data; } } } InPluginProcessDumpSingleton.java000066400000000000000000000067671330756104600461200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/outputpackage org.apache.maven.plugin.surefire.booterclient.output; /* * 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. */ import org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import org.apache.maven.surefire.util.internal.DumpFileUtils; import java.io.File; import static java.lang.String.format; import static org.apache.maven.plugin.surefire.SurefireHelper.DUMPSTREAM_FILENAME_FORMATTER; import static org.apache.maven.surefire.booter.DumpErrorSingleton.DUMPSTREAM_FILE_EXT; /** * Reports errors to dump file. * Used only within java process of the plugin itself and not the forked JVM. */ public final class InPluginProcessDumpSingleton { private static final InPluginProcessDumpSingleton SINGLETON = new InPluginProcessDumpSingleton(); private final String creationDate = DumpFileUtils.newFormattedDateFileName(); private InPluginProcessDumpSingleton() { } public static InPluginProcessDumpSingleton getSingleton() { return SINGLETON; } public synchronized File dumpException( Throwable t, String msg, DefaultReporterFactory defaultReporterFactory, int jvmRun ) { File dump = newDumpFile( defaultReporterFactory, jvmRun ); DumpFileUtils.dumpException( t, msg == null ? "null" : msg, dump ); return dump; } public synchronized void dumpException( Throwable t, String msg, DefaultReporterFactory defaultReporterFactory ) { DumpFileUtils.dumpException( t, msg == null ? "null" : msg, newDumpFile( defaultReporterFactory ) ); } public synchronized void dumpException( Throwable t, DefaultReporterFactory defaultReporterFactory ) { DumpFileUtils.dumpException( t, newDumpFile( defaultReporterFactory ) ); } public synchronized File dumpText( String msg, DefaultReporterFactory defaultReporterFactory, int jvmRun ) { File dump = newDumpFile( defaultReporterFactory, jvmRun ); DumpFileUtils.dumpText( msg == null ? "null" : msg, dump ); return dump; } public synchronized void dumpText( String msg, DefaultReporterFactory defaultReporterFactory ) { DumpFileUtils.dumpText( msg == null ? "null" : msg, newDumpFile( defaultReporterFactory ) ); } private File newDumpFile( DefaultReporterFactory defaultReporterFactory ) { File reportsDirectory = defaultReporterFactory.getReportsDirectory(); return new File( reportsDirectory, creationDate + DUMPSTREAM_FILE_EXT ); } private static File newDumpFile( DefaultReporterFactory defaultReporterFactory, int jvmRun ) { File reportsDirectory = defaultReporterFactory.getReportsDirectory(); return new File( reportsDirectory, format( DUMPSTREAM_FILENAME_FORMATTER, jvmRun ) ); } } MultipleFailureException.java000066400000000000000000000043211330756104600452650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/outputpackage org.apache.maven.plugin.surefire.booterclient.output; /* * 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. */ import java.io.IOException; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; final class MultipleFailureException extends IOException { private final Queue exceptions = new ConcurrentLinkedQueue(); void addException( Throwable exception ) { exceptions.add( exception ); } boolean hasNestedExceptions() { return !exceptions.isEmpty(); } @Override public String getLocalizedMessage() { StringBuilder messages = new StringBuilder(); for ( Throwable exception : exceptions ) { if ( messages.length() != 0 ) { messages.append( '\n' ); } String message = exception.getLocalizedMessage(); messages.append( message == null ? exception.toString() : message ); } return messages.toString(); } @Override public String getMessage() { StringBuilder messages = new StringBuilder(); for ( Throwable exception : exceptions ) { if ( messages.length() != 0 ) { messages.append( '\n' ); } String message = exception.getMessage(); messages.append( message == null ? exception.toString() : message ); } return messages.toString(); } } NativeStdErrStreamConsumer.java000066400000000000000000000033101330756104600455420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/outputpackage org.apache.maven.plugin.surefire.booterclient.output; /* * 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. */ import org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import org.apache.maven.shared.utils.cli.StreamConsumer; /** * Used by forked JMV, see {@link org.apache.maven.plugin.surefire.booterclient.ForkStarter}. * * @author Tibor Digana (tibor17) * @since 2.20 * @see org.apache.maven.plugin.surefire.booterclient.ForkStarter */ public final class NativeStdErrStreamConsumer implements StreamConsumer { private final DefaultReporterFactory defaultReporterFactory; public NativeStdErrStreamConsumer( DefaultReporterFactory defaultReporterFactory ) { this.defaultReporterFactory = defaultReporterFactory; } @Override public void consumeLine( String line ) { InPluginProcessDumpSingleton.getSingleton().dumpText( line, defaultReporterFactory ); } } ThreadedStreamConsumer.java000066400000000000000000000120401330756104600447100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/outputpackage org.apache.maven.plugin.surefire.booterclient.output; /* * 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. */ import org.apache.maven.shared.utils.cli.StreamConsumer; import org.apache.maven.surefire.util.internal.DaemonThreadFactory; import java.io.Closeable; import java.io.IOException; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.atomic.AtomicBoolean; import static java.lang.Thread.currentThread; /** * Knows how to reconstruct *all* the state transmitted over stdout by the forked process. * * @author Kristian Rosenvold */ public final class ThreadedStreamConsumer implements StreamConsumer, Closeable { private static final String END_ITEM = ""; private static final int ITEM_LIMIT_BEFORE_SLEEP = 10 * 1000; private final BlockingQueue items = new ArrayBlockingQueue( ITEM_LIMIT_BEFORE_SLEEP ); private final AtomicBoolean stop = new AtomicBoolean(); private final Thread thread; private final Pumper pumper; final class Pumper implements Runnable { private final StreamConsumer target; private final MultipleFailureException errors = new MultipleFailureException(); Pumper( StreamConsumer target ) { this.target = target; } /** * Calls {@link ForkClient#consumeLine(String)} which may throw any {@link RuntimeException}.
* Even if {@link ForkClient} is not fault-tolerant, this method MUST be fault-tolerant and thus the * try-catch block must be inside of the loop which prevents from loosing events from {@link StreamConsumer}. *
* If {@link org.apache.maven.plugin.surefire.report.ConsoleOutputFileReporter#writeTestOutput} throws * {@link java.io.IOException} and then {@code target.consumeLine()} throws any RuntimeException, this method * MUST NOT skip reading the events from the forked JVM; otherwise we could simply lost events * e.g. acquire-next-test which means that {@link ForkClient} could hang on waiting for old test to complete * and therefore the plugin could be permanently in progress. */ @Override public void run() { while ( !ThreadedStreamConsumer.this.stop.get() ) { try { String item = ThreadedStreamConsumer.this.items.take(); if ( shouldStopQueueing( item ) ) { return; } target.consumeLine( item ); } catch ( Throwable t ) { errors.addException( t ); } } } boolean hasErrors() { return errors.hasNestedExceptions(); } void throwErrors() throws IOException { throw errors; } } public ThreadedStreamConsumer( StreamConsumer target ) { pumper = new Pumper( target ); thread = DaemonThreadFactory.newDaemonThread( pumper, "ThreadedStreamConsumer" ); thread.start(); } @Override public void consumeLine( String s ) { if ( stop.get() && !thread.isAlive() ) { items.clear(); return; } try { items.put( s ); } catch ( InterruptedException e ) { currentThread().interrupt(); throw new IllegalStateException( e ); } } @Override public void close() throws IOException { if ( stop.compareAndSet( false, true ) ) { items.clear(); try { items.put( END_ITEM ); } catch ( InterruptedException e ) { currentThread().interrupt(); } } if ( pumper.hasErrors() ) { pumper.throwErrors(); } } /** * Compared item with {@link #END_ITEM} by identity. * * @param item element from items * @return {@code true} if tail of the queue */ private boolean shouldStopQueueing( String item ) { return item == END_ITEM; } } log/000077500000000000000000000000001330756104600341705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefirePluginConsoleLogger.java000066400000000000000000000064551330756104600407660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/logpackage org.apache.maven.plugin.surefire.log; /* * 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. */ import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.codehaus.plexus.logging.Logger; /** * Wrapper logger of miscellaneous (Maven 2.2.1 or 3.1) implementations of {@link Logger}. * Calling {@link Logger#isInfoEnabled()} before {@link Logger#info(String)} due to Maven 2.2.1. * * @author Tibor Digana (tibor17) * @since 2.20 * @see ConsoleLogger */ public final class PluginConsoleLogger implements ConsoleLogger { private final Logger plexusLogger; public PluginConsoleLogger( Logger plexusLogger ) { this.plexusLogger = plexusLogger; } @Override public boolean isDebugEnabled() { return plexusLogger.isDebugEnabled(); } @Override public void debug( String message ) { if ( isDebugEnabled() ) { plexusLogger.debug( message ); } } public void debug( CharSequence content, Throwable error ) { if ( isDebugEnabled() ) { plexusLogger.debug( content == null ? "" : content.toString(), error ); } } @Override public boolean isInfoEnabled() { return plexusLogger.isInfoEnabled(); } @Override public void info( String message ) { if ( isInfoEnabled() ) { plexusLogger.info( message ); } } @Override public boolean isWarnEnabled() { return plexusLogger.isWarnEnabled(); } @Override public void warning( String message ) { if ( isWarnEnabled() ) { plexusLogger.warn( message ); } } public void warning( CharSequence content, Throwable error ) { if ( isWarnEnabled() ) { plexusLogger.warn( content == null ? "" : content.toString(), error ); } } @Override public boolean isErrorEnabled() { return plexusLogger.isErrorEnabled() || plexusLogger.isFatalErrorEnabled(); } @Override public void error( String message ) { if ( isErrorEnabled() ) { plexusLogger.error( message ); } } @Override public void error( String message, Throwable t ) { if ( isErrorEnabled() ) { plexusLogger.error( message, t ); } } @Override public void error( Throwable t ) { if ( isErrorEnabled() ) { plexusLogger.error( "", t ); } } } report/000077500000000000000000000000001330756104600347225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefireConsoleOutputFileReporter.java000066400000000000000000000126341330756104600427410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.FilterOutputStream; import java.io.IOException; import java.util.concurrent.atomic.AtomicStampedReference; import java.util.concurrent.locks.ReentrantLock; import org.apache.maven.surefire.booter.DumpErrorSingleton; import org.apache.maven.surefire.report.ReportEntry; import static org.apache.maven.plugin.surefire.report.FileReporter.getReportFile; /** * Surefire output consumer proxy that writes test output to a {@link java.io.File} for each test suite. * * @author Kristian Rosenvold * @author Carlos Sanchez */ public class ConsoleOutputFileReporter implements TestcycleConsoleOutputReceiver { private static final int STREAM_BUFFER_SIZE = 16 * 1024; private static final int OPEN = 0; private static final int CLOSED_TO_REOPEN = 1; private static final int CLOSED = 2; private final File reportsDirectory; private final String reportNameSuffix; private final AtomicStampedReference fileOutputStream = new AtomicStampedReference( null, OPEN ); private final ReentrantLock lock = new ReentrantLock(); private volatile String reportEntryName; public ConsoleOutputFileReporter( File reportsDirectory, String reportNameSuffix ) { this.reportsDirectory = reportsDirectory; this.reportNameSuffix = reportNameSuffix; } @Override public void testSetStarting( ReportEntry reportEntry ) { lock.lock(); try { closeNullReportFile( reportEntry ); } finally { lock.unlock(); } } @Override public void testSetCompleted( ReportEntry report ) { } @Override public void close() { // The close() method is called in main Thread T2. lock.lock(); try { closeReportFile(); } finally { lock.unlock(); } } @Override public void writeTestOutput( byte[] buf, int off, int len, boolean stdout ) { lock.lock(); try { // This method is called in single thread T1 per fork JVM (see ThreadedStreamConsumer). // The close() method is called in main Thread T2. int[] status = new int[1]; FilterOutputStream os = fileOutputStream.get( status ); if ( status[0] != CLOSED ) { if ( os == null ) { if ( !reportsDirectory.exists() ) { //noinspection ResultOfMethodCallIgnored reportsDirectory.mkdirs(); } File file = getReportFile( reportsDirectory, reportEntryName, reportNameSuffix, "-output.txt" ); os = new BufferedOutputStream( new FileOutputStream( file ), STREAM_BUFFER_SIZE ); fileOutputStream.set( os, OPEN ); } os.write( buf, off, len ); } } catch ( IOException e ) { DumpErrorSingleton.getSingleton() .dumpException( e ); throw new RuntimeException( e ); } finally { lock.unlock(); } } @SuppressWarnings( "checkstyle:emptyblock" ) private void closeNullReportFile( ReportEntry reportEntry ) { try { // close null-output.txt report file close( true ); } catch ( IOException ignored ) { DumpErrorSingleton.getSingleton() .dumpException( ignored ); } finally { // prepare -output.txt report file reportEntryName = reportEntry.getName(); } } @SuppressWarnings( "checkstyle:emptyblock" ) private void closeReportFile() { try { close( false ); } catch ( IOException ignored ) { DumpErrorSingleton.getSingleton() .dumpException( ignored ); } } private void close( boolean closeReattempt ) throws IOException { int[] status = new int[1]; FilterOutputStream os = fileOutputStream.get( status ); if ( status[0] != CLOSED ) { fileOutputStream.set( null, closeReattempt ? CLOSED_TO_REOPEN : CLOSED ); if ( os != null && status[0] == OPEN ) { os.close(); } } } } ConsoleReporter.java000066400000000000000000000062071330756104600407170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import java.util.List; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.shared.utils.logging.MessageBuilder; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.plugin.surefire.log.api.Level; import static org.apache.maven.plugin.surefire.log.api.Level.resolveLevel; import static org.apache.maven.plugin.surefire.report.TestSetStats.concatenateWithTestGroup; import static org.apache.maven.shared.utils.logging.MessageUtils.buffer; /** * Base class for console reporters. * * @author Brett Porter * @author Kristian Rosenvold */ public class ConsoleReporter { public static final String BRIEF = "brief"; public static final String PLAIN = "plain"; private static final String TEST_SET_STARTING_PREFIX = "Running "; private final ConsoleLogger logger; public ConsoleReporter( ConsoleLogger logger ) { this.logger = logger; } public ConsoleLogger getConsoleLogger() { return logger; } public void testSetStarting( ReportEntry report ) { MessageBuilder builder = buffer(); logger.info( concatenateWithTestGroup( builder.a( TEST_SET_STARTING_PREFIX ), report ) ); } public void testSetCompleted( WrappedReportEntry report, TestSetStats testSetStats, List testResults ) { boolean success = testSetStats.getCompletedCount() > 0; boolean failures = testSetStats.getFailures() > 0; boolean errors = testSetStats.getErrors() > 0; boolean skipped = testSetStats.getSkipped() > 0; boolean flakes = testSetStats.getSkipped() > 0; Level level = resolveLevel( success, failures, errors, skipped, flakes ); println( testSetStats.getColoredTestSetSummary( report ), level ); for ( String testResult : testResults ) { println( testResult, level ); } } public void reset() { } private void println( String message, Level level ) { switch ( level ) { case FAILURE: logger.error( message ); break; case UNSTABLE: logger.warning( message ); break; default: logger.info( message ); } } } DefaultReporterFactory.java000066400000000000000000000424521330756104600422330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import org.apache.maven.plugin.surefire.StartupReportConfiguration; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.log.api.Level; import org.apache.maven.plugin.surefire.runorder.StatisticsReporter; import org.apache.maven.shared.utils.logging.MessageBuilder; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.RunStatistics; import org.apache.maven.surefire.report.StackTraceWriter; import org.apache.maven.surefire.suite.RunResult; import java.io.File; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.TreeMap; import java.util.concurrent.ConcurrentLinkedQueue; import static org.apache.maven.plugin.surefire.log.api.Level.resolveLevel; import static org.apache.maven.plugin.surefire.report.ConsoleReporter.PLAIN; import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType.error; import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType.failure; import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType.flake; import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType.skipped; import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType.success; import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType.unknown; import static org.apache.maven.plugin.surefire.report.ReportEntryType.ERROR; import static org.apache.maven.plugin.surefire.report.ReportEntryType.FAILURE; import static org.apache.maven.plugin.surefire.report.ReportEntryType.SUCCESS; import static org.apache.maven.shared.utils.logging.MessageUtils.buffer; import static org.apache.maven.surefire.util.internal.ObjectUtils.useNonNull; /** * Provides reporting modules on the plugin side. *
* Keeps a centralized count of test run results. * * @author Kristian Rosenvold */ public class DefaultReporterFactory implements ReporterFactory { private final StartupReportConfiguration reportConfiguration; private final ConsoleLogger consoleLogger; private final Collection listeners; private RunStatistics globalStats = new RunStatistics(); // from "." -> statistics about all the runs for flaky tests private Map> flakyTests; // from "." -> statistics about all the runs for failed tests private Map> failedTests; // from "." -> statistics about all the runs for error tests private Map> errorTests; public DefaultReporterFactory( StartupReportConfiguration reportConfiguration, ConsoleLogger consoleLogger ) { this.reportConfiguration = reportConfiguration; this.consoleLogger = consoleLogger; listeners = new ConcurrentLinkedQueue(); } @Override public RunListener createReporter() { TestSetRunListener testSetRunListener = new TestSetRunListener( createConsoleReporter(), createFileReporter(), createSimpleXMLReporter(), createConsoleOutputReceiver(), createStatisticsReporter(), reportConfiguration.isTrimStackTrace(), PLAIN.equals( reportConfiguration.getReportFormat() ), reportConfiguration.isBriefOrPlainFormat() ); addListener( testSetRunListener ); return testSetRunListener; } public File getReportsDirectory() { return reportConfiguration.getReportsDirectory(); } private ConsoleReporter createConsoleReporter() { return shouldReportToConsole() ? new ConsoleReporter( consoleLogger ) : NullConsoleReporter.INSTANCE; } private FileReporter createFileReporter() { final FileReporter fileReporter = reportConfiguration.instantiateFileReporter(); return useNonNull( fileReporter, NullFileReporter.INSTANCE ); } private StatelessXmlReporter createSimpleXMLReporter() { final StatelessXmlReporter xmlReporter = reportConfiguration.instantiateStatelessXmlReporter(); return useNonNull( xmlReporter, NullStatelessXmlReporter.INSTANCE ); } private TestcycleConsoleOutputReceiver createConsoleOutputReceiver() { final TestcycleConsoleOutputReceiver consoleOutputReceiver = reportConfiguration.instantiateConsoleOutputFileReporter(); return useNonNull( consoleOutputReceiver, NullConsoleOutputReceiver.INSTANCE ); } private StatisticsReporter createStatisticsReporter() { final StatisticsReporter statisticsReporter = reportConfiguration.getStatisticsReporter(); return useNonNull( statisticsReporter, NullStatisticsReporter.INSTANCE ); } private boolean shouldReportToConsole() { return reportConfiguration.isUseFile() ? reportConfiguration.isPrintSummary() : reportConfiguration.isRedirectTestOutputToFile() || reportConfiguration.isBriefOrPlainFormat(); } public void mergeFromOtherFactories( Collection factories ) { for ( DefaultReporterFactory factory : factories ) { for ( TestSetRunListener listener : factory.listeners ) { listeners.add( listener ); } } } final void addListener( TestSetRunListener listener ) { listeners.add( listener ); } @Override public RunResult close() { mergeTestHistoryResult(); runCompleted(); for ( TestSetRunListener listener : listeners ) { listener.close(); } return globalStats.getRunResult(); } public void runStarting() { log( "" ); log( "-------------------------------------------------------" ); log( " T E S T S" ); log( "-------------------------------------------------------" ); } private void runCompleted() { if ( reportConfiguration.isPrintSummary() ) { log( "" ); log( "Results:" ); log( "" ); } boolean printedFailures = printTestFailures( failure ); boolean printedErrors = printTestFailures( error ); boolean printedFlakes = printTestFailures( flake ); if ( printedFailures | printedErrors | printedFlakes ) { log( "" ); } boolean hasSuccessful = globalStats.getCompletedCount() > 0; boolean hasSkipped = globalStats.getSkipped() > 0; log( globalStats.getSummary(), hasSuccessful, printedFailures, printedErrors, hasSkipped, printedFlakes ); log( "" ); } public RunStatistics getGlobalRunStatistics() { mergeTestHistoryResult(); return globalStats; } /** * Get the result of a test based on all its runs. If it has success and failures/errors, then it is a flake; * if it only has errors or failures, then count its result based on its first run * * @param reportEntries the list of test run report type for a given test * @param rerunFailingTestsCount configured rerun count for failing tests * @return the type of test result */ // Use default visibility for testing static TestResultType getTestResultType( List reportEntries, int rerunFailingTestsCount ) { if ( reportEntries == null || reportEntries.isEmpty() ) { return unknown; } boolean seenSuccess = false, seenFailure = false, seenError = false; for ( ReportEntryType resultType : reportEntries ) { if ( resultType == SUCCESS ) { seenSuccess = true; } else if ( resultType == FAILURE ) { seenFailure = true; } else if ( resultType == ERROR ) { seenError = true; } } if ( seenFailure || seenError ) { if ( seenSuccess && rerunFailingTestsCount > 0 ) { return flake; } else { return seenError ? error : failure; } } else if ( seenSuccess ) { return success; } else { return skipped; } } /** * Merge all the TestMethodStats in each TestRunListeners and put results into flakyTests, failedTests and * errorTests, indexed by test class and method name. Update globalStatistics based on the result of the merge. */ void mergeTestHistoryResult() { globalStats = new RunStatistics(); flakyTests = new TreeMap>(); failedTests = new TreeMap>(); errorTests = new TreeMap>(); Map> mergedTestHistoryResult = new HashMap>(); // Merge all the stats for tests from listeners for ( TestSetRunListener listener : listeners ) { List testMethodStats = listener.getTestMethodStats(); for ( TestMethodStats methodStats : testMethodStats ) { List currentMethodStats = mergedTestHistoryResult.get( methodStats.getTestClassMethodName() ); if ( currentMethodStats == null ) { currentMethodStats = new ArrayList(); currentMethodStats.add( methodStats ); mergedTestHistoryResult.put( methodStats.getTestClassMethodName(), currentMethodStats ); } else { currentMethodStats.add( methodStats ); } } } // Update globalStatistics by iterating through mergedTestHistoryResult int completedCount = 0, skipped = 0; for ( Map.Entry> entry : mergedTestHistoryResult.entrySet() ) { List testMethodStats = entry.getValue(); String testClassMethodName = entry.getKey(); completedCount++; List resultTypes = new ArrayList(); for ( TestMethodStats methodStats : testMethodStats ) { resultTypes.add( methodStats.getResultType() ); } switch ( getTestResultType( resultTypes, reportConfiguration.getRerunFailingTestsCount() ) ) { case success: // If there are multiple successful runs of the same test, count all of them int successCount = 0; for ( ReportEntryType type : resultTypes ) { if ( type == SUCCESS ) { successCount++; } } completedCount += successCount - 1; break; case skipped: skipped++; break; case flake: flakyTests.put( testClassMethodName, testMethodStats ); break; case failure: failedTests.put( testClassMethodName, testMethodStats ); break; case error: errorTests.put( testClassMethodName, testMethodStats ); break; default: throw new IllegalStateException( "Get unknown test result type" ); } } globalStats.set( completedCount, errorTests.size(), failedTests.size(), skipped, flakyTests.size() ); } /** * Print failed tests and flaked tests. A test is considered as a failed test if it failed/got an error with * all the runs. If a test passes in ever of the reruns, it will be count as a flaked test * * @param type the type of results to be printed, could be error, failure or flake * @return {@code true} if printed some lines */ // Use default visibility for testing boolean printTestFailures( TestResultType type ) { final Map> testStats; final Level level; switch ( type ) { case failure: testStats = failedTests; level = Level.FAILURE; break; case error: testStats = errorTests; level = Level.FAILURE; break; case flake: testStats = flakyTests; level = Level.UNSTABLE; break; default: return false; } boolean printed = false; if ( !testStats.isEmpty() ) { log( type.getLogPrefix(), level ); printed = true; } for ( Map.Entry> entry : testStats.entrySet() ) { printed = true; List testMethodStats = entry.getValue(); if ( testMethodStats.size() == 1 ) { // No rerun, follow the original output format failure( " " + testMethodStats.get( 0 ).getStackTraceWriter().smartTrimmedStackTrace() ); } else { log( entry.getKey(), level ); for ( int i = 0; i < testMethodStats.size(); i++ ) { StackTraceWriter failureStackTrace = testMethodStats.get( i ).getStackTraceWriter(); if ( failureStackTrace == null ) { success( " Run " + ( i + 1 ) + ": PASS" ); } else { failure( " Run " + ( i + 1 ) + ": " + failureStackTrace.smartTrimmedStackTrace() ); } } log( "" ); } } return printed; } // Describe the result of a given test enum TestResultType { error( "Errors: " ), failure( "Failures: " ), flake( "Flakes: " ), success( "Success: " ), skipped( "Skipped: " ), unknown( "Unknown: " ); private final String logPrefix; TestResultType( String logPrefix ) { this.logPrefix = logPrefix; } public String getLogPrefix() { return logPrefix; } } private void log( String s, boolean success, boolean failures, boolean errors, boolean skipped, boolean flakes ) { Level level = resolveLevel( success, failures, errors, skipped, flakes ); log( s, level ); } private void log( String s, Level level ) { MessageBuilder builder = buffer(); switch ( level ) { case FAILURE: consoleLogger.error( builder.failure( s ).toString() ); break; case UNSTABLE: consoleLogger.warning( builder.warning( s ).toString() ); break; case SUCCESS: consoleLogger.info( builder.success( s ).toString() ); break; default: consoleLogger.info( builder.a( s ).toString() ); } } private void log( String s ) { consoleLogger.info( s ); } private void info( String s ) { MessageBuilder builder = buffer(); consoleLogger.info( builder.info( s ).toString() ); } private void err( String s ) { MessageBuilder builder = buffer(); consoleLogger.error( builder.error( s ).toString() ); } private void success( String s ) { MessageBuilder builder = buffer(); consoleLogger.info( builder.success( s ).toString() ); } private void failure( String s ) { MessageBuilder builder = buffer(); consoleLogger.error( builder.failure( s ).toString() ); } } DirectConsoleOutput.java000066400000000000000000000043401330756104600415440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import java.io.PrintStream; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.CharacterCodingException; import org.apache.maven.surefire.report.ReportEntry; import static java.nio.charset.Charset.defaultCharset; /** * Outputs test system out/system err directly to the console *
* Just a step on the road to getting the separation of reporting concerns * operating properly. * * @author Kristian Rosenvold */ public class DirectConsoleOutput implements TestcycleConsoleOutputReceiver { private final PrintStream sout; private final PrintStream serr; public DirectConsoleOutput( PrintStream sout, PrintStream serr ) { this.sout = sout; this.serr = serr; } @Override public void writeTestOutput( byte[] buf, int off, int len, boolean stdout ) { final PrintStream stream = stdout ? sout : serr; try { CharBuffer decode = defaultCharset().newDecoder().decode( ByteBuffer.wrap( buf, off, len ) ); stream.append( decode ); } catch ( CharacterCodingException e ) { stream.write( buf, off, len ); } } @Override public void testSetStarting( ReportEntry reportEntry ) { } @Override public void testSetCompleted( ReportEntry report ) { } @Override public void close() { } } FileReporter.java000066400000000000000000000075731330756104600402030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.ReporterException; import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Writer; import java.nio.charset.Charset; import java.util.List; import static org.apache.maven.plugin.surefire.report.FileReporterUtils.stripIllegalFilenameChars; import static org.apache.maven.surefire.util.internal.StringUtils.isNotBlank; /** * Base class for file reporters. * * @author Brett Porter * @author Kristian Rosenvold */ public class FileReporter { private final File reportsDirectory; private final String reportNameSuffix; private final Charset encoding; public FileReporter( File reportsDirectory, String reportNameSuffix, Charset encoding ) { this.reportsDirectory = reportsDirectory; this.reportNameSuffix = reportNameSuffix; this.encoding = encoding; } private PrintWriter testSetStarting( ReportEntry report ) { File reportFile = getReportFile( reportsDirectory, report.getName(), reportNameSuffix, ".txt" ); File reportDir = reportFile.getParentFile(); // noinspection ResultOfMethodCallIgnored reportDir.mkdirs(); try { Writer encodedStream = new OutputStreamWriter( new FileOutputStream( reportFile ), encoding ); PrintWriter writer = new PrintWriter( new BufferedWriter( encodedStream, 16 * 1024 ) ); writer.println( "-------------------------------------------------------------------------------" ); writer.println( "Test set: " + report.getName() ); writer.println( "-------------------------------------------------------------------------------" ); return writer; } catch ( IOException e ) { throw new ReporterException( "Unable to create file for report: " + e.getMessage(), e ); } } static File getReportFile( File reportsDirectory, String reportEntryName, String reportNameSuffix, String fileExtension ) { String fileName = reportEntryName + ( isNotBlank( reportNameSuffix ) ? "-" + reportNameSuffix : "" ) + fileExtension; return new File( reportsDirectory, stripIllegalFilenameChars( fileName ) ); } public void testSetCompleted( WrappedReportEntry report, TestSetStats testSetStats, List testResults ) { PrintWriter writer = null; try { writer = testSetStarting( report ); writer.println( testSetStats.getTestSetSummary( report ) ); for ( String testResult : testResults ) { writer.println( testResult ); } writer.flush(); } finally { if ( writer != null ) { writer.close(); } } } } FileReporterUtils.java000066400000000000000000000031441330756104600412120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS; /** * Utils class for file-based reporters * * @author Andreas Gudian */ public final class FileReporterUtils { private FileReporterUtils() { throw new IllegalStateException( "non instantiable constructor" ); } public static String stripIllegalFilenameChars( String original ) { String result = original; String illegalChars = getOSSpecificIllegalChars(); for ( int i = 0; i < illegalChars.length(); i++ ) { result = result.replace( illegalChars.charAt( i ), '_' ); } return result; } private static String getOSSpecificIllegalChars() { return IS_OS_WINDOWS ? "\\/:*?\"<>|\0" : "/\0"; } } NullConsoleOutputReceiver.java000066400000000000000000000031161330756104600427310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import org.apache.maven.surefire.report.ReportEntry; /** * ConsoleReporter doing nothing rather than using null. * * @author Benedikt Ritter * @since 2.20 */ class NullConsoleOutputReceiver implements TestcycleConsoleOutputReceiver { static final NullConsoleOutputReceiver INSTANCE = new NullConsoleOutputReceiver(); private NullConsoleOutputReceiver() { } @Override public void testSetStarting( ReportEntry reportEntry ) { } @Override public void testSetCompleted( ReportEntry report ) { } @Override public void close() { } @Override public void writeTestOutput( byte[] buf, int off, int len, boolean stdout ) { } } NullConsoleReporter.java000066400000000000000000000031651330756104600415520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import java.util.List; import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger; import org.apache.maven.surefire.report.ReportEntry; /** * ConsoleReporter doing nothing rather than using null. * * @author Benedikt Ritter * @since 2.20 */ class NullConsoleReporter extends ConsoleReporter { static final NullConsoleReporter INSTANCE = new NullConsoleReporter(); private NullConsoleReporter() { super( new NullConsoleLogger() ); } @Override public void testSetStarting( ReportEntry report ) { } @Override public void testSetCompleted( WrappedReportEntry report, TestSetStats testSetStats, List testResults ) { } @Override public void reset() { } } NullFileReporter.java000066400000000000000000000025371330756104600410310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import java.util.List; /** * FileReporter doing nothing rather than using null. * * @author Benedikt Ritter * @since 2.20 */ class NullFileReporter extends FileReporter { static final NullFileReporter INSTANCE = new NullFileReporter(); private NullFileReporter() { super( null, null, null ); } @Override public void testSetCompleted( WrappedReportEntry report, TestSetStats testSetStats, List testResults ) { } } NullStatelessXmlReporter.java000066400000000000000000000026621330756104600426010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ /** * FileReporter doing nothing rather than using null. * * @author Benedikt Ritter * @since 2.20 */ class NullStatelessXmlReporter extends StatelessXmlReporter { static final NullStatelessXmlReporter INSTANCE = new NullStatelessXmlReporter(); private NullStatelessXmlReporter() { super( null, null, false, 0, null, null ); } @Override public void testSetCompleted( WrappedReportEntry testSetReportEntry, TestSetStats testSetStats ) { } @Override public void cleanTestHistoryMap() { } } NullStatisticsReporter.java000066400000000000000000000033261330756104600423010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import org.apache.maven.plugin.surefire.runorder.StatisticsReporter; import org.apache.maven.surefire.report.ReportEntry; /** * StatisticsReporter doing nothing rather than using null. * * @author Benedikt Ritter * @since 2.20 */ class NullStatisticsReporter extends StatisticsReporter { static final NullStatisticsReporter INSTANCE = new NullStatisticsReporter(); private NullStatisticsReporter() { super( null, null, null ); } @Override public synchronized void testSetCompleted() { } @Override public void testSucceeded( ReportEntry report ) { } @Override public void testSkipped( ReportEntry report ) { } @Override public void testError( ReportEntry report ) { } @Override public void testFailed( ReportEntry report ) { } } ReportEntryType.java000066400000000000000000000031461330756104600407300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ /** * Type of an entry in the report * */ public enum ReportEntryType { ERROR( "error", "flakyError", "rerunError" ), FAILURE( "failure", "flakyFailure", "rerunFailure" ), SKIPPED( "skipped", "", "" ), SUCCESS( "", "", "" ); private final String xmlTag; private final String flakyXmlTag; private final String rerunXmlTag; ReportEntryType( String xmlTag, String flakyXmlTag, String rerunXmlTag ) { this.xmlTag = xmlTag; this.flakyXmlTag = flakyXmlTag; this.rerunXmlTag = rerunXmlTag; } public String getXmlTag() { return xmlTag; } public String getFlakyXmlTag() { return flakyXmlTag; } public String getRerunXmlTag() { return rerunXmlTag; } } ReporterUtils.java000066400000000000000000000026671330756104600404230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import java.text.NumberFormat; import java.util.Locale; /** * Utility for reporter classes. * * @author Tibor Digana (tibor17) * @since 2.19 */ final class ReporterUtils { private static final int MS_PER_SEC = 1000; private ReporterUtils() { throw new IllegalStateException( "non instantiable constructor" ); } public static String formatElapsedTime( double runTime ) { NumberFormat numberFormat = NumberFormat.getInstance( Locale.ENGLISH ); return numberFormat.format( runTime / MS_PER_SEC ); } } StatelessXmlReporter.java000066400000000000000000000617021330756104600417460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import org.apache.maven.shared.utils.xml.PrettyPrintXMLWriter; import org.apache.maven.shared.utils.xml.XMLWriter; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.ReporterException; import org.apache.maven.surefire.report.SafeThrowable; import org.apache.maven.surefire.util.internal.StringUtils; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.FilterOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.StringTokenizer; import static org.apache.commons.io.IOUtils.closeQuietly; import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType; import static org.apache.maven.plugin.surefire.report.FileReporterUtils.stripIllegalFilenameChars; import static org.apache.maven.plugin.surefire.report.ReportEntryType.SUCCESS; import static org.apache.maven.surefire.util.internal.StringUtils.UTF_8; import static org.apache.maven.surefire.util.internal.StringUtils.isBlank; @SuppressWarnings( { "javadoc", "checkstyle:javadoctype" } ) // CHECKSTYLE_OFF: LineLength /* * XML format reporter writing to TEST-reportName[-suffix].xml file like written and read * by Ant's <junit> and * <junitreport> tasks, * then supported by many tools like CI servers. *
*
<?xml version="1.0" encoding="UTF-8"?>
 * <testsuite name="suite name" [group="group"] tests="0" failures="0" errors="0" skipped="0" time="0,###.###">
 *  <properties>
 *    <property name="name" value="value"/>
 *    [...]
 *  </properties>
 *  <testcase time="0,###.###" name="test name [classname="class name"] [group="group"]"/>
 *  <testcase time="0,###.###" name="test name [classname="class name"] [group="group"]">
 *    <error message="message" type="exception class name">stacktrace</error>
 *    <system-out>system out content (present only if not empty)</system-out>
 *    <system-err>system err content (present only if not empty)</system-err>
 *  </testcase>
 *  <testcase time="0,###.###" name="test name [classname="class name"] [group="group"]">
 *    <failure message="message" type="exception class name">stacktrace</failure>
 *    <system-out>system out content (present only if not empty)</system-out>
 *    <system-err>system err content (present only if not empty)</system-err>
 *  </testcase>
 *  <testcase time="0,###.###" name="test name [classname="class name"] [group="group"]">
 *    <skipped/>
 *  </testcase>
 *  [...]
* * @author Kristian Rosenvold * @see Ant's format enhancement proposal * (not yet implemented by Ant 1.8.2) */ public class StatelessXmlReporter { private final File reportsDirectory; private final String reportNameSuffix; private final boolean trimStackTrace; private final int rerunFailingTestsCount; private final String xsdSchemaLocation; // Map between test class name and a map between test method name // and the list of runs for each test method private final Map>> testClassMethodRunHistoryMap; public StatelessXmlReporter( File reportsDirectory, String reportNameSuffix, boolean trimStackTrace, int rerunFailingTestsCount, Map>> testClassMethodRunHistoryMap, String xsdSchemaLocation ) { this.reportsDirectory = reportsDirectory; this.reportNameSuffix = reportNameSuffix; this.trimStackTrace = trimStackTrace; this.rerunFailingTestsCount = rerunFailingTestsCount; this.testClassMethodRunHistoryMap = testClassMethodRunHistoryMap; this.xsdSchemaLocation = xsdSchemaLocation; } public void testSetCompleted( WrappedReportEntry testSetReportEntry, TestSetStats testSetStats ) { String testClassName = testSetReportEntry.getName(); Map> methodRunHistoryMap = getAddMethodRunHistoryMap( testClassName ); // Update testClassMethodRunHistoryMap for ( WrappedReportEntry methodEntry : testSetStats.getReportEntries() ) { getAddMethodEntryList( methodRunHistoryMap, methodEntry ); } OutputStream outputStream = getOutputStream( testSetReportEntry ); OutputStreamWriter fw = getWriter( outputStream ); try { XMLWriter ppw = new PrettyPrintXMLWriter( fw ); ppw.setEncoding( StringUtils.UTF_8.name() ); createTestSuiteElement( ppw, testSetReportEntry, testSetStats, testSetReportEntry.elapsedTimeAsString() ); showProperties( ppw, testSetReportEntry.getSystemProperties() ); // Iterate through all the test methods in the test class for ( Entry> entry : methodRunHistoryMap.entrySet() ) { List methodEntryList = entry.getValue(); if ( methodEntryList == null ) { throw new IllegalStateException( "Get null test method run history" ); } if ( !methodEntryList.isEmpty() ) { if ( rerunFailingTestsCount > 0 ) { switch ( getTestResultType( methodEntryList ) ) { case success: for ( WrappedReportEntry methodEntry : methodEntryList ) { if ( methodEntry.getReportEntryType() == SUCCESS ) { startTestElement( ppw, methodEntry, reportNameSuffix, methodEntryList.get( 0 ).elapsedTimeAsString() ); ppw.endElement(); } } break; case error: case failure: // When rerunFailingTestsCount is set to larger than 0 startTestElement( ppw, methodEntryList.get( 0 ), reportNameSuffix, methodEntryList.get( 0 ).elapsedTimeAsString() ); boolean firstRun = true; for ( WrappedReportEntry singleRunEntry : methodEntryList ) { if ( firstRun ) { firstRun = false; getTestProblems( fw, ppw, singleRunEntry, trimStackTrace, outputStream, singleRunEntry.getReportEntryType().getXmlTag(), false ); createOutErrElements( fw, ppw, singleRunEntry, outputStream ); } else { getTestProblems( fw, ppw, singleRunEntry, trimStackTrace, outputStream, singleRunEntry.getReportEntryType().getRerunXmlTag(), true ); } } ppw.endElement(); break; case flake: String runtime = ""; // Get the run time of the first successful run for ( WrappedReportEntry singleRunEntry : methodEntryList ) { if ( singleRunEntry.getReportEntryType() == SUCCESS ) { runtime = singleRunEntry.elapsedTimeAsString(); break; } } startTestElement( ppw, methodEntryList.get( 0 ), reportNameSuffix, runtime ); for ( WrappedReportEntry singleRunEntry : methodEntryList ) { if ( singleRunEntry.getReportEntryType() != SUCCESS ) { getTestProblems( fw, ppw, singleRunEntry, trimStackTrace, outputStream, singleRunEntry.getReportEntryType().getFlakyXmlTag(), true ); } } ppw.endElement(); break; case skipped: startTestElement( ppw, methodEntryList.get( 0 ), reportNameSuffix, methodEntryList.get( 0 ).elapsedTimeAsString() ); getTestProblems( fw, ppw, methodEntryList.get( 0 ), trimStackTrace, outputStream, methodEntryList.get( 0 ).getReportEntryType().getXmlTag(), false ); ppw.endElement(); break; default: throw new IllegalStateException( "Get unknown test result type" ); } } else { // rerunFailingTestsCount is smaller than 1, but for some reasons a test could be run // for more than once for ( WrappedReportEntry methodEntry : methodEntryList ) { startTestElement( ppw, methodEntry, reportNameSuffix, methodEntry.elapsedTimeAsString() ); if ( methodEntry.getReportEntryType() != SUCCESS ) { getTestProblems( fw, ppw, methodEntry, trimStackTrace, outputStream, methodEntry.getReportEntryType().getXmlTag(), false ); createOutErrElements( fw, ppw, methodEntry, outputStream ); } ppw.endElement(); } } } } ppw.endElement(); // TestSuite } finally { closeQuietly( fw ); } } /** * Clean testClassMethodRunHistoryMap */ public void cleanTestHistoryMap() { testClassMethodRunHistoryMap.clear(); } /** * Get the result of a test from a list of its runs in WrappedReportEntry * * @param methodEntryList the list of runs for a given test * @return the TestResultType for the given test */ private TestResultType getTestResultType( List methodEntryList ) { List testResultTypeList = new ArrayList(); for ( WrappedReportEntry singleRunEntry : methodEntryList ) { testResultTypeList.add( singleRunEntry.getReportEntryType() ); } return DefaultReporterFactory.getTestResultType( testResultTypeList, rerunFailingTestsCount ); } private Map> getAddMethodRunHistoryMap( String testClassName ) { Map> methodRunHistoryMap = testClassMethodRunHistoryMap.get( testClassName ); if ( methodRunHistoryMap == null ) { methodRunHistoryMap = Collections.synchronizedMap( new LinkedHashMap>() ); testClassMethodRunHistoryMap.put( testClassName, methodRunHistoryMap ); } return methodRunHistoryMap; } private OutputStream getOutputStream( WrappedReportEntry testSetReportEntry ) { File reportFile = getReportFile( testSetReportEntry, reportsDirectory, reportNameSuffix ); File reportDir = reportFile.getParentFile(); //noinspection ResultOfMethodCallIgnored reportDir.mkdirs(); try { return new BufferedOutputStream( new FileOutputStream( reportFile ), 16 * 1024 ); } catch ( Exception e ) { throw new ReporterException( "When writing report", e ); } } private static OutputStreamWriter getWriter( OutputStream fos ) { return new OutputStreamWriter( fos, UTF_8 ); } private static void getAddMethodEntryList( Map> methodRunHistoryMap, WrappedReportEntry methodEntry ) { List methodEntryList = methodRunHistoryMap.get( methodEntry.getName() ); if ( methodEntryList == null ) { methodEntryList = new ArrayList(); methodRunHistoryMap.put( methodEntry.getName(), methodEntryList ); } methodEntryList.add( methodEntry ); } private static File getReportFile( ReportEntry report, File reportsDirectory, String reportNameSuffix ) { String reportName = "TEST-" + report.getName(); String customizedReportName = isBlank( reportNameSuffix ) ? reportName : reportName + "-" + reportNameSuffix; return new File( reportsDirectory, stripIllegalFilenameChars( customizedReportName + ".xml" ) ); } private static void startTestElement( XMLWriter ppw, WrappedReportEntry report, String reportNameSuffix, String timeAsString ) { ppw.startElement( "testcase" ); ppw.addAttribute( "name", report.getReportName() ); if ( report.getGroup() != null ) { ppw.addAttribute( "group", report.getGroup() ); } if ( report.getSourceName() != null ) { if ( reportNameSuffix != null && !reportNameSuffix.isEmpty() ) { ppw.addAttribute( "classname", report.getSourceName() + "(" + reportNameSuffix + ")" ); } else { ppw.addAttribute( "classname", report.getSourceName() ); } } ppw.addAttribute( "time", timeAsString ); } private void createTestSuiteElement( XMLWriter ppw, WrappedReportEntry report, TestSetStats testSetStats, String timeAsString ) { ppw.startElement( "testsuite" ); ppw.addAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" ); ppw.addAttribute( "xsi:noNamespaceSchemaLocation", xsdSchemaLocation ); ppw.addAttribute( "name", report.getReportName( reportNameSuffix ) ); if ( report.getGroup() != null ) { ppw.addAttribute( "group", report.getGroup() ); } ppw.addAttribute( "time", timeAsString ); ppw.addAttribute( "tests", String.valueOf( testSetStats.getCompletedCount() ) ); ppw.addAttribute( "errors", String.valueOf( testSetStats.getErrors() ) ); ppw.addAttribute( "skipped", String.valueOf( testSetStats.getSkipped() ) ); ppw.addAttribute( "failures", String.valueOf( testSetStats.getFailures() ) ); } private static void getTestProblems( OutputStreamWriter outputStreamWriter, XMLWriter ppw, WrappedReportEntry report, boolean trimStackTrace, OutputStream fw, String testErrorType, boolean createOutErrElementsInside ) { ppw.startElement( testErrorType ); String stackTrace = report.getStackTrace( trimStackTrace ); if ( report.getMessage() != null && !report.getMessage().isEmpty() ) { ppw.addAttribute( "message", extraEscape( report.getMessage(), true ) ); } if ( report.getStackTraceWriter() != null ) { //noinspection ThrowableResultOfMethodCallIgnored SafeThrowable t = report.getStackTraceWriter().getThrowable(); if ( t != null ) { if ( t.getMessage() != null ) { int delimiter = stackTrace.indexOf( ":" ); String type = delimiter == -1 ? stackTrace : stackTrace.substring( 0, delimiter ); ppw.addAttribute( "type", type ); } else { ppw.addAttribute( "type", new StringTokenizer( stackTrace ).nextToken() ); } } } if ( stackTrace != null ) { ppw.writeText( extraEscape( stackTrace, false ) ); } if ( createOutErrElementsInside ) { createOutErrElements( outputStreamWriter, ppw, report, fw ); } ppw.endElement(); // entry type } // Create system-out and system-err elements private static void createOutErrElements( OutputStreamWriter outputStreamWriter, XMLWriter ppw, WrappedReportEntry report, OutputStream fw ) { EncodingOutputStream eos = new EncodingOutputStream( fw ); addOutputStreamElement( outputStreamWriter, eos, ppw, report.getStdout(), "system-out" ); addOutputStreamElement( outputStreamWriter, eos, ppw, report.getStdErr(), "system-err" ); } private static void addOutputStreamElement( OutputStreamWriter outputStreamWriter, EncodingOutputStream eos, XMLWriter xmlWriter, Utf8RecodingDeferredFileOutputStream utf8RecodingDeferredFileOutputStream, String name ) { if ( utf8RecodingDeferredFileOutputStream != null && utf8RecodingDeferredFileOutputStream.getByteCount() > 0 ) { xmlWriter.startElement( name ); try { xmlWriter.writeText( "" ); // Cheat sax to emit element outputStreamWriter.flush(); utf8RecodingDeferredFileOutputStream.close(); eos.getUnderlying().write( ByteConstantsHolder.CDATA_START_BYTES ); // emit cdata utf8RecodingDeferredFileOutputStream.writeTo( eos ); eos.getUnderlying().write( ByteConstantsHolder.CDATA_END_BYTES ); eos.flush(); } catch ( IOException e ) { throw new ReporterException( "When writing xml report stdout/stderr", e ); } xmlWriter.endElement(); } } /** * Adds system properties to the XML report. *
* * @param xmlWriter The test suite to report to */ private static void showProperties( XMLWriter xmlWriter, Map systemProperties ) { xmlWriter.startElement( "properties" ); for ( final Entry entry : systemProperties.entrySet() ) { final String key = entry.getKey(); String value = entry.getValue(); if ( value == null ) { value = "null"; } xmlWriter.startElement( "property" ); xmlWriter.addAttribute( "name", key ); xmlWriter.addAttribute( "value", extraEscape( value, true ) ); xmlWriter.endElement(); } xmlWriter.endElement(); } /** * Handle stuff that may pop up in java that is not legal in xml * * @param message The string * @param attribute true if the escaped value is inside an attribute * @return The escaped string */ private static String extraEscape( String message, boolean attribute ) { // Someday convert to xml 1.1 which handles everything but 0 inside string return containsEscapesIllegalXml10( message ) ? escapeXml( message, attribute ) : message; } private static final class EncodingOutputStream extends FilterOutputStream { private int c1; private int c2; EncodingOutputStream( OutputStream out ) { super( out ); } OutputStream getUnderlying() { return out; } private boolean isCdataEndBlock( int c ) { return c1 == ']' && c2 == ']' && c == '>'; } @Override public void write( int b ) throws IOException { if ( isCdataEndBlock( b ) ) { out.write( ByteConstantsHolder.CDATA_ESCAPE_STRING_BYTES ); } else if ( isIllegalEscape( b ) ) { // uh-oh! This character is illegal in XML 1.0! // http://www.w3.org/TR/1998/REC-xml-19980210#charsets // we're going to deliberately doubly-XML escape it... // there's nothing better we can do! :-( // SUREFIRE-456 out.write( ByteConstantsHolder.AMP_BYTES ); out.write( String.valueOf( b ).getBytes( UTF_8 ) ); out.write( ';' ); // & Will be encoded to amp inside xml encodingSHO } else { out.write( b ); } c1 = c2; c2 = b; } } private static boolean containsEscapesIllegalXml10( String message ) { int size = message.length(); for ( int i = 0; i < size; i++ ) { if ( isIllegalEscape( message.charAt( i ) ) ) { return true; } } return false; } private static boolean isIllegalEscape( char c ) { return isIllegalEscape( (int) c ); } private static boolean isIllegalEscape( int c ) { return c >= 0 && c < 32 && c != '\n' && c != '\r' && c != '\t'; } private static String escapeXml( String text, boolean attribute ) { StringBuilder sb = new StringBuilder( text.length() * 2 ); for ( int i = 0; i < text.length(); i++ ) { char c = text.charAt( i ); if ( isIllegalEscape( c ) ) { // uh-oh! This character is illegal in XML 1.0! // http://www.w3.org/TR/1998/REC-xml-19980210#charsets // we're going to deliberately doubly-XML escape it... // there's nothing better we can do! :-( // SUREFIRE-456 sb.append( attribute ? "&#" : "&#" ).append( (int) c ).append( ';' ); // & Will be encoded to amp inside xml encodingSHO } else { sb.append( c ); } } return sb.toString(); } private static final class ByteConstantsHolder { private static final byte[] CDATA_START_BYTES; private static final byte[] CDATA_END_BYTES; private static final byte[] CDATA_ESCAPE_STRING_BYTES; private static final byte[] AMP_BYTES; static { CDATA_START_BYTES = "".getBytes( UTF_8 ); CDATA_ESCAPE_STRING_BYTES = "]]>".getBytes( UTF_8 ); AMP_BYTES = "&#".getBytes( UTF_8 ); } } } TestMethodStats.java000066400000000000000000000033351330756104600406700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import org.apache.maven.surefire.report.StackTraceWriter; /** * * Maintains per-thread test result state for a single test method. * * @author Qingzhou Luo * */ public class TestMethodStats { private final String testClassMethodName; private final ReportEntryType resultType; private final StackTraceWriter stackTraceWriter; public TestMethodStats( String testClassMethodName, ReportEntryType resultType, StackTraceWriter stackTraceWriter ) { this.testClassMethodName = testClassMethodName; this.resultType = resultType; this.stackTraceWriter = stackTraceWriter; } public String getTestClassMethodName() { return testClassMethodName; } public ReportEntryType getResultType() { return resultType; } public StackTraceWriter getStackTraceWriter() { return stackTraceWriter; } } TestSetRunListener.java000066400000000000000000000237111330756104600413570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.runorder.StatisticsReporter; import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.TestSetReportEntry; import static org.apache.maven.plugin.surefire.report.ReportEntryType.ERROR; import static org.apache.maven.plugin.surefire.report.ReportEntryType.FAILURE; import static org.apache.maven.plugin.surefire.report.ReportEntryType.SKIPPED; import static org.apache.maven.plugin.surefire.report.ReportEntryType.SUCCESS; /** * Reports data for a single test set. *
* * @author Kristian Rosenvold */ public class TestSetRunListener implements RunListener, ConsoleOutputReceiver, ConsoleLogger { private final TestSetStats detailsForThis; private List testMethodStats; private Utf8RecodingDeferredFileOutputStream testStdOut = initDeferred( "stdout" ); private Utf8RecodingDeferredFileOutputStream testStdErr = initDeferred( "stderr" ); private Utf8RecodingDeferredFileOutputStream initDeferred( String channel ) { return new Utf8RecodingDeferredFileOutputStream( channel ); } private final TestcycleConsoleOutputReceiver consoleOutputReceiver; private final boolean briefOrPlainFormat; private final StatelessXmlReporter simpleXMLReporter; private final ConsoleReporter consoleReporter; private final FileReporter fileReporter; private final StatisticsReporter statisticsReporter; @SuppressWarnings( "checkstyle:parameternumber" ) public TestSetRunListener( ConsoleReporter consoleReporter, FileReporter fileReporter, StatelessXmlReporter simpleXMLReporter, TestcycleConsoleOutputReceiver consoleOutputReceiver, StatisticsReporter statisticsReporter, boolean trimStackTrace, boolean isPlainFormat, boolean briefOrPlainFormat ) { this.consoleReporter = consoleReporter; this.fileReporter = fileReporter; this.statisticsReporter = statisticsReporter; this.simpleXMLReporter = simpleXMLReporter; this.consoleOutputReceiver = consoleOutputReceiver; this.briefOrPlainFormat = briefOrPlainFormat; detailsForThis = new TestSetStats( trimStackTrace, isPlainFormat ); testMethodStats = new ArrayList(); } @Override public boolean isDebugEnabled() { return consoleReporter.getConsoleLogger().isDebugEnabled(); } @Override public void debug( String message ) { consoleReporter.getConsoleLogger().debug( trimTrailingNewLine( message ) ); } @Override public boolean isInfoEnabled() { return consoleReporter.getConsoleLogger().isInfoEnabled(); } @Override public void info( String message ) { consoleReporter.getConsoleLogger().info( trimTrailingNewLine( message ) ); } @Override public boolean isWarnEnabled() { return consoleReporter.getConsoleLogger().isWarnEnabled(); } @Override public void warning( String message ) { consoleReporter.getConsoleLogger().warning( trimTrailingNewLine( message ) ); } @Override public boolean isErrorEnabled() { return consoleReporter.getConsoleLogger().isErrorEnabled(); } @Override public void error( String message ) { consoleReporter.getConsoleLogger().error( trimTrailingNewLine( message ) ); } @Override public void error( String message, Throwable t ) { consoleReporter.getConsoleLogger().error( message, t ); } @Override public void error( Throwable t ) { consoleReporter.getConsoleLogger().error( t ); } @Override public void writeTestOutput( byte[] buf, int off, int len, boolean stdout ) { try { if ( stdout ) { testStdOut.write( buf, off, len ); } else { testStdErr.write( buf, off, len ); } consoleOutputReceiver.writeTestOutput( buf, off, len, stdout ); } catch ( IOException e ) { throw new RuntimeException( e ); } } @Override public void testSetStarting( TestSetReportEntry report ) { detailsForThis.testSetStart(); consoleReporter.testSetStarting( report ); consoleOutputReceiver.testSetStarting( report ); } private void clearCapture() { testStdOut = initDeferred( "stdout" ); testStdErr = initDeferred( "stderr" ); } @Override public void testSetCompleted( TestSetReportEntry report ) { final WrappedReportEntry wrap = wrapTestSet( report ); final List testResults = briefOrPlainFormat ? detailsForThis.getTestResults() : Collections.emptyList(); fileReporter.testSetCompleted( wrap, detailsForThis, testResults ); simpleXMLReporter.testSetCompleted( wrap, detailsForThis ); statisticsReporter.testSetCompleted(); consoleReporter.testSetCompleted( wrap, detailsForThis, testResults ); consoleOutputReceiver.testSetCompleted( wrap ); consoleReporter.reset(); wrap.getStdout().free(); wrap.getStdErr().free(); addTestMethodStats(); detailsForThis.reset(); clearCapture(); } // ---------------------------------------------------------------------- // Test // ---------------------------------------------------------------------- @Override public void testStarting( ReportEntry report ) { detailsForThis.testStart(); } @Override public void testSucceeded( ReportEntry reportEntry ) { WrappedReportEntry wrapped = wrap( reportEntry, SUCCESS ); detailsForThis.testSucceeded( wrapped ); statisticsReporter.testSucceeded( reportEntry ); clearCapture(); } @Override public void testError( ReportEntry reportEntry ) { WrappedReportEntry wrapped = wrap( reportEntry, ERROR ); detailsForThis.testError( wrapped ); statisticsReporter.testError( reportEntry ); clearCapture(); } @Override public void testFailed( ReportEntry reportEntry ) { WrappedReportEntry wrapped = wrap( reportEntry, FAILURE ); detailsForThis.testFailure( wrapped ); statisticsReporter.testFailed( reportEntry ); clearCapture(); } // ---------------------------------------------------------------------- // Counters // ---------------------------------------------------------------------- @Override public void testSkipped( ReportEntry reportEntry ) { WrappedReportEntry wrapped = wrap( reportEntry, SKIPPED ); detailsForThis.testSkipped( wrapped ); statisticsReporter.testSkipped( reportEntry ); clearCapture(); } @Override public void testExecutionSkippedByUser() { } @Override public void testAssumptionFailure( ReportEntry report ) { testSkipped( report ); } private WrappedReportEntry wrap( ReportEntry other, ReportEntryType reportEntryType ) { int estimatedElapsed = 0; if ( reportEntryType != SKIPPED ) { Integer etime = other.getElapsed(); estimatedElapsed = etime == null ? detailsForThis.getElapsedSinceLastStart() : etime; } return new WrappedReportEntry( other, reportEntryType, estimatedElapsed, testStdOut, testStdErr ); } private WrappedReportEntry wrapTestSet( TestSetReportEntry other ) { return new WrappedReportEntry( other, null, other.getElapsed() != null ? other.getElapsed() : detailsForThis.getElapsedSinceTestSetStart(), testStdOut, testStdErr, other.getSystemProperties() ); } public void close() { consoleOutputReceiver.close(); } private void addTestMethodStats() { for ( WrappedReportEntry reportEntry : detailsForThis.getReportEntries() ) { TestMethodStats methodStats = new TestMethodStats( reportEntry.getClassMethodName(), reportEntry.getReportEntryType(), reportEntry.getStackTraceWriter() ); testMethodStats.add( methodStats ); } } public List getTestMethodStats() { return testMethodStats; } private static String trimTrailingNewLine( final String message ) { final int e = message == null ? 0 : lineBoundSymbolWidth( message ); return message != null && e != 0 ? message.substring( 0, message.length() - e ) : message; } private static int lineBoundSymbolWidth( String message ) { return message.endsWith( "\n" ) || message.endsWith( "\r" ) ? 1 : ( message.endsWith( "\r\n" ) ? 2 : 0 ); } } TestSetStats.java000066400000000000000000000210701330756104600401770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import org.apache.maven.shared.utils.logging.MessageBuilder; import org.apache.maven.surefire.report.ReportEntry; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import static org.apache.maven.shared.utils.logging.MessageUtils.buffer; /** * Maintains per-thread test result state. Not thread safe. */ public class TestSetStats { private static final String TESTS = "Tests "; private static final String RUN = "run: "; private static final String TESTS_RUN = "Tests run: "; private static final String FAILURES = "Failures: "; private static final String ERRORS = "Errors: "; private static final String SKIPPED = "Skipped: "; private static final String FAILURE_MARKER = " <<< FAILURE!"; private static final String IN_MARKER = " - in "; private static final String COMMA = ", "; private final Queue reportEntries = new ConcurrentLinkedQueue(); private final boolean trimStackTrace; private final boolean plainFormat; private long testSetStartAt; private long testStartAt; private int completedCount; private int errors; private int failures; private int skipped; private long lastStartAt; public TestSetStats( boolean trimStackTrace, boolean plainFormat ) { this.trimStackTrace = trimStackTrace; this.plainFormat = plainFormat; } public int getElapsedSinceTestSetStart() { return testSetStartAt > 0 ? (int) ( System.currentTimeMillis() - testSetStartAt ) : 0; } public int getElapsedSinceLastStart() { return lastStartAt > 0 ? (int) ( System.currentTimeMillis() - lastStartAt ) : 0; } public void testSetStart() { testSetStartAt = System.currentTimeMillis(); lastStartAt = testSetStartAt; } public void testStart() { testStartAt = System.currentTimeMillis(); lastStartAt = testStartAt; } private void finishTest( WrappedReportEntry reportEntry ) { reportEntries.add( reportEntry ); incrementCompletedCount(); // SUREFIRE-398 skipped tests call endTest without calling testStarting // if startTime = 0, set it to endTime, so the diff will be 0 if ( testStartAt == 0 ) { testStartAt = System.currentTimeMillis(); } } public void testSucceeded( WrappedReportEntry reportEntry ) { finishTest( reportEntry ); } public void testError( WrappedReportEntry reportEntry ) { errors += 1; finishTest( reportEntry ); } public void testFailure( WrappedReportEntry reportEntry ) { failures += 1; finishTest( reportEntry ); } public void testSkipped( WrappedReportEntry reportEntry ) { skipped += 1; finishTest( reportEntry ); } public void reset() { completedCount = 0; errors = 0; failures = 0; skipped = 0; for ( WrappedReportEntry entry : reportEntries ) { entry.getStdout().free(); entry.getStdErr().free(); } reportEntries.clear(); } public int getCompletedCount() { return completedCount; } public int getErrors() { return errors; } public int getFailures() { return failures; } public int getSkipped() { return skipped; } private void incrementCompletedCount() { completedCount += 1; } public String getTestSetSummary( WrappedReportEntry reportEntry ) { String summary = TESTS_RUN + completedCount + COMMA + FAILURES + failures + COMMA + ERRORS + errors + COMMA + SKIPPED + skipped + COMMA + reportEntry.getElapsedTimeVerbose(); if ( failures > 0 || errors > 0 ) { summary += FAILURE_MARKER; } summary += IN_MARKER + reportEntry.getNameWithGroup(); return summary; } public String getColoredTestSetSummary( WrappedReportEntry reportEntry ) { final boolean isSuccessful = failures == 0 && errors == 0 && skipped == 0; final boolean isFailure = failures > 0; final boolean isError = errors > 0; final boolean isFailureOrError = isFailure | isError; final boolean isSkipped = skipped > 0; final MessageBuilder builder = buffer(); if ( isSuccessful ) { if ( completedCount == 0 ) { builder.strong( TESTS_RUN ).strong( completedCount ); } else { builder.success( TESTS_RUN ).success( completedCount ); } } else { if ( isFailureOrError ) { builder.failure( TESTS ).strong( RUN ).strong( completedCount ); } else { builder.warning( TESTS ).strong( RUN ).strong( completedCount ); } } builder.a( COMMA ); if ( isFailure ) { builder.failure( FAILURES ).failure( failures ); } else { builder.a( FAILURES ).a( failures ); } builder.a( COMMA ); if ( isError ) { builder.failure( ERRORS ).failure( errors ); } else { builder.a( ERRORS ).a( errors ); } builder.a( COMMA ); if ( isSkipped ) { builder.warning( SKIPPED ).warning( skipped ); } else { builder.a( SKIPPED ).a( skipped ); } builder.a( COMMA ) .a( reportEntry.getElapsedTimeVerbose() ); if ( isFailureOrError ) { builder.failure( FAILURE_MARKER ); } builder.a( IN_MARKER ); return concatenateWithTestGroup( builder, reportEntry ); } public List getTestResults() { List result = new ArrayList(); for ( WrappedReportEntry testResult : reportEntries ) { if ( testResult.isErrorOrFailure() ) { result.add( testResult.getOutput( trimStackTrace ) ); } else if ( plainFormat && testResult.isSkipped() ) { result.add( testResult.getName() + " skipped" ); } else if ( plainFormat && testResult.isSucceeded() ) { result.add( testResult.getElapsedTimeSummary() ); } } // This should be Map with an enum and the enums will be displayed with colors on console. return result; } public Collection getReportEntries() { return reportEntries; } /** * Append the test set message for a report. * e.g. "org.foo.BarTest ( of group )" * * @param builder MessageBuilder with preceded text inside * @param report report whose test set is starting * @return the message */ static String concatenateWithTestGroup( MessageBuilder builder, ReportEntry report ) { final String testClass = report.getNameWithGroup(); int delimiter = testClass.lastIndexOf( '.' ); String pkg = testClass.substring( 0, 1 + delimiter ); String cls = testClass.substring( 1 + delimiter ); return builder.a( pkg ) .strong( cls ) .toString(); } } TestcycleConsoleOutputReceiver.java000066400000000000000000000023101330756104600437510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.ReportEntry; /** * @author Kristian Rosenvold */ public interface TestcycleConsoleOutputReceiver extends ConsoleOutputReceiver { void testSetStarting( ReportEntry reportEntry ); void testSetCompleted( ReportEntry report ); void close(); } Utf8RecodingDeferredFileOutputStream.java000066400000000000000000000073331330756104600447320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import org.apache.commons.io.output.DeferredFileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; import static org.apache.maven.surefire.util.internal.StringUtils.UTF_8; /** * A deferred file output stream decorator that recodes the bytes written into the stream from the VM default encoding * to UTF-8. * * @author Andreas Gudian */ class Utf8RecodingDeferredFileOutputStream { private DeferredFileOutputStream deferredFileOutputStream; private boolean closed = false; @SuppressWarnings( "checkstyle:magicnumber" ) Utf8RecodingDeferredFileOutputStream( String channel ) { this.deferredFileOutputStream = new DeferredFileOutputStream( 1000000, channel, "deferred", null ); } public synchronized void write( byte[] buf, int off, int len ) throws IOException { if ( closed ) { return; } if ( !Charset.defaultCharset().equals( UTF_8 ) ) { CharBuffer decodedFromDefaultCharset = Charset.defaultCharset().decode( ByteBuffer.wrap( buf, off, len ) ); ByteBuffer utf8Encoded = UTF_8.encode( decodedFromDefaultCharset ); if ( utf8Encoded.hasArray() ) { byte[] convertedBytes = utf8Encoded.array(); deferredFileOutputStream.write( convertedBytes, utf8Encoded.position(), utf8Encoded.remaining() ); } else { byte[] convertedBytes = new byte[utf8Encoded.remaining()]; utf8Encoded.get( convertedBytes, 0, utf8Encoded.remaining() ); deferredFileOutputStream.write( convertedBytes, 0, convertedBytes.length ); } } else { deferredFileOutputStream.write( buf, off, len ); } } public long getByteCount() { return deferredFileOutputStream.getByteCount(); } public synchronized void close() throws IOException { closed = true; deferredFileOutputStream.close(); } public synchronized void writeTo( OutputStream out ) throws IOException { if ( closed ) { deferredFileOutputStream.writeTo( out ); } } public synchronized void free() { if ( null != deferredFileOutputStream && null != deferredFileOutputStream.getFile() ) { try { closed = true; deferredFileOutputStream.close(); if ( !deferredFileOutputStream.getFile().delete() ) { deferredFileOutputStream.getFile().deleteOnExit(); } } catch ( IOException ioe ) { deferredFileOutputStream.getFile().deleteOnExit(); } } } } WrappedReportEntry.java000066400000000000000000000126731330756104600414160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.StackTraceWriter; import org.apache.maven.surefire.report.TestSetReportEntry; import java.util.Collections; import java.util.Map; import static java.util.Collections.unmodifiableMap; import static org.apache.maven.plugin.surefire.report.ReporterUtils.formatElapsedTime; import static org.apache.maven.surefire.util.internal.StringUtils.NL; /** * @author Kristian Rosenvold */ public class WrappedReportEntry implements TestSetReportEntry { private final ReportEntry original; private final ReportEntryType reportEntryType; private final Integer elapsed; private final Utf8RecodingDeferredFileOutputStream stdout; private final Utf8RecodingDeferredFileOutputStream stdErr; private final Map systemProperties; public WrappedReportEntry( ReportEntry original, ReportEntryType reportEntryType, Integer estimatedElapsed, Utf8RecodingDeferredFileOutputStream stdout, Utf8RecodingDeferredFileOutputStream stdErr, Map systemProperties ) { this.original = original; this.reportEntryType = reportEntryType; this.elapsed = estimatedElapsed; this.stdout = stdout; this.stdErr = stdErr; this.systemProperties = unmodifiableMap( systemProperties ); } public WrappedReportEntry( ReportEntry original, ReportEntryType reportEntryType, Integer estimatedElapsed, Utf8RecodingDeferredFileOutputStream stdout, Utf8RecodingDeferredFileOutputStream stdErr ) { this( original, reportEntryType, estimatedElapsed, stdout, stdErr, Collections.emptyMap() ); } @Override public Integer getElapsed() { return elapsed; } public ReportEntryType getReportEntryType() { return reportEntryType; } public Utf8RecodingDeferredFileOutputStream getStdout() { return stdout; } public Utf8RecodingDeferredFileOutputStream getStdErr() { return stdErr; } @Override public String getSourceName() { return original.getSourceName(); } @Override public String getName() { return original.getName(); } public String getClassMethodName() { return getSourceName() + "." + getName(); } @Override public String getGroup() { return original.getGroup(); } @Override public StackTraceWriter getStackTraceWriter() { return original.getStackTraceWriter(); } @Override public String getMessage() { return original.getMessage(); } public String getStackTrace( boolean trimStackTrace ) { StackTraceWriter w = original.getStackTraceWriter(); return w == null ? null : ( trimStackTrace ? w.writeTrimmedTraceToString() : w.writeTraceToString() ); } public String elapsedTimeAsString() { return formatElapsedTime( getElapsed() ); } public String getReportName() { final int i = getName().lastIndexOf( "(" ); return i > 0 ? getName().substring( 0, i ) : getName(); } public String getReportName( String suffix ) { return suffix != null && !suffix.isEmpty() ? getReportName() + "(" + suffix + ")" : getReportName(); } public String getOutput( boolean trimStackTrace ) { String outputLine = getElapsedTimeSummary() + " <<< " + getReportEntryType().name() + "!"; String trimmedStackTrace = getStackTrace( trimStackTrace ); return trimmedStackTrace == null ? outputLine : outputLine + NL + trimmedStackTrace; } public String getElapsedTimeVerbose() { return "Time elapsed: " + elapsedTimeAsString() + " s"; } public String getElapsedTimeSummary() { return getName() + " " + getElapsedTimeVerbose(); } public boolean isErrorOrFailure() { ReportEntryType thisType = getReportEntryType(); return ReportEntryType.FAILURE == thisType || ReportEntryType.ERROR == thisType; } public boolean isSkipped() { return ReportEntryType.SKIPPED == getReportEntryType(); } public boolean isSucceeded() { return ReportEntryType.SUCCESS == getReportEntryType(); } @Override public String getNameWithGroup() { return original.getNameWithGroup(); } @Override public Map getSystemProperties() { return systemProperties; } } runorder/000077500000000000000000000000001330756104600352475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefireStatisticsReporter.java000066400000000000000000000045731330756104600420000ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/runorderpackage org.apache.maven.plugin.surefire.runorder; /* * 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. */ import java.io.File; import java.io.FileNotFoundException; import org.apache.maven.surefire.report.ReportEntry; import static org.apache.maven.plugin.surefire.runorder.RunEntryStatisticsMap.fromFile; /** * @author Kristian Rosenvold */ public class StatisticsReporter { private final RunEntryStatisticsMap existing; private final RunEntryStatisticsMap newResults; private final File dataFile; public StatisticsReporter( File dataFile ) { this( dataFile, fromFile( dataFile ), new RunEntryStatisticsMap() ); } protected StatisticsReporter( File dataFile, RunEntryStatisticsMap existing, RunEntryStatisticsMap newRestuls ) { this.dataFile = dataFile; this.existing = existing; this.newResults = newRestuls; } public synchronized void testSetCompleted() { try { newResults.serialize( dataFile ); } catch ( FileNotFoundException e ) { throw new RuntimeException( e ); } } public void testSucceeded( ReportEntry report ) { newResults.add( existing.createNextGeneration( report ) ); } public void testSkipped( ReportEntry report ) { newResults.add( existing.createNextGeneration( report ) ); } public void testError( ReportEntry report ) { newResults.add( existing.createNextGenerationFailure( report ) ); } public void testFailed( ReportEntry report ) { newResults.add( existing.createNextGenerationFailure( report ) ); } } util/000077500000000000000000000000001330756104600343645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefireDependencyScanner.java000066400000000000000000000106141330756104600406210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/utilpackage org.apache.maven.plugin.surefire.util; /* * 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. */ import static org.apache.maven.plugin.surefire.util.ScannerUtil.convertJarFileResourceToJavaClassName; import static org.apache.maven.plugin.surefire.util.ScannerUtil.isJavaClassFile; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Enumeration; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import java.util.jar.JarEntry; import java.util.jar.JarFile; import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.surefire.testset.TestFilter; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.util.DefaultScanResult; /** * Scans dependencies looking for tests. * * @author Aslak Knutsen */ public class DependencyScanner { private final List dependenciesToScan; private final TestListResolver filter; public DependencyScanner( List dependenciesToScan, TestListResolver filter ) { this.dependenciesToScan = dependenciesToScan; this.filter = filter; } public DefaultScanResult scan() throws MojoExecutionException { Set classes = new LinkedHashSet(); for ( File artifact : dependenciesToScan ) { if ( artifact != null && artifact.isFile() && artifact.getName().endsWith( ".jar" ) ) { try { scanArtifact( artifact, filter, classes ); } catch ( IOException e ) { throw new MojoExecutionException( "Could not scan dependency " + artifact.toString(), e ); } } } return new DefaultScanResult( new ArrayList( classes ) ); } private static void scanArtifact( File artifact, TestFilter filter, Set classes ) throws IOException { JarFile jar = null; try { jar = new JarFile( artifact ); for ( Enumeration entries = jar.entries(); entries.hasMoreElements(); ) { JarEntry entry = entries.nextElement(); String path = entry.getName(); if ( !entry.isDirectory() && isJavaClassFile( path ) && filter.shouldRun( path, null ) ) { classes.add( convertJarFileResourceToJavaClassName( path ) ); } } } finally { if ( jar != null ) { jar.close(); } } } public static List filter( List artifacts, List groupArtifactIds ) { List matches = new ArrayList(); if ( groupArtifactIds == null || artifacts == null ) { return matches; } for ( Artifact artifact : artifacts ) { for ( String groups : groupArtifactIds ) { String[] groupArtifact = groups.split( ":" ); if ( groupArtifact.length != 2 ) { throw new IllegalArgumentException( "dependencyToScan argument should be in format" + " 'groupid:artifactid': " + groups ); } if ( artifact.getGroupId().matches( groupArtifact[0] ) && artifact.getArtifactId().matches( groupArtifact[1] ) ) { matches.add( artifact ); } } } return matches; } } DirectoryScanner.java000066400000000000000000000032051330756104600405050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/utilpackage org.apache.maven.plugin.surefire.util; /* * 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. */ import java.io.File; import java.util.ArrayList; import java.util.List; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.util.DefaultScanResult; /** * Scans directories looking for tests. * * @author Karl M. Davis * @author Kristian Rosenvold */ public class DirectoryScanner { private final File basedir; private final TestListResolver filter; public DirectoryScanner( File basedir, TestListResolver filter ) { this.basedir = basedir; this.filter = filter; } public DefaultScanResult scan() { FileScanner scanner = new FileScanner( basedir, "class" ); List result = new ArrayList(); scanner.scanTo( result, filter ); return new DefaultScanResult( result ); } }FileScanner.java000066400000000000000000000111721330756104600374220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/utilpackage org.apache.maven.plugin.surefire.util; /* * 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. */ import org.apache.maven.surefire.testset.TestFilter; import java.io.File; import java.util.Collection; import static org.apache.maven.surefire.util.internal.StringUtils.isBlank; final class FileScanner { private final File basedir; private final String ext; FileScanner( File basedir, String ext ) { this.basedir = basedir; ext = ext.trim(); if ( isBlank( ext ) ) { throw new IllegalArgumentException( "No file extension" ); } this.ext = ext.startsWith( "." ) ? ext : "." + ext; } void scanTo( Collection scannedJavaClassNames, TestFilter filter ) { scan( scannedJavaClassNames, filter, basedir ); } private void scan( Collection scannedJavaClassNames, TestFilter filter, File basedir, String... subDirectories ) { File[] filesAndDirs = basedir.listFiles(); if ( filesAndDirs != null ) { final String pAckage = toJavaPackage( subDirectories ); final String path = toPath( subDirectories ); final String ext = this.ext; final boolean hasExtension = ext != null; final int extLength = hasExtension ? ext.length() : 0; for ( File fileOrDir : filesAndDirs ) { String name = fileOrDir.getName(); if ( !name.isEmpty() ) { if ( fileOrDir.isFile() ) { final int clsLength = name.length() - extLength; if ( clsLength > 0 && ( !hasExtension || name.regionMatches( true, clsLength, ext, 0, extLength ) ) ) { String simpleClassName = hasExtension ? name.substring( 0, clsLength ) : name; if ( filter.shouldRun( toFile( path, simpleClassName ), null ) ) { String fullyQualifiedClassName = pAckage.isEmpty() ? simpleClassName : pAckage + '.' + simpleClassName; scannedJavaClassNames.add( fullyQualifiedClassName ); } } } else if ( fileOrDir.isDirectory() ) { String[] paths = new String[subDirectories.length + 1]; System.arraycopy( subDirectories, 0, paths, 0, subDirectories.length ); paths[subDirectories.length] = name; scan( scannedJavaClassNames, filter, fileOrDir, paths ); } } } } } private static String toJavaPackage( String... subDirectories ) { StringBuilder pkg = new StringBuilder(); for ( int i = 0; i < subDirectories.length; i++ ) { if ( i > 0 && i < subDirectories.length ) { pkg.append( '.' ); } pkg.append( subDirectories[i] ); } return pkg.toString(); } private static String toPath( String... subDirectories ) { StringBuilder pkg = new StringBuilder(); for ( int i = 0; i < subDirectories.length; i++ ) { if ( i > 0 && i < subDirectories.length ) { pkg.append( '/' ); } pkg.append( subDirectories[i] ); } return pkg.toString(); } private String toFile( String path, String fileNameWithoutExtension ) { String pathWithoutExtension = path.isEmpty() ? fileNameWithoutExtension : path + '/' + fileNameWithoutExtension; return pathWithoutExtension + ext; } } Relocator.java000066400000000000000000000035521330756104600371660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/utilpackage org.apache.maven.plugin.surefire.util; /* * 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. */ import javax.annotation.Nonnull; /** * Relocates class names when running with relocated provider * * @author Kristian Rosenvold */ public final class Relocator { private static final String RELOCATION_BASE = "org.apache.maven.surefire."; private static final String PACKAGE_DELIMITER = "shadefire"; private Relocator() { throw new IllegalStateException( "no instantiable constructor" ); } @Nonnull public static String relocate( @Nonnull String className ) { if ( className.contains( PACKAGE_DELIMITER ) ) { return className; } else { if ( !className.startsWith( RELOCATION_BASE ) ) { throw new IllegalArgumentException( "'" + className + "' should start with '" + RELOCATION_BASE + "'" ); } String rest = className.substring( RELOCATION_BASE.length() ); final String s = RELOCATION_BASE + PACKAGE_DELIMITER + "."; return s + rest; } } } ScannerUtil.java000066400000000000000000000033261330756104600374620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/utilpackage org.apache.maven.plugin.surefire.util; /* * 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. */ import org.apache.commons.lang3.StringUtils; import javax.annotation.Nonnull; final class ScannerUtil { private ScannerUtil() { throw new IllegalStateException( "not instantiable constructor" ); } @Deprecated private static final String FS = System.getProperty( "file.separator" ); @Deprecated private static final boolean IS_NON_UNIX_FS = ( !FS.equals( "/" ) ); @Nonnull public static String convertJarFileResourceToJavaClassName( @Nonnull String test ) { return StringUtils.removeEnd( test, ".class" ).replace( "/", "." ); } public static boolean isJavaClassFile( String file ) { return file.endsWith( ".class" ); } @Deprecated @Nonnull public static String convertSlashToSystemFileSeparator( @Nonnull String path ) { return ( IS_NON_UNIX_FS ? path.replace( "/", FS ) : path ); } } SpecificFileFilter.java000066400000000000000000000043251330756104600407260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/utilpackage org.apache.maven.plugin.surefire.util; /* * 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. */ import java.util.HashSet; import java.util.Set; import javax.annotation.Nullable; import org.apache.maven.shared.utils.io.SelectorUtils; import static org.apache.maven.plugin.surefire.util.ScannerUtil.convertSlashToSystemFileSeparator; /** * filters file names by a given collection of class name patterns * */ @Deprecated public class SpecificFileFilter { private Set names; public SpecificFileFilter( @Nullable String[] classNames ) { if ( classNames != null && classNames.length > 0 ) { this.names = new HashSet(); for ( String name : classNames ) { names.add( convertSlashToSystemFileSeparator( name ) ); } } } public boolean accept( @Nullable String resourceName ) { // If the tests enumeration is empty, allow anything. if ( names != null && !names.isEmpty() ) { for ( String pattern : names ) { // This is the same utility used under the covers in the plexus DirectoryScanner, and // therefore in the surefire DefaultDirectoryScanner implementation. if ( SelectorUtils.matchPath( pattern, resourceName, true ) ) { return true; } } return false; } return true; } } maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/surefire/000077500000000000000000000000001330756104600321705ustar00rootroot00000000000000providerapi/000077500000000000000000000000001330756104600344355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/surefireServiceLoader.java000066400000000000000000000136601330756104600400350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/surefire/providerapipackage org.apache.maven.surefire.providerapi; /* * 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. */ import javax.annotation.Nonnull; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.lang.reflect.InvocationTargetException; import java.net.URL; import java.util.Enumeration; import java.util.HashSet; import java.util.Set; import static java.lang.Character.isJavaIdentifierPart; import static java.lang.Character.isJavaIdentifierStart; import static java.util.Collections.emptySet; import static org.apache.maven.surefire.util.ReflectionUtils.getConstructor; /** * SPI loader for Surefire/Failsafe should use {@link Thread#getContextClassLoader() current ClassLoader}. *
* The {@link java.util.ServiceLoader} embedded in JVM uses * {@link ClassLoader#getSystemClassLoader() System ClassLoader} and cannot be used in Surefire/Failsafe. * * @since 2.20 */ public final class ServiceLoader { @Nonnull @SuppressWarnings( "unchecked" ) public Set load( Class clazz, ClassLoader classLoader ) { try { Set implementations = new HashSet(); for ( String fullyQualifiedClassName : lookup( clazz, classLoader ) ) { Class implClass = classLoader.loadClass( fullyQualifiedClassName ); implementations.add( (T) getConstructor( implClass ).newInstance() ); } return implementations; } catch ( IOException e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } catch ( ClassNotFoundException e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } catch ( InvocationTargetException e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } catch ( InstantiationException e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } catch ( IllegalAccessException e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } } @Nonnull public Set lookup( Class clazz, ClassLoader classLoader ) throws IOException { final String resourceName = "META-INF/services/" + clazz.getName(); if ( classLoader == null ) { return emptySet(); } final Enumeration urls = classLoader.getResources( resourceName ); return lookupSpiImplementations( urls ); } /** * Method loadServices loads the services of a class that are * defined using the SPI mechanism. * * @param urlEnumeration The urls from the resource * @return The set of service provider names * @throws IOException When reading the streams fails */ @Nonnull @SuppressWarnings( "checkstyle:innerassignment" ) private static Set lookupSpiImplementations( final Enumeration urlEnumeration ) throws IOException { final Set names = new HashSet(); nextUrl: while ( urlEnumeration.hasMoreElements() ) { final URL url = urlEnumeration.nextElement(); final BufferedReader reader = getReader( url ); try { for ( String line; ( line = reader.readLine() ) != null; ) { int ci = line.indexOf( '#' ); if ( ci >= 0 ) { line = line.substring( 0, ci ); } line = line.trim(); int n = line.length(); if ( n == 0 ) { continue; // next line } if ( line.indexOf( ' ' ) >= 0 || line.indexOf( '\t' ) >= 0 ) { continue nextUrl; // next url } char cp = line.charAt( 0 ); // should use codePointAt but this was JDK1.3 if ( !isJavaIdentifierStart( cp ) ) { continue nextUrl; // next url } for ( int i = 1; i < n; i++ ) { cp = line.charAt( i ); // should use codePointAt but this was JDK1.3 if ( !isJavaIdentifierPart( cp ) && cp != '.' ) { continue nextUrl; // next url } } if ( !names.contains( line ) ) { names.add( line ); } } } finally { reader.close(); } } return names; } @Nonnull private static BufferedReader getReader( @Nonnull URL url ) throws IOException { final InputStream inputStream = url.openStream(); final InputStreamReader inputStreamReader = new InputStreamReader( inputStream ); return new BufferedReader( inputStreamReader ); } } maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/surefire/report/000077500000000000000000000000001330756104600335035ustar00rootroot00000000000000RunStatistics.java000066400000000000000000000053711330756104600371140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import org.apache.maven.plugin.surefire.report.TestSetStats; import org.apache.maven.surefire.suite.RunResult; /** * @author Kristian Rosenvold */ public class RunStatistics { private int completedCount; private int errors; private int failures; private int skipped; private int flakes; public synchronized boolean hadFailures() { return failures > 0; } public synchronized boolean hadErrors() { return errors > 0; } public synchronized int getCompletedCount() { return completedCount; } public synchronized int getSkipped() { return skipped; } public synchronized int getFailures() { return failures; } public synchronized int getErrors() { return errors; } public synchronized int getFlakes() { return flakes; } public synchronized void add( TestSetStats testSetStats ) { this.completedCount += testSetStats.getCompletedCount(); this.errors += testSetStats.getErrors(); this.failures += testSetStats.getFailures(); this.skipped += testSetStats.getSkipped(); } public synchronized void set( int completedCount, int errors, int failures, int skipped, int flakes ) { this.completedCount = completedCount; this.errors = errors; this.failures = failures; this.skipped = skipped; this.flakes = flakes; } public synchronized RunResult getRunResult() { return new RunResult( completedCount, errors, failures, skipped, flakes ); } public synchronized String getSummary() { String summary = "Tests run: " + completedCount + ", Failures: " + failures + ", Errors: " + errors + ", Skipped: " + skipped; if ( flakes > 0 ) { summary += ", Flakes: " + flakes; } return summary; } } maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/000077500000000000000000000000001330756104600243405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/000077500000000000000000000000001330756104600252615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/000077500000000000000000000000001330756104600260505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/000077500000000000000000000000001330756104600272715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600303775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/000077500000000000000000000000001330756104600316755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/000077500000000000000000000000001330756104600335215ustar00rootroot00000000000000AbstractSurefireMojoJava7PlusTest.java000066400000000000000000000413441330756104600430050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.surefire.log.PluginConsoleLogger; import org.apache.maven.surefire.booter.ClassLoaderConfiguration; import org.apache.maven.surefire.booter.Classpath; import org.apache.maven.surefire.booter.ModularClasspathConfiguration; import org.apache.maven.surefire.booter.StartupConfiguration; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.util.DefaultScanResult; import org.codehaus.plexus.languages.java.jpms.LocationManager; import org.codehaus.plexus.languages.java.jpms.ResolvePathsRequest; import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult; import org.codehaus.plexus.logging.Logger; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import java.io.File; import java.io.IOException; import java.nio.file.Path; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import static java.io.File.separatorChar; import static java.util.Arrays.asList; import static java.util.Collections.singleton; import static org.apache.commons.lang3.JavaVersion.JAVA_1_7; import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT; import static org.apache.maven.surefire.booter.SystemUtils.isBuiltInJava7AtLeast; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assume.assumeTrue; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.powermock.api.mockito.PowerMockito.doReturn; import static org.powermock.api.mockito.PowerMockito.doNothing; import static org.powermock.api.mockito.PowerMockito.mock; import static org.powermock.api.mockito.PowerMockito.mockStatic; import static org.powermock.api.mockito.PowerMockito.spy; import static org.powermock.api.mockito.PowerMockito.verifyPrivate; import static org.powermock.api.mockito.PowerMockito.verifyStatic; import static org.powermock.reflect.Whitebox.invokeMethod; /** * Test for {@link AbstractSurefireMojo}. */ @RunWith( PowerMockRunner.class ) @PrepareForTest( { AbstractSurefireMojo.class, ResolvePathsRequest.class } ) public class AbstractSurefireMojoJava7PlusTest { @Mock private LocationManager locationManager; @BeforeClass public static void withJava7Plus() { assumeTrue( JAVA_RECENT.atLeast( JAVA_1_7 ) ); } @Test public void shouldHaveStartupConfigForModularClasspath() throws Exception { AbstractSurefireMojo mojo = spy( new Mojo() ); doReturn( locationManager ) .when( mojo, "getLocationManager" ); Classpath testClasspath = new Classpath( asList( "non-modular.jar", "modular.jar", "target" + separatorChar + "classes", "junit.jar", "hamcrest.jar" ) ); doReturn( testClasspath ).when( mojo, "generateTestClasspath" ); doReturn( 1 ).when( mojo, "getEffectiveForkCount" ); doReturn( true ).when( mojo, "effectiveIsEnableAssertions" ); when( mojo.isChildDelegation() ).thenReturn( false ); when( mojo.getTestClassesDirectory() ).thenReturn( new File( "target" + separatorChar + "test-classes" ) ); DefaultScanResult scanResult = mock( DefaultScanResult.class ); when( scanResult.getClasses() ).thenReturn( asList( "org.apache.A", "org.apache.B" ) ); ClassLoaderConfiguration classLoaderConfiguration = new ClassLoaderConfiguration( false, true ); Classpath providerClasspath = new Classpath( singleton( "surefire-provider.jar" ) ); File moduleInfo = new File( "target" + separatorChar + "classes" + separatorChar + "module-info.class" ); @SuppressWarnings( "unchecked" ) ResolvePathsRequest req = mock( ResolvePathsRequest.class ); mockStatic( ResolvePathsRequest.class ); when( ResolvePathsRequest.withStrings( eq( testClasspath.getClassPath() ) ) ).thenReturn( req ); when( req.setMainModuleDescriptor( eq( moduleInfo.getAbsolutePath() ) ) ).thenReturn( req ); @SuppressWarnings( "unchecked" ) ResolvePathsResult res = mock( ResolvePathsResult.class ); when( res.getClasspathElements() ).thenReturn( asList( "non-modular.jar", "junit.jar", "hamcrest.jar" ) ); Map mod = new LinkedHashMap(); mod.put( "modular.jar", null ); mod.put( "target" + separatorChar + "classes", null ); when( res.getModulepathElements() ).thenReturn( mod ); when( locationManager.resolvePaths( eq( req ) ) ).thenReturn( res ); Logger logger = mock( Logger.class ); when( logger.isDebugEnabled() ).thenReturn( true ); doNothing().when( logger ).debug( anyString() ); when( mojo.getConsoleLogger() ).thenReturn( new PluginConsoleLogger( logger ) ); StartupConfiguration conf = invokeMethod( mojo, "newStartupConfigForModularClasspath", classLoaderConfiguration, providerClasspath, "org.asf.Provider", moduleInfo, scanResult ); verify( mojo, times( 1 ) ).effectiveIsEnableAssertions(); verify( mojo, times( 1 ) ).isChildDelegation(); verifyPrivate( mojo, times( 1 ) ).invoke( "generateTestClasspath" ); verify( mojo, times( 1 ) ).getEffectiveForkCount(); verify( mojo, times( 1 ) ).getTestClassesDirectory(); verify( scanResult, times( 1 ) ).getClasses(); verifyStatic( ResolvePathsRequest.class, times( 1 ) ); ResolvePathsRequest.withStrings( eq( testClasspath.getClassPath() ) ); verify( req, times( 1 ) ).setMainModuleDescriptor( eq( moduleInfo.getAbsolutePath() ) ); verify( res, times( 1 ) ).getClasspathElements(); verify( res, times( 1 ) ).getModulepathElements(); verify( locationManager, times( 1 ) ).resolvePaths( eq( req ) ); ArgumentCaptor argument = ArgumentCaptor.forClass( String.class ); verify( logger, times( 6 ) ).debug( argument.capture() ); assertThat( argument.getAllValues() ) .containsExactly( "test classpath: non-modular.jar junit.jar hamcrest.jar", "test modulepath: modular.jar target" + separatorChar + "classes", "provider classpath: surefire-provider.jar", "test(compact) classpath: non-modular.jar junit.jar hamcrest.jar", "test(compact) modulepath: modular.jar classes", "provider(compact) classpath: surefire-provider.jar" ); assertThat( conf ).isNotNull(); assertThat( conf.isShadefire() ).isFalse(); assertThat( conf.isProviderMainClass() ).isFalse(); assertThat( conf.isManifestOnlyJarRequestedAndUsable() ).isFalse(); assertThat( conf.getClassLoaderConfiguration() ).isSameAs( classLoaderConfiguration ); assertThat( conf.getProviderClassName() ).isEqualTo( "org.asf.Provider" ); assertThat( conf.getActualClassName() ).isEqualTo( "org.asf.Provider" ); assertThat( conf.getClasspathConfiguration() ).isNotNull(); assertThat( ( Object ) conf.getClasspathConfiguration().getTestClasspath() ) .isEqualTo( new Classpath( res.getClasspathElements() ) ); assertThat( ( Object ) conf.getClasspathConfiguration().getProviderClasspath() ).isSameAs( providerClasspath ); assertThat( conf.getClasspathConfiguration() ).isInstanceOf( ModularClasspathConfiguration.class ); ModularClasspathConfiguration mcc = ( ModularClasspathConfiguration ) conf.getClasspathConfiguration(); assertThat( mcc.getModularClasspath().getModuleDescriptor() ).isEqualTo( moduleInfo ); assertThat( mcc.getModularClasspath().getPackages() ).containsOnly( "org.apache" ); assertThat( mcc.getModularClasspath().getPatchFile() ) .isEqualTo( new File( "target" + separatorChar + "test-classes" ) ); assertThat( mcc.getModularClasspath().getModulePath() ) .containsExactly( "modular.jar", "target" + separatorChar + "classes" ); assertThat( ( Object ) mcc.getTestClasspath() ).isEqualTo( new Classpath( res.getClasspathElements() ) ); } @Test public void shouldHaveTmpDirectory() throws IOException { Path path = ( Path ) AbstractSurefireMojo.createTmpDirectoryWithJava7( "surefire" ); assertThat( path ) .isNotNull(); assertThat( path.startsWith( System.getProperty( "java.io.tmpdir" ) ) ) .isTrue(); String dir = path.getName( path.getNameCount() - 1 ).toString(); assertThat( dir ) .startsWith( "surefire" ); assertThat( dir ) .matches( "^surefire[\\d]+$" ); } @Test public void shouldHaveTmpDirectoryName() throws IOException { String dir = AbstractSurefireMojo.createTmpDirectoryNameWithJava7( "surefire" ); assertThat( dir ) .isNotNull(); assertThat( dir ) .startsWith( "surefire" ); assertThat( dir ) .matches( "^surefire[\\d]+$" ); } @Test public void shouldTestIsJava7() { assertThat( isBuiltInJava7AtLeast() ) .isTrue(); } public static class Mojo extends AbstractSurefireMojo { @Override protected String getPluginName() { return null; } @Override protected int getRerunFailingTestsCount() { return 0; } @Override public boolean isSkipTests() { return false; } @Override public void setSkipTests( boolean skipTests ) { } @Override public boolean isSkipExec() { return false; } @Override public void setSkipExec( boolean skipExec ) { } @Override public boolean isSkip() { return false; } @Override public void setSkip( boolean skip ) { } @Override public File getBasedir() { return null; } @Override public void setBasedir( File basedir ) { } @Override public File getTestClassesDirectory() { return null; } @Override public void setTestClassesDirectory( File testClassesDirectory ) { } @Override public File getClassesDirectory() { return null; } @Override public void setClassesDirectory( File classesDirectory ) { } @Override public File getReportsDirectory() { return null; } @Override public void setReportsDirectory( File reportsDirectory ) { } @Override public String getTest() { return null; } @Override public void setTest( String test ) { } @Override public List getIncludes() { return null; } @Override public File getIncludesFile() { return null; } @Override public void setIncludes( List includes ) { } @Override public boolean isPrintSummary() { return false; } @Override public void setPrintSummary( boolean printSummary ) { } @Override public String getReportFormat() { return null; } @Override public void setReportFormat( String reportFormat ) { } @Override public boolean isUseFile() { return false; } @Override public void setUseFile( boolean useFile ) { } @Override public String getDebugForkedProcess() { return null; } @Override public void setDebugForkedProcess( String debugForkedProcess ) { } @Override public int getForkedProcessTimeoutInSeconds() { return 0; } @Override public void setForkedProcessTimeoutInSeconds( int forkedProcessTimeoutInSeconds ) { } @Override public int getForkedProcessExitTimeoutInSeconds() { return 0; } @Override public void setForkedProcessExitTimeoutInSeconds( int forkedProcessTerminationTimeoutInSeconds ) { } @Override public double getParallelTestsTimeoutInSeconds() { return 0; } @Override public void setParallelTestsTimeoutInSeconds( double parallelTestsTimeoutInSeconds ) { } @Override public double getParallelTestsTimeoutForcedInSeconds() { return 0; } @Override public void setParallelTestsTimeoutForcedInSeconds( double parallelTestsTimeoutForcedInSeconds ) { } @Override public boolean isUseSystemClassLoader() { return false; } @Override public void setUseSystemClassLoader( boolean useSystemClassLoader ) { } @Override public boolean isUseManifestOnlyJar() { return false; } @Override public void setUseManifestOnlyJar( boolean useManifestOnlyJar ) { } @Override public String getEncoding() { return null; } @Override public void setEncoding( String encoding ) { } @Override public Boolean getFailIfNoSpecifiedTests() { return null; } @Override public void setFailIfNoSpecifiedTests( boolean failIfNoSpecifiedTests ) { } @Override public int getSkipAfterFailureCount() { return 0; } @Override public String getShutdown() { return null; } @Override public File getExcludesFile() { return null; } @Override protected List suiteXmlFiles() { return null; } @Override protected boolean hasSuiteXmlFiles() { return false; } @Override public File[] getSuiteXmlFiles() { return new File[0]; } @Override public void setSuiteXmlFiles( File[] suiteXmlFiles ) { } @Override public String getRunOrder() { return null; } @Override public void setRunOrder( String runOrder ) { } @Override protected void handleSummary( RunResult summary, Exception firstForkException ) throws MojoExecutionException, MojoFailureException { } @Override protected boolean isSkipExecution() { return false; } @Override protected String[] getDefaultIncludes() { return new String[0]; } @Override protected String getReportSchemaLocation() { return null; } @Override protected Artifact getMojoArtifact() { return null; } } } AbstractSurefireMojoTest.java000066400000000000000000000426261330756104600412540ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.handler.ArtifactHandler; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.surefire.log.PluginConsoleLogger; import org.apache.maven.project.MavenProject; import org.apache.maven.surefire.booter.ClassLoaderConfiguration; import org.apache.maven.surefire.booter.Classpath; import org.apache.maven.surefire.booter.StartupConfiguration; import org.apache.maven.surefire.suite.RunResult; import org.codehaus.plexus.logging.Logger; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import java.io.File; import java.io.IOException; import java.util.HashSet; import java.util.List; import java.util.Set; import static java.io.File.separatorChar; import static java.util.Arrays.asList; import static java.util.Collections.singleton; import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS; import static org.fest.assertions.Assertions.assertThat; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.when; import static org.mockito.Mockito.verify; import static org.powermock.api.mockito.PowerMockito.doNothing; import static org.powermock.api.mockito.PowerMockito.doReturn; import static org.powermock.api.mockito.PowerMockito.mock; import static org.powermock.api.mockito.PowerMockito.spy; import static org.powermock.api.mockito.PowerMockito.verifyPrivate; import static org.powermock.reflect.Whitebox.invokeMethod; /** * Test for {@link AbstractSurefireMojo}. */ @RunWith( PowerMockRunner.class ) @PrepareForTest( AbstractSurefireMojo.class ) public class AbstractSurefireMojoTest { private final Mojo mojo = new Mojo(); @Test public void shouldGenerateTestClasspath() throws Exception { AbstractSurefireMojo mojo = spy( this.mojo ); when( mojo.getClassesDirectory() ).thenReturn( new File( "target" + separatorChar + "classes" ) ); when( mojo.getTestClassesDirectory() ).thenReturn( new File( "target" + separatorChar + "test-classes" ) ); when( mojo.getClasspathDependencyScopeExclude() ).thenReturn( "runtime" ); when( mojo.getClasspathDependencyExcludes() ).thenReturn( new String[]{ "g3:a3" } ); doReturn( mock( Artifact.class ) ).when( mojo, "getTestNgArtifact" ); doNothing().when( mojo, "addTestNgUtilsArtifacts", any() ); Set artifacts = new HashSet(); Artifact a1 = mock( Artifact.class ); when( a1.getGroupId() ).thenReturn( "g1" ); when( a1.getArtifactId() ).thenReturn( "a1" ); when( a1.getVersion() ).thenReturn( "1" ); when( a1.getScope() ).thenReturn( "runtime" ); when( a1.getDependencyConflictId() ).thenReturn( "g1:a1:jar" ); when( a1.getId() ).thenReturn( "g1:a1:jar:1" ); artifacts.add( a1 ); ArtifactHandler artifactHandler = mock( ArtifactHandler.class ); when( artifactHandler.isAddedToClasspath() ).thenReturn( true ); Artifact a2 = mock( Artifact.class ); when( a2.getGroupId() ).thenReturn( "g2" ); when( a2.getArtifactId() ).thenReturn( "a2" ); when( a2.getVersion() ).thenReturn( "2" ); when( a2.getScope() ).thenReturn( "test" ); when( a2.getDependencyConflictId() ).thenReturn( "g2:a2:jar" ); when( a2.getId() ).thenReturn( "g2:a2:jar:2" ); when( a2.getFile() ).thenReturn( new File( "a2-2.jar" ) ); when( a2.getArtifactHandler() ).thenReturn( artifactHandler ); artifacts.add( a2 ); Artifact a3 = mock( Artifact.class ); when( a3.getGroupId() ).thenReturn( "g3" ); when( a3.getArtifactId() ).thenReturn( "a3" ); when( a3.getVersion() ).thenReturn( "3" ); when( a3.getScope() ).thenReturn( "test" ); when( a3.getDependencyConflictId() ).thenReturn( "g3:a3:jar" ); when( a3.getId() ).thenReturn( "g3:a3:jar:3" ); when( a3.getFile() ).thenReturn( new File( "a3-3.jar" ) ); when( a3.getArtifactHandler() ).thenReturn( artifactHandler ); artifacts.add( a3 ); MavenProject project = mock( MavenProject.class ); when( project.getArtifacts() ).thenReturn( artifacts ); when( mojo.getProject() ).thenReturn( project ); Classpath cp = invokeMethod( mojo, "generateTestClasspath" ); verifyPrivate( mojo, times( 1 ) ).invoke( "generateTestClasspath" ); verify( mojo, times( 1 ) ).getClassesDirectory(); verify( mojo, times( 1 ) ).getTestClassesDirectory(); verify( mojo, times( 3 ) ).getClasspathDependencyScopeExclude(); verify( mojo, times( 2 ) ).getClasspathDependencyExcludes(); verify( artifactHandler, times( 1 ) ).isAddedToClasspath(); verifyPrivate( mojo, times( 1 ) ).invoke( "getTestNgArtifact" ); verifyPrivate( mojo, times( 1 ) ).invoke( "addTestNgUtilsArtifacts", eq( cp.getClassPath() ) ); assertThat( cp.getClassPath() ).hasSize( 3 ); assertThat( cp.getClassPath().get( 0 ) ).endsWith( "test-classes" ); assertThat( cp.getClassPath().get( 1 ) ).endsWith( "classes" ); assertThat( cp.getClassPath().get( 2 ) ).endsWith( "a2-2.jar" ); } @Test public void shouldHaveStartupConfigForNonModularClasspath() throws Exception { AbstractSurefireMojo mojo = spy( this.mojo ); Classpath testClasspath = new Classpath( asList( "junit.jar", "hamcrest.jar" ) ); doReturn( testClasspath ).when( mojo, "generateTestClasspath" ); doReturn( 1 ).when( mojo, "getEffectiveForkCount" ); doReturn( true ).when( mojo, "effectiveIsEnableAssertions" ); when( mojo.isChildDelegation() ).thenReturn( false ); ClassLoaderConfiguration classLoaderConfiguration = new ClassLoaderConfiguration( false, true ); Classpath providerClasspath = new Classpath( singleton( "surefire-provider.jar" ) ); Classpath inprocClasspath = new Classpath( asList( "surefire-api.jar", "surefire-common.jar", "surefire-provider.jar" ) ); Logger logger = mock( Logger.class ); when( logger.isDebugEnabled() ).thenReturn( true ); doNothing().when( logger ).debug( anyString() ); when( mojo.getConsoleLogger() ).thenReturn( new PluginConsoleLogger( logger ) ); StartupConfiguration conf = invokeMethod( mojo, "newStartupConfigForNonModularClasspath", classLoaderConfiguration, providerClasspath, inprocClasspath, "org.asf.Provider" ); verify( mojo, times( 1 ) ).effectiveIsEnableAssertions(); verify( mojo, times( 1 ) ).isChildDelegation(); verifyPrivate( mojo, times( 1 ) ).invoke( "generateTestClasspath" ); verify( mojo, times( 1 ) ).getEffectiveForkCount(); verify( logger, times( 4 ) ).isDebugEnabled(); ArgumentCaptor argument = ArgumentCaptor.forClass( String.class ); verify( logger, times( 4 ) ).debug( argument.capture() ); assertThat( argument.getAllValues() ) .containsExactly( "test classpath: junit.jar hamcrest.jar", "provider classpath: surefire-provider.jar", "test(compact) classpath: junit.jar hamcrest.jar", "provider(compact) classpath: surefire-provider.jar" ); assertThat( conf.getClassLoaderConfiguration() ) .isSameAs( classLoaderConfiguration ); assertThat( ( Object ) conf.getClasspathConfiguration().getTestClasspath() ) .isSameAs( testClasspath ); assertThat( ( Object ) conf.getClasspathConfiguration().getProviderClasspath() ) .isSameAs( providerClasspath ); assertThat( ( Object ) conf.getClasspathConfiguration().isClassPathConfig() ) .isEqualTo( true ); assertThat( ( Object ) conf.getClasspathConfiguration().isModularPathConfig() ) .isEqualTo( false ); assertThat( ( Object ) conf.getClasspathConfiguration().isEnableAssertions() ) .isEqualTo( true ); assertThat( conf.getProviderClassName() ) .isEqualTo( "org.asf.Provider" ); } @Test public void shouldExistTmpDirectory() throws IOException { String systemTmpDir = System.getProperty( "java.io.tmpdir" ); String usrDir = new File( System.getProperty( "user.dir" ) ).getCanonicalPath(); String tmpDir = "surefireX" + System.currentTimeMillis(); //noinspection ResultOfMethodCallIgnored new File( systemTmpDir, tmpDir ).delete(); File targetDir = new File( usrDir, "target" ); //noinspection ResultOfMethodCallIgnored new File( targetDir, tmpDir ).delete(); AbstractSurefireMojo mojo = mock( AbstractSurefireMojo.class ); when( mojo.getTempDir() ).thenReturn( tmpDir ); when( mojo.getProjectBuildDirectory() ).thenReturn( targetDir ); when( mojo.createSurefireBootDirectoryInTemp() ).thenCallRealMethod(); when( mojo.createSurefireBootDirectoryInBuild() ).thenCallRealMethod(); when( mojo.getSurefireTempDir() ).thenCallRealMethod(); File bootDir = mojo.createSurefireBootDirectoryInTemp(); assertThat( bootDir ).isNotNull(); assertThat( bootDir ).isDirectory(); assertThat( new File( systemTmpDir, bootDir.getName() ) ).isDirectory(); assertThat( bootDir.getName() ) .startsWith( tmpDir ); File buildTmp = mojo.createSurefireBootDirectoryInBuild(); assertThat( buildTmp ).isNotNull(); assertThat( buildTmp ).isDirectory(); assertThat( buildTmp.getParentFile().getCanonicalFile().getParent() ).isEqualTo( usrDir ); assertThat( buildTmp.getName() ).isEqualTo( tmpDir ); File tmp = mojo.getSurefireTempDir(); assertThat( tmp ).isNotNull(); assertThat( tmp ).isDirectory(); assertThat( IS_OS_WINDOWS ? new File( systemTmpDir, bootDir.getName() ) : new File( targetDir, tmpDir ) ) .isDirectory(); } public static class Mojo extends AbstractSurefireMojo { @Override protected String getPluginName() { return null; } @Override protected int getRerunFailingTestsCount() { return 0; } @Override public boolean isSkipTests() { return false; } @Override public void setSkipTests( boolean skipTests ) { } @Override public boolean isSkipExec() { return false; } @Override public void setSkipExec( boolean skipExec ) { } @Override public boolean isSkip() { return false; } @Override public void setSkip( boolean skip ) { } @Override public File getBasedir() { return null; } @Override public void setBasedir( File basedir ) { } @Override public File getTestClassesDirectory() { return null; } @Override public void setTestClassesDirectory( File testClassesDirectory ) { } @Override public File getClassesDirectory() { return null; } @Override public void setClassesDirectory( File classesDirectory ) { } @Override public File getReportsDirectory() { return null; } @Override public void setReportsDirectory( File reportsDirectory ) { } @Override public String getTest() { return null; } @Override public void setTest( String test ) { } @Override public List getIncludes() { return null; } @Override public File getIncludesFile() { return null; } @Override public void setIncludes( List includes ) { } @Override public boolean isPrintSummary() { return false; } @Override public void setPrintSummary( boolean printSummary ) { } @Override public String getReportFormat() { return null; } @Override public void setReportFormat( String reportFormat ) { } @Override public boolean isUseFile() { return false; } @Override public void setUseFile( boolean useFile ) { } @Override public String getDebugForkedProcess() { return null; } @Override public void setDebugForkedProcess( String debugForkedProcess ) { } @Override public int getForkedProcessTimeoutInSeconds() { return 0; } @Override public void setForkedProcessTimeoutInSeconds( int forkedProcessTimeoutInSeconds ) { } @Override public int getForkedProcessExitTimeoutInSeconds() { return 0; } @Override public void setForkedProcessExitTimeoutInSeconds( int forkedProcessTerminationTimeoutInSeconds ) { } @Override public double getParallelTestsTimeoutInSeconds() { return 0; } @Override public void setParallelTestsTimeoutInSeconds( double parallelTestsTimeoutInSeconds ) { } @Override public double getParallelTestsTimeoutForcedInSeconds() { return 0; } @Override public void setParallelTestsTimeoutForcedInSeconds( double parallelTestsTimeoutForcedInSeconds ) { } @Override public boolean isUseSystemClassLoader() { return false; } @Override public void setUseSystemClassLoader( boolean useSystemClassLoader ) { } @Override public boolean isUseManifestOnlyJar() { return false; } @Override public void setUseManifestOnlyJar( boolean useManifestOnlyJar ) { } @Override public String getEncoding() { return null; } @Override public void setEncoding( String encoding ) { } @Override public Boolean getFailIfNoSpecifiedTests() { return null; } @Override public void setFailIfNoSpecifiedTests( boolean failIfNoSpecifiedTests ) { } @Override public int getSkipAfterFailureCount() { return 0; } @Override public String getShutdown() { return null; } @Override public File getExcludesFile() { return null; } @Override protected List suiteXmlFiles() { return null; } @Override protected boolean hasSuiteXmlFiles() { return false; } @Override public File[] getSuiteXmlFiles() { return new File[0]; } @Override public void setSuiteXmlFiles( File[] suiteXmlFiles ) { } @Override public String getRunOrder() { return null; } @Override public void setRunOrder( String runOrder ) { } @Override protected void handleSummary( RunResult summary, Exception firstForkException ) throws MojoExecutionException, MojoFailureException { } @Override protected boolean isSkipExecution() { return false; } @Override protected String[] getDefaultIncludes() { return new String[0]; } @Override protected String getReportSchemaLocation() { return null; } @Override protected Artifact getMojoArtifact() { return null; } } } DataZT1A.java000066400000000000000000000015601330756104600356200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/* * 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. */ package org.apache.maven.plugin.surefire; public class DataZT1A { } DataZT2A.java000066400000000000000000000015611330756104600356220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/* * 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. */ package org.apache.maven.plugin.surefire; public class DataZT2A { } DataZT3A.java000066400000000000000000000015611330756104600356230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/* * 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. */ package org.apache.maven.plugin.surefire; public class DataZT3A { } MojoMocklessTest.java000066400000000000000000000404321330756104600375550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DefaultArtifact; import org.apache.maven.artifact.handler.ArtifactHandler; import org.apache.maven.artifact.handler.DefaultArtifactHandler; import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.util.DefaultScanResult; import org.junit.Test; import java.io.File; import java.io.FileOutputStream; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; import static org.fest.assertions.Assertions.assertThat; public class MojoMocklessTest { @Test public void scanDependenciesShouldReturnNull() throws MojoFailureException { Mojo mojo = new Mojo( null, null ); DefaultScanResult result = mojo.scanDependencies(); assertThat( result ) .isNull(); } @Test public void scanDependenciesShouldReturnNullAfterMissingBuildArtifact() throws MojoFailureException { VersionRange version = VersionRange.createFromVersion( "1.0" ); ArtifactHandler handler = new DefaultArtifactHandler(); Artifact testDeps = new DefaultArtifact( "g", "a", version, "compile", "jar", null, handler ); List projectTestArtifacts = singletonList( testDeps ); String[] dependenciesToScan = { "g:a" }; Mojo mojo = new Mojo( projectTestArtifacts, dependenciesToScan ); DefaultScanResult result = mojo.scanDependencies(); assertThat( result ) .isNull(); } @Test public void scanDependenciesShouldReturnNullWithWAR() throws MojoFailureException { VersionRange version = VersionRange.createFromVersion( "1.0" ); ArtifactHandler handler = new DefaultArtifactHandler(); Artifact testDeps = new DefaultArtifact( "g", "a", version, "compile", "war", null, handler ); testDeps.setFile( new File( new File( "target" ), "a-1.0.war" ) ); List projectTestArtifacts = singletonList( testDeps ); String[] dependenciesToScan = { "g:a" }; Mojo mojo = new Mojo( projectTestArtifacts, dependenciesToScan ); DefaultScanResult result = mojo.scanDependencies(); assertThat( result ) .isNull(); } @Test public void scanDependenciesShouldReturnNullWithExistingWAR() throws Exception { VersionRange version = VersionRange.createFromVersion( "1.0" ); ArtifactHandler handler = new DefaultArtifactHandler(); Artifact testDeps = new DefaultArtifact( "g", "a", version, "compile", "war", null, handler ); File artifactFile = File.createTempFile( "surefire", ".war" ); testDeps.setFile( artifactFile ); List projectTestArtifacts = singletonList( testDeps ); String[] dependenciesToScan = { "g:a" }; Mojo mojo = new Mojo( projectTestArtifacts, dependenciesToScan ); DefaultScanResult result = mojo.scanDependencies(); assertThat( result ) .isNull(); } @Test public void scanDependenciesShouldReturnClassWithExistingTestJAR() throws Exception { VersionRange version = VersionRange.createFromVersion( "1.0" ); ArtifactHandler handler = new DefaultArtifactHandler(); Artifact testDeps = new DefaultArtifact( "g", "a", version, "compile", "test-jar", null, handler ); File artifactFile = File.createTempFile( "surefire", ".jar" ); testDeps.setFile( artifactFile ); ZipOutputStream os = new ZipOutputStream( new FileOutputStream( artifactFile ) ); os.putNextEntry( new ZipEntry( "pkg/" ) ); os.closeEntry(); os.putNextEntry( new ZipEntry( "pkg/MyTest.class" ) ); os.closeEntry(); os.finish(); os.close(); List projectTestArtifacts = singletonList( testDeps ); String[] dependenciesToScan = { "g:a" }; Mojo mojo = new Mojo( projectTestArtifacts, dependenciesToScan ); DefaultScanResult result = mojo.scanDependencies(); assertThat( result ) .isNotNull(); assertThat( result.isEmpty() ) .isFalse(); assertThat( result.getClasses() ) .contains( "pkg.MyTest" ); } @Test public void scanDependenciesShouldReturnNullWithEmptyTestJAR() throws Exception { VersionRange version = VersionRange.createFromVersion( "1.0" ); ArtifactHandler handler = new DefaultArtifactHandler(); Artifact testDeps = new DefaultArtifact( "g", "a", version, "compile", "jar", null, handler ); File artifactFile = File.createTempFile( "surefire", ".jar" ); testDeps.setFile( artifactFile ); ZipOutputStream os = new ZipOutputStream( new FileOutputStream( artifactFile ) ); os.putNextEntry( new ZipEntry( "pkg/" ) ); os.closeEntry(); os.finish(); os.close(); List projectTestArtifacts = singletonList( testDeps ); String[] dependenciesToScan = { "g:a" }; Mojo mojo = new Mojo( projectTestArtifacts, dependenciesToScan ); DefaultScanResult result = mojo.scanDependencies(); assertThat( result ) .isNotNull(); assertThat( result.isEmpty() ) .isTrue(); } @Test public void scanDependenciesShouldReturnClassWithDirectory() throws Exception { VersionRange version = VersionRange.createFromVersion( "1.0" ); ArtifactHandler handler = new DefaultArtifactHandler(); Artifact testDeps = new DefaultArtifact( "g", "a", version, "compile", "test-jar", null, handler ); File artifactFile = File.createTempFile( "surefire", "-classes" ); String classDir = artifactFile.getCanonicalPath(); assertThat( artifactFile.delete() ).isTrue(); File classes = new File( classDir ); assertThat( classes.mkdir() ).isTrue(); testDeps.setFile( classes ); assertThat( new File( classes, "AnotherTest.class" ).createNewFile() ) .isTrue(); List projectTestArtifacts = singletonList( testDeps ); String[] dependenciesToScan = { "g:a" }; Mojo mojo = new Mojo( projectTestArtifacts, dependenciesToScan ); DefaultScanResult result = mojo.scanDependencies(); assertThat( result ) .isNotNull(); assertThat( result.isEmpty() ) .isFalse(); assertThat( result.getClasses() ) .contains( "AnotherTest" ); } @Test public void scanMultipleDependencies() throws Exception { VersionRange version = VersionRange.createFromVersion( "1.0" ); ArtifactHandler handler = new DefaultArtifactHandler(); Artifact testDep1 = new DefaultArtifact( "g", "x", version, "compile", "jar", null, handler ); File artifactFile1 = File.createTempFile( "surefire", "-classes" ); String classDir = artifactFile1.getCanonicalPath(); assertThat( artifactFile1.delete() ).isTrue(); File classes = new File( classDir ); assertThat( classes.mkdir() ).isTrue(); testDep1.setFile( classes ); assertThat( new File( classes, "AnotherTest.class" ).createNewFile() ) .isTrue(); Artifact testDep2 = new DefaultArtifact( "g", "a", version, "test", "jar", null, handler ); File artifactFile2 = File.createTempFile( "surefire", ".jar" ); testDep2.setFile( artifactFile2 ); ZipOutputStream os = new ZipOutputStream( new FileOutputStream( artifactFile2 ) ); os.putNextEntry( new ZipEntry( "pkg/" ) ); os.closeEntry(); os.putNextEntry( new ZipEntry( "pkg/MyTest.class" ) ); os.closeEntry(); os.finish(); os.close(); List projectTestArtifacts = asList( testDep1, testDep2 ); String[] dependenciesToScan = { "g:a" }; Mojo mojo = new Mojo( projectTestArtifacts, dependenciesToScan ); DefaultScanResult result = mojo.scanDependencies(); assertThat( result ) .isNotNull(); assertThat( result.isEmpty() ) .isFalse(); assertThat( result.getClasses() ) .hasSize( 1 ); assertThat( result.getClasses() ) .contains( "pkg.MyTest" ); } private final static class Mojo extends AbstractSurefireMojo { private final List projectTestArtifacts; private final String[] dependenciesToScan; Mojo( List projectTestArtifacts, String[] dependenciesToScan ) { this.projectTestArtifacts = projectTestArtifacts; this.dependenciesToScan = dependenciesToScan; } @Override protected String getPluginName() { return null; } @Override protected int getRerunFailingTestsCount() { return 0; } @Override public boolean isSkipTests() { return false; } @Override public void setSkipTests( boolean skipTests ) { } @Override public boolean isSkipExec() { return false; } @Override public void setSkipExec( boolean skipExec ) { } @Override public boolean isSkip() { return false; } @Override public void setSkip( boolean skip ) { } @Override public File getBasedir() { return null; } @Override public void setBasedir( File basedir ) { } @Override public File getTestClassesDirectory() { return null; } @Override public void setTestClassesDirectory( File testClassesDirectory ) { } @Override public File getClassesDirectory() { return null; } @Override public void setClassesDirectory( File classesDirectory ) { } @Override public File getReportsDirectory() { return null; } @Override public void setReportsDirectory( File reportsDirectory ) { } @Override public String getTest() { return null; } @Override public void setTest( String test ) { } @Override public List getIncludes() { return null; } @Override public File getIncludesFile() { return null; } @Override public void setIncludes( List includes ) { } @Override public boolean isPrintSummary() { return false; } @Override public void setPrintSummary( boolean printSummary ) { } @Override public String getReportFormat() { return null; } @Override public void setReportFormat( String reportFormat ) { } @Override public boolean isUseFile() { return false; } @Override public void setUseFile( boolean useFile ) { } @Override public String getDebugForkedProcess() { return null; } @Override public void setDebugForkedProcess( String debugForkedProcess ) { } @Override public int getForkedProcessTimeoutInSeconds() { return 0; } @Override public void setForkedProcessTimeoutInSeconds( int forkedProcessTimeoutInSeconds ) { } @Override public int getForkedProcessExitTimeoutInSeconds() { return 0; } @Override public void setForkedProcessExitTimeoutInSeconds( int forkedProcessTerminationTimeoutInSeconds ) { } @Override public double getParallelTestsTimeoutInSeconds() { return 0; } @Override public void setParallelTestsTimeoutInSeconds( double parallelTestsTimeoutInSeconds ) { } @Override public double getParallelTestsTimeoutForcedInSeconds() { return 0; } @Override public void setParallelTestsTimeoutForcedInSeconds( double parallelTestsTimeoutForcedInSeconds ) { } @Override public boolean isUseSystemClassLoader() { return false; } @Override public void setUseSystemClassLoader( boolean useSystemClassLoader ) { } @Override public boolean isUseManifestOnlyJar() { return false; } @Override public void setUseManifestOnlyJar( boolean useManifestOnlyJar ) { } @Override public String getEncoding() { return null; } @Override public void setEncoding( String encoding ) { } @Override public Boolean getFailIfNoSpecifiedTests() { return null; } @Override public void setFailIfNoSpecifiedTests( boolean failIfNoSpecifiedTests ) { } @Override public int getSkipAfterFailureCount() { return 0; } @Override public String getShutdown() { return null; } @Override public File getExcludesFile() { return null; } @Override protected List suiteXmlFiles() { return null; } @Override protected boolean hasSuiteXmlFiles() { return false; } @Override public File[] getSuiteXmlFiles() { return new File[0]; } @Override public void setSuiteXmlFiles( File[] suiteXmlFiles ) { } @Override public String getRunOrder() { return null; } @Override public void setRunOrder( String runOrder ) { } @Override public String[] getDependenciesToScan() { return dependenciesToScan; } @Override protected void handleSummary( RunResult summary, Exception firstForkException ) throws MojoExecutionException, MojoFailureException { } @Override protected boolean isSkipExecution() { return false; } @Override protected String[] getDefaultIncludes() { return new String[0]; } @Override protected String getReportSchemaLocation() { return null; } @Override protected Artifact getMojoArtifact() { return null; } @Override List getProjectTestArtifacts() { return projectTestArtifacts; } } } SurefireHelperTest.java000066400000000000000000000061601330756104600400740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import org.junit.Test; import java.util.ArrayList; import java.util.List; import static java.util.Collections.addAll; import static java.util.Collections.singleton; import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS; import static org.apache.maven.plugin.surefire.SurefireHelper.escapeToPlatformPath; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assume.assumeTrue; /** * Test of {@link SurefireHelper}. */ public class SurefireHelperTest { @Test public void shouldBeThreeDumpFiles() { String[] dumps = SurefireHelper.getDumpFilesToPrint(); assertThat( dumps ).hasSize( 3 ); assertThat( dumps ).doesNotHaveDuplicates(); List onlyStrings = new ArrayList(); addAll( onlyStrings, dumps ); onlyStrings.removeAll( singleton( (String) null ) ); assertThat( onlyStrings ).hasSize( 3 ); } @Test public void shouldCloneDumpFiles() { String[] dumps1 = SurefireHelper.getDumpFilesToPrint(); String[] dumps2 = SurefireHelper.getDumpFilesToPrint(); assertThat( dumps1 ).isNotSameAs( dumps2 ); } @Test public void testConstants() { assertThat( SurefireHelper.DUMPSTREAM_FILENAME_FORMATTER ) .isEqualTo( SurefireHelper.DUMP_FILE_PREFIX + "%d.dumpstream" ); assertThat( String.format( SurefireHelper.DUMPSTREAM_FILENAME_FORMATTER, 5) ) .endsWith( "-jvmRun5.dumpstream" ); } @Test public void shouldEscapeWindowsPath() { assumeTrue( IS_OS_WINDOWS ); String root = "X:\\path\\to\\project\\"; String pathToJar = "target\\surefire\\surefirebooter4942721306300108667.jar"; int projectNameLength = 247 - root.length() - pathToJar.length(); StringBuilder projectFolder = new StringBuilder(); for ( int i = 0; i < projectNameLength; i++ ) { projectFolder.append( 'x' ); } String path = root + projectFolder + "\\" + pathToJar; String escaped = escapeToPlatformPath( path ); assertThat( escaped ).isEqualTo( "\\\\?\\" + path ); path = root + "\\" + pathToJar; escaped = escapeToPlatformPath( path ); assertThat( escaped ).isEqualTo( root + "\\" + pathToJar ); } } SurefirePropertiesTest.java000066400000000000000000000116751330756104600410200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import java.util.Enumeration; import java.util.Iterator; import java.util.Properties; import java.util.SortedSet; import java.util.TreeSet; import junit.framework.TestCase; import org.apache.maven.surefire.booter.KeyValueSource; import static java.util.Collections.list; /** * Tests the insertion-order preserving properties collection */ public class SurefirePropertiesTest extends TestCase { public void testKeys() throws Exception { SurefireProperties orderedProperties = new SurefireProperties( (KeyValueSource) null ); orderedProperties.setProperty( "abc", "1" ); orderedProperties.setProperty( "xyz", "1" ); orderedProperties.setProperty( "efg", "1" ); Enumeration keys = orderedProperties.keys(); assertEquals( "abc", keys.nextElement() ); assertEquals( "xyz", keys.nextElement() ); assertEquals( "efg", keys.nextElement() ); } public void testKeysReinsert() throws Exception { SurefireProperties orderedProperties = new SurefireProperties( (KeyValueSource) null ); orderedProperties.setProperty( "abc", "1" ); orderedProperties.setProperty( "xyz", "1" ); orderedProperties.setProperty( "efg", "1" ); orderedProperties.setProperty( "abc", "2" ); orderedProperties.remove( "xyz" ); orderedProperties.setProperty( "xyz", "1" ); Enumeration keys = orderedProperties.keys(); assertEquals( "abc", keys.nextElement() ); assertEquals( "efg", keys.nextElement() ); assertEquals( "xyz", keys.nextElement() ); } public void testConstructWithOther() { Properties src = new Properties(); src.setProperty( "a", "1" ); src.setProperty( "b", "2" ); SurefireProperties orderedProperties = new SurefireProperties( src ); // Cannot make assumptions about insertion order // keys() uses the items property, more reliable to test than size(), // which is based on the Properties class // see https://issues.apache.org/jira/browse/SUREFIRE-1445 assertEquals( src.size(), list( orderedProperties.keys() ).size() ); assertEquals( src.size(), size( orderedProperties.getStringKeySet().iterator() ) ); assertEquals( 2, orderedProperties.size() ); assertTrue( list( orderedProperties.keys() ).contains( "a" ) ); assertTrue( list( orderedProperties.keys() ).contains( "b" ) ); Iterator it = orderedProperties.getStringKeySet().iterator(); SortedSet keys = new TreeSet(); keys.add( it.next() ); keys.add( it.next() ); it = keys.iterator(); assertEquals( "a", it.next() ); assertEquals( "b", it.next() ); } public void testPutAll() { Properties src = new Properties(); src.setProperty( "a", "1" ); src.setProperty( "b", "2" ); SurefireProperties orderedProperties = new SurefireProperties(); orderedProperties.putAll( src ); // Cannot make assumptions about insertion order // keys() uses the items property, more reliable to test than size(), // which is based on the Properties class // see https://issues.apache.org/jira/browse/SUREFIRE-1445 assertEquals( src.size(), list( orderedProperties.keys() ).size() ); assertEquals( src.size(), size( orderedProperties.getStringKeySet().iterator() ) ); assertEquals( 2, orderedProperties.size() ); assertTrue( list( orderedProperties.keys() ).contains( "a" ) ); assertTrue( list( orderedProperties.keys() ).contains( "b" ) ); Iterator it = orderedProperties.getStringKeySet().iterator(); SortedSet keys = new TreeSet(); keys.add( it.next() ); keys.add( it.next() ); it = keys.iterator(); assertEquals( "a", it.next() ); assertEquals( "b", it.next() ); } private static int size( Iterator iterator ) { int count = 0; while ( iterator.hasNext() ) { iterator.next(); count++; } return count; } } SurefireReflectorTest.java000066400000000000000000000056061330756104600406060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.log.api.ConsoleLoggerDecorator; import org.apache.maven.plugin.surefire.log.api.PrintStreamLogger; import org.apache.maven.surefire.booter.IsolatedClassLoader; import org.apache.maven.surefire.booter.SurefireReflector; import org.junit.Before; import org.junit.Test; import static org.apache.maven.surefire.util.ReflectionUtils.getMethod; import static org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.CoreMatchers.sameInstance; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; /** * @author Tibor Digana (tibor17) * @see ConsoleLogger * @see SurefireReflector * @since 2.20 */ public class SurefireReflectorTest { private ConsoleLogger logger; private SurefireReflector reflector; @Before public void prepareData() { logger = spy( new PrintStreamLogger( System.out ) ); ClassLoader cl = new IsolatedClassLoader( Thread.currentThread().getContextClassLoader(), false, "role" ); reflector = new SurefireReflector( cl ); } @Test public void shouldProxyConsoleLogger() { Object mirror = reflector.createConsoleLogger( logger ); assertThat( mirror, is( notNullValue() ) ); assertThat( mirror.getClass().getInterfaces()[0].getName(), is( ConsoleLogger.class.getName() ) ); assertThat( mirror, is( not( sameInstance( (Object) logger ) ) ) ); assertThat( mirror, is( instanceOf( ConsoleLoggerDecorator.class ) ) ); invokeMethodWithArray( mirror, getMethod( mirror, "info", String.class ), "Hi There!" ); verify( logger, times( 1 ) ).info( "Hi There!" ); } } booterclient/000077500000000000000000000000001330756104600361335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefireBooterDeserializerProviderConfigurationTest.java000066400000000000000000000272431330756104600477060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import junit.framework.Assert; import junit.framework.TestCase; import org.apache.maven.surefire.booter.*; import org.apache.maven.surefire.cli.CommandLineOption; import org.apache.maven.surefire.report.ReporterConfiguration; import org.apache.maven.surefire.testset.*; import org.apache.maven.surefire.util.RunOrder; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.*; import static org.apache.maven.surefire.cli.CommandLineOption.LOGGING_LEVEL_DEBUG; import static org.apache.maven.surefire.cli.CommandLineOption.REACTOR_FAIL_FAST; import static org.apache.maven.surefire.cli.CommandLineOption.SHOW_ERRORS; /** * Performs roundtrip testing of serialization/deserialization of the ProviderConfiguration * * @author Kristian Rosenvold */ public class BooterDeserializerProviderConfigurationTest extends TestCase { public static final TypeEncodedValue aTestTyped = new TypeEncodedValue( String.class.getName(), "aTest" ); private static final String aUserRequestedTest = "aUserRequestedTest"; private static final String aUserRequestedTestMethod = "aUserRequestedTestMethod"; private static final int rerunFailingTestsCount = 3; private final List cli = Arrays.asList( LOGGING_LEVEL_DEBUG, SHOW_ERRORS, REACTOR_FAIL_FAST ); private static ClassLoaderConfiguration getForkConfiguration() { return new ClassLoaderConfiguration( true, false ); } // ProviderConfiguration methods public void testDirectoryScannerParams() throws IOException { File aDir = new File( "." ); List includes = new ArrayList(); List excludes = new ArrayList(); includes.add( "abc" ); includes.add( "cde" ); excludes.add( "xx1" ); excludes.add( "xx2" ); ClassLoaderConfiguration forkConfiguration = getForkConfiguration(); final StartupConfiguration testStartupConfiguration = getTestStartupConfiguration( forkConfiguration ); ProviderConfiguration providerConfiguration = getReloadedProviderConfiguration(); ProviderConfiguration read = saveAndReload( providerConfiguration, testStartupConfiguration, false ); Assert.assertEquals( aDir, read.getBaseDir() ); Assert.assertEquals( includes.get( 0 ), read.getIncludes().get( 0 ) ); Assert.assertEquals( includes.get( 1 ), read.getIncludes().get( 1 ) ); Assert.assertEquals( excludes.get( 0 ), read.getExcludes().get( 0 ) ); Assert.assertEquals( excludes.get( 1 ), read.getExcludes().get( 1 ) ); assertEquals( cli, providerConfiguration.getMainCliOptions() ); } public void testReporterConfiguration() throws IOException { DirectoryScannerParameters directoryScannerParameters = getDirectoryScannerParametersWithoutSpecificTests(); ClassLoaderConfiguration forkConfiguration = getForkConfiguration(); ProviderConfiguration providerConfiguration = getTestProviderConfiguration( directoryScannerParameters, false ); final StartupConfiguration testProviderConfiguration = getTestStartupConfiguration( forkConfiguration ); ProviderConfiguration reloaded = saveAndReload( providerConfiguration, testProviderConfiguration, false ); assertTrue( reloaded.getReporterConfiguration().isTrimStackTrace() ); assertNotNull( reloaded.getReporterConfiguration().getReportsDirectory() ); assertEquals( cli, providerConfiguration.getMainCliOptions() ); } public void testTestArtifact() throws IOException { ProviderConfiguration reloaded = getReloadedProviderConfiguration(); Assert.assertEquals( "5.0", reloaded.getTestArtifact().getVersion() ); Assert.assertEquals( "ABC", reloaded.getTestArtifact().getClassifier() ); assertEquals( cli, reloaded.getMainCliOptions() ); } public void testTestRequest() throws IOException { ProviderConfiguration reloaded = getReloadedProviderConfiguration(); TestRequest testSuiteDefinition = reloaded.getTestSuiteDefinition(); List suiteXmlFiles = testSuiteDefinition.getSuiteXmlFiles(); File[] expected = getSuiteXmlFiles(); Assert.assertEquals( expected[0], suiteXmlFiles.get( 0 ) ); Assert.assertEquals( expected[1], suiteXmlFiles.get( 1 ) ); Assert.assertEquals( getTestSourceDirectory(), testSuiteDefinition.getTestSourceDirectory() ); TestListResolver resolver = testSuiteDefinition.getTestListResolver(); Assert.assertNotNull( resolver ); Assert.assertFalse( resolver.isEmpty() ); Assert.assertEquals( aUserRequestedTest + "#" + aUserRequestedTestMethod, resolver.getPluginParameterTest() ); Assert.assertFalse( resolver.getIncludedPatterns().isEmpty() ); Assert.assertTrue( resolver.getExcludedPatterns().isEmpty() ); Assert.assertEquals( 1, resolver.getIncludedPatterns().size() ); ResolvedTest filter = resolver.getIncludedPatterns().iterator().next(); Assert.assertNotNull( filter ); Assert.assertEquals( "**/" + aUserRequestedTest, filter.getTestClassPattern() ); Assert.assertEquals( aUserRequestedTestMethod, filter.getTestMethodPattern() ); Assert.assertEquals( rerunFailingTestsCount, testSuiteDefinition.getRerunFailingTestsCount() ); assertEquals( cli, reloaded.getMainCliOptions() ); } public void testTestForFork() throws IOException { final ProviderConfiguration reloaded = getReloadedProviderConfiguration(); Assert.assertEquals( aTestTyped, reloaded.getTestForFork() ); assertEquals( cli, reloaded.getMainCliOptions() ); } public void testTestForForkWithMultipleFiles() throws IOException { final ProviderConfiguration reloaded = getReloadedProviderConfigurationForReadFromInStream(); Assert.assertNull( reloaded.getTestForFork() ); Assert.assertTrue( reloaded.isReadTestsFromInStream() ); assertEquals( cli, reloaded.getMainCliOptions() ); } public void testFailIfNoTests() throws IOException { ProviderConfiguration reloaded = getReloadedProviderConfiguration(); assertTrue( reloaded.isFailIfNoTests() ); assertEquals( cli, reloaded.getMainCliOptions() ); } private ProviderConfiguration getReloadedProviderConfigurationForReadFromInStream() throws IOException { return getReloadedProviderConfiguration( true ); } private ProviderConfiguration getReloadedProviderConfiguration() throws IOException { return getReloadedProviderConfiguration( false ); } private ProviderConfiguration getReloadedProviderConfiguration( boolean readTestsFromInStream ) throws IOException { DirectoryScannerParameters directoryScannerParameters = getDirectoryScannerParametersWithoutSpecificTests(); ClassLoaderConfiguration forkConfiguration = getForkConfiguration(); ProviderConfiguration booterConfiguration = getTestProviderConfiguration( directoryScannerParameters, readTestsFromInStream ); assertEquals( cli, booterConfiguration.getMainCliOptions() ); final StartupConfiguration testProviderConfiguration = getTestStartupConfiguration( forkConfiguration ); return saveAndReload( booterConfiguration, testProviderConfiguration, readTestsFromInStream ); } private DirectoryScannerParameters getDirectoryScannerParametersWithoutSpecificTests() { File aDir = new File( "." ); List includes = new ArrayList(); List excludes = new ArrayList(); includes.add( "abc" ); includes.add( "cde" ); excludes.add( "xx1" ); excludes.add( "xx2" ); return new DirectoryScannerParameters( aDir, includes, excludes, Collections.emptyList(), true, RunOrder.asString( RunOrder.DEFAULT ) ); } private ProviderConfiguration saveAndReload( ProviderConfiguration booterConfiguration, StartupConfiguration testProviderConfiguration, boolean readTestsFromInStream ) throws IOException { final ForkConfiguration forkConfiguration = ForkConfigurationTest.getForkConfiguration( (String) null ); PropertiesWrapper props = new PropertiesWrapper( new HashMap() ); BooterSerializer booterSerializer = new BooterSerializer( forkConfiguration ); Object test; if ( readTestsFromInStream ) { test = null; } else { test = "aTest"; } final File propsTest = booterSerializer.serialize( props, booterConfiguration, testProviderConfiguration, test, readTestsFromInStream, 51L ); BooterDeserializer booterDeserializer = new BooterDeserializer( new FileInputStream( propsTest ) ); assertEquals( 51L, (Object) booterDeserializer.getPluginPid() ); return booterDeserializer.deserialize(); } private ProviderConfiguration getTestProviderConfiguration( DirectoryScannerParameters directoryScannerParameters, boolean readTestsFromInStream ) { File cwd = new File( "." ); ReporterConfiguration reporterConfiguration = new ReporterConfiguration( cwd, true ); TestRequest testSuiteDefinition = new TestRequest( getSuiteXmlFileStrings(), getTestSourceDirectory(), new TestListResolver( aUserRequestedTest + "#aUserRequestedTestMethod" ), rerunFailingTestsCount ); RunOrderParameters runOrderParameters = new RunOrderParameters( RunOrder.DEFAULT, null ); return new ProviderConfiguration( directoryScannerParameters, runOrderParameters, true, reporterConfiguration, new TestArtifactInfo( "5.0", "ABC" ), testSuiteDefinition, new HashMap(), aTestTyped, readTestsFromInStream, cli, 0, Shutdown.DEFAULT, 0 ); } private StartupConfiguration getTestStartupConfiguration( ClassLoaderConfiguration classLoaderConfiguration ) { ClasspathConfiguration classpathConfiguration = new ClasspathConfiguration( true, true ); return new StartupConfiguration( "com.provider", classpathConfiguration, classLoaderConfiguration, false, false ); } private File getTestSourceDirectory() { return new File( "TestSrc" ); } private File[] getSuiteXmlFiles() { return new File[]{ new File( "A1" ), new File( "A2" ) }; } private List getSuiteXmlFileStrings() { return Arrays.asList( "A1", "A2" ); } } BooterDeserializerStartupConfigurationTest.java000066400000000000000000000163761330756104600475630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import junit.framework.TestCase; import org.apache.maven.surefire.booter.*; import org.apache.maven.surefire.cli.CommandLineOption; import org.apache.maven.surefire.report.ReporterConfiguration; import org.apache.maven.surefire.testset.*; import org.apache.maven.surefire.util.RunOrder; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import static org.apache.maven.surefire.cli.CommandLineOption.LOGGING_LEVEL_DEBUG; import static org.apache.maven.surefire.cli.CommandLineOption.REACTOR_FAIL_FAST; import static org.apache.maven.surefire.cli.CommandLineOption.SHOW_ERRORS; /** * Performs roundtrip testing of serialization/deserialization of The StartupConfiguration * * @author Kristian Rosenvold */ public class BooterDeserializerStartupConfigurationTest extends TestCase { private final ClasspathConfiguration classpathConfiguration = createClasspathConfiguration(); private final List cli = Arrays.asList( LOGGING_LEVEL_DEBUG, SHOW_ERRORS, REACTOR_FAIL_FAST ); public void testProvider() throws IOException { assertEquals( "com.provider", getReloadedStartupConfiguration().getProviderClassName() ); } public void testClassPathConfiguration() throws IOException { AbstractPathConfiguration reloadedClasspathConfiguration = getReloadedStartupConfiguration().getClasspathConfiguration(); assertTrue( reloadedClasspathConfiguration instanceof ClasspathConfiguration ); assertCpConfigEquals( classpathConfiguration, (ClasspathConfiguration) reloadedClasspathConfiguration ); } private void assertCpConfigEquals( ClasspathConfiguration expectedConfiguration, ClasspathConfiguration actualConfiguration ) { assertEquals( expectedConfiguration.getTestClasspath().getClassPath(), actualConfiguration.getTestClasspath().getClassPath() ); assertEquals( expectedConfiguration.isEnableAssertions(), actualConfiguration.isEnableAssertions() ); assertEquals( expectedConfiguration.isChildDelegation(), actualConfiguration.isChildDelegation() ); assertEquals( expectedConfiguration.getProviderClasspath(), actualConfiguration.getProviderClasspath() ); assertEquals( expectedConfiguration.getTestClasspath(), actualConfiguration.getTestClasspath() ); } public void testClassLoaderConfiguration() throws IOException { assertFalse( getReloadedStartupConfiguration().isManifestOnlyJarRequestedAndUsable() ); } public void testClassLoaderConfigurationTrues() throws IOException { final StartupConfiguration testStartupConfiguration = getTestStartupConfiguration( getManifestOnlyJarForkConfiguration() ); boolean current = testStartupConfiguration.isManifestOnlyJarRequestedAndUsable(); assertEquals( current, saveAndReload( testStartupConfiguration ).isManifestOnlyJarRequestedAndUsable() ); } private ClasspathConfiguration createClasspathConfiguration() { Classpath testClassPath = new Classpath( Arrays.asList( "CP1", "CP2" ) ); Classpath providerClasspath = new Classpath( Arrays.asList( "SP1", "SP2" ) ); return new ClasspathConfiguration( testClassPath, providerClasspath, Classpath.emptyClasspath(), true, true ); } public static ClassLoaderConfiguration getSystemClassLoaderConfiguration() { return new ClassLoaderConfiguration( true, false ); } public static ClassLoaderConfiguration getManifestOnlyJarForkConfiguration() { return new ClassLoaderConfiguration( true, true ); } private StartupConfiguration getReloadedStartupConfiguration() throws IOException { ClassLoaderConfiguration classLoaderConfiguration = getSystemClassLoaderConfiguration(); return saveAndReload( getTestStartupConfiguration( classLoaderConfiguration ) ); } private StartupConfiguration saveAndReload( StartupConfiguration startupConfiguration ) throws IOException { final ForkConfiguration forkConfiguration = ForkConfigurationTest.getForkConfiguration( (String) null ); PropertiesWrapper props = new PropertiesWrapper( new HashMap() ); BooterSerializer booterSerializer = new BooterSerializer( forkConfiguration ); String aTest = "aTest"; final File propsTest = booterSerializer.serialize( props, getProviderConfiguration(), startupConfiguration, aTest, false, null ); BooterDeserializer booterDeserializer = new BooterDeserializer( new FileInputStream( propsTest ) ); assertNull( booterDeserializer.getPluginPid() ); return booterDeserializer.getProviderConfiguration(); } private ProviderConfiguration getProviderConfiguration() { File cwd = new File( "." ); DirectoryScannerParameters directoryScannerParameters = new DirectoryScannerParameters( cwd, new ArrayList(), new ArrayList(), new ArrayList(), true, "hourly" ); ReporterConfiguration reporterConfiguration = new ReporterConfiguration( cwd, true ); TestRequest testSuiteDefinition = new TestRequest( Arrays.asList( getSuiteXmlFileStrings() ), getTestSourceDirectory(), new TestListResolver( "aUserRequestedTest#aUserRequestedTestMethod" )); RunOrderParameters runOrderParameters = new RunOrderParameters( RunOrder.DEFAULT, null ); return new ProviderConfiguration( directoryScannerParameters, runOrderParameters, true, reporterConfiguration, new TestArtifactInfo( "5.0", "ABC" ), testSuiteDefinition, new HashMap(), BooterDeserializerProviderConfigurationTest.aTestTyped, true, cli, 0, Shutdown.DEFAULT, 0 ); } private StartupConfiguration getTestStartupConfiguration( ClassLoaderConfiguration classLoaderConfiguration ) { return new StartupConfiguration( "com.provider", classpathConfiguration, classLoaderConfiguration, false, false ); } private File getTestSourceDirectory() { return new File( "TestSrc" ); } private String[] getSuiteXmlFileStrings() { return new String[]{ "A1", "A2" }; } } DefaultForkConfigurationTest.java000066400000000000000000000351571330756104600446070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.OutputStreamFlushableCommandline; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.util.Relocator; import org.apache.maven.surefire.booter.ClassLoaderConfiguration; import org.apache.maven.surefire.booter.Classpath; import org.apache.maven.surefire.booter.ClasspathConfiguration; import org.apache.maven.surefire.booter.ForkedBooter; import org.apache.maven.surefire.booter.StartupConfiguration; import org.apache.maven.surefire.booter.SurefireBooterForkException; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import javax.annotation.Nonnull; import java.io.File; import java.util.HashMap; import java.util.Map; import java.util.Properties; import static java.util.Collections.singleton; import static org.fest.assertions.Assertions.assertThat; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.powermock.api.mockito.PowerMockito.*; import static org.powermock.reflect.Whitebox.invokeMethod; /** * Unit tests for {@link DefaultForkConfiguration}. * * @author Tibor Digana (tibor17) * @since 2.21 */ @RunWith( PowerMockRunner.class ) @PrepareForTest( { DefaultForkConfiguration.class, Relocator.class } ) public class DefaultForkConfigurationTest { private Classpath booterClasspath; private File tempDirectory; private String debugLine; private File workingDirectory; private Properties modelProperties; private String argLine; private Map environmentVariables; private boolean debug; private int forkCount; private boolean reuseForks; private Platform pluginPlatform; private ConsoleLogger log; @Before public void setup() { booterClasspath = new Classpath( singleton( "provider.jar" ) ); tempDirectory = new File( "target/surefire" ); debugLine = ""; workingDirectory = new File( "." ); modelProperties = new Properties(); argLine = null; environmentVariables = new HashMap(); debug = true; forkCount = 2; reuseForks = true; pluginPlatform = new Platform(); log = mock( ConsoleLogger.class ); } @Test public void shouldBeNullArgLine() throws Exception { DefaultForkConfiguration config = new DefaultForkConfiguration( booterClasspath, tempDirectory, debugLine, workingDirectory, modelProperties, argLine, environmentVariables, debug, forkCount, reuseForks, pluginPlatform, log ) { @Override protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, @Nonnull String booterThatHasMainMethod, @Nonnull StartupConfiguration config ) throws SurefireBooterForkException { } }; DefaultForkConfiguration mockedConfig = spy( config ); String newArgLine = invokeMethod( mockedConfig, "newJvmArgLine", new Class[] { int.class }, 2 ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "interpolateArgLineWithPropertyExpressions" ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "extendJvmArgLine", eq( "" ) ); assertThat( newArgLine ).isEmpty(); } @Test public void shouldBeEmptyArgLine() throws Exception { argLine = ""; DefaultForkConfiguration config = new DefaultForkConfiguration( booterClasspath, tempDirectory, debugLine, workingDirectory, modelProperties, argLine, environmentVariables, debug, forkCount, reuseForks, pluginPlatform, log ) { @Override protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, @Nonnull String booterThatHasMainMethod, @Nonnull StartupConfiguration config ) throws SurefireBooterForkException { } }; DefaultForkConfiguration mockedConfig = spy( config ); String newArgLine = invokeMethod( mockedConfig, "newJvmArgLine", new Class[] { int.class }, 2 ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "interpolateArgLineWithPropertyExpressions" ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "extendJvmArgLine", eq( "" ) ); assertThat( newArgLine ).isEmpty(); } @Test public void shouldBeEmptyArgLineInsteadOfNewLines() throws Exception { argLine = "\n\r"; DefaultForkConfiguration config = new DefaultForkConfiguration( booterClasspath, tempDirectory, debugLine, workingDirectory, modelProperties, argLine, environmentVariables, debug, forkCount, reuseForks, pluginPlatform, log ) { @Override protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, @Nonnull String booterThatHasMainMethod, @Nonnull StartupConfiguration config ) throws SurefireBooterForkException { } }; DefaultForkConfiguration mockedConfig = spy( config ); String newArgLine = invokeMethod( mockedConfig, "newJvmArgLine", new Class[] { int.class }, 2 ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "interpolateArgLineWithPropertyExpressions" ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "extendJvmArgLine", eq( "" ) ); assertThat( newArgLine ).isEmpty(); } @Test public void shouldBeWithoutEscaping() throws Exception { argLine = "-Dfile.encoding=UTF-8"; DefaultForkConfiguration config = new DefaultForkConfiguration( booterClasspath, tempDirectory, debugLine, workingDirectory, modelProperties, argLine, environmentVariables, debug, forkCount, reuseForks, pluginPlatform, log ) { @Override protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, @Nonnull String booterThatHasMainMethod, @Nonnull StartupConfiguration config ) throws SurefireBooterForkException { } }; DefaultForkConfiguration mockedConfig = spy( config ); String newArgLine = invokeMethod( mockedConfig, "newJvmArgLine", new Class[] { int.class }, 2 ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "interpolateArgLineWithPropertyExpressions" ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "extendJvmArgLine", eq( "-Dfile.encoding=UTF-8" ) ); assertThat( newArgLine ).isEqualTo( "-Dfile.encoding=UTF-8" ); } @Test public void shouldBeWithEscaping() throws Exception { modelProperties.put( "encoding", "UTF-8" ); argLine = "-Dfile.encoding=@{encoding}"; DefaultForkConfiguration config = new DefaultForkConfiguration( booterClasspath, tempDirectory, debugLine, workingDirectory, modelProperties, argLine, environmentVariables, debug, forkCount, reuseForks, pluginPlatform, log ) { @Override protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, @Nonnull String booterThatHasMainMethod, @Nonnull StartupConfiguration config ) throws SurefireBooterForkException { } }; DefaultForkConfiguration mockedConfig = spy( config ); String newArgLine = invokeMethod( mockedConfig, "newJvmArgLine", new Class[] { int.class }, 2 ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "interpolateArgLineWithPropertyExpressions" ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "extendJvmArgLine", eq( "-Dfile.encoding=UTF-8" ) ); assertThat( newArgLine ).isEqualTo( "-Dfile.encoding=UTF-8" ); } @Test public void shouldBeWhitespaceInsteadOfNewLines() throws Exception { argLine = "a\n\rb"; DefaultForkConfiguration config = new DefaultForkConfiguration( booterClasspath, tempDirectory, debugLine, workingDirectory, modelProperties, argLine, environmentVariables, debug, forkCount, reuseForks, pluginPlatform, log ) { @Override protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, @Nonnull String booterThatHasMainMethod, @Nonnull StartupConfiguration config ) throws SurefireBooterForkException { } }; DefaultForkConfiguration mockedConfig = spy( config ); String newArgLine = invokeMethod( mockedConfig, "newJvmArgLine", new Class[] { int.class }, 2 ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "interpolateArgLineWithPropertyExpressions" ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "extendJvmArgLine", eq( "a b" ) ); assertThat( newArgLine ).isEqualTo( "a b" ); } @Test public void shouldEscapeThreadNumber() throws Exception { argLine = "-Dthread=${surefire.threadNumber}"; DefaultForkConfiguration config = new DefaultForkConfiguration( booterClasspath, tempDirectory, debugLine, workingDirectory, modelProperties, argLine, environmentVariables, debug, forkCount, reuseForks, pluginPlatform, log ) { @Override protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, @Nonnull String booterThatHasMainMethod, @Nonnull StartupConfiguration config ) throws SurefireBooterForkException { } }; DefaultForkConfiguration mockedConfig = spy( config ); String newArgLine = invokeMethod( mockedConfig, "newJvmArgLine", new Class[] { int.class }, 2 ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "interpolateArgLineWithPropertyExpressions" ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "extendJvmArgLine", eq( "-Dthread=" + forkCount ) ); assertThat( newArgLine ).isEqualTo( "-Dthread=" + forkCount ); } @Test public void shouldEscapeForkNumber() throws Exception { argLine = "-Dthread=${surefire.forkNumber}"; DefaultForkConfiguration config = new DefaultForkConfiguration( booterClasspath, tempDirectory, debugLine, workingDirectory, modelProperties, argLine, environmentVariables, debug, forkCount, reuseForks, pluginPlatform, log ) { @Override protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, @Nonnull String booterThatHasMainMethod, @Nonnull StartupConfiguration config ) throws SurefireBooterForkException { } }; DefaultForkConfiguration mockedConfig = spy( config ); String newArgLine = invokeMethod( mockedConfig, "newJvmArgLine", new Class[] { int.class }, 2 ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "interpolateArgLineWithPropertyExpressions" ); verifyPrivate( mockedConfig, times( 1 ) ).invoke( "extendJvmArgLine", eq( "-Dthread=" + forkCount ) ); assertThat( newArgLine ).isEqualTo( "-Dthread=" + forkCount ); } @Test public void shouldRelocateBooterClassWhenShadefire() throws Exception { ClassLoaderConfiguration clc = new ClassLoaderConfiguration( true, true ); ClasspathConfiguration cc = new ClasspathConfiguration( true, true ); StartupConfiguration conf = new StartupConfiguration( "org.apache.maven.surefire.shadefire.MyProvider", cc, clc, false, false ); StartupConfiguration confMock = spy( conf ); mockStatic( Relocator.class ); when( Relocator.relocate( anyString() ) ).thenCallRealMethod(); String cls = invokeMethod( DefaultForkConfiguration.class, "findStartClass", confMock ); verify( confMock, times( 1 ) ).isShadefire(); verifyStatic( Relocator.class, times( 1 ) ); Relocator.relocate( eq( ForkedBooter.class.getName() ) ); assertThat( cls ).isEqualTo( "org.apache.maven.surefire.shadefire.booter.ForkedBooter" ); assertThat( confMock.isShadefire() ).isTrue(); } @Test public void shouldNotRelocateBooterClass() throws Exception { ClassLoaderConfiguration clc = new ClassLoaderConfiguration( true, true ); ClasspathConfiguration cc = new ClasspathConfiguration( true, true ); StartupConfiguration conf = new StartupConfiguration( "org.apache.maven.surefire.MyProvider", cc, clc, false, false ); StartupConfiguration confMock = spy( conf ); mockStatic( Relocator.class ); when( Relocator.relocate( anyString() ) ).thenCallRealMethod(); String cls = invokeMethod( DefaultForkConfiguration.class, "findStartClass", confMock ); verify( confMock, times( 1 ) ).isShadefire(); verifyStatic( Relocator.class, never() ); Relocator.relocate( eq( ForkedBooter.class.getName() ) ); assertThat( cls ).isEqualTo( "org.apache.maven.surefire.booter.ForkedBooter" ); assertThat( confMock.isShadefire() ).isFalse(); } } ForkConfigurationTest.java000066400000000000000000000217741330756104600433020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.SystemUtils; import org.apache.maven.plugin.surefire.JdkAttributes; import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger; import org.apache.maven.shared.utils.StringUtils; import org.apache.maven.shared.utils.cli.Commandline; import org.apache.maven.surefire.booter.ClassLoaderConfiguration; import org.apache.maven.surefire.booter.Classpath; import org.apache.maven.surefire.booter.ClasspathConfiguration; import org.apache.maven.surefire.booter.StartupConfiguration; import org.apache.maven.surefire.booter.SurefireBooterForkException; import org.junit.Test; import java.io.File; import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Properties; import static java.util.Collections.singletonList; import static org.apache.maven.surefire.booter.Classpath.emptyClasspath; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; public class ForkConfigurationTest { private static final StartupConfiguration STARTUP_CONFIG = new StartupConfiguration( "", new ClasspathConfiguration( true, true ), new ClassLoaderConfiguration( true, true ), false, false ); @Test public void testCreateCommandLine_UseSystemClassLoaderForkOnce_ShouldConstructManifestOnlyJar() throws IOException, SurefireBooterForkException { ForkConfiguration config = getForkConfiguration( (String) null ); File cpElement = getTempClasspathFile(); List cp = singletonList( cpElement.getAbsolutePath() ); ClasspathConfiguration cpConfig = new ClasspathConfiguration( new Classpath( cp ), emptyClasspath(), emptyClasspath(), true, true ); ClassLoaderConfiguration clc = new ClassLoaderConfiguration( true, true ); StartupConfiguration startup = new StartupConfiguration( "", cpConfig, clc, false, false ); Commandline cli = config.createCommandLine( startup, 1 ); String line = StringUtils.join( cli.getCommandline(), " " ); assertTrue( line.contains( "-jar" ) ); } @Test public void testArglineWithNewline() throws IOException, SurefireBooterForkException { // SUREFIRE-657 ForkConfiguration config = getForkConfiguration( "abc\ndef" ); File cpElement = getTempClasspathFile(); List cp = singletonList( cpElement.getAbsolutePath() ); ClasspathConfiguration cpConfig = new ClasspathConfiguration( new Classpath( cp ), emptyClasspath(), emptyClasspath(), true, true ); ClassLoaderConfiguration clc = new ClassLoaderConfiguration( true, true ); StartupConfiguration startup = new StartupConfiguration( "", cpConfig, clc, false, false ); Commandline commandLine = config.createCommandLine( startup, 1 ); assertTrue( commandLine.toString().contains( "abc def" ) ); } @Test public void testCurrentWorkingDirectoryPropagationIncludingForkNumberExpansion() throws IOException, SurefireBooterForkException { // SUREFIRE-1136 File baseDir = new File( FileUtils.getTempDirectory(), "SUREFIRE-1136-" + RandomStringUtils.randomAlphabetic( 3 ) ); assertTrue( baseDir.mkdirs() ); baseDir.deleteOnExit(); File cwd = new File( baseDir, "fork_${surefire.forkNumber}" ); ClasspathConfiguration cpConfig = new ClasspathConfiguration( emptyClasspath(), emptyClasspath(), emptyClasspath(), true, true ); ClassLoaderConfiguration clc = new ClassLoaderConfiguration( true, true ); StartupConfiguration startup = new StartupConfiguration( "", cpConfig, clc, false, false ); ForkConfiguration config = getForkConfiguration( cwd.getCanonicalFile() ); Commandline commandLine = config.createCommandLine( startup, 1 ); File forkDirectory = new File( baseDir, "fork_1" ); forkDirectory.deleteOnExit(); String shellWorkDir = commandLine.getShell().getWorkingDirectory().getCanonicalPath(); assertEquals( shellWorkDir, forkDirectory.getCanonicalPath() ); } @Test public void testExceptionWhenCurrentDirectoryIsNotRealDirectory() throws IOException, SurefireBooterForkException { // SUREFIRE-1136 File baseDir = new File( FileUtils.getTempDirectory(), "SUREFIRE-1136-" + RandomStringUtils.randomAlphabetic( 3 ) ); assertTrue( baseDir.mkdirs() ); baseDir.deleteOnExit(); File cwd = new File( baseDir, "cwd.txt" ); FileUtils.touch( cwd ); cwd.deleteOnExit(); ForkConfiguration config = getForkConfiguration( cwd.getCanonicalFile() ); try { config.createCommandLine( STARTUP_CONFIG, 1 ); } catch ( SurefireBooterForkException sbfe ) { // To handle issue with ~ expansion on Windows String absolutePath = cwd.getCanonicalPath(); assertEquals( "WorkingDirectory " + absolutePath + " exists and is not a directory", sbfe.getMessage() ); return; } fail(); } @Test public void testExceptionWhenCurrentDirectoryCannotBeCreated() throws IOException, SurefireBooterForkException { // SUREFIRE-1136 File baseDir = new File( FileUtils.getTempDirectory(), "SUREFIRE-1136-" + RandomStringUtils.randomAlphabetic( 3 ) ); assertTrue( baseDir.mkdirs() ); baseDir.deleteOnExit(); // NULL is invalid for JDK starting from 1.7.60 - https://github.com/openjdk-mirror/jdk/commit/e5389115f3634d25d101e2dcc71f120d4fd9f72f // ? character is invalid on Windows, seems to be imposable to create invalid directory using Java on Linux File cwd = new File( baseDir, "?\u0000InvalidDirectoryName" ); ForkConfiguration config = getForkConfiguration( cwd.getAbsoluteFile() ); try { config.createCommandLine( STARTUP_CONFIG, 1 ); } catch ( SurefireBooterForkException sbfe ) { assertEquals( "Cannot create workingDirectory " + cwd.getAbsolutePath(), sbfe.getMessage() ); return; } if ( SystemUtils.IS_OS_WINDOWS || isJavaVersionAtLeast7u60() ) { fail(); } } private File getTempClasspathFile() throws IOException { File cpElement = File.createTempFile( "ForkConfigurationTest.", ".file" ); cpElement.deleteOnExit(); return cpElement; } static ForkConfiguration getForkConfiguration( String argLine ) throws IOException { File jvm = new File( new File( System.getProperty( "java.home" ), "bin" ), "java" ); return getForkConfiguration( argLine, jvm.getAbsolutePath(), new File( "." ).getCanonicalFile() ); } private static ForkConfiguration getForkConfiguration( File cwd ) throws IOException { File jvm = new File( new File( System.getProperty( "java.home" ), "bin" ), "java" ); return getForkConfiguration( null, jvm.getAbsolutePath(), cwd ); } private static ForkConfiguration getForkConfiguration( String argLine, String jvm, File cwd ) throws IOException { Platform platform = new Platform().withJdkExecAttributesForTests( new JdkAttributes( jvm, false ) ); File tmpDir = File.createTempFile( "target", "surefire" ); assertTrue( tmpDir.delete() ); assertTrue( tmpDir.mkdirs() ); return new JarManifestForkConfiguration( emptyClasspath(), tmpDir, null, cwd, new Properties(), argLine, Collections.emptyMap(), false, 1, false, platform, new NullConsoleLogger() ); } // based on http://stackoverflow.com/questions/2591083/getting-version-of-java-in-runtime private static boolean isJavaVersionAtLeast7u60() { String[] javaVersionElements = System.getProperty( "java.runtime.version" ).split( "\\.|_|-b" ); return Integer.valueOf( javaVersionElements[1] ) >= 7 && Integer.valueOf( javaVersionElements[3] ) >= 60; } } ForkingRunListenerTest.java000066400000000000000000000376531330756104600434460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import junit.framework.Assert; import junit.framework.TestCase; import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.NotifiableTestStream; import org.apache.maven.plugin.surefire.booterclient.output.ForkClient; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger; import org.apache.maven.surefire.booter.ForkingRunListener; import org.apache.maven.surefire.report.CategorizedReportEntry; import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.LegacyPojoStackTraceWriter; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.ReporterException; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.SimpleReportEntry; import org.apache.maven.surefire.report.StackTraceWriter; import org.apache.maven.surefire.report.TestSetReportEntry; import org.hamcrest.MatcherAssert; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; import java.nio.charset.Charset; import java.util.List; import java.util.StringTokenizer; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; /** * @author Kristian Rosenvold */ public class ForkingRunListenerTest extends TestCase { private final ByteArrayOutputStream content, anotherContent; private final PrintStream printStream, anotherPrintStream; final int defaultChannel = 17; final int anotherChannel = 18; public ForkingRunListenerTest() { content = new ByteArrayOutputStream(); printStream = new PrintStream( content ); anotherContent = new ByteArrayOutputStream(); anotherPrintStream = new PrintStream( anotherContent ); } private void reset() { printStream.flush(); content.reset(); } public void testHeaderCreation() { final byte[] header = ForkingRunListener.createHeader( (byte) 'F', 0xCAFE ); String asString = new String( header ); assertEquals( "F,cafe," + Charset.defaultCharset().name() + ",", asString ); } public void testHeaderCreationShort() { final byte[] header = ForkingRunListener.createHeader( (byte) 'F', 0xE ); String asString = new String( header ); assertEquals( "F,e," + Charset.defaultCharset().name() + ",", asString ); } public void testSetStarting() throws ReporterException, IOException { final StandardTestRun standardTestRun = new StandardTestRun(); TestSetReportEntry expected = createDefaultReportEntry(); standardTestRun.run().testSetStarting( expected ); standardTestRun.assertExpected( MockReporter.SET_STARTING, expected ); } public void testSetCompleted() throws ReporterException, IOException { final StandardTestRun standardTestRun = new StandardTestRun(); TestSetReportEntry expected = createDefaultReportEntry(); standardTestRun.run().testSetCompleted( expected ); standardTestRun.assertExpected( MockReporter.SET_COMPLETED, expected ); } public void testStarting() throws ReporterException, IOException { final StandardTestRun standardTestRun = new StandardTestRun(); ReportEntry expected = createDefaultReportEntry(); standardTestRun.run().testStarting( expected ); standardTestRun.assertExpected( MockReporter.TEST_STARTING, expected ); } public void testStringTokenizer() { String test = "5,11,com.abc.TestClass,testMethod,null,22,,,"; StringTokenizer tok = new StringTokenizer( test, "," ); assertEquals( "5", tok.nextToken() ); assertEquals( "11", tok.nextToken() ); assertEquals( "com.abc.TestClass", tok.nextToken() ); assertEquals( "testMethod", tok.nextToken() ); assertEquals( "null", tok.nextToken() ); assertEquals( "22", tok.nextToken() ); assertFalse( tok.hasMoreTokens() ); } public void testSucceded() throws ReporterException, IOException { final StandardTestRun standardTestRun = new StandardTestRun(); ReportEntry expected = createDefaultReportEntry(); standardTestRun.run().testSucceeded( expected ); standardTestRun.assertExpected( MockReporter.TEST_SUCCEEDED, expected ); } public void testFailed() throws ReporterException, IOException { final StandardTestRun standardTestRun = new StandardTestRun(); ReportEntry expected = createReportEntryWithStackTrace(); standardTestRun.run().testFailed( expected ); standardTestRun.assertExpected( MockReporter.TEST_FAILED, expected ); } public void testFailedWithCommaInMessage() throws ReporterException, IOException { final StandardTestRun standardTestRun = new StandardTestRun(); ReportEntry expected = createReportEntryWithSpecialMessage( "We, the people" ); standardTestRun.run().testFailed( expected ); standardTestRun.assertExpected( MockReporter.TEST_FAILED, expected ); } public void testFailedWithUnicodeEscapeInMessage() throws ReporterException, IOException { final StandardTestRun standardTestRun = new StandardTestRun(); ReportEntry expected = createReportEntryWithSpecialMessage( "We, \\u0177 people" ); standardTestRun.run().testFailed( expected ); standardTestRun.assertExpected( MockReporter.TEST_FAILED, expected ); } public void testFailure() throws ReporterException, IOException { final StandardTestRun standardTestRun = new StandardTestRun(); ReportEntry expected = createDefaultReportEntry(); standardTestRun.run().testError( expected ); standardTestRun.assertExpected( MockReporter.TEST_ERROR, expected ); } public void testSkipped() throws ReporterException, IOException { final StandardTestRun standardTestRun = new StandardTestRun(); ReportEntry expected = createDefaultReportEntry(); standardTestRun.run().testSkipped( expected ); standardTestRun.assertExpected( MockReporter.TEST_SKIPPED, expected ); } public void testAssumptionFailure() throws ReporterException, IOException { final StandardTestRun standardTestRun = new StandardTestRun(); ReportEntry expected = createDefaultReportEntry(); standardTestRun.run().testAssumptionFailure( expected ); standardTestRun.assertExpected( MockReporter.TEST_ASSUMPTION_FAIL, expected ); } public void testConsole() throws ReporterException, IOException { final StandardTestRun standardTestRun = new StandardTestRun(); ConsoleLogger directConsoleReporter = (ConsoleLogger) standardTestRun.run(); directConsoleReporter.info( "HeyYou" ); standardTestRun.assertExpected( MockReporter.CONSOLE_OUTPUT, "HeyYou" ); } public void testConsoleOutput() throws ReporterException, IOException { final StandardTestRun standardTestRun = new StandardTestRun(); ConsoleOutputReceiver directConsoleReporter = (ConsoleOutputReceiver) standardTestRun.run(); directConsoleReporter.writeTestOutput( "HeyYou".getBytes(), 0, 6, true ); standardTestRun.assertExpected( MockReporter.STDOUT, "HeyYou" ); } public void testSystemProperties() throws ReporterException, IOException { final StandardTestRun standardTestRun = new StandardTestRun(); standardTestRun.run(); reset(); createForkingRunListener( defaultChannel ); TestSetMockReporterFactory providerReporterFactory = new TestSetMockReporterFactory(); NullConsoleLogger log = new NullConsoleLogger(); ForkClient forkStreamClient = new ForkClient( providerReporterFactory, new MockNotifiableTestStream(), log, null ); forkStreamClient.consumeMultiLineContent( content.toString( "UTF-8" ) ); MatcherAssert.assertThat( forkStreamClient.getTestVmSystemProperties().size(), is( greaterThan( 1 ) ) ); } public void testMultipleEntries() throws ReporterException, IOException { final StandardTestRun standardTestRun = new StandardTestRun(); standardTestRun.run(); reset(); RunListener forkingReporter = createForkingRunListener( defaultChannel ); TestSetReportEntry reportEntry = createDefaultReportEntry(); forkingReporter.testSetStarting( reportEntry ); forkingReporter.testStarting( reportEntry ); forkingReporter.testSucceeded( reportEntry ); forkingReporter.testSetCompleted( reportEntry ); TestSetMockReporterFactory providerReporterFactory = new TestSetMockReporterFactory(); NullConsoleLogger log = new NullConsoleLogger(); ForkClient forkStreamClient = new ForkClient( providerReporterFactory, new MockNotifiableTestStream(), log, null ); forkStreamClient.consumeMultiLineContent( content.toString( "UTF-8" ) ); final MockReporter reporter = (MockReporter) forkStreamClient.getReporter(); final List events = reporter.getEvents(); assertEquals( MockReporter.SET_STARTING, events.get( 0 ) ); assertEquals( MockReporter.TEST_STARTING, events.get( 1 ) ); assertEquals( MockReporter.TEST_SUCCEEDED, events.get( 2 ) ); assertEquals( MockReporter.SET_COMPLETED, events.get( 3 ) ); } public void test2DifferentChannels() throws ReporterException, IOException { reset(); ReportEntry expected = createDefaultReportEntry(); final SimpleReportEntry secondExpected = createAnotherDefaultReportEntry(); new ForkingRunListener( printStream, defaultChannel, false ) .testStarting( expected ); new ForkingRunListener( anotherPrintStream, anotherChannel, false ) .testSkipped( secondExpected ); TestSetMockReporterFactory providerReporterFactory = new TestSetMockReporterFactory(); NotifiableTestStream notifiableTestStream = new MockNotifiableTestStream(); NullConsoleLogger log = new NullConsoleLogger(); ForkClient forkStreamClient = new ForkClient( providerReporterFactory, notifiableTestStream, log, null ); forkStreamClient.consumeMultiLineContent( content.toString( "UTF-8" ) ); MockReporter reporter = (MockReporter) forkStreamClient.getReporter(); Assert.assertEquals( MockReporter.TEST_STARTING, reporter.getFirstEvent() ); Assert.assertEquals( expected, reporter.getFirstData() ); Assert.assertEquals( 1, reporter.getEvents().size() ); forkStreamClient = new ForkClient( providerReporterFactory, notifiableTestStream, log, null ); forkStreamClient.consumeMultiLineContent( anotherContent.toString( "UTF-8" ) ); MockReporter reporter2 = (MockReporter) forkStreamClient.getReporter(); Assert.assertEquals( MockReporter.TEST_SKIPPED, reporter2.getFirstEvent() ); Assert.assertEquals( secondExpected, reporter2.getFirstData() ); Assert.assertEquals( 1, reporter2.getEvents().size() ); } // Todo: Test weird characters private SimpleReportEntry createDefaultReportEntry() { return new SimpleReportEntry( "com.abc.TestClass", "testMethod", 22 ); } private SimpleReportEntry createAnotherDefaultReportEntry() { return new SimpleReportEntry( "com.abc.AnotherTestClass", "testAnotherMethod", 42 ); } private SimpleReportEntry createReportEntryWithStackTrace() { try { throw new RuntimeException(); } catch ( RuntimeException e ) { StackTraceWriter stackTraceWriter = new LegacyPojoStackTraceWriter( "org.apache.tests.TestClass", "testMethod11", e ); return new CategorizedReportEntry( "com.abc.TestClass", "testMethod", "aGroup", stackTraceWriter, 77 ); } } private SimpleReportEntry createReportEntryWithSpecialMessage( String message ) { try { throw new RuntimeException( message ); } catch ( RuntimeException e ) { StackTraceWriter stackTraceWriter = new LegacyPojoStackTraceWriter( "org.apache.tests.TestClass", "testMethod11", e ); return new CategorizedReportEntry( "com.abc.TestClass", "testMethod", "aGroup", stackTraceWriter, 77 ); } } private RunListener createForkingRunListener( Integer testSetChannel ) { return new ForkingRunListener( printStream, testSetChannel, false ); } private class StandardTestRun { private MockReporter reporter; public RunListener run() throws ReporterException { reset(); return createForkingRunListener( defaultChannel ); } public void clientReceiveContent() throws ReporterException, IOException { TestSetMockReporterFactory providerReporterFactory = new TestSetMockReporterFactory(); NullConsoleLogger log = new NullConsoleLogger(); final ForkClient forkStreamClient = new ForkClient( providerReporterFactory, new MockNotifiableTestStream(), log, null ); forkStreamClient.consumeMultiLineContent( content.toString( ) ); reporter = (MockReporter) forkStreamClient.getReporter(); } public String getFirstEvent() { return reporter.getEvents().get( 0 ); } public ReportEntry getFirstData() { return (ReportEntry) reporter.getData().get( 0 ); } private void assertExpected( String actionCode, ReportEntry expected ) throws IOException, ReporterException { clientReceiveContent(); assertEquals( actionCode, getFirstEvent() ); final ReportEntry firstData = getFirstData(); assertEquals( expected.getSourceName(), firstData.getSourceName() ); assertEquals( expected.getName(), firstData.getName() ); //noinspection deprecation assertEquals( expected.getElapsed(), firstData.getElapsed() ); assertEquals( expected.getGroup(), firstData.getGroup() ); if ( expected.getStackTraceWriter() != null ) { //noinspection ThrowableResultOfMethodCallIgnored assertEquals( expected.getStackTraceWriter().getThrowable().getLocalizedMessage(), firstData.getStackTraceWriter().getThrowable().getLocalizedMessage() ); assertEquals( expected.getStackTraceWriter().writeTraceToString(), firstData.getStackTraceWriter().writeTraceToString() ); } } private void assertExpected( String actionCode, String expected ) throws IOException, ReporterException { clientReceiveContent(); assertEquals( actionCode, getFirstEvent() ); final String firstData = (String) reporter.getData().get( 0 ); assertEquals( expected, firstData ); } } } MockNotifiableTestStream.java000066400000000000000000000030371330756104600437030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.NotifiableTestStream; import org.apache.maven.surefire.booter.*; /** * Mock of {@link NotifiableTestStream} for testing purposes. * * @author Tibor Digana (tibor17) * @since 2.19 */ final class MockNotifiableTestStream implements NotifiableTestStream { @Override public void provideNewTest() { } @Override public void skipSinceNextTest() { } @Override public void shutdown( Shutdown shutdownType ) { } @Override public void noop() { } @Override public void acknowledgeByeEventReceived() { } }MockReporter.java000066400000000000000000000125511330756104600414160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.TestSetReportEntry; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; /** * Internal tests use only. */ public class MockReporter implements RunListener, ConsoleLogger, ConsoleOutputReceiver { private final List events = new ArrayList(); private final List data = new ArrayList(); public static final String SET_STARTING = "SET_STARTED"; public static final String SET_COMPLETED = "SET_COMPLETED"; public static final String TEST_STARTING = "TEST_STARTED"; public static final String TEST_SUCCEEDED = "TEST_COMPLETED"; public static final String TEST_FAILED = "TEST_FAILED"; public static final String TEST_ERROR = "TEST_ERROR"; public static final String TEST_SKIPPED = "TEST_SKIPPED"; public static final String TEST_ASSUMPTION_FAIL = "TEST_ASSUMPTION_SKIPPED"; public static final String CONSOLE_OUTPUT = "CONSOLE_OUTPUT"; public static final String STDOUT = "STDOUT"; public static final String STDERR = "STDERR"; private final AtomicInteger testSucceeded = new AtomicInteger(); private final AtomicInteger testIgnored = new AtomicInteger(); private final AtomicInteger testFailed = new AtomicInteger(); @Override public void testSetStarting( TestSetReportEntry report ) { events.add( SET_STARTING ); data.add( report ); } @Override public void testSetCompleted( TestSetReportEntry report ) { events.add( SET_COMPLETED ); data.add( report ); } @Override public void testStarting( ReportEntry report ) { events.add( TEST_STARTING ); data.add( report ); } @Override public void testSucceeded( ReportEntry report ) { events.add( TEST_SUCCEEDED ); testSucceeded.incrementAndGet(); data.add( report ); } @Override public void testError( ReportEntry report ) { events.add( TEST_ERROR ); data.add( report ); testFailed.incrementAndGet(); } @Override public void testFailed( ReportEntry report ) { events.add( TEST_FAILED ); data.add( report ); testFailed.incrementAndGet(); } @Override public void testSkipped( ReportEntry report ) { events.add( TEST_SKIPPED ); data.add( report ); testIgnored.incrementAndGet(); } @Override public void testExecutionSkippedByUser() { } public void testSkippedByUser( ReportEntry report ) { testSkipped( report ); } public List getEvents() { return events; } public List getData() { return data; } public String getFirstEvent() { return events.get( 0 ); } public ReportEntry getFirstData() { return (ReportEntry) data.get( 0 ); } @Override public void testAssumptionFailure( ReportEntry report ) { events.add( TEST_ASSUMPTION_FAIL ); data.add( report ); testIgnored.incrementAndGet(); } @Override public boolean isDebugEnabled() { return true; } @Override public void debug( String message ) { events.add( CONSOLE_OUTPUT ); data.add( message ); } @Override public boolean isInfoEnabled() { return true; } @Override public void info( String message ) { events.add( CONSOLE_OUTPUT ); data.add( message ); } @Override public boolean isWarnEnabled() { return true; } @Override public void warning( String message ) { events.add( CONSOLE_OUTPUT ); data.add( message ); } @Override public boolean isErrorEnabled() { return true; } @Override public void error( String message ) { events.add( CONSOLE_OUTPUT ); data.add( message ); } @Override public void error( String message, Throwable t ) { } @Override public void error( Throwable t ) { } @Override public void writeTestOutput( byte[] buf, int off, int len, boolean stdout ) { events.add( stdout ? STDOUT : STDERR ); data.add( new String( buf, off, len ) ); } } ModularClasspathForkConfigurationTest.java000066400000000000000000000152051330756104600464610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.OutputStreamFlushableCommandline; import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger; import org.apache.maven.surefire.booter.ClassLoaderConfiguration; import org.apache.maven.surefire.booter.Classpath; import org.apache.maven.surefire.booter.ForkedBooter; import org.apache.maven.surefire.booter.ModularClasspath; import org.apache.maven.surefire.booter.ModularClasspathConfiguration; import org.apache.maven.surefire.booter.StartupConfiguration; import org.junit.Before; import org.junit.Test; import javax.annotation.Nonnull; import java.io.File; import java.io.IOException; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Properties; import static org.apache.commons.lang3.JavaVersion.JAVA_1_7; import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT; import static java.io.File.separator; import static java.io.File.pathSeparator; import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.file.Files.readAllLines; import static java.util.Arrays.asList; import static java.util.Collections.singleton; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assume.assumeTrue; /** * @author Tibor Digana (tibor17) * @since 2.21.0.Jigsaw */ public class ModularClasspathForkConfigurationTest { @Before public void withJava7orHigher() { assumeTrue( JAVA_RECENT.atLeast( JAVA_1_7 ) ); } @Test @SuppressWarnings( "ResultOfMethodCallIgnored" ) public void shouldCreateModularArgsFile() throws Exception { Classpath booter = new Classpath( asList( "booter.jar", "non-modular.jar" ) ); File target = new File( "target" ).getCanonicalFile(); File tmp = new File( target, "surefire" ); tmp.mkdirs(); File pwd = new File( "." ).getCanonicalFile(); ModularClasspathForkConfiguration config = new ModularClasspathForkConfiguration( booter, tmp, "", pwd, new Properties(), "", new HashMap(), true, 1, true, new Platform(), new NullConsoleLogger() ) { @Nonnull @Override String toModuleName( @Nonnull File moduleDescriptor ) throws IOException { return "abc"; } }; File patchFile = new File( "target" + separator + "test-classes" ); File descriptor = new File( tmp, "module-info.class" ); descriptor.createNewFile(); List modulePath = asList( "modular.jar", "target/classes" ); List classPath = asList( "booter.jar", "non-modular.jar", patchFile.getPath() ); Collection packages = singleton( "org.apache.abc" ); String startClassName = ForkedBooter.class.getName(); File jigsawArgsFile = config.createArgsFile( descriptor, modulePath, classPath, packages, patchFile, startClassName ); assertThat( jigsawArgsFile ).isNotNull(); List argsFileLines = readAllLines( jigsawArgsFile.toPath(), UTF_8 ); assertThat( argsFileLines ).hasSize( 13 ); assertThat( argsFileLines.get( 0 ) ).isEqualTo( "--module-path" ); assertThat( argsFileLines.get( 1 ) ).isEqualTo( "modular.jar" + pathSeparator + "target/classes" ); assertThat( argsFileLines.get( 2 ) ).isEqualTo( "--class-path" ); assertThat( argsFileLines.get( 3 ) ) .isEqualTo( "booter.jar" + pathSeparator + "non-modular.jar" + pathSeparator + patchFile.getPath() ); assertThat( argsFileLines.get( 4 ) ).isEqualTo( "--patch-module" ); assertThat( argsFileLines.get( 5 ) ).isEqualTo( "abc=" + patchFile.getPath() ); assertThat( argsFileLines.get( 6 ) ).isEqualTo( "--add-exports" ); assertThat( argsFileLines.get( 7 ) ).isEqualTo( "abc/org.apache.abc=ALL-UNNAMED" ); assertThat( argsFileLines.get( 8 ) ).isEqualTo( "--add-modules" ); assertThat( argsFileLines.get( 9 ) ).isEqualTo( "abc" ); assertThat( argsFileLines.get( 10 ) ).isEqualTo( "--add-reads" ); assertThat( argsFileLines.get( 11 ) ).isEqualTo( "abc=ALL-UNNAMED" ); assertThat( argsFileLines.get( 12 ) ).isEqualTo( ForkedBooter.class.getName() ); ModularClasspath modularClasspath = new ModularClasspath( descriptor, modulePath, packages, patchFile ); Classpath testClasspathUrls = new Classpath( singleton( "target" + separator + "test-classes" ) ); Classpath surefireClasspathUrls = Classpath.emptyClasspath(); ModularClasspathConfiguration modularClasspathConfiguration = new ModularClasspathConfiguration( modularClasspath, testClasspathUrls, surefireClasspathUrls, true, true ); ClassLoaderConfiguration clc = new ClassLoaderConfiguration( true, true ); StartupConfiguration startupConfiguration = new StartupConfiguration( "JUnitCoreProvider", modularClasspathConfiguration, clc, true, true ); OutputStreamFlushableCommandline cli = new OutputStreamFlushableCommandline(); config.resolveClasspath( cli, ForkedBooter.class.getName(), startupConfiguration ); assertThat( cli.getArguments() ).isNotNull(); assertThat( cli.getArguments() ).hasSize( 1 ); assertThat( cli.getArguments()[0] ).startsWith( "@" ); File argFile = new File( cli.getArguments()[0].substring( 1 ) ); assertThat( argFile ).isFile(); List argsFileLines2 = readAllLines( argFile.toPath(), UTF_8 ); assertThat( argsFileLines2 ).hasSize( 13 ); for ( int i = 0; i < argsFileLines2.size(); i++ ) { String line = argsFileLines2.get( i ); assertThat( line ).isEqualTo( argsFileLines.get( i ) ); } } } TestSetMockReporterFactory.java000066400000000000000000000036621330756104600442650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclientpackage org.apache.maven.plugin.surefire.booterclient; /* * 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. */ import org.apache.maven.plugin.surefire.StartupReportConfiguration; import org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger; import org.apache.maven.surefire.report.RunListener; import java.io.File; /** * Internal tests use only. * * @author Kristian Rosenvold */ public class TestSetMockReporterFactory extends DefaultReporterFactory { public TestSetMockReporterFactory() { super( defaultValue(), new NullConsoleLogger() ); } @Override public RunListener createReporter() { return new MockReporter(); } /** * For testing purposes only. * * @return StartupReportConfiguration fo testing purposes */ private static StartupReportConfiguration defaultValue() { File target = new File( "./target" ); File statisticsFile = new File( target, "TESTHASH" ); return new StartupReportConfiguration( true, true, "PLAIN", false, false, target, false, null, statisticsFile, false, 0, null, null ); } } lazytestprovider/000077500000000000000000000000001330756104600415655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclientTestLessInputStreamBuilderTest.java000066400000000000000000000137671330756104600505570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestproviderpackage org.apache.maven.plugin.surefire.booterclient.lazytestprovider; /* * 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. */ import org.apache.maven.surefire.booter.Command; import org.apache.maven.surefire.booter.MasterProcessCommand; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.io.DataInputStream; import java.io.IOException; import java.util.Iterator; import java.util.NoSuchElementException; import static org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestLessInputStream.TestLessInputStreamBuilder; import static org.apache.maven.surefire.booter.Command.NOOP; import static org.apache.maven.surefire.booter.Command.SKIP_SINCE_NEXT_TEST; import static org.apache.maven.surefire.booter.MasterProcessCommand.BYE_ACK; import static org.apache.maven.surefire.booter.MasterProcessCommand.SHUTDOWN; import static org.apache.maven.surefire.booter.MasterProcessCommand.decode; import static org.apache.maven.surefire.booter.Shutdown.EXIT; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** * Testing cached and immediate commands in {@link TestLessInputStream}. * * @author Tibor Digana (tibor17) * @since 2.19 */ public class TestLessInputStreamBuilderTest { @Rule public final ExpectedException e = ExpectedException.none(); @Test public void cachableCommandsShouldBeIterableWithStillOpenIterator() { TestLessInputStreamBuilder builder = new TestLessInputStreamBuilder(); TestLessInputStream is = builder.build(); Iterator iterator = builder.getIterableCachable().iterator(); assertFalse( iterator.hasNext() ); builder.getCachableCommands().skipSinceNextTest(); assertTrue( iterator.hasNext() ); assertThat( iterator.next(), is( SKIP_SINCE_NEXT_TEST ) ); assertFalse( iterator.hasNext() ); builder.getCachableCommands().noop(); assertTrue( iterator.hasNext() ); assertThat( iterator.next(), is( NOOP ) ); builder.removeStream( is ); } @Test public void immediateCommands() throws IOException { TestLessInputStreamBuilder builder = new TestLessInputStreamBuilder(); TestLessInputStream is = builder.build(); assertThat( is.availablePermits(), is( 0 ) ); is.noop(); assertThat( is.availablePermits(), is( 1 ) ); is.beforeNextCommand(); assertThat( is.availablePermits(), is( 0 ) ); assertThat( is.nextCommand(), is( NOOP ) ); assertThat( is.availablePermits(), is( 0 ) ); e.expect( NoSuchElementException.class ); is.nextCommand(); } @Test public void combinedCommands() throws IOException { TestLessInputStreamBuilder builder = new TestLessInputStreamBuilder(); TestLessInputStream is = builder.build(); assertThat( is.availablePermits(), is( 0 ) ); builder.getCachableCommands().skipSinceNextTest(); is.noop(); assertThat( is.availablePermits(), is( 2 ) ); is.beforeNextCommand(); assertThat( is.availablePermits(), is( 1 ) ); assertThat( is.nextCommand(), is( NOOP ) ); assertThat( is.availablePermits(), is( 1 ) ); builder.getCachableCommands().skipSinceNextTest(); assertThat( is.availablePermits(), is( 1 ) ); builder.getImmediateCommands().shutdown( EXIT ); assertThat( is.availablePermits(), is( 2 ) ); is.beforeNextCommand(); assertThat( is.nextCommand().getCommandType(), is( SHUTDOWN ) ); assertThat( is.availablePermits(), is( 1 ) ); is.beforeNextCommand(); assertThat( is.nextCommand(), is( SKIP_SINCE_NEXT_TEST ) ); assertThat( is.availablePermits(), is( 0 ) ); builder.getImmediateCommands().noop(); assertThat( is.availablePermits(), is( 1 ) ); builder.getCachableCommands().shutdown( EXIT ); builder.getCachableCommands().shutdown( EXIT ); assertThat( is.availablePermits(), is( 2 ) ); is.beforeNextCommand(); assertThat( is.nextCommand(), is( NOOP ) ); assertThat( is.availablePermits(), is( 1 ) ); is.beforeNextCommand(); assertThat( is.nextCommand().getCommandType(), is( SHUTDOWN ) ); assertThat( is.availablePermits(), is( 0 ) ); e.expect( NoSuchElementException.class ); is.nextCommand(); } @Test public void shouldDecodeTwoCommands() throws IOException { TestLessInputStreamBuilder builder = new TestLessInputStreamBuilder(); TestLessInputStream pluginIs = builder.build(); builder.getImmediateCommands().acknowledgeByeEventReceived(); builder.getImmediateCommands().noop(); DataInputStream is = new DataInputStream( pluginIs ); Command bye = decode( is ); assertThat( bye, is( notNullValue() ) ); assertThat( bye.getCommandType(), is( BYE_ACK ) ); Command noop = decode( is ); assertThat( noop, is( notNullValue() ) ); assertThat( noop.getCommandType(), is( MasterProcessCommand.NOOP ) ); } } TestProvidingInputStreamTest.java000066400000000000000000000130701330756104600502660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestproviderpackage org.apache.maven.plugin.surefire.booterclient.lazytestprovider; /* * 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. */ import org.apache.maven.surefire.booter.Command; import org.apache.maven.surefire.booter.MasterProcessCommand; import org.junit.Test; import java.io.DataInputStream; import java.io.IOException; import java.util.ArrayDeque; import java.util.Queue; import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.FutureTask; import java.util.concurrent.TimeUnit; import static org.apache.maven.surefire.booter.MasterProcessCommand.BYE_ACK; import static org.apache.maven.surefire.booter.MasterProcessCommand.decode; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; /** * Asserts that this stream properly reads bytes from queue. * * @author Tibor Digana (tibor17) * @since 2.19 */ public class TestProvidingInputStreamTest { @Test public void closedStreamShouldReturnEndOfStream() throws IOException { Queue commands = new ArrayDeque(); TestProvidingInputStream is = new TestProvidingInputStream( commands ); is.close(); assertThat( is.read(), is( -1 ) ); } @Test public void emptyStreamShouldWaitUntilClosed() throws Exception { Queue commands = new ArrayDeque(); final TestProvidingInputStream is = new TestProvidingInputStream( commands ); final Thread streamThread = Thread.currentThread(); FutureTask futureTask = new FutureTask( new Callable() { @Override public Thread.State call() { sleep( 1000 ); Thread.State state = streamThread.getState(); is.close(); return state; } } ); Thread assertionThread = new Thread( futureTask ); assertionThread.start(); assertThat( is.read(), is( -1 ) ); Thread.State state = futureTask.get(); assertThat( state, is( Thread.State.WAITING ) ); } @Test public void finishedTestsetShouldNotBlock() throws IOException { Queue commands = new ArrayDeque(); final TestProvidingInputStream is = new TestProvidingInputStream( commands ); is.testSetFinished(); new Thread( new Runnable() { @Override public void run() { is.provideNewTest(); } } ).start(); assertThat( is.read(), is( 0 ) ); assertThat( is.read(), is( 0 ) ); assertThat( is.read(), is( 0 ) ); assertThat( is.read(), is( 1 ) ); assertThat( is.read(), is( 0 ) ); assertThat( is.read(), is( 0 ) ); assertThat( is.read(), is( 0 ) ); assertThat( is.read(), is( 0 ) ); is.close(); assertThat( is.read(), is( -1 ) ); } @Test public void shouldReadTest() throws IOException { Queue commands = new ArrayDeque(); commands.add( "Test" ); final TestProvidingInputStream is = new TestProvidingInputStream( commands ); new Thread( new Runnable() { @Override public void run() { is.provideNewTest(); } } ).start(); assertThat( is.read(), is( 0 ) ); assertThat( is.read(), is( 0 ) ); assertThat( is.read(), is( 0 ) ); assertThat( is.read(), is( 0 ) ); assertThat( is.read(), is( 0 ) ); assertThat( is.read(), is( 0 ) ); assertThat( is.read(), is( 0 ) ); assertThat( is.read(), is( 4 ) ); assertThat( is.read(), is( (int) 'T' ) ); assertThat( is.read(), is( (int) 'e' ) ); assertThat( is.read(), is( (int) 's' ) ); assertThat( is.read(), is( (int) 't' ) ); } @Test public void shouldDecodeTwoCommands() throws IOException { TestProvidingInputStream pluginIs = new TestProvidingInputStream( new ConcurrentLinkedQueue() ); pluginIs.acknowledgeByeEventReceived(); pluginIs.noop(); DataInputStream is = new DataInputStream( pluginIs ); Command bye = decode( is ); assertThat( bye, is( notNullValue() ) ); assertThat( bye.getCommandType(), is( BYE_ACK ) ); Command noop = decode( is ); assertThat( noop, is( notNullValue() ) ); assertThat( noop.getCommandType(), is( MasterProcessCommand.NOOP ) ); } private static void sleep( long millis ) { try { TimeUnit.MILLISECONDS.sleep( millis ); } catch ( InterruptedException e ) { // do nothing } } } report/000077500000000000000000000000001330756104600347555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefireDefaultReporterFactoryTest.java000066400000000000000000000253671330756104600431340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import java.io.File; import java.util.ArrayList; import java.util.List; import junit.framework.TestCase; import org.apache.maven.plugin.surefire.StartupReportConfiguration; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.shared.utils.logging.MessageUtils; import org.apache.maven.surefire.report.RunStatistics; import org.apache.maven.surefire.report.SafeThrowable; import org.apache.maven.surefire.report.StackTraceWriter; import static java.util.Arrays.asList; import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType.error; import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType.failure; import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType.flake; import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType.skipped; import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType.success; import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType.unknown; import static org.apache.maven.plugin.surefire.report.DefaultReporterFactory.getTestResultType; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; public class DefaultReporterFactoryTest extends TestCase { private final static String TEST_ONE = "testOne"; private final static String TEST_TWO = "testTwo"; private final static String TEST_THREE = "testThree"; private final static String TEST_FOUR = "testFour"; private final static String TEST_FIVE = "testFive"; private final static String ASSERTION_FAIL = "assertionFail"; private final static String ERROR = "error"; public void testMergeTestHistoryResult() { MessageUtils.setColorEnabled( false ); File reportsDirectory = new File("target"); StartupReportConfiguration reportConfig = new StartupReportConfiguration( true, true, "PLAIN", false, false, reportsDirectory, false, null, new File( reportsDirectory, "TESTHASH" ), false, 1, null, null ); DummyTestReporter reporter = new DummyTestReporter(); DefaultReporterFactory factory = new DefaultReporterFactory( reportConfig, reporter ); // First run, four tests failed and one passed List firstRunStats = new ArrayList(); firstRunStats.add( new TestMethodStats( TEST_ONE, ReportEntryType.ERROR, new DummyStackTraceWriter( ERROR ) ) ); firstRunStats.add( new TestMethodStats( TEST_TWO, ReportEntryType.ERROR, new DummyStackTraceWriter( ERROR ) ) ); firstRunStats.add( new TestMethodStats( TEST_THREE, ReportEntryType.FAILURE, new DummyStackTraceWriter( ASSERTION_FAIL ) ) ); firstRunStats.add( new TestMethodStats( TEST_FOUR, ReportEntryType.FAILURE, new DummyStackTraceWriter( ASSERTION_FAIL ) ) ); firstRunStats.add( new TestMethodStats( TEST_FIVE, ReportEntryType.SUCCESS, null ) ); // Second run, two tests passed List secondRunStats = new ArrayList(); secondRunStats.add( new TestMethodStats( TEST_ONE, ReportEntryType.FAILURE, new DummyStackTraceWriter( ASSERTION_FAIL ) ) ); secondRunStats.add( new TestMethodStats( TEST_TWO, ReportEntryType.SUCCESS, null ) ); secondRunStats.add( new TestMethodStats( TEST_THREE, ReportEntryType.ERROR, new DummyStackTraceWriter( ERROR ) ) ); secondRunStats.add( new TestMethodStats( TEST_FOUR, ReportEntryType.SUCCESS, null ) ); // Third run, another test passed List thirdRunStats = new ArrayList(); thirdRunStats.add( new TestMethodStats( TEST_ONE, ReportEntryType.SUCCESS, null ) ); thirdRunStats.add( new TestMethodStats( TEST_THREE, ReportEntryType.ERROR, new DummyStackTraceWriter( ERROR ) ) ); TestSetRunListener firstRunListener = mock( TestSetRunListener.class ); TestSetRunListener secondRunListener = mock( TestSetRunListener.class ); TestSetRunListener thirdRunListener = mock( TestSetRunListener.class ); when( firstRunListener.getTestMethodStats() ).thenReturn( firstRunStats ); when( secondRunListener.getTestMethodStats() ).thenReturn( secondRunStats ); when( thirdRunListener.getTestMethodStats() ).thenReturn( thirdRunStats ); factory.addListener( firstRunListener ); factory.addListener( secondRunListener ); factory.addListener( thirdRunListener ); factory.mergeTestHistoryResult(); RunStatistics mergedStatistics = factory.getGlobalRunStatistics(); // Only TEST_THREE is a failing test, other three are flaky tests assertEquals( 5, mergedStatistics.getCompletedCount() ); assertEquals( 1, mergedStatistics.getErrors() ); assertEquals( 0, mergedStatistics.getFailures() ); assertEquals( 3, mergedStatistics.getFlakes() ); assertEquals( 0, mergedStatistics.getSkipped() ); // Now test the result will be printed out correctly factory.printTestFailures( flake ); String[] expectedFlakeOutput = { "Flakes: ", TEST_FOUR, " Run 1: " + ASSERTION_FAIL, " Run 2: PASS", "", TEST_ONE, " Run 1: " + ERROR, " Run 2: " + ASSERTION_FAIL, " Run 3: PASS", "", TEST_TWO, " Run 1: " + ERROR, " Run 2: PASS", "" }; assertEquals( asList( expectedFlakeOutput ), reporter.getMessages() ); reporter.reset(); factory.printTestFailures( error ); String[] expectedFailureOutput = { "Errors: ", TEST_THREE, " Run 1: " + ASSERTION_FAIL, " Run 2: " + ERROR, " Run 3: " + ERROR, "" }; assertEquals( asList( expectedFailureOutput ), reporter.getMessages() ); reporter.reset(); factory.printTestFailures( failure ); String[] expectedErrorOutput = { }; assertEquals( asList( expectedErrorOutput ), reporter.getMessages() ); } static final class DummyTestReporter implements ConsoleLogger { private final List messages = new ArrayList(); @Override public boolean isDebugEnabled() { return true; } @Override public void debug( String message ) { messages.add( message ); } @Override public boolean isInfoEnabled() { return true; } @Override public void info( String message ) { messages.add( message ); } @Override public boolean isWarnEnabled() { return true; } @Override public void warning( String message ) { messages.add( message ); } @Override public boolean isErrorEnabled() { return true; } @Override public void error( String message ) { messages.add( message ); } @Override public void error( String message, Throwable t ) { messages.add( message ); } @Override public void error( Throwable t ) { } List getMessages() { return messages; } void reset() { messages.clear(); } } public void testGetTestResultType() { List emptyList = new ArrayList(); assertEquals( unknown, getTestResultType( emptyList, 1 ) ); List successList = new ArrayList(); successList.add( ReportEntryType.SUCCESS ); successList.add( ReportEntryType.SUCCESS ); assertEquals( success, getTestResultType( successList, 1 ) ); List failureErrorList = new ArrayList(); failureErrorList.add( ReportEntryType.FAILURE ); failureErrorList.add( ReportEntryType.ERROR ); assertEquals( error, getTestResultType( failureErrorList, 1 ) ); List errorFailureList = new ArrayList(); errorFailureList.add( ReportEntryType.ERROR ); errorFailureList.add( ReportEntryType.FAILURE ); assertEquals( error, getTestResultType( errorFailureList, 1 ) ); List flakeList = new ArrayList(); flakeList.add( ReportEntryType.SUCCESS ); flakeList.add( ReportEntryType.FAILURE ); assertEquals( flake, getTestResultType( flakeList, 1 ) ); assertEquals( failure, getTestResultType( flakeList, 0 ) ); flakeList = new ArrayList(); flakeList.add( ReportEntryType.ERROR ); flakeList.add( ReportEntryType.SUCCESS ); flakeList.add( ReportEntryType.FAILURE ); assertEquals( flake, getTestResultType( flakeList, 1 ) ); assertEquals( error, getTestResultType( flakeList, 0 ) ); List skippedList = new ArrayList(); skippedList.add( ReportEntryType.SKIPPED ); assertEquals( skipped, getTestResultType( skippedList, 1 ) ); } static class DummyStackTraceWriter implements StackTraceWriter { private final String stackTrace; public DummyStackTraceWriter( String stackTrace ) { this.stackTrace = stackTrace; } @Override public String writeTraceToString() { return ""; } @Override public String writeTrimmedTraceToString() { return ""; } @Override public String smartTrimmedStackTrace() { return stackTrace; } @Override public SafeThrowable getThrowable() { return null; } } }StatelessXmlReporterTest.java000066400000000000000000000337011330756104600426370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import junit.framework.TestCase; import org.apache.maven.plugin.surefire.booterclient.output.DeserializedStacktraceWriter; import org.apache.maven.shared.utils.StringUtils; import org.apache.maven.shared.utils.xml.Xpp3Dom; import org.apache.maven.shared.utils.xml.Xpp3DomBuilder; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.SimpleReportEntry; import org.apache.maven.surefire.report.StackTraceWriter; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import static org.apache.maven.surefire.util.internal.ObjectUtils.systemProps; import static org.apache.maven.surefire.util.internal.StringUtils.UTF_8; @SuppressWarnings( "ResultOfMethodCallIgnored" ) public class StatelessXmlReporterTest extends TestCase { private static final String XSD = "https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd"; private final static String TEST_ONE = "aTestMethod"; private final static String TEST_TWO = "bTestMethod"; private final static String TEST_THREE = "cTestMethod"; private static final AtomicInteger FOLDER_POSTFIX = new AtomicInteger(); private TestSetStats stats; private TestSetStats rerunStats; private File expectedReportFile; private File reportDir; @Override protected void setUp() throws Exception { stats = new TestSetStats( false, true ); rerunStats = new TestSetStats( false, true ); File basedir = new File( "." ); File target = new File( basedir.getCanonicalFile(), "target" ); target.mkdir(); String reportRelDir = getClass().getSimpleName() + "-" + FOLDER_POSTFIX.incrementAndGet(); reportDir = new File( target, reportRelDir ); reportDir.mkdir(); } @Override protected void tearDown() throws Exception { if ( expectedReportFile != null ) { expectedReportFile.delete(); } } public void testFileNameWithoutSuffix() { StatelessXmlReporter reporter = new StatelessXmlReporter( reportDir, null, false, 0, new ConcurrentHashMap>>(), XSD ); reporter.cleanTestHistoryMap(); ReportEntry reportEntry = new SimpleReportEntry( getClass().getName(), getClass().getName(), 12 ); WrappedReportEntry testSetReportEntry = new WrappedReportEntry( reportEntry, ReportEntryType.SUCCESS, 12, null, null, systemProps() ); stats.testSucceeded( testSetReportEntry ); reporter.testSetCompleted( testSetReportEntry, stats ); expectedReportFile = new File( reportDir, "TEST-" + getClass().getName() + ".xml" ); assertTrue( "Report file (" + expectedReportFile.getAbsolutePath() + ") doesn't exist", expectedReportFile.exists() ); } public void testAllFieldsSerialized() throws IOException { ReportEntry reportEntry = new SimpleReportEntry( getClass().getName(), TEST_ONE, 12 ); WrappedReportEntry testSetReportEntry = new WrappedReportEntry( reportEntry, ReportEntryType.SUCCESS, 12, null, null, systemProps() ); expectedReportFile = new File( reportDir, "TEST-" + TEST_ONE + ".xml" ); stats.testSucceeded( testSetReportEntry ); StackTraceWriter stackTraceWriter = new DeserializedStacktraceWriter( "A fud msg", "trimmed", "fail at foo" ); Utf8RecodingDeferredFileOutputStream stdOut = new Utf8RecodingDeferredFileOutputStream( "fds" ); String stdOutPrefix; String stdErrPrefix; if ( defaultCharsetSupportsSpecialChar() ) { stdErrPrefix = "std-\u0115rr"; stdOutPrefix = "st]]>d-o\u00DCt"; } else { stdErrPrefix = "std-err"; stdOutPrefix = "st]]>d-out"; } byte[] stdOutBytes = (stdOutPrefix + "!\u0020\u0000\u001F").getBytes(); stdOut.write( stdOutBytes, 0, stdOutBytes.length ); Utf8RecodingDeferredFileOutputStream stdErr = new Utf8RecodingDeferredFileOutputStream( "fds" ); byte[] stdErrBytes = (stdErrPrefix + "?&-&£\u0020\u0000\u001F").getBytes(); stdErr.write( stdErrBytes, 0, stdErrBytes.length ); WrappedReportEntry t2 = new WrappedReportEntry( new SimpleReportEntry( Inner.class.getName(), TEST_TWO, stackTraceWriter, 13 ), ReportEntryType.ERROR, 13, stdOut, stdErr ); stats.testSucceeded( t2 ); StatelessXmlReporter reporter = new StatelessXmlReporter( reportDir, null, false, 0, new ConcurrentHashMap>>(), XSD ); reporter.testSetCompleted( testSetReportEntry, stats ); FileInputStream fileInputStream = new FileInputStream( expectedReportFile ); Xpp3Dom testSuite = Xpp3DomBuilder.build( new InputStreamReader( fileInputStream, UTF_8) ); assertEquals( "testsuite", testSuite.getName() ); Xpp3Dom properties = testSuite.getChild( "properties" ); assertEquals( System.getProperties().size(), properties.getChildCount() ); Xpp3Dom child = properties.getChild( 1 ); assertFalse( StringUtils.isEmpty( child.getAttribute( "value" ) ) ); assertFalse( StringUtils.isEmpty( child.getAttribute( "name" ) ) ); Xpp3Dom[] testcase = testSuite.getChildren( "testcase" ); Xpp3Dom tca = testcase[0]; assertEquals( TEST_ONE, tca.getAttribute( "name" ) ); // Hopefully same order on jdk5 assertEquals( "0.012", tca.getAttribute( "time" ) ); assertEquals( getClass().getName(), tca.getAttribute( "classname" ) ); Xpp3Dom tcb = testcase[1]; assertEquals( TEST_TWO, tcb.getAttribute( "name" ) ); assertEquals( "0.013", tcb.getAttribute( "time" ) ); assertEquals( Inner.class.getName(), tcb.getAttribute( "classname" ) ); Xpp3Dom errorNode = tcb.getChild( "error" ); assertNotNull( errorNode ); assertEquals( "A fud msg", errorNode.getAttribute( "message" ) ); assertEquals( "fail at foo", errorNode.getAttribute( "type" ) ); assertEquals( stdOutPrefix + "! &#0;&#31;", tcb.getChild( "system-out" ).getValue() ); assertEquals( stdErrPrefix + "?&-&£ &#0;&#31;", tcb.getChild( "system-err" ).getValue() ); } public void testOutputRerunFlakyFailure() throws IOException { ReportEntry reportEntry = new SimpleReportEntry( getClass().getName(), TEST_ONE, 12 ); WrappedReportEntry testSetReportEntry = new WrappedReportEntry( reportEntry, ReportEntryType.SUCCESS, 12, null, null, systemProps() ); expectedReportFile = new File( reportDir, "TEST-" + TEST_ONE + ".xml" ); stats.testSucceeded( testSetReportEntry ); StackTraceWriter stackTraceWriterOne = new DeserializedStacktraceWriter( "A fud msg", "trimmed", "fail at foo" ); StackTraceWriter stackTraceWriterTwo = new DeserializedStacktraceWriter( "A fud msg two", "trimmed two", "fail at foo two" ); String firstRunOut = "first run out"; String firstRunErr = "first run err"; String secondRunOut = "second run out"; String secondRunErr = "second run err"; WrappedReportEntry testTwoFirstError = new WrappedReportEntry( new SimpleReportEntry( Inner.class.getName(), TEST_TWO, stackTraceWriterOne, 5 ), ReportEntryType.ERROR, 5, createStdOutput( firstRunOut ), createStdOutput( firstRunErr ) ); WrappedReportEntry testTwoSecondError = new WrappedReportEntry( new SimpleReportEntry( Inner.class.getName(), TEST_TWO, stackTraceWriterTwo, 13 ), ReportEntryType.ERROR, 13, createStdOutput( secondRunOut ), createStdOutput( secondRunErr ) ); WrappedReportEntry testThreeFirstRun = new WrappedReportEntry( new SimpleReportEntry( Inner.class.getName(), TEST_THREE, stackTraceWriterOne, 13 ), ReportEntryType.FAILURE, 13, createStdOutput( firstRunOut ), createStdOutput( firstRunErr ) ); WrappedReportEntry testThreeSecondRun = new WrappedReportEntry( new SimpleReportEntry( Inner.class.getName(), TEST_THREE, stackTraceWriterTwo, 2 ), ReportEntryType.SUCCESS, 2, createStdOutput( secondRunOut ), createStdOutput( secondRunErr ) ); stats.testSucceeded( testTwoFirstError ); stats.testSucceeded( testThreeFirstRun ); rerunStats.testSucceeded( testTwoSecondError ); rerunStats.testSucceeded( testThreeSecondRun ); StatelessXmlReporter reporter = new StatelessXmlReporter( reportDir, null, false, 1, new HashMap>>(), XSD ); reporter.testSetCompleted( testSetReportEntry, stats ); reporter.testSetCompleted( testSetReportEntry, rerunStats ); FileInputStream fileInputStream = new FileInputStream( expectedReportFile ); Xpp3Dom testSuite = Xpp3DomBuilder.build( new InputStreamReader( fileInputStream, UTF_8 ) ); assertEquals( "testsuite", testSuite.getName() ); assertEquals( "0.012", testSuite.getAttribute( "time" ) ); Xpp3Dom properties = testSuite.getChild( "properties" ); assertEquals( System.getProperties().size(), properties.getChildCount() ); Xpp3Dom child = properties.getChild( 1 ); assertFalse( StringUtils.isEmpty( child.getAttribute( "value" ) ) ); assertFalse( StringUtils.isEmpty( child.getAttribute( "name" ) ) ); Xpp3Dom[] testcase = testSuite.getChildren( "testcase" ); Xpp3Dom testCaseOne = testcase[0]; assertEquals( TEST_ONE, testCaseOne.getAttribute( "name" ) ); assertEquals( "0.012", testCaseOne.getAttribute( "time" ) ); assertEquals( getClass().getName(), testCaseOne.getAttribute( "classname" ) ); Xpp3Dom testCaseTwo = testcase[1]; assertEquals( TEST_TWO, testCaseTwo.getAttribute( "name" ) ); // Run time for a rerun failing test is the run time of the first run assertEquals( "0.005", testCaseTwo.getAttribute( "time" ) ); assertEquals( Inner.class.getName(), testCaseTwo.getAttribute( "classname" ) ); Xpp3Dom errorNode = testCaseTwo.getChild( "error" ); Xpp3Dom rerunErrorNode = testCaseTwo.getChild( "rerunError" ); assertNotNull( errorNode ); assertNotNull( rerunErrorNode ); assertEquals( "A fud msg", errorNode.getAttribute( "message" ) ); assertEquals( "fail at foo", errorNode.getAttribute( "type" ) ); // Check rerun error node contains all the information assertEquals( firstRunOut, testCaseTwo.getChild( "system-out" ).getValue() ); assertEquals( firstRunErr, testCaseTwo.getChild( "system-err" ).getValue() ); assertEquals( secondRunOut, rerunErrorNode.getChild( "system-out" ).getValue() ); assertEquals( secondRunErr, rerunErrorNode.getChild( "system-err" ).getValue() ); assertEquals( "A fud msg two", rerunErrorNode.getAttribute( "message" ) ); assertEquals( "fail at foo two", rerunErrorNode.getAttribute( "type" ) ); // Check flaky failure node Xpp3Dom testCaseThree = testcase[2]; assertEquals( TEST_THREE, testCaseThree.getAttribute( "name" ) ); // Run time for a flaky test is the run time of the first successful run assertEquals( "0.002", testCaseThree.getAttribute( "time" ) ); assertEquals( Inner.class.getName(), testCaseThree.getAttribute( "classname" ) ); Xpp3Dom flakyFailureNode = testCaseThree.getChild( "flakyFailure" ); assertNotNull( flakyFailureNode ); assertEquals( firstRunOut, flakyFailureNode.getChild( "system-out" ).getValue() ); assertEquals( firstRunErr, flakyFailureNode.getChild( "system-err" ).getValue() ); // system-out and system-err should not be present for flaky failures assertNull( testCaseThree.getChild( "system-out" ) ); assertNull( testCaseThree.getChild( "system-err" ) ); } private boolean defaultCharsetSupportsSpecialChar() { // some charsets are not able to deal with \u0115 on both ways of the conversion return "\u0115\u00DC".equals( new String( "\u0115\u00DC".getBytes() ) ); } private Utf8RecodingDeferredFileOutputStream createStdOutput( String content ) throws IOException { Utf8RecodingDeferredFileOutputStream stdOut = new Utf8RecodingDeferredFileOutputStream( "fds2" ); stdOut.write( content.getBytes(), 0, content.length() ); return stdOut; } class Inner { } } WrappedReportEntryTest.java000066400000000000000000000054641330756104600423110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/reportpackage org.apache.maven.plugin.surefire.report; /* * 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. */ import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.SimpleReportEntry; import junit.framework.TestCase; /** * @author Kristian Rosenvold */ public class WrappedReportEntryTest extends TestCase { public void testClassNameOnly() throws Exception { String category = "surefire.testcase.JunitParamsTest"; WrappedReportEntry wr = new WrappedReportEntry( new SimpleReportEntry( "fud", category ), null, 12, null, null ); final String reportName = wr.getReportName(); assertEquals( "surefire.testcase.JunitParamsTest", reportName ); } public void testRegular() { ReportEntry reportEntry = new SimpleReportEntry( "fud", "testSum(surefire.testcase.NonJunitParamsTest)" ); WrappedReportEntry wr = new WrappedReportEntry( reportEntry, null, 12, null, null ); final String reportName = wr.getReportName(); assertEquals( "testSum", reportName ); } public void testGetReportNameWithParams() throws Exception { String category = "[0] 1\u002C 2\u002C 3 (testSum)(surefire.testcase.JunitParamsTest)"; ReportEntry reportEntry = new SimpleReportEntry( "fud", category ); WrappedReportEntry wr = new WrappedReportEntry( reportEntry, null, 12, null, null ); final String reportName = wr.getReportName(); assertEquals( "[0] 1, 2, 3 (testSum)", reportName ); } public void testElapsed() throws Exception { String category = "[0] 1\u002C 2\u002C 3 (testSum)(surefire.testcase.JunitParamsTest)"; ReportEntry reportEntry = new SimpleReportEntry( "fud", category ); WrappedReportEntry wr = new WrappedReportEntry( reportEntry, null, 12, null, null ); String elapsedTimeSummary = wr.getElapsedTimeSummary(); assertEquals( "[0] 1, 2, 3 (testSum)(surefire.testcase.JunitParamsTest) Time elapsed: 0.012 s", elapsedTimeSummary ); } } runorder/000077500000000000000000000000001330756104600353025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefireRunEntryStatisticsMapTest.java000066400000000000000000000104501330756104600433040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/runorderpackage org.apache.maven.plugin.surefire.runorder; /* * 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. */ import java.io.File; import java.io.IOException; import java.io.StringReader; import java.util.Arrays; import java.util.List; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.SimpleReportEntry; import junit.framework.TestCase; /** * @author Kristian Rosenvold */ public class RunEntryStatisticsMapTest extends TestCase { public void testPrioritizedClassRuntime() throws IOException { final RunEntryStatisticsMap runEntryStatisticsMap = RunEntryStatisticsMap.fromReader( getStatisticsFile() ); final List> list = Arrays.>asList( A.class, B.class, C.class ); final List> prioritizedTestsClassRunTime = runEntryStatisticsMap.getPrioritizedTestsClassRunTime( list, 2 ); assertEquals( C.class, prioritizedTestsClassRunTime.get( 0 ) ); assertEquals( B.class, prioritizedTestsClassRunTime.get( 1 ) ); assertEquals( A.class, prioritizedTestsClassRunTime.get( 2 ) ); } public void testPrioritizedFailureFirst() throws IOException { final RunEntryStatisticsMap runEntryStatisticsMap = RunEntryStatisticsMap.fromReader( getStatisticsFile() ); final List> list = Arrays.>asList( A.class, B.class, NewClass.class, C.class ); final List> prioritizedTestsClassRunTime = runEntryStatisticsMap.getPrioritizedTestsByFailureFirst( list ); assertEquals( A.class, prioritizedTestsClassRunTime.get( 0 ) ); assertEquals( NewClass.class, prioritizedTestsClassRunTime.get( 1 ) ); assertEquals( C.class, prioritizedTestsClassRunTime.get( 2 ) ); assertEquals( B.class, prioritizedTestsClassRunTime.get( 3 ) ); } private StringReader getStatisticsFile() { String content = "0,17,testA(org.apache.maven.plugin.surefire.runorder.RunEntryStatisticsMapTest$A)\n" + "2,42,testB(org.apache.maven.plugin.surefire.runorder.RunEntryStatisticsMapTest$B)\n" + "1,100,testC(org.apache.maven.plugin.surefire.runorder.RunEntryStatisticsMapTest$C)\n"; return new StringReader( content ); } public void testSerialize() throws Exception { File data = File.createTempFile( "surefire-unit", "test" ); RunEntryStatisticsMap existingEntries = RunEntryStatisticsMap.fromFile( data ); RunEntryStatisticsMap newResults = new RunEntryStatisticsMap(); ReportEntry reportEntry1 = new SimpleReportEntry( "abc", "method1", 42 ); ReportEntry reportEntry2 = new SimpleReportEntry( "abc", "willFail", 17 ); ReportEntry reportEntry3 = new SimpleReportEntry( "abc", "method3", 100 ); newResults.add( existingEntries.createNextGeneration( reportEntry1 ) ); newResults.add( existingEntries.createNextGeneration( reportEntry2 ) ); newResults.add( existingEntries.createNextGeneration( reportEntry3 ) ); newResults.serialize( data ); RunEntryStatisticsMap nextRun = RunEntryStatisticsMap.fromFile( data ); newResults = new RunEntryStatisticsMap(); newResults.add( existingEntries.createNextGeneration( reportEntry1 ) ); newResults.add( existingEntries.createNextGenerationFailure( reportEntry2 ) ); newResults.add( existingEntries.createNextGeneration( reportEntry3 ) ); newResults.serialize( data ); } class A { } class B { } class C { } class NewClass { } } util/000077500000000000000000000000001330756104600344175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefireDependenciesScannerTest.java000066400000000000000000000064571330756104600420360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/utilpackage org.apache.maven.plugin.surefire.util; /* * 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. */ import junit.framework.TestCase; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DefaultArtifact; import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.util.ScanResult; import java.io.File; import java.io.FileOutputStream; import java.util.*; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; /** * @author Aslak Knutsen */ public class DependenciesScannerTest extends TestCase { public void testLocateTestClasses() throws Exception { File testFile = writeTestFile(); // use target as people can configure ide to compile in an other place than maven Artifact artifact = new DefaultArtifact( "org.surefire.dependency", "test-jar", VersionRange.createFromVersion( "1.0" ), "test", "jar", "tests", null ); artifact.setFile( testFile ); List scanDependencies = new ArrayList(); scanDependencies.add( "org.surefire.dependency:test-jar" ); List include = new ArrayList(); include.add( "**/*A.java" ); List exclude = new ArrayList(); List dependenciesToScan = new ArrayList(); for ( Artifact a : DependencyScanner.filter( Collections.singletonList( artifact ), scanDependencies ) ) { dependenciesToScan.add( a.getFile() ); } DependencyScanner scanner = new DependencyScanner( dependenciesToScan, new TestListResolver( include, exclude ) ); ScanResult classNames = scanner.scan(); assertNotNull( classNames ); assertEquals( 1, classNames.size() ); Map props = new HashMap(); classNames.writeTo( props ); assertEquals( 1, props.size() ); } private File writeTestFile() throws Exception { File output = new File( "target/DependenciesScannerTest-tests.jar" ); output.delete(); ZipOutputStream out = new ZipOutputStream( new FileOutputStream( output ) ); try { out.putNextEntry( new ZipEntry( "org/test/TestA.class" ) ); out.closeEntry(); out.putNextEntry( new ZipEntry( "org/test/TestB.class" ) ); out.closeEntry(); return output; } finally { out.close(); } } } DirectoryScannerTest.java000066400000000000000000000054071330756104600414060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/utilpackage org.apache.maven.plugin.surefire.util; /* * 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. */ import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.util.ScanResult; import org.hamcrest.Matcher; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import java.io.File; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; import static org.junit.runners.Parameterized.*; /** * @author Kristian Rosenvold */ @RunWith( Parameterized.class ) public class DirectoryScannerTest { @Parameters( name = "\"{0}\" should count {1} classes" ) public static Iterable data() { return Arrays.asList( new Object[][] { { "**/*ZT*A.java", is( 3 ) }, { "**/*ZT*A.java#testMethod", is( 3 ) }, { "**/*ZT?A.java#testMethod, !*ZT2A", is( 2 ) }, { "**/*ZT?A.java#testMethod, !*ZT2A#testMethod", is( 3 ) }, { "#testMethod", is( greaterThanOrEqualTo( 3 ) ) }, } ); } @Parameter( 0 ) public String filter; @Parameter( 1 ) public Matcher expectedClassesCount; @Test public void locateTestClasses() throws Exception { // use target as people can configure ide to compile in an other place than maven File baseDir = new File( new File( "target/test-classes" ).getCanonicalPath() ); TestListResolver resolver = new TestListResolver( filter ); DirectoryScanner surefireDirectoryScanner = new DirectoryScanner( baseDir, resolver ); ScanResult classNames = surefireDirectoryScanner.scan(); assertThat( classNames, is( notNullValue() ) ); assertThat( classNames.size(), is( expectedClassesCount ) ); Map props = new HashMap(); classNames.writeTo( props ); assertThat( props.values(), hasSize( expectedClassesCount ) ); } } ScannerUtilTest.java000066400000000000000000000033531330756104600403550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/utilpackage org.apache.maven.plugin.surefire.util; /* * 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. */ import org.junit.Test; import static org.fest.assertions.Assertions.assertThat; /** * Unit test for {@link ScannerUtil} */ public class ScannerUtilTest { @Test public void shouldConvertJarFileResourceToJavaClassName() { String className = ScannerUtil.convertJarFileResourceToJavaClassName( "org/apache/pkg/MyService.class" ); assertThat( className ) .isEqualTo( "org.apache.pkg.MyService" ); className = ScannerUtil.convertJarFileResourceToJavaClassName( "META-INF/MANIFEST.MF" ); assertThat( className ) .isEqualTo( "META-INF.MANIFEST.MF" ); } @Test public void shouldBeClassFile() { assertThat( ScannerUtil.isJavaClassFile( "META-INF/MANIFEST.MF" ) ) .isFalse(); assertThat( ScannerUtil.isJavaClassFile( "org/apache/pkg/MyService.class" ) ) .isTrue(); } } SpecificFileFilterTest.java000066400000000000000000000043361330756104600416230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/utilpackage org.apache.maven.plugin.surefire.util; /* * 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. */ import static org.apache.maven.plugin.surefire.util.ScannerUtil.convertSlashToSystemFileSeparator; import junit.framework.TestCase; /** * @author Kristian Rosenvold */ @Deprecated public class SpecificFileFilterTest extends TestCase { public void testMatchSingleCharacterWildcard() { SpecificFileFilter filter = createFileFilter( "org/apache/maven/surefire/?pecificTestClassFilter.class" ); assertTrue( filter.accept( getFile() ) ); } public void testMatchSingleSegmentWordWildcard() { SpecificFileFilter filter = createFileFilter( "org/apache/maven/surefire/*TestClassFilter.class" ); assertTrue( filter.accept( getFile() ) ); } public void testMatchMultiSegmentWildcard() { SpecificFileFilter filter = createFileFilter( "org/**/SpecificTestClassFilter.class" ); assertTrue( filter.accept( getFile() ) ); } public void testMatchSingleSegmentWildcard() { SpecificFileFilter filter = createFileFilter( "org/*/maven/surefire/SpecificTestClassFilter.class" ); assertTrue( filter.accept( getFile() ) ); } private SpecificFileFilter createFileFilter( String s ) { return new SpecificFileFilter( new String[]{ s } ); } private String getFile() { return convertSlashToSystemFileSeparator( "org/apache/maven/surefire/SpecificTestClassFilter.class" ); } } maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/000077500000000000000000000000001330756104600322235ustar00rootroot00000000000000JUnit4SuiteTest.java000066400000000000000000000123731330756104600360040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefirepackage org.apache.maven.surefire; /* * 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. */ import junit.framework.JUnit4TestAdapter; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import org.apache.maven.plugin.surefire.AbstractSurefireMojoJava7PlusTest; import org.apache.maven.plugin.surefire.AbstractSurefireMojoTest; import org.apache.maven.plugin.surefire.MojoMocklessTest; import org.apache.maven.plugin.surefire.SurefireHelperTest; import org.apache.maven.plugin.surefire.SurefireReflectorTest; import org.apache.maven.plugin.surefire.SurefirePropertiesTest; import org.apache.maven.plugin.surefire.booterclient.BooterDeserializerProviderConfigurationTest; import org.apache.maven.plugin.surefire.booterclient.BooterDeserializerStartupConfigurationTest; import org.apache.maven.plugin.surefire.booterclient.DefaultForkConfigurationTest; import org.apache.maven.plugin.surefire.booterclient.ForkConfigurationTest; import org.apache.maven.plugin.surefire.booterclient.ForkingRunListenerTest; import org.apache.maven.plugin.surefire.booterclient.ModularClasspathForkConfigurationTest; import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestLessInputStreamBuilderTest; import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestProvidingInputStreamTest; import org.apache.maven.plugin.surefire.report.DefaultReporterFactoryTest; import org.apache.maven.plugin.surefire.report.StatelessXmlReporterTest; import org.apache.maven.plugin.surefire.report.WrappedReportEntryTest; import org.apache.maven.plugin.surefire.runorder.RunEntryStatisticsMapTest; import org.apache.maven.plugin.surefire.util.DependenciesScannerTest; import org.apache.maven.plugin.surefire.util.DirectoryScannerTest; import org.apache.maven.plugin.surefire.util.ScannerUtilTest; import org.apache.maven.plugin.surefire.util.SpecificFileFilterTest; import org.apache.maven.surefire.report.ConsoleOutputFileReporterTest; import org.apache.maven.surefire.report.FileReporterTest; import org.apache.maven.surefire.report.RunStatisticsTest; import org.apache.maven.surefire.spi.SPITest; import org.apache.maven.surefire.util.RelocatorTest; import static org.apache.commons.lang3.JavaVersion.JAVA_1_7; import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT; /** * Adapt the JUnit4 tests which use only annotations to the JUnit3 test suite. * * @author Tibor Digana (tibor17) * @since 2.19 */ public class JUnit4SuiteTest extends TestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTestSuite( RelocatorTest.class ); suite.addTestSuite( RunStatisticsTest.class ); suite.addTestSuite( FileReporterTest.class ); suite.addTestSuite( ConsoleOutputFileReporterTest.class ); suite.addTestSuite( SurefirePropertiesTest.class ); suite.addTestSuite( SpecificFileFilterTest.class ); suite.addTest( new JUnit4TestAdapter( DirectoryScannerTest.class ) ); suite.addTestSuite( DependenciesScannerTest.class ); suite.addTestSuite( RunEntryStatisticsMapTest.class ); suite.addTestSuite( WrappedReportEntryTest.class ); suite.addTestSuite( StatelessXmlReporterTest.class ); suite.addTestSuite( DefaultReporterFactoryTest.class ); suite.addTestSuite( ForkingRunListenerTest.class ); suite.addTest( new JUnit4TestAdapter( ForkConfigurationTest.class ) ); suite.addTestSuite( BooterDeserializerStartupConfigurationTest.class ); suite.addTestSuite( BooterDeserializerProviderConfigurationTest.class ); suite.addTest( new JUnit4TestAdapter( TestProvidingInputStreamTest.class ) ); suite.addTest( new JUnit4TestAdapter( TestLessInputStreamBuilderTest.class ) ); suite.addTest( new JUnit4TestAdapter( SPITest.class ) ); suite.addTest( new JUnit4TestAdapter( SurefireReflectorTest.class ) ); suite.addTest( new JUnit4TestAdapter( SurefireHelperTest.class ) ); suite.addTest( new JUnit4TestAdapter( AbstractSurefireMojoTest.class ) ); suite.addTest( new JUnit4TestAdapter( DefaultForkConfigurationTest.class ) ); suite.addTest( new JUnit4TestAdapter( ModularClasspathForkConfigurationTest.class ) ); if ( JAVA_RECENT.atLeast( JAVA_1_7 ) ) { suite.addTest( new JUnit4TestAdapter( AbstractSurefireMojoJava7PlusTest.class ) ); } suite.addTest( new JUnit4TestAdapter( ScannerUtilTest.class ) ); suite.addTest( new JUnit4TestAdapter( MojoMocklessTest.class ) ); return suite; } } maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/000077500000000000000000000000001330756104600335365ustar00rootroot00000000000000ConsoleOutputFileReporterTest.java000066400000000000000000000152371330756104600423400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.apache.maven.plugin.surefire.report.ConsoleOutputFileReporter; import junit.framework.TestCase; import org.apache.maven.shared.utils.io.FileUtils; import static org.apache.maven.surefire.util.internal.StringUtils.US_ASCII; import static org.fest.assertions.Assertions.assertThat; public class ConsoleOutputFileReporterTest extends TestCase { /* * Test method for 'org.codehaus.surefire.report.ConsoleOutputFileReporter.testSetCompleted(ReportEntry report)' */ public void testFileNameWithoutSuffix() throws IOException { File reportDir = new File( new File( System.getProperty( "user.dir" ), "target" ), "tmp1" ); //noinspection ResultOfMethodCallIgnored reportDir.mkdirs(); ReportEntry reportEntry = new SimpleReportEntry( getClass().getName(), getClass().getName() ); ConsoleOutputFileReporter reporter = new ConsoleOutputFileReporter( reportDir, null ); reporter.testSetStarting( reportEntry ); reporter.writeTestOutput( "some text".getBytes( US_ASCII ), 0, 5, true ); reporter.testSetCompleted( reportEntry ); reporter.close(); File expectedReportFile = new File( reportDir, getClass().getName() + "-output.txt" ); assertTrue( "Report file (" + expectedReportFile.getAbsolutePath() + ") doesn't exist", expectedReportFile.exists() ); assertThat( FileUtils.fileRead( expectedReportFile, US_ASCII.name() ) ) .contains( "some " ); //noinspection ResultOfMethodCallIgnored expectedReportFile.delete(); } /* * Test method for 'org.codehaus.surefire.report.ConsoleOutputFileReporter.testSetCompleted(ReportEntry report)' */ public void testFileNameWithSuffix() throws IOException { File reportDir = new File( new File( System.getProperty( "user.dir" ), "target" ), "tmp2" ); //noinspection ResultOfMethodCallIgnored reportDir.mkdirs(); String suffixText = "sampleSuffixText"; ReportEntry reportEntry = new SimpleReportEntry( getClass().getName(), getClass().getName() ); ConsoleOutputFileReporter reporter = new ConsoleOutputFileReporter( reportDir, suffixText ); reporter.testSetStarting( reportEntry ); reporter.writeTestOutput( "some text".getBytes( US_ASCII ), 0, 5, true ); reporter.testSetCompleted( reportEntry ); reporter.close(); File expectedReportFile = new File( reportDir, getClass().getName() + "-" + suffixText + "-output.txt" ); assertTrue( "Report file (" + expectedReportFile.getAbsolutePath() + ") doesn't exist", expectedReportFile.exists() ); assertThat( FileUtils.fileRead( expectedReportFile, US_ASCII.name() ) ) .contains( "some " ); //noinspection ResultOfMethodCallIgnored expectedReportFile.delete(); } public void testNullReportFile() throws IOException { File reportDir = new File( new File( System.getProperty( "user.dir" ), "target" ), "tmp3" ); //noinspection ResultOfMethodCallIgnored reportDir.mkdirs(); ConsoleOutputFileReporter reporter = new ConsoleOutputFileReporter( reportDir, null ); reporter.writeTestOutput( "some text".getBytes( US_ASCII ), 0, 5, true ); reporter.testSetCompleted( new SimpleReportEntry( getClass().getName(), getClass().getName() ) ); reporter.close(); File expectedReportFile = new File( reportDir, "null-output.txt" ); assertTrue( "Report file (" + expectedReportFile.getAbsolutePath() + ") doesn't exist", expectedReportFile.exists() ); assertThat( FileUtils.fileRead( expectedReportFile, US_ASCII.name() ) ) .contains( "some " ); //noinspection ResultOfMethodCallIgnored expectedReportFile.delete(); } public void testConcurrentAccessReportFile() throws Exception { File reportDir = new File( new File( System.getProperty( "user.dir" ), "target" ), "tmp4" ); //noinspection ResultOfMethodCallIgnored reportDir.mkdirs(); final ConsoleOutputFileReporter reporter = new ConsoleOutputFileReporter( reportDir, null ); reporter.testSetStarting( new SimpleReportEntry( getClass().getName(), getClass().getName() ) ); ExecutorService scheduler = Executors.newFixedThreadPool( 10 ); final ArrayList> jobs = new ArrayList>(); for ( int i = 0; i < 10; i++ ) { jobs.add( new Callable() { @Override public Void call() { byte[] stream = "some text\n".getBytes( US_ASCII ); reporter.writeTestOutput( stream, 0, stream.length, true ); return null; } } ); } scheduler.invokeAll( jobs ); scheduler.shutdown(); reporter.close(); File expectedReportFile = new File( reportDir, getClass().getName() + "-output.txt" ); assertTrue( "Report file (" + expectedReportFile.getAbsolutePath() + ") doesn't exist", expectedReportFile.exists() ); assertThat( FileUtils.fileRead( expectedReportFile, US_ASCII.name() ) ) .contains( "some text" ); StringBuilder expectedText = new StringBuilder(); for ( int i = 0; i < 10; i++ ) { expectedText.append( "some text\n" ); } assertThat( FileUtils.fileRead( expectedReportFile, US_ASCII.name() ) ) .isEqualTo( expectedText.toString() ); //noinspection ResultOfMethodCallIgnored expectedReportFile.delete(); } } FileReporterTest.java000066400000000000000000000063121330756104600375660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import java.io.File; import java.nio.charset.Charset; import java.util.ArrayList; import org.apache.maven.plugin.surefire.report.FileReporter; import org.apache.maven.plugin.surefire.report.ReportEntryType; import org.apache.maven.plugin.surefire.report.TestSetStats; import org.apache.maven.plugin.surefire.report.WrappedReportEntry; import junit.framework.TestCase; public class FileReporterTest extends TestCase { private FileReporter reporter; private ReportEntry reportEntry; private static final String testName = "org.apache.maven.surefire.report.FileReporterTest"; public void testFileNameWithoutSuffix() { File reportDir = new File( "target" ); reportEntry = new SimpleReportEntry( this.getClass().getName(), testName ); WrappedReportEntry wrappedReportEntry = new WrappedReportEntry( reportEntry, ReportEntryType.SUCCESS, 12, null, null ); reporter = new FileReporter( reportDir, null, Charset.defaultCharset() ); reporter.testSetCompleted( wrappedReportEntry, createTestSetStats(), new ArrayList() ); File expectedReportFile = new File( reportDir, testName + ".txt" ); assertTrue( "Report file (" + expectedReportFile.getAbsolutePath() + ") doesn't exist", expectedReportFile.exists() ); //noinspection ResultOfMethodCallIgnored expectedReportFile.delete(); } private TestSetStats createTestSetStats() { return new TestSetStats( true, true ); } public void testFileNameWithSuffix() { File reportDir = new File( "target" ); String suffixText = "sampleSuffixText"; reportEntry = new SimpleReportEntry( this.getClass().getName(), testName ); WrappedReportEntry wrappedReportEntry = new WrappedReportEntry( reportEntry, ReportEntryType.SUCCESS, 12, null, null ); reporter = new FileReporter( reportDir, suffixText, Charset.defaultCharset() ); reporter.testSetCompleted( wrappedReportEntry, createTestSetStats(), new ArrayList() ); File expectedReportFile = new File( reportDir, testName + "-" + suffixText + ".txt" ); assertTrue( "Report file (" + expectedReportFile.getAbsolutePath() + ") doesn't exist", expectedReportFile.exists() ); //noinspection ResultOfMethodCallIgnored expectedReportFile.delete(); } } RunStatisticsTest.java000066400000000000000000000022261330756104600400030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; import junit.framework.TestCase; /* * Copyright 2002-2009 the original author or authors. * * Licensed 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. * */ public class RunStatisticsTest extends TestCase { public void testSetRunStatistics() { RunStatistics statistics = new RunStatistics(); statistics.set( 10, 5, 2, 1, 2 ); assertEquals( 10, statistics.getCompletedCount() ); assertEquals( 5, statistics.getErrors() ); assertEquals( 2, statistics.getFailures() ); assertEquals( 1, statistics.getSkipped() ); assertEquals( 2, statistics.getFlakes() ); } } maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/000077500000000000000000000000001330756104600330165ustar00rootroot00000000000000CustomizedImpl.java000066400000000000000000000020771330756104600365600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/spipackage org.apache.maven.surefire.spi; /* * 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. */ /** * @author Tibor Digana (tibor17) * @since 2.20 */ public class CustomizedImpl implements IDefault { @Override public boolean isDefault() { return false; } } DefaultImpl.java000066400000000000000000000020731330756104600360120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/spipackage org.apache.maven.surefire.spi; /* * 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. */ /** * @author Tibor Digana (tibor17) * @since 2.20 */ public class DefaultImpl implements IDefault { @Override public boolean isDefault() { return true; } } EmptyServiceInterface.java000066400000000000000000000017711330756104600400500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/spipackage org.apache.maven.surefire.spi; /* * 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. */ /** * @author Tibor Digana (tibor17) * @since 2.20 */ public interface EmptyServiceInterface { String whoAmI(); } ExistingServiceInterface.java000066400000000000000000000017741330756104600405470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/spipackage org.apache.maven.surefire.spi; /* * 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. */ /** * @author Tibor Digana (tibor17) * @since 2.20 */ public interface ExistingServiceInterface { String whoAmI(); } IDefault.java000066400000000000000000000022301330756104600352740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/spipackage org.apache.maven.surefire.spi; /* * 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. */ /** * @author Tibor Digana (tibor17) * @since 2.20 */ public interface IDefault { /** * @return {@code true} if SPI implementation vendor is maven-surefire-plugin or maven-failsafe-plugin. * {@code false} if customized by users. */ boolean isDefault(); } NoServiceInterface.java000066400000000000000000000017721330756104600373270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/spipackage org.apache.maven.surefire.spi; /* * 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. */ /** * @author Tibor Digana (tibor17) * @since 2.20 */ public interface NoServiceInterface { void dummyService(); } SPITest.java000066400000000000000000000061261330756104600351020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/spipackage org.apache.maven.surefire.spi; /* * 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. */ import org.apache.maven.plugin.surefire.booterclient.ProviderDetector; import org.apache.maven.surefire.providerapi.ServiceLoader; import org.junit.Test; import java.io.IOException; import static java.lang.Thread.currentThread; import static org.fest.assertions.Assertions.assertThat; /** * @author Tibor Digana (tibor17) * @since 2.20 */ public class SPITest { private final ServiceLoader spi = new ServiceLoader(); private final ProviderDetector providerDetector = new ProviderDetector(); private final ClassLoader ctx = currentThread().getContextClassLoader(); @Test public void shouldNotLoadSpiDoesNotExist() throws IOException { assertThat( spi.lookup( NoServiceInterface.class, ctx ) ) .isEmpty(); assertThat( spi.load( NoServiceInterface.class, ctx ) ) .isEmpty(); assertThat( providerDetector.lookupServiceNames( NoServiceInterface.class, ctx ) ) .isEmpty(); } @Test public void shouldNotLoadEmptySpi() throws IOException { assertThat( spi.lookup( EmptyServiceInterface.class, ctx ) ) .isEmpty(); assertThat( spi.load( EmptyServiceInterface.class, ctx ) ) .isEmpty(); assertThat( providerDetector.lookupServiceNames( EmptyServiceInterface.class, ctx ) ) .isEmpty(); } @Test public void shouldLoad2SpiObjects() throws IOException { assertThat( spi.lookup( ExistingServiceInterface.class, ctx ) ) .hasSize( 2 ); assertThat( spi.lookup( ExistingServiceInterface.class, ctx ) ) .containsOnly( SPImpl1.class.getName(), SPImpl2.class.getName() ); assertThat( spi.load( ExistingServiceInterface.class, ctx ) ) .hasSize( 2 ); assertThat( spi.load( ExistingServiceInterface.class, ctx ) ) .contains( new SPImpl1(), new SPImpl2() ); assertThat( providerDetector.lookupServiceNames( ExistingServiceInterface.class, ctx ) ) .hasSize( 2 ); assertThat( providerDetector.lookupServiceNames( ExistingServiceInterface.class, ctx ) ) .containsOnly( SPImpl1.class.getName(), SPImpl2.class.getName() ); } } SPImpl1.java000066400000000000000000000024521330756104600350320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/spipackage org.apache.maven.surefire.spi; /* * 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. */ /** * @author Tibor Digana (tibor17) * @since 2.20 */ public class SPImpl1 implements ExistingServiceInterface { @Override public String whoAmI() { return SPImpl1.class.getSimpleName(); } @Override public boolean equals( Object o ) { return this == o || getClass() == o.getClass(); } @Override public int hashCode() { return whoAmI().hashCode(); } } SPImpl2.java000066400000000000000000000024521330756104600350330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/spipackage org.apache.maven.surefire.spi; /* * 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. */ /** * @author Tibor Digana (tibor17) * @since 2.20 */ public class SPImpl2 implements ExistingServiceInterface { @Override public String whoAmI() { return SPImpl2.class.getSimpleName(); } @Override public boolean equals( Object o ) { return this == o || getClass() == o.getClass(); } @Override public int hashCode() { return whoAmI().hashCode(); } } maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/util/000077500000000000000000000000001330756104600332005ustar00rootroot00000000000000RelocatorTest.java000066400000000000000000000027041330756104600365610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import org.apache.maven.plugin.surefire.util.Relocator; import junit.framework.TestCase; /** * @author Kristian Rosenvold */ public class RelocatorTest extends TestCase { public void testFoo() { String cn = "org.apache.maven.surefire.report.ForkingConsoleReporter"; assertEquals( "org.apache.maven.surefire.shadefire.report.ForkingConsoleReporter", Relocator.relocate( cn ) ); } public void testRelocation() { String org1 = "org.apache.maven.surefire.fooz.Baz"; assertEquals( "org.apache.maven.surefire.shadefire.fooz.Baz", Relocator.relocate( org1 ) ); } } maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/resources/000077500000000000000000000000001330756104600263525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/resources/META-INF/000077500000000000000000000000001330756104600275125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/resources/META-INF/services/000077500000000000000000000000001330756104600313355ustar00rootroot00000000000000org.apache.maven.surefire.spi.EmptyServiceInterface000066400000000000000000000016051330756104600431730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/resources/META-INF/services# # 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. # # this is just a comment and should not be retrieved from SPI loader # here should not be any class specified! org.apache.maven.surefire.spi.ExistingServiceInterface000066400000000000000000000016721330756104600436730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/resources/META-INF/services# # 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. # # this is just a comment and should not be retrieved from SPI loader org.apache.maven.surefire.spi.SPImpl1 # another comment org.apache.maven.surefire.spi.SPImpl2 org.apache.maven.surefire.spi.IDefault000066400000000000000000000015561330756104600404350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-common/src/test/resources/META-INF/services# # 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. # org.apache.maven.surefire.spi.DefaultImpl org.apache.maven.surefire.spi.CustomizedImpl maven-surefire-surefire-2.22.0/maven-surefire-plugin/000077500000000000000000000000001330756104600226005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/pom.xml000066400000000000000000000116671330756104600241300ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire 2.22.0 org.apache.maven.plugins maven-surefire-plugin maven-plugin Maven Surefire Plugin Maven Surefire MOJO in maven-surefire-plugin. 2.2.1 Surefire Failsafe org.apache.maven.surefire maven-surefire-common org.apache.maven.plugins maven-plugin-plugin true mojo-descriptor process-classes descriptor help-goal helpmojo maven-surefire-plugin org.apache.maven.surefire surefire-shadefire 2.12.4 maven-assembly-plugin 2.6 build-site package single true site-source src/assembly/site-source.xml org.apache.maven.plugins maven-plugin-plugin ${mavenPluginPluginVersion} ci enableCiProfile true maven-docck-plugin 1.0 check reporting org.apache.maven.plugins maven-changes-plugin false jira-report maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/000077500000000000000000000000001330756104600233675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/assembly/000077500000000000000000000000001330756104600252065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/assembly/site-source.xml000066400000000000000000000032741330756104600302000ustar00rootroot00000000000000 site-source zip false true ${basedir}/src/site false / true ${project.build.directory}/source-site false / maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/main/000077500000000000000000000000001330756104600243135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/main/java/000077500000000000000000000000001330756104600252345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/main/java/org/000077500000000000000000000000001330756104600260235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/main/java/org/apache/000077500000000000000000000000001330756104600272445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600303525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/000077500000000000000000000000001330756104600316505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/000077500000000000000000000000001330756104600334745ustar00rootroot00000000000000SurefirePlugin.java000066400000000000000000000564011330756104600372310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import java.io.File; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.surefire.suite.RunResult; import static org.apache.maven.plugin.surefire.SurefireHelper.reportExecution; /** * Run tests using Surefire. * * @author Jason van Zyl */ @Mojo( name = "test", defaultPhase = LifecyclePhase.TEST, threadSafe = true, requiresDependencyResolution = ResolutionScope.TEST ) public class SurefirePlugin extends AbstractSurefireMojo implements SurefireReportParameters { /** * The directory containing generated classes of the project being tested. This will be included after the test * classes in the test classpath. */ @Parameter( defaultValue = "${project.build.outputDirectory}" ) private File classesDirectory; /** * Set this to "true" to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on * occasion. */ @Parameter( property = "maven.test.failure.ignore", defaultValue = "false" ) private boolean testFailureIgnore; /** * Base directory where all reports are written to. */ @Parameter( defaultValue = "${project.build.directory}/surefire-reports" ) private File reportsDirectory; @SuppressWarnings( "checkstyle:linelength" ) /** * Specify this parameter to run individual tests by file name, overriding the parameter {@code includes} and * {@code excludes}. Each pattern you specify here will be used to create an include pattern formatted like * **{@literal /}${test}.java, so you can just type {@code -Dtest=MyTest} to run a single test called * "foo/MyTest.java". The test patterns prefixed with a ! will be excluded. *
* This parameter overrides the parameter {@code includes}, {@code excludes}, and the TestNG parameter * {@code suiteXmlFiles}. *
* Since 2.7.3, you can execute a limited number of methods in the test by adding #myMethod or * #my*ethod. For example, {@code -Dtest=MyTest#myMethod}. This is supported for junit 4.x and TestNg.
*
* Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): *
"-Dtest=???Test, !Unstable*, pkg{@literal /}**{@literal /}Ci*leTest.java, *Test#test*One+testTwo?????, #fast*+slowTest"
* or e.g. *
"-Dtest=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyTest.class#one.*|two.*], %regex[#fast.*|slow.*]"
*
* The Parameterized JUnit runner {@code describes} test methods using an index in brackets, so the non-regex * method pattern would become: {@code #testMethod[*]}. * If using @Parameters(name="{index}: fib({0})={1}") and selecting the index e.g. 5 in pattern, the * non-regex method pattern would become {@code #testMethod[5:*]}. */ @Parameter( property = "test" ) private String test; /** * Option to print summary of test suites or just print the test cases that have errors. */ @Parameter( property = "surefire.printSummary", defaultValue = "true" ) private boolean printSummary; /** * Selects the formatting for the test report to be generated. Can be set as "brief" or "plain". * Only applies to the output format of the output files (target/surefire-reports/testName.txt) */ @Parameter( property = "surefire.reportFormat", defaultValue = "brief" ) private String reportFormat; /** * Option to generate a file test report or just output the test report to the console. */ @Parameter( property = "surefire.useFile", defaultValue = "true" ) private boolean useFile; /** * Set this to "true" to cause a failure if none of the tests specified in -Dtest=... are run. Defaults to * "true". * * @since 2.12 */ @Parameter( property = "surefire.failIfNoSpecifiedTests" ) private Boolean failIfNoSpecifiedTests; /** * Attach a debugger to the forked JVM. If set to "true", the process will suspend and wait for a debugger to attach * on port 5005. If set to some other string, that string will be appended to the argLine, allowing you to configure * arbitrary debuggability options (without overwriting the other options specified through the {@code argLine} * parameter). * * @since 2.4 */ @Parameter( property = "maven.surefire.debug" ) private String debugForkedProcess; /** * Kill the forked test process after a certain number of seconds. If set to 0, wait forever for the process, never * timing out. * * @since 2.4 */ @Parameter( property = "surefire.timeout" ) private int forkedProcessTimeoutInSeconds; /** * Forked process is normally terminated without any significant delay after given tests have completed. * If the particular tests started non-daemon Thread(s), the process hangs instead of been properly terminated * by {@code System.exit()}. Use this parameter in order to determine the timeout of terminating the process. * see the documentation: * http://maven.apache.org/surefire/maven-surefire-plugin/examples/shutdown.html * Turns to default fallback value of 30 seconds if negative integer. * * @since 2.20 */ @Parameter( property = "surefire.exitTimeout", defaultValue = "30" ) private int forkedProcessExitTimeoutInSeconds; /** * Stop executing queued parallel JUnit tests after a certain number of seconds. *
* Example values: "3.5", "4"
*
* If set to 0, wait forever, never timing out. * Makes sense with specified {@code parallel} different from "none". * * @since 2.16 */ @Parameter( property = "surefire.parallel.timeout" ) private double parallelTestsTimeoutInSeconds; /** * Stop executing queued parallel JUnit tests * and {@code interrupt} currently running tests after a certain number of seconds. *
* Example values: "3.5", "4"
*
* If set to 0, wait forever, never timing out. * Makes sense with specified {@code parallel} different from "none". * * @since 2.16 */ @Parameter( property = "surefire.parallel.forcedTimeout" ) private double parallelTestsTimeoutForcedInSeconds; @SuppressWarnings( "checkstyle:linelength" ) /** * A list of <include> elements specifying the tests (by pattern) that should be included in testing. When not * specified and when the {@code test} parameter is not specified, the default includes will be *

     * {@literal }
     *     {@literal }**{@literal /}Test*.java{@literal }
     *     {@literal }**{@literal /}*Test.java{@literal }
     *     {@literal }**{@literal /}*Tests.java{@literal }
     *     {@literal }**{@literal /}*TestCase.java{@literal }
     * {@literal }
     * 
* Each include item may also contain a comma-separated sub-list of items, which will be treated as multiple *  <include> entries.
* Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): *

     *
     * 
* {@literal }%regex[.*[Cat|Dog].*], Basic????, !Unstable*{@literal } * {@literal }%regex[.*[Cat|Dog].*], !%regex[pkg.*Slow.*.class], pkg{@literal /}**{@literal /}*Fast*.java{@literal } *
* This parameter is ignored if the TestNG {@code suiteXmlFiles} parameter is specified.
*
* Notice that these values are relative to the directory containing generated test classes of the project * being tested. This directory is declared by the parameter {@code testClassesDirectory} which defaults * to the POM property {@code ${project.build.testOutputDirectory}}, typically * {@literal src/test/java} unless overridden. */ @Parameter private List includes; /** * Option to pass dependencies to the system's classloader instead of using an isolated class loader when forking. * Prevents problems with JDKs which implement the service provider lookup mechanism by using the system's * ClassLoader. * * @since 2.3 */ @Parameter( property = "surefire.useSystemClassLoader", defaultValue = "true" ) private boolean useSystemClassLoader; /** * By default, Surefire forks your tests using a manifest-only JAR; set this parameter to "false" to force it to * launch your tests with a plain old Java classpath. (See the * * http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html * for a more detailed explanation of manifest-only JARs and their benefits.) *
* Beware, setting this to "false" may cause your tests to fail on Windows if your classpath is too long. * * @since 2.4.3 */ @Parameter( property = "surefire.useManifestOnlyJar", defaultValue = "true" ) private boolean useManifestOnlyJar; /** * The character encoding scheme to be applied while generating test report * files (see target/surefire-reports/yourTestName.txt). * The report output files (*-out.txt) are still encoded with JVM's encoding used in standard out/err pipes. * * @since 3.0.0-M1 */ @Parameter( property = "surefire.encoding", defaultValue = "${project.reporting.outputEncoding}" ) private String encoding; /** * (JUnit 4+ providers) * The number of times each failing test will be rerun. If set larger than 0, rerun failing tests immediately after * they fail. If a failing test passes in any of those reruns, it will be marked as pass and reported as a "flake". * However, all the failing attempts will be recorded. */ @Parameter( property = "surefire.rerunFailingTestsCount", defaultValue = "0" ) private int rerunFailingTestsCount; /** * (TestNG) List of <suiteXmlFile> elements specifying TestNG suite xml file locations. Note that * {@code suiteXmlFiles} is incompatible with several other parameters of this plugin, like * {@code includes} and {@code excludes}.
* This parameter is ignored if the {@code test} parameter is specified (allowing you to run a single test * instead of an entire suite). * * @since 2.2 */ @Parameter( property = "surefire.suiteXmlFiles" ) private File[] suiteXmlFiles; /** * Defines the order the tests will be run in. Supported values are {@code alphabetical}, * {@code reversealphabetical}, {@code random}, {@code hourly} (alphabetical on even hours, reverse alphabetical * on odd hours), {@code failedfirst}, {@code balanced} and {@code filesystem}. *
*
* Odd/Even for hourly is determined at the time the of scanning the classpath, meaning it could change during a * multi-module build. *
*
* Failed first will run tests that failed on previous run first, as well as new tests for this run. *
*
* Balanced is only relevant with parallel=classes, and will try to optimize the run-order of the tests reducing the * overall execution time. Initially a statistics file is created and every next test run will reorder classes. *
*
* Note that the statistics are stored in a file named .surefire-XXXXXXXXX beside pom.xml and * should not be checked into version control. The "XXXXX" is the SHA1 checksum of the entire surefire * configuration, so different configurations will have different statistics files, meaning if you change any * configuration settings you will re-run once before new statistics data can be established. * * @since 2.7 */ @Parameter( property = "surefire.runOrder", defaultValue = "filesystem" ) private 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: *

     * *{@literal /}test{@literal /}*
     * **{@literal /}NotIncludedByDefault.java
     * %regex[.*Test.*|.*Not.*]
     * 
*/ @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:
*

     * *{@literal /}test{@literal /}*
     * **{@literal /}DontRunTest.*
     * %regex[.*Test.*|.*Not.*]
     * 
*/ @Parameter( property = "surefire.excludesFile" ) private File excludesFile; /** * Set to error/failure count in order to skip remaining tests. * Due to race conditions in parallel/forked execution this may not be fully guaranteed.
* Enable with system property {@code -Dsurefire.skipAfterFailureCount=1} or any number greater than zero. * Defaults to "0".
* See the prerequisites and limitations in documentation:
* * http://maven.apache.org/plugins/maven-surefire-plugin/examples/skip-after-failure.html * * @since 2.19 */ @Parameter( property = "surefire.skipAfterFailureCount", defaultValue = "0" ) private int skipAfterFailureCount; /** * After the plugin process is shutdown by sending SIGTERM signal (CTRL+C), SHUTDOWN command is * received by every forked JVM. *
* By default ({@code shutdown=testset}) forked JVM would not continue with new test which means that * the current test may still continue to run. *
* The parameter can be configured with other two values {@code exit} and {@code kill}. *
* Using {@code exit} forked JVM executes {@code System.exit(1)} after the plugin process has received * SIGTERM signal. *
* Using {@code kill} the JVM executes {@code Runtime.halt(1)} and kills itself. * * @since 2.19 */ @Parameter( property = "surefire.shutdown", defaultValue = "testset" ) private String shutdown; @Override protected int getRerunFailingTestsCount() { return rerunFailingTestsCount; } @Override protected void handleSummary( RunResult summary, Exception firstForkException ) throws MojoExecutionException, MojoFailureException { reportExecution( this, summary, getConsoleLogger(), firstForkException ); } @Override protected boolean isSkipExecution() { return isSkip() || isSkipTests() || isSkipExec(); } @Override protected String getPluginName() { return "surefire"; } @Override protected String[] getDefaultIncludes() { return new String[]{ "**/Test*.java", "**/*Test.java", "**/*Tests.java", "**/*TestCase.java" }; } @Override protected String getReportSchemaLocation() { return "https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd"; } @Override protected Artifact getMojoArtifact() { final Map pluginArtifactMap = getPluginArtifactMap(); return pluginArtifactMap.get( "org.apache.maven.plugins:maven-surefire-plugin" ); } // now for the implementation of the field accessors @Override public boolean isSkipTests() { return skipTests; } @Override public void setSkipTests( boolean skipTests ) { this.skipTests = skipTests; } @Override public boolean isSkipExec() { return skipExec; } @Override public void setSkipExec( boolean skipExec ) { this.skipExec = skipExec; } @Override public boolean isSkip() { return skip; } @Override public void setSkip( boolean skip ) { this.skip = skip; } @Override public boolean isTestFailureIgnore() { return testFailureIgnore; } @Override public void setTestFailureIgnore( boolean testFailureIgnore ) { this.testFailureIgnore = testFailureIgnore; } @Override public File getBasedir() { return basedir; } @Override public void setBasedir( File basedir ) { this.basedir = basedir; } @Override public File getTestClassesDirectory() { return testClassesDirectory; } @Override public void setTestClassesDirectory( File testClassesDirectory ) { this.testClassesDirectory = testClassesDirectory; } @Override public File getClassesDirectory() { return classesDirectory; } @Override public void setClassesDirectory( File classesDirectory ) { this.classesDirectory = classesDirectory; } @Override public File getReportsDirectory() { return reportsDirectory; } @Override public void setReportsDirectory( File reportsDirectory ) { this.reportsDirectory = reportsDirectory; } @Override public String getTest() { return test; } @Override public boolean isUseSystemClassLoader() { return useSystemClassLoader; } @Override public void setUseSystemClassLoader( boolean useSystemClassLoader ) { this.useSystemClassLoader = useSystemClassLoader; } @Override public boolean isUseManifestOnlyJar() { return useManifestOnlyJar; } @Override public void setUseManifestOnlyJar( boolean useManifestOnlyJar ) { this.useManifestOnlyJar = useManifestOnlyJar; } @Override public String getEncoding() { return encoding; } @Override public void setEncoding( String encoding ) { this.encoding = encoding; } @Override public Boolean getFailIfNoSpecifiedTests() { return failIfNoSpecifiedTests; } @Override public void setFailIfNoSpecifiedTests( boolean failIfNoSpecifiedTests ) { this.failIfNoSpecifiedTests = failIfNoSpecifiedTests; } @Override public int getSkipAfterFailureCount() { return skipAfterFailureCount; } @Override public String getShutdown() { return shutdown; } @Override public boolean isPrintSummary() { return printSummary; } @Override public void setPrintSummary( boolean printSummary ) { this.printSummary = printSummary; } @Override public String getReportFormat() { return reportFormat; } @Override public void setReportFormat( String reportFormat ) { this.reportFormat = reportFormat; } @Override public boolean isUseFile() { return useFile; } @Override public void setUseFile( boolean useFile ) { this.useFile = useFile; } @Override public String getDebugForkedProcess() { return debugForkedProcess; } @Override public void setDebugForkedProcess( String debugForkedProcess ) { this.debugForkedProcess = debugForkedProcess; } @Override public int getForkedProcessTimeoutInSeconds() { return forkedProcessTimeoutInSeconds; } @Override public void setForkedProcessTimeoutInSeconds( int forkedProcessTimeoutInSeconds ) { this.forkedProcessTimeoutInSeconds = forkedProcessTimeoutInSeconds; } @Override public int getForkedProcessExitTimeoutInSeconds() { return forkedProcessExitTimeoutInSeconds; } @Override public void setForkedProcessExitTimeoutInSeconds( int forkedProcessExitTimeoutInSeconds ) { this.forkedProcessExitTimeoutInSeconds = forkedProcessExitTimeoutInSeconds; } @Override public double getParallelTestsTimeoutInSeconds() { return parallelTestsTimeoutInSeconds; } @Override public void setParallelTestsTimeoutInSeconds( double parallelTestsTimeoutInSeconds ) { this.parallelTestsTimeoutInSeconds = parallelTestsTimeoutInSeconds; } @Override public double getParallelTestsTimeoutForcedInSeconds() { return parallelTestsTimeoutForcedInSeconds; } @Override public void setParallelTestsTimeoutForcedInSeconds( double parallelTestsTimeoutForcedInSeconds ) { this.parallelTestsTimeoutForcedInSeconds = parallelTestsTimeoutForcedInSeconds; } @Override public void setTest( String test ) { this.test = test; } @Override public List getIncludes() { return includes; } @Override public void setIncludes( List includes ) { this.includes = includes; } @Override public File[] getSuiteXmlFiles() { return suiteXmlFiles.clone(); } @Override @SuppressWarnings( "UnusedDeclaration" ) public void setSuiteXmlFiles( File[] suiteXmlFiles ) { this.suiteXmlFiles = suiteXmlFiles.clone(); } @Override public String getRunOrder() { return runOrder; } @Override @SuppressWarnings( "UnusedDeclaration" ) public void setRunOrder( String runOrder ) { this.runOrder = runOrder; } @Override public File getIncludesFile() { return includesFile; } @Override public File getExcludesFile() { return excludesFile; } @Override protected final List suiteXmlFiles() { return hasSuiteXmlFiles() ? Arrays.asList( suiteXmlFiles ) : Collections.emptyList(); } @Override protected final boolean hasSuiteXmlFiles() { return suiteXmlFiles != null && suiteXmlFiles.length != 0; } } maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/000077500000000000000000000000001330756104600243335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/000077500000000000000000000000001330756104600251175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/api.apt.vm000066400000000000000000000072311330756104600270220ustar00rootroot00000000000000 ------ Provider API ------ Kristian Rosenvold ------ 2010-12-09 ------ ~~ 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 Maven Surefire Provider API As of version 2.7 of Surefire, there is a proposed public API available for external providers to use Surefire features. The key features of Surefire are forking, reporting and directory/classpath scanning. The remaining features are implemented in the providers. Please note that this API is still subject to change until otherwise declared, even in minor revisions. Such changes will mostly happen to facilitate needs of new providers. * Requirements for a Provider There are three things any provider must fulfill: * A provider must implement the <<>> interface. * A provider contains a <<>> file entry named <<>> (as per {{{http://download.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html}ServiceLoader}}). This file contains the fully qualified name of the actual provider class. * The actual provider class contains a one-arg constructor that accepts an instance of <<>>. This interface delivers all Surefire features to the provider implementation. Please see the javadoc of this interface for options. [] There are four well-known providers within Surefire that are also implemented this way, so examples can be found by looking at the Surefire source code itself. <<>> is the showcase implementation. The javadoc on the intefaces mentioned in this article should otherwise be sufficient to write a provider. Providers are added as dependencies to the Surefire and Failsafe plugins. ** API Changes for 2.11 Prior to 2.11, the provider would do +---+ TestsToRun scanned = directoryScanner.locateTestClasses( testClassLoader, scannerFilter ); +---+ and the classes would arrive in sorted order. In 2.11, an additional step must be implemented by the provider; +---+ TestsToRun scanned = directoryScanner.locateTestClasses( testClassLoader, scannerFilter ); return providerParameters.getRunOrderCalculator().orderTestClasses( scanned ); +---+ ** API changes for 2.12.2: Prior to this version, the provider would do +---+ directoryScanner = booterParameters.getDirectoryScanner(); final TestsToRun scanResult = directoryScanner.locateTestClasses( testClassLoader, testChecker ); +---+ In this version <<>> has been deprecated, and it *will* be removed for the next major version. Instead, use +---+ scanResult = booterParameters.getScanResult(); final TestsToRun testsToRun = scanResult.applyFilter(testChecker, testClassLoader ); +---+ maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/developing.apt.vm000066400000000000000000000133021330756104600304010ustar00rootroot00000000000000 ------ Developing Surefire ------ Kristian Rosenvold ------ 2011-03-07 ------ ~~ 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 Developer Center When working with Surefire, it is necessary to understand a few things: * Multi-module Project The plugin is built as part of a multi-module plugin. You need to check out the complete module and build from there: +---+ git clone https://git-wip-us.apache.org/repos/asf/maven-surefire.git +---+ * Making Test Cases for Demonstrating Problems When reporting an issue, it is immensely useful to create a small sample project that demonstrates the problem. Surefire already contains a large number of such projects, and they can be found at {{surefire-integration-tests/src/test/resources/}}. Typically you can check out one of the pre-existing projects and run it like this: +---+ cd surefire-integration-tests/src/test/resources/failsafe-buildfail mvn -Dsurefire.version=2.12 verify +---+ * Attaching a Debugger Sometimes it's appropriate to attach a remote debugger to the Surefire fork to try to determine what is going on. If you checkout and build trunk, you'd usually do something like this: +---+ mvn -Dmaven.surefire.debug=true install +---+ Load the source in your IDE, set a breakpoint at the start of <<>> and attach a debugger to port 5005. * Tracing a Forked Execution The forked Surefire process uses standard input and output to communicate back to the source. Sometimes when tracking troubles it can be helpful to look at just the output of the fork. This can be done by running: +---+ mvn -e -X install | grep Forking +---+ If you copy the command part of the output, you should be able to re-run the command by just pasting it on the command line (you might have to do only the bits after <<<&&>>>). You can now paste this command on the command line and capture the output of the fork. This may help you determine if the problem is in the forked end or the receiving end. When investigating a particular class, you probably want to <<>> the output for the class name. Additionally the booter code (first field) can be seen at {{https://git-wip-us.apache.org/repos/asf?p=maven-surefire.git;a=blob;f=surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingRunListener.java}} The second field in the output (after the booter code) is the logical channel number, where different threads in the fork should come in different channels. * Test Cases All patches to Surefire must contain test coverage, either as an integration test or a unit test. All new features (changed/added plugin options) must be covered by an end-to-end integration test. There are numerous other integration tests that all operate on small sample projects in <<>>. Example integration tests are <<>> and the corresponding <<>>. * Essential Source Code Reading List Some methods/classes reveal more about the basic working of a piece of code than others. The following classes/methods are a "reading list" for getting quickly acquainted with the code: +---+ AbstractSurefireMojo#executeAllProviders ForkStarter#fork ForkedBooter#main +---+ * JDK Versions The surefire booter is capable of booting all the way back to jdk1.6. Specifically this means <<>>, <<>>, <<>> and <<>> are source/target 1.6. The plugin and several providers are 1.6. * Provider Isolation Classes in the SUT () override any classes within the Surefire providers. This means providers using any third party dependencies (other than the test framework itself) should shade these classes to a different package. * Common Provider Modules The <<>> module contains <<>> modules. These modules depend on the <<>> version of JUnit and can access the JUnit APIs at the correct JUnit version level. Unit tests can also be written that will run with the correct JUnit version. At build time, all of the relevant parts of these "common" modules are just shaded into the provider jar files. * Shadefire "Shadefire" is the first module to be run in the Surefire build. This creates as shaded version of the JUnit provider, and this provider is thereafter used to build Surefire itself (as of Surefire 2.8). This is because the SUT overrides the provider, and the Shadefire provider has been relocated to avoid this overriding when Surefire is building itself. * Deploying and Releasing Surefire Surefire depends on a previous version of itself, which is too advanced for the Maven 2.2.x dependency resolution. Thus Maven 3.x is required to build Surefire. maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/000077500000000000000000000000001330756104600267355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/class-loading.apt.vm000066400000000000000000000211721330756104600326070ustar00rootroot00000000000000 ------ Class Loading and Forking ------ Dan Fabulich ------ 2010-01-09 ------ ~~ 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 Class Loading and Forking in Maven Surefire This page discusses class loading and forking under Maven Surefire which is a shared component used by both the Surefire and Failsafe Maven plugins, with an eye towards troubleshooting problems. * Executive Summary If you're having problems, you'll probably want to tinker with these three settings: <<>>, <<>>, and <<>>. * What Problem does the Maven Surefire Project Solve? Initially, the problem seems simple enough. Just launch Java with a classpath, like this: +---+ java -classpath foo.jar:bar.jar MyApp +---+ But there's a problem here: on some operating systems (Windows), there's a limit on how long you can make your command line, and therefore a limit on how long you can make your classpath. The limit is different on different versions of Windows; in some versions only a few hundred characters are allowed, in others a few thousand, but the limit can be pretty severe in either case. * Update for Maven Surefire 2.8.2 It turns out setting the <<>> as an environment variable may remove most of the practical length limitations, as documented in {{{https://issues.apache.org/jira/browse/SUREFIRE-727}SUREFIRE-727}}. This means most of the length-related problems in this article may be outdated. * Generic Solutions There are two "tricks" you can use to workaround this problem; both of them can cause other problems in some cases. 1. <>: One workaround is to use an isolated class loader. Instead of launching directly, we can launch some other application (a "booter") with a much shorter classpath. We can then create a new java.lang.ClassLoader (usually a <<>>) with the desired classpath configured. The booter can then load up from the class loader; when refers to other classes, they will be automatically loaded from our isolated class loader. The problem with using an isolated class loader is that your classpath isn't correct, and some applications can detect this and object. For example, the system property <<>> won't include your jars; if your application notices this, it could cause a problem. There's another similar problem with using an isolated class loader: any class may call the static method <<>> and attempt to load classes out of that class loader, instead of using the default class loader. Classes often do this if they need to create class loaders of their own. Unfortunately, Java-based web application servers like Jetty, Tomcat, BEA WebLogic and IBM WebSphere are very likely to try to escape the confines of an isolated class loader. 2. <>: Another workaround is to use a "manifest-only JAR." In this case, you create a temporary JAR that's almost completely empty, except for a <<>> file. Java manifests can contain attributes that the Java virtual machine will honor as directives. For example, you can have a <<>> attribute, which specifies a list of other JARs to add to the classpath. So then you can run your code like this: +---+ java -classpath booter.jar MyApp +---+ This is a bit more realistic, because in this case the system class loader, the thread context class loader and the default class loader are all the same; there's no possibility of "escaping" the class loader. But this is still a weird simulation of a "normal" classpath, and it's still possible for apps to notice this. Again, <<>> may not be what you'd expect ("why does it contain only one jar?"). Additionally, it's possible to query the system class loader to get the list of jars back out of it; your application may be confused if it finds only our <<>> there! * Advantages/Disadvantages of each Solution If your application tries to interrogate its own class loader for a list of JARs, it may work better under an isolated class loader than it would with a manifest-only JAR. However, if your application tries to escape its default class loader, it may not work under an isolated class loader at all. One advantage of using an isolated class loader is that it's the only way to use an isolated class loader without forking a separate process, running all of the tests in the same process as Maven itself. But that itself can be pretty risky, especially if Maven is running embedded in your IDE! Finally, of course, you could just try to wire up a plain old Java classpath and hope it's short enough. In the worst case your classpath might work on some machines and not others. Windows boxes would behave differently from Linux boxes; users with short user names might have more success than users with long user names, etc. For this reason, we chose not to make the basic classpath the default, though we do provide it as an option (mostly as a last resort). * What does Maven Surefire do? Surefire provides a mechanism for using multiple strategies. The main parameter that determines this is called <<>>. If <<>> is <<>>, then we use a manifest-only JAR; otherwise, we use an isolated class loader. If you want to use a basic plain old Java classpath, you can set <<>> which only has an effect when <<>>. The default value for <<>> changed between Surefire 2.3 and Surefire 2.4, which was a pretty significant change. In Surefire 2.3, <<>> was <<>> by default, and we used an isolated class loader. In Surefire 2.4, <<>> is <<>> by default. No value works for everyone, but we think this default is an improvement; a bunch of hard-to-diagnose bugs get better when we <<>>. Unfortunately, if <<>> is set incorrectly for your application, you're going to have a problem on your hands that can be quite difficult to diagnose. You might even be forced to read a long documentation page like this one. ;-) If you're having problems loading classes, try setting <<>> to see if that helps. You can do that with the POM snippet below, or by setting <<<-Dsurefire.useSystemClassLoader=false>>>. If that doesn't work, try setting <<>> back to <<>> and setting <<>> to <<>>. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} false [...] +---+ * Debugging Classpath Problems If you've read this far, you're probably fully equipped to diagnose problems that may occur during class loading. Here's some general tips to try: * Run Maven with <<<--debug>>> (or equivalently, <<<-X>>>) to get more detailed output * Check your <<>>. If <<>> (or <<>>, the deprecated version of that), it's impossible to use the system class loader or a plain old Java classpath; we have to use an isolated class loader. * If you're using the defaults, <<>> and <<>>. In that case, look at the generated manifest-only Surefire booter JAR. Open it up (it's just a zip) and read its manifest. * Run Maven with <<<-Dmaven.${thisPlugin.toLowerCase()}.debug>>>, and attach to the running process with a debugger. configuring-classpath.apt.vm000066400000000000000000000115241330756104600343020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples ------ Configuring the Classpath ------ Pascal Lambert ------ 2010-01-09 ------ ~~ 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 The Default Classpath The Surefire plugin builds the test classpath in the following order: #{if}(${project.artifactId}=="maven-surefire-plugin") [[1]] The {{{../test-mojo.html#testClassesDirectory}test-classes}} directory [[2]] The {{{../test-mojo.html#classesDirectory}classes}} directory #{else} [[1]] The {{{../integration-test-mojo.html#testClassesDirectory}test-classes}} directory [[2]] The {{{../integration-test-mojo.html#classesDirectory}classes}} JAR file or directory #{end} [[3]] The project dependencies [[4]] Additional classpath elements #{if}(${project.artifactId}=="maven-failsafe-plugin") Notice that loading JAR file is preferable over the output classes directory in the maven-failsafe-plugin. This behavior can be changed by configuration parameter <<>>. #{end} Additional Classpath Elements If you need to put more stuff in your classpath when ${thisPlugin} executes (e.g some funky resources or a container specific JAR), we normally recommend you add it to your classpath as a dependency. Consider deploying shared JARs to a private remote repository for your organization. But, if you must, you can use the <<>> element to add custom resources/JARs to your classpath. This will be treated as an absolute file system path, so you may want use $\{basedir\} or another property combined with a relative path. Note that additional classpath elements are added to the end of the classpath, so you cannot use these to override project dependencies or resources. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} path/to/additional/resources path/to/additional/jar path/to/csv/jar1, path/to/csv/jar2 [...] +---+ Removing Dependency Classpath Elements Dependencies can be removed from the test classpath using the parameters <<>> and <<>>. A list of specific dependencies can be removed from the classpath by specifying the <<>> to be removed. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} org.apache.commons:commons-email [...] +---+ Dependencies under a certain scope can be removed from the classpath using <<>>. The valid values for the dependency scope exclude are defined by <<>>. * <> - system, provided, compile * <> - compile, runtime * <> - system, provided, compile, runtime, test +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} runtime [...] +---+ maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/cucumber.apt.vm000066400000000000000000000064101330756104600316720ustar00rootroot00000000000000 ------ Using Cucumber ------ M.P. Korstanje ------ 2010-10-10 ------ ~~ 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 Using Cucumber with JUnit * Configuring Cucumber JUnit To get started with Cucumber, you need to add the required version of Cucumber JUnit to your project: +---+ [...] io.cucumber cucumber-junit ${cucumber.version} test [...] +---+ Then create an empty class that uses the Cucumber JUnit runner. #{if}(${project.artifactId}=="maven-surefire-plugin") +---+ package org.sample.cucumber; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith( Cucumber.class ) public class RunCucumberTest { [...] } +---+ #{else} +---+ package org.sample.cucumber; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith( Cucumber.class ) public class RunCucumberIT { [...] } +---+ #{end} This will execute all scenarios in the package of the runner. By default a glue code is assumed to be in the same package. The <<<@CucumberOptions>>> annotation can be used to provide additional configuration of Cucumber. #{if}(${project.artifactId}=="maven-surefire-plugin") Note that in this example the BDD scenarios are executed by the ${thisPlugin} Plugin in the <<>> phase of the build lifecycle. +---+ mvn test +---+ #{else} Note that in this example the BDD scenarios are executed by the ${thisPlugin} Plugin in the <<>> phase of the build lifecycle. The ${thisPlugin} Plugin can be invoked by calling the <<>> phase. +---+ mvn verify +---+ #{end} * Using JUnit Rules The Cucumber supports JUnit annotations <<<@ClassRule>>>, <<<@BeforeClass>>> and <<<@AfterClass>>>. These are invoked around the suite of features. Using these is not recommended as it limits the portability between different runners. Instead it is recommended to use Cucumbers `Before` and `After` hooks to setup scaffolding. * Using other JUnit features The Cucumber runner acts like a suite of a JUnit tests. As such other JUnit features such as Categories, Custom JUnit Listeners and Reporters and re-running failed tests can all be expected to work. maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/debugging.apt.vm000066400000000000000000000057661330756104600320350ustar00rootroot00000000000000 ------ Debugging Tests ------ Dan Fabulich ------ 2010-01-09 ------ ~~ 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 Debugging Tests Sometimes you need to debug the tests exactly as Maven ran them. Here's how! Forked Tests By default, Maven runs your tests in a separate ("forked") process. You can use the <<>> property to debug your forked tests remotely, like this: #{if}(${project.artifactId}=="maven-surefire-plugin") +---+ mvn -Dmaven.${thisPlugin.toLowerCase()}.debug test +---+ #{else} +---+ mvn -Dmaven.${thisPlugin.toLowerCase()}.debug verify +---+ #{end} The tests will automatically pause and await a remote debugger on port 5005. You can then attach to the running tests using Eclipse. You can setup a "Remote Java Application" launch configuration via the menu command "Run" > "Open Debug Dialog..." If you need to configure a different port, you may pass a more detailed value. For example, the command below will use port 8000 instead of port 5005. #{if}(${project.artifactId}=="maven-surefire-plugin") +---+ mvn -Dmaven.${thisPlugin.toLowerCase()}.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE" test +---+ #{else} +---+ mvn -Dmaven.${thisPlugin.toLowerCase()}.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE" verify +---+ #{end} Non-forked Tests You can force Maven not to fork tests by setting the configuration parameter <<>> to 0. #{if}(${project.artifactId}=="maven-surefire-plugin") +---+ mvn -DforkCount=0 test +---+ #{else} +---+ mvn -DforkCount=0 verify +---+ #{end} Then all you need to do is debug Maven itself. Since Maven 2.0.8, Maven ships with a <<>> shell script that you can use to launch Maven with convenient debugging options: #{if}(${project.artifactId}=="maven-surefire-plugin") +---+ mvnDebug -DforkCount=0 test +---+ #{else} +---+ mvnDebug -DforkCount=0 verify +---+ #{end} Then you can attach Eclipse to Maven itself, which may be easier/more convenient than debugging the forked executable. fork-options-and-parallel-execution.apt.vm000066400000000000000000000407721330756104600370040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples ------ Fork Options and Parallel Test Execution ------ Andreas Gudian ------ 2013-01-03 ------ ~~ 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 Fork Options and Parallel Test Execution Choosing the right forking strategy and parallel execution settings can have substantial impact on the memory requirements and the execution time of your build system. The ${thisPlugin.toLowerCase()} offers a variety of options to execute tests in parallel, allowing you to make best use of the hardware at your disposal. But forking in particular can also help keeping the memory requirements low. This page shall give you some ideas of how you can configure the test execution in a way best suitable for your environment. * Parallel Test Execution Basically, there are two ways in ${project.artifactId} to achieve parallel test execution. The most obvious one is by using the <<>> parameter. The possible values depend on the test provider used. For JUnit 4.7 and onwards, this may be <<>>, <<>>, <<>>, <<>>, <<>>, <<>>, <<>> or <<>>. As a prerequisite in JUnit tests, the JUnit runner should extend <<>>. If no runner is specified through the annotation <<<@org.junit.runner.RunWith>>>, the prerequisite is accomplished. As of ${project.artifactId}:2.16, the value "<<>>" is deprecated but it still can be used and behaves same as <<>>. See the example pages for {{{./junit.html#Running_tests_in_parallel}JUnit}} and {{{./testng.html#Running_tests_in_parallel}TestNG}} for details. The extension of the parallelism is configured using the following parameters. The parameter <<>> allows for an unlimited number of threads. Unless <<>>, the parameter <<>> can be used with the optional parameter <<>> (true by default). The parameters <<>> and <<>> are to be interpreted in the context of the value specified for the <<>> parameter. As of ${project.artifactId}:2.16, one can impose thread-count limitations on suites, classes or methods using one or more of the parameters <<>>, <<>> and <<>>. If only <<>> is specified, ${project.artifactId} attempts to <> the thread counts for suites, classes and methods and reuses the threads in favor of a <>, e.g. parallel methods (optionally increasing concurrent methods). As an example with an unlimited number of threads, there is maximum of three concurrent threads to execute suites: <<>>, <<>>, <<>>. In the second example, the number of concurrent methods is not strictly limited: <<>>, <<>>, <<>>. Here the number of parallel methods is varying from 5 to 7. Accordingly <<>>, but the sum of <<>> and <<>> must not exceed certain (<<>> - 1). Other combinations are possible with unspecified thread-count <>. Make sure that the <> is last from the order suites-classes-methods in <<>>. In the third example the thread-counts represent a ratio, e.g. for <<>>, <<>>, <<>>, <<>>, <<>>. Thus the concurrent suites will be 20%, concurrent classes 30%, and concurrent methods 50%. Finally, the <<>> and <<>> may not be necessarily configured if the equivalent thread-counts are specified for the value in <<>>. The ${project.artifactId} is trying to reuse threads, thus <> the thread-counts, and prefers thread fairness. The optimization <<>> of the number of Threads is enabled by default in terms of e.g. the number of runners do not necessarily have to waste 's Thread resources. If <<>> is used, then the <> with unlimited thread-count may speed up especially at the end of test phase. The parameters <<>> and <<>> are used to specify an optional timeout in parallel execution. If the timeout is elapsed, the plugin prints the summary log with ERROR lines: <"These tests were executed in prior to the shutdown operation">, and <"These tests are incomplete"> if the running Threads were <>. <> As designed by JUnit runners, the static methods annotated with e.g. <@Parameters>, <@BeforeClass> and <@AfterClass> are called in parent thread. For the sake of memory visibility between threads synchronize the methods. See the keywords: , , <> and in {{{https://jcp.org/en/jsr/detail?id=133}Java Memory Model - JSR-133}}. <> with the <<>> option is: the concurrency happens within the same JVM process. That is efficient in terms of memory and execution time, but you may be more vulnerable towards race conditions or other unexpected and hard to reproduce behavior. The other possibility for parallel test execution is setting the parameter <<>> to a value higher than 1. The next section covers the details about this and the related <<>> parameter. Using <<>> (by default) and forking the test classes in reusable JVMs may lead to the same problem with shared across <@BeforeClass> class initializers if using <<>> without forking. Therefore setting <<>> may help however it would not guarantee proper functionality of some features, e.g. <<>>. * Parallel Test Execution and Single Thread Execution As mentioned above the <<>> test execution is used with specific thread count. Since of ${project.artifactId}:2.18, you can apply the annotation <<<@net.jcip.annotations.NotThreadSafe>>> on the Java class of JUnit test (pure test class, , , etc.) in order to execute it in single Thread instance. The Thread has name and it is executed at the end of the test run. Just use project dependency or another artifact with Apache License 2.0. +---+ [...] junit junit 4.7 test com.github.stephenc.jcip jcip-annotations 1.0-1 test [...] +---+ This way the parallel execution of tests classes annotated with <<<@NotThreadSafe>>> are forked in single thread instance (don't mean forked JVM process). If the or is annotated with <<<@NotThreadSafe>>>, the suite classes are executed in single thread. You can also annotate individual test class referenced by , and the other unannotated test classes in the can be subject to run in parallel. This way you can isolate conflicting groups of tests and still run their individual tests in parallel. <> As designed by JUnit runners, the static methods annotated with e.g. <@Parameters>, <@BeforeClass> and <@AfterClass> are called in parent thread. Assign classes to <<<@NotThreadSafe Suite>>> to prevent from this trouble. If you do not want to change the hierarchy of your test classes, you may synchronize such methods for the sake of improving memory visibility as a simplistic treatment. See the keywords: , , <> and in {{{https://jcp.org/en/jsr/detail?id=133}Java Memory Model - JSR-133}}. * Parallel ${project.artifactId} Execution in Multi-Module Maven Parallel Build Maven core allows building modules of multi-module projects in parallel with the command line option <<<-T>>>. This the extent of concurrency configured directly in ${project.artifactId}. * Forked Test Execution The parameter <<>> defines the maximum number of JVM processes that ${project.artifactId} will spawn to execute the tests. It supports the same syntax as <<<-T>>> in maven-core: if you terminate the value with a 'C', that value will be multiplied with the number of available CPU cores in your system. For example <<>> on a Quad-Core system will result in forking up to ten concurrent JVM processes that execute tests. The parameter <<>> is used to define whether to terminate the spawned process after one test class and to create a new process for the next test in line (<<>>), or whether to reuse the processes to execute the next tests (<<>>). The is <<>>/<<>>, which means that ${project.artifactId} creates one new JVM process to execute all tests in one Maven module. <<>>/<<>> executes each test class in its own JVM process, one after another. It creates the highest level of separation for the test execution, but it would probably also give you the longest execution time of all the available options. Consider it as a last resort. With the <<>> property, you can specify additional parameters to be passed to the forked JVM process, such as memory settings. System property variables from the main maven process are passed to the forked process as well. Additionally, you can use the element <<>> to specify variables and values to be added to the system properties during the test execution. You can use the place holder <<<$\{surefire.forkNumber\}>>> within <<>>, or within the system properties (both those specified via <<>> and via <<>>). Before executing the tests, the ${thisPlugin.toLowerCase()} plugin replaces that place holder by the number of the actually executing process, counting from 1 to the effective value of <<>> times the maximum number of parallel executions in Maven parallel builds, i.e. the effective value of the <<<-T>>> command line argument of Maven core. In case of disabled forking (<<>>), the place holder will be replaced with <1>. The following is an example configuration that makes use of up to three forked processes that execute the tests and then terminate. A system property is passed to the processes, that shall specify the database schema to use during the tests. The values for that will be , , and for the three processes. Additionaly by specifying custom each of processes will be executed in a separate working directory to ensure isolation on file system level. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} 3 true -Xmx1024m -XX:MaxPermSize=256m MY_TEST_SCHEMA_${surefire.forkNumber} FORK_DIRECTORY_${surefire.forkNumber} [...] +---+ In case of a multi module project with tests in different modules, you could also use, say, <<>> to start the build, yielding values for <<<$\{surefire.forkNumber\}>>> ranging from 1 to 6. Imagine you execute some tests that use a JPA context, which has a notable initial startup time. By setting <<>>, you can reuse that context for consecutive tests. And as many tests tend to use and access the same test data, you can avoid database locks during the concurrent execution by using distinct but uniform database schemas. Port numbers and file names are other examples of resources for which it may be hard or undesired to be shared among concurrent test executions. * Combining forkCount and parallel The modes <<>> and <<>>/<<>> can be combined freely with the available settings for <<>>. As <<>> creates a new JVM process for each test class, using <<>> would have no effect. You can still use <<>>, though. When using <<>> and a <<>> value larger than one, test classes are handed over to the forked process one-by-one. Thus, <<>> would not change anything. However, you can use <<>>: classes are executed in <<>> concurrent processes, each of the processes can then use <<>> threads to execute the methods of one class in parallel. Regarding the compatibility with multi-module parallel maven builds via <<<-T>>>, the only limitation is that you can not use it together with <<>>. When running parallel maven builds without forks, all system properties are shared among the builder threads and ${thisPlugin.toLowerCase()} executions, therefore the threads will encounter race conditions when setting properties, e.g. <<>>, which may lead to changing system properties and unexpected runtime behaviour. * Migrating the Deprecated forkMode Parameter to forkCount and reuseForks ${thisPlugin.toLowerCase()} versions prior 2.14 used the parameter <<>> to configure forking. Although that parameter is still supported for backward compatibility, users are strongly encouraged to migrate their configuration and use <<>> and <<>> instead. The migration is quite simple, given the following mapping: *--------------------------+-------------------------------------------+ <> | <> | *--------------------------+-------------------------------------------+ <<>> | <<>> (default), | (default) | <<>> (default) | *--------------------------+-------------------------------------------+ <<>> | <<>> (default), | | <<>> | *--------------------------+-------------------------------------------+ <<>> | <<>> | *--------------------------+-------------------------------------------+ <<>>, | <<>>, | <<>> | (<<>>, if you did not | | had that one set) | *--------------------------+-------------------------------------------+ * Known issues and limitations * <<<$\{surefire.forkNumber\}>>> propagation is not supported on Maven 2.x (the variable will be resolved to null value all the time) * <<<$\{surefire.forkNumber\}>>> is properly propagated within <<>> since ${project.artifactId}:2.19, more details in {{{https://issues.apache.org/jira/browse/SUREFIRE-1136}SUREFIRE-1136}} inclusion-exclusion.apt.vm000066400000000000000000000152031330756104600340200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples ------ Inclusions and Exclusions of Tests ------ Allan Ramirez ------ 2010-01-09 ------ ~~ 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 Inclusions and Exclusions of Tests * Inclusions By default, the ${thisPlugin} Plugin will automatically include all test classes with the following wildcard patterns: #{if}(${project.artifactId}=="maven-surefire-plugin") * <<<"**/Test*.java">>> - includes all of its subdirectories and all Java filenames that start with "Test". * <<<"**/*Test.java">>> - includes all of its subdirectories and all Java filenames that end with "Test". * <<<"**/*Tests.java">>> - includes all of its subdirectories and all Java filenames that end with "Tests". * <<<"**/*TestCase.java">>> - includes all of its subdirectories and all Java filenames that end with "TestCase". #{else} * <<<"**/IT*.java">>> - includes all of its subdirectories and all Java filenames that start with "IT". * <<<"**/*IT.java">>> - includes all of its subdirectories and all Java filenames that end with "IT". * <<<"**/*ITCase.java">>> - includes all of its subdirectories and all Java filenames that end with "ITCase". #{end} [] If the test classes do not follow any of these naming conventions, then configure ${thisPlugin} Plugin and specify the tests you want to include. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} Sample.java [...] +---+ * Exclusions There are certain times when some tests are causing the build to fail. Excluding them is one of the best workarounds to continue the build. Exclusions can be done by configuring the <<>> property of the plugin. #{if}(${project.artifactId}=="maven-surefire-plugin") +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} **/TestCircle.java **/TestSquare.java [...] +---+ #{else} +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} **/CircleIT.java **/SquareIT.java [...] +---+ #{end} * Regular Expression Support An include/exclude pattern can be an ant-style path expression, but regular expressions are also supported through this syntax: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} %regex[.*(Cat|Dog).*Test.*] [...] +---+ Note the syntax <<<%regex[expr]>>>, where <<>> is the actual expression and the rest is just wrapping. Also note the following about the use of regular expressions: * Regex matches are done over <<<*.class>>> files and not <<<*.java>>> files * Regex matches are done over paths using slashes ("<<>>") and not package names using dots ("<<<.>>>"), so the "<<<.>>>" in <<>> is a regex metacharacter, which happens to match any character, notably the (forward) slashes ("<<>>") that make up the path. Slashes here are , even on Windows * The trailing <<<.class>>> is interpreted literally, and not as a regular expression ("<<<\.class>>>" does not work here) * Multiple Formats in One As of ${thisPlugin} Plugin 2.19, a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): +---+ [...] %regex[.*(Cat|Dog).*], !%regex[pkg.*Slow.*.class], pkg/**/*Fast*.java, Basic????, !Unstable* [...] %regex[pkg.*Slow.*.class], Unstable* [...] +---+ This syntax can be used in parameters: <<>>, <<>>, <<>>, <<>>, <<>>. Exclamation mark (!) excludes tests. The syntax in parameter <<>> and <<>> should not use (!). The character (?) within non-regex pattern replaces one character in file name or path. The file extensions are not mandatory in non-regex patterns, and packages with slash can be used. The regex validates fully qualified class file. The regex supports '.class' file extension only. Note the regex comments, marked by (#) character, are unsupported. * Fully qualified class name As of ${thisPlugin} Plugin 2.19.1, the syntax with fully qualified class names or packages can be used, e.g.: +---+ [...] my.package.*, another.package.* [...] my.package.???ExcludedTest, another.package.*ExcludedTest [...] +---+ The character (?) replaces single character and (*) represents zero or more characters. Multiple formats can be additionally combined. This syntax can be used in parameters: <<>>, <<>>, <<>>, <<>>, <<>>. maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/junit-platform.apt.vm000066400000000000000000000142141330756104600330410ustar00rootroot00000000000000 ------ Using JUnit 5 Platform ------ JUnit Lambda Team ------ 2018-05-14 ------ ~~ 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 Using JUnit 5 Platform * Configuring JUnit Platform To get started with JUnit Platform, you need to add at least a single <<>> implementation to your project. For example, if you want to write tests with Jupiter, add the test artifact <<>> to the dependencies in POM: +---+ [...] org.junit.jupiter junit-jupiter-engine 5.2.0 test [...] +---+ This will pull in all required dependencies. Among those dependencies is <<>> which contains the classes and interfaces your test source requires to compile. <<>> is also resolved and added. This is the only step that is required to get started - you can now create tests in your test source directory (e.g., <<>>). If you want to write and execute JUnit 3 or 4 tests via the JUnit Platform add the Vintage Engine to the dependencies: +---+ [...] org.junit.vintage junit-vintage-engine 5.2.0 test [...] +---+ * Provider Selection If nothing is configured, Surefire detects which JUnit version to use by the following algorithm: +---+ if the JUnit 5 Platform Engine is present in the project use junit-platform if the JUnit version in the project >= 4.7 and the <<>> configuration parameter has ANY value use junit47 provider if JUnit >= 4.0 is present use junit4 provider else use junit3.8.1 +---+ When using this technique there is no check that the proper test-frameworks are present on your project's classpath. Failing to add the proper test-frameworks will result in a build failure. * Running Tests in Parallel From JUnit Platform does not support running tests in parallel. * Running a Single Test Class The JUnit Platform Provider supports the <<>> JVM system property supported by the Maven Surefire Plugin. For example, to run only test methods in the <<>> test class you can execute <<>> from the command line. * Filtering by Test Class Names The Maven Surefire Plugin will scan for test classes whose fully qualified names match the following patterns. * <<<**/Test*.java>>> * <<<**/*Test.java>>> * <<<**/*Tests.java>>> * <<<**/*TestCase.java>>> Moreover, it will exclude all nested classes (including static member classes) by default. Note, however, that you can override this default behavior by configuring explicit `include` and `exclude` rules in your `pom.xml` file. For example, to keep Maven Surefire from excluding static member classes, you can override its exclude rules. * Overriding exclude rules of Maven Surefire +---+ ... ... ${project.groupId} ${project.artifactId} ${project.version} some test to exclude here ... +---+ * Filtering by Tags You can use JUnit5 Tags and filter tests by tags or tag expressions. * To include <<>> or <<>>, use <<>>. * To exclude <<>> or <<>>, use either <<>>. +---+ ... ... ${project.groupId} ${project.artifactId} ${project.version} acceptance | !feature-a integration, regression ... +---+ * Configuration Parameters You can set JUnit Platform configuration parameters to influence test discovery and execution by declaring the <<>> property and providing key-value pairs using the Java <<>> file syntax (as shown below) or via the <<>> file. +---+ ... ... ${project.groupId} ${project.artifactId} ${project.version} junit.jupiter.conditions.deactivate = * junit.jupiter.extensions.autodetection.enabled = true junit.jupiter.testinstance.lifecycle.default = per_class ... +---+ maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/junit.apt.vm000066400000000000000000000256771330756104600312360ustar00rootroot00000000000000 ------ Using JUnit ------ Kristian Rosenvold ------ 2010-10-10 ------ ~~ 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 Using JUnit * Configuring JUnit To get started with JUnit, you need to add the required version of JUnit to your project: +---+ [...] junit junit 4.11 test [...] +---+ This is the only step that is required to get started - you can now create tests in your test source directory (e.g., <<>>). * Different Generations of JUnit support Surefire supports three different generations of JUnit: JUnit 3.8.x, JUnit 4.x (serial provider) and JUnit 4.7 (junit-core provider with parallel support). The provider is selected based on the JUnit version in your project and the configuration parameters (for parallel). * Upgrade Check for JUnit 4.x As of Surefire version 2.7, the algorithm for choosing which tests to run has changed. From 2.7 and on, only valid JUnit tests are run for all versions of JUnit, where older versions of the plugin would also run invalid tests that satisfied the naming convention. When upgrading from a Surefire version prior to 2.7, the build can be run with the flag <<<-Dsurefire.junit4.upgradecheck>>>. This will perform a check and notify you of any invalid tests that will not be run with this version of Surefire (and the build fails). This is only meant to be used as a tool when upgrading to check that all expected tests will be run. It is a transitional feature that will be removed in a future version of surefire. * Provider Selection If nothing is configured, Surefire detects which JUnit version to use by the following algorithm: +---+ if the JUnit 5 Platform Engine is present in the project use junit-platform if the JUnit version in the project >= 4.7 and the <<>> configuration parameter has ANY value use junit47 provider if JUnit >= 4.0 is present use junit4 provider else use junit3.8.1 +---+ Please note that the "else" part of this algorithm is also a FAQ response: You depend on the appropriate version of JUnit being present in the project dependencies, or Surefire may choose the wrong provider. If, for instance, one of your dependencies pulls in JUnit 3.8.1 you risk that surefire chooses the 3.8.1 provider, which will not support annotations or any of the 4.x features. Use <<>>, POM dependency ordering and/or exclusion of transitive dependencies to fix this problem. ** Manually Specifying a Provider You can also manually force a specific provider by adding it as a dependency to ${thisPlugin} itself: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} org.apache.maven.surefire surefire-junit47 ${project.version} [...] +---+ When using this technique there is no check that the proper test-frameworks are present on your project's classpath. Failing to add the proper test-frameworks will result in a build failure. * Running Tests in Parallel From JUnit 4.7 onwards you can run your tests in parallel. To do this, you must set the <<>> parameter, and may change the <<>> or <<>> attribute. For example: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} methods 10 [...] +---+ If your tests specify any value for the <<>> attribute and your project uses JUnit 4.7+, your request will be routed to the concurrent JUnit provider, which uses the JUnit JUnitCore test runner. This is particularly useful for slow tests that can have high concurrency. As of Surefire 2.7, no additional dependencies are needed to use the full set of options with parallel. As of Surefire 2.16, new thread-count attributes are introduced, namely <<>>, <<>> and <<>>. Additionally, the new attributes <<>> and <<>> are used to shut down the parallel execution after an elapsed timeout, and the attribute <<>> specifies new values. See also {{{./fork-options-and-parallel-execution.html}Fork Options and Parallel Test Execution}}. * Using Custom Listeners and Reporters The junit4 and junit47 providers provide support for attaching custom <<>> to your tests. You can configure multiple custom listeners like this: +---+ [...] your-junit-listener-artifact-groupid your-junit-listener-artifact-artifactid your-junit-listener-artifact-version test [...] [...] [...] ${project.groupId} ${project.artifactId} ${project.version} listener com.mycompany.MyResultListener,com.mycompany.MyResultListener2 [...] +---+ For more information on JUnit, see the {{{http://www.junit.org}JUnit web site}}. You can implement JUnit listener interface <<>> in a separate test artifact <<>> with scope=test, or in project test source code <<>>. You can filter test artifacts by the parameter <<>> to load its classes in current ClassLoader of surefire-junit* providers. Since JUnit 4.12 thread safe listener class should be annotated by <<>> which avoids unnecessary locks in JUnit. * Using a Security Manager (JUnit3 only) As long as <<>> is not 0 and you use JUnit3, you can run your tests with a Java security manager enabled. The class name of the security manager must be sent as a system property variable to the JUnit3 provider. JUnit4 uses mechanisms internally that are not compatible with the tested security managers and thus this means of configuring a security manager with JUnit4 is not supported by Surefire. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} java.lang.SecurityManager [...] +---+ * Using a Security Manager (All providers) Alternatively you can define a policy file that allows all providers to run with Surefire and configure it using the <<>> parameter and two system properties: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} -Djava.security.manager -Djava.security.policy=${basedir}/src/test/resources/java.policy [...] +---+ The disadvantage of this solution is that the policy changes will affect the tests too, which make the security environment less realistic. * Using JUnit Categories JUnit 4.8 introduced the notion of Categories. You can use JUnit categories by using the <<>> parameter. As long as the JUnit version in the project is 4.8 or higher, the presence of the "groups" parameter will automatically make Surefire select the junit47 provider, which supports groups. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} com.mycompany.SlowTests [...] +---+ This will execute only those tests annotated with the <<<@Category(com.mycompany.SlowTests.class)>>> annotation and those tests annotated with <<<@Category(com.mycompany.SlowerTests.class)>>> if class/interface <<>> is subclass of <<>>: +---+ public interface SlowTests{} public interface SlowerTests extends SlowTests{} +---+ +---+ public class AppTest { @Test @Category(com.mycompany.SlowTests.class) public void testSlow() { System.out.println("slow"); } @Test @Category(com.mycompany.SlowerTests.class) public void testSlower() { System.out.println("slower"); } @Test @Category(com.cmycompany.FastTests.class) public void testSlow() { System.out.println("fast"); } } +---+ The <<<@Category>>> annotation can also be applied at class-level. Multiple categories can be specified by comma-delimiting them in the <<>> parameter in which case tests annotated with any of the categories will be executed. For more information on JUnit, see the {{{http://www.junit.org}JUnit web site}}. Since version 2.18.1 and JUnit 4.12, the <<<@Category>>> annotation type is automatically inherited from superclasses, see <<<@java.lang.annotation.Inherited>>>. Make sure that test class inheritance still makes sense together with <<<@Category>>> annotation of the JUnit 4.12 or higher appeared in superclass. maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/logging.apt.vm000066400000000000000000000034711330756104600315170ustar00rootroot00000000000000 ------ Using Console Logs ------ Tibor Digana ------ 2015-06-04 ------ ~~ 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 Using Console Logs * Suppressed logs Since version 2.19 few lines are suppressed by surefire and failsafe plugin in std/out, namely * report directory, * Java class of provider, * configuration of parallel execution and * Java class of TestNG configurator. [] In order to enable detailed logs, use any of CLI Maven option, i.e. -X,--debug,-e,--errors. The result would be e.g.: +---+ [INFO] Surefire report directory: D:\vcs\project\target\surefire-reports [INFO] Using configured provider org.apache.maven.surefire.junitcore.JUnitCoreProvider [INFO] parallel='none', perCoreThreadCount=true, threadCount=0, useUnlimitedThreads=false, threadCountSuites=0, threadCountClasses=0, threadCountMethods=0, parallelOptimized=true Configuring TestNG with: TestNGMapConfigurator +---+ maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/pojo-test.apt.vm000066400000000000000000000034251330756104600320140ustar00rootroot00000000000000 ------ Using POJO Tests ------ Christian Gruber ------ May 2008 ------ ~~ 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 Using POJO Tests POJO tests look very much like JUnit or TestNG tests, though they do not require dependencies on these artifacts. A test class should be named <<<**/*Test>>> and should contain <<>> methods which will each be executed by Surefire. Validating assertions can be done using the JDK 1.4 <<>> keyword. Simultaneous test execution is not possible with POJO tests. Fixtures can be setup before and after each <<>> method by implementing a set-up and a tear-down methods. These methods must match the following signatures to be recognized and executed before and after each test method: +---+ public void setUp(); public void tearDown(); +---+ These fixture methods can also throw any exception and will still be valid. maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/providers.apt.vm000066400000000000000000000046331330756104600321070ustar00rootroot00000000000000 ------ Selecting Providers ------ Kristian Rosenvold ------ 2010-12-04 ------ ~~ 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 Selecting Providers * Selecting a Provider Surefire normally automatically selects which test-framework provider to use based on the version of TestNG/JUnit present in your project's classpath. In some cases it may be desirable to manually override such a selection. This can be done by adding the required provider as a dependency to the surefire-plugin. The following example shows how to force usage of the JUnit 4.7 provider: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} org.apache.maven.surefire surefire-junit47 ${project.version} [...] +---+ The providers supplied with Surefire are <<>>, <<>>, <<>>, <<>> and <<>>. Please note that forcing a provider still requires that the test framework is properly set up on your project classpath. You can also specify multiple providers as dependencies, and they will all be run and produce a common report. This may be especially handy with external providers, since there are few use cases for combining the included providers. rerun-failing-tests.apt.vm000066400000000000000000000141021330756104600337050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples ------ Rerun failing tests ------ Qingzhou Luo ------ 2014-06-27 ------ ~~ 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 Rerun Failing Tests During development, you may re-run failing tests because they are flaky. To use this feature through Maven surefire, set the <<>> property to be a value larger than 0. Tests will be run until they pass or the number of reruns has been exhausted. << NOTE : This feature is supported only for JUnit 4.x. >> +---+ mvn -D${thisPlugin.toLowerCase()}.rerunFailingTestsCount=2 test +---+ If <<>> is set to a value smaller than or equal to 0, then it will be ignored. * Output flaky re-run information on the screen When <<>> is set to a value larger than 0 and the test fails, then it will be re-run and each run information will also be output. Each run with its number and trimmed stack trace will be output. If the test passes in its first run, then the output on the screen will be identical to the case where <<>> is not used. It the test fails in the first run, then there are two possible cases: 1) The test passes in one of its re-runs: the last run will be marked as PASS For example, a test passed in its second run will output on the screen: +---+ Run 1: ... Run 2: PASS +---+ Then this test will be counted as a flaky test. The build will be successful, but in the end of the summary of all tests run, the number of flaky tests will be output on the screen, for example: +---+ Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Flakes: 1 +---+ 2) The test fails in all of the re-runs: For example, a test failed in all the three runs, then all the runs will be output on the screen: +---+ Run 1: ... Run 2: ... Run 3: ... +---+ Then this build will be marked as failure. The type of the failure (failed test or test in error) of this test depends on its first failure. * Output flaky re-run information in test report xml When <<>> is set to a value larger than 0, the output xml of test report will also be extended to include information of each re-run. If the test passes in its first run, then the output xml report will be identical to the case where <<>> is not used. It the test fails in the first run, then there are also two possible cases. 1) The test passes in one of its re-runs: <<>> and <<>> elements will be used in the generated xml report to include information of each failing re-runs. <<>> and <<>> will also be used inside each <<>> or <<>> to include information of System.out and System.err output. The original <<>> and <<>> elements will be retained on the top level under <<>> for the last successful run. For example: +---+ flaky failure stack trace flaky failure success +---+ In the xml report, the running time of a flaky test will be the running time of the <>. 2) The test fails in all of the re-runs: <<>> and <<>> elements will still be used in the generated xml report to include information for the first failing run, the same as without using <<>>. <<>> and <<>> elements will be used in the generated xml report to include information of each <> failing re-runs. <<>> and <<>> will also be used inside each <<>> or <<>> to include information of System.out and System.err output. The original <<>> and <<>> elements will be retained on the top level under <<>> for the first original failing run. For example: +---+ first failure stack trace first failure rerun failure stack trace rerun failure +---+ In the xml report, the running time of a failing test with re-runs will be the running time of the <>. * Re-run execution in JUnit Providers The provider <<>> executes individual test class and consequently re-runs failed tests. The provider <<>> executes all test classes and re-runs failed tests afterwards. * Re-run execution in Cucumber JVM Since of 2.21.0 the provider <<>> can rerun scenarios created by <> 2.0.0 and higher. * Re-run and skip execution Since of 2.19.1 you can use parameters <<>> and <<>> together. This is enabled by providers <<>> and <<>>. You can run again failed tests and skip the rest of the test-set if errors or failures reached <<>>. Notice that failed tests within re-run phase are not included in <<>>. maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/shutdown.apt.vm000066400000000000000000000114721330756104600317440ustar00rootroot00000000000000 ------ Forked JVM Shutdown ------ Tibor Digana ------ September 2015 ------ ~~ 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 Shutdown of Forked JVM * Embedded shutdown After the test-set has completed, the process executes <<>> which starts shutdown hooks. At this point the process may run next 30 seconds until all non daemon Threads die. After the period of time has elapsed, the process kills itself by <<>>. The timeout of 30 seconds can be customized by configuration parameter <<>>. * Pinging forked JVM << Since ${thisPlugin} Plugin 2.20.1 ping is platform dependent and fallbacks to old mechanism if PID of Maven process or platform is not recognized, native commands fail in Java. >> Simply the mechanism checks the <<< Maven PID >>> is still alive and it is not reused by OS in another application. If Maven process has died, the forked JVM is killed. << Implementation: >> The <<< Maven PID >>> is determined by: * Java 9 call <<< ProcessHandle.current().pid() >>>, or * resolving PID from <<< /proc/self/stat >>> on Linux and <<< /proc/curproc/status >>> on BSD, or * the JMX call <<< ManagementFactory.getRuntimeMXBean().getName() >>>. [] On Unix like systems the process' uptime is determined by native command <<< (/usr)/bin/ps -o etime= -p [PID] >>>. On Windows the start time is determined using <<< wmic process where (ProcessId=[PID]) get CreationDate >>> in the forked JVM. << Since ${thisPlugin} Plugin 2.19 the old mechanism is significantly slower: >> The master process sends NOOP command to a forked JVM every 10 seconds. Forked JVM is waiting for the command every 20 seconds (changed to 30 seconds since version 2.20.1, see {{{https://issues.apache.org/jira/browse/SUREFIRE-1302}SUREFIRE-1302}}). If the master process is killed (received SIGKILL signal) or shutdown (pressed CTRL+C, received SIGTERM signal), forked JVM is killed after timing out waiting period. * Shutdown of forked JVM by stopping the build After the master process of the build is shutdown by sending SIGTERM signal or pressing CTRL+C, the master process immediately sends SHUTDOWN command to every forked JVM. By default (configuration parameter <<>>) forked JVM would not pick up a new test which means that the current test may still continue to run. The SIGTERM signal triggers Java shutdownhook which executes <<>> in the forked JVM (not always reliable depending on VM and OS). The parameter <<>> can be configured with other two values <<>> and <<>>. Using <<>> forked JVM executes <<>> after the master process has received SIGTERM. Using <<>> the JVM executes <<>>, example: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} kill [...] +---+ * Shutdown of forked JVM after certain timeout Using parameter <<>> forked JVMs are killed separately after every individual process elapsed certain amount of time and the whole plugin fails with the error message: <<>> * Crashed forked JVM caused listing the crashed test(s) After the JVM exited abruptly, the console lists the message <<>> with a list of crashed tests if the entire test-set has not been yet completed. This happens if a test exited, killed JVM or a segmentation fault crashed JVM. In such cases you may be interested in dump files generated in reports directory, see {{{../faq.html#dumpfiles}FAQ}}. maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/single-test.apt.vm000066400000000000000000000126461330756104600323330ustar00rootroot00000000000000 ------ Running a Single Test ------ Allan Ramirez Olivier Lamy ------ 2012-02-28 ------ ~~ 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 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 <<>> property to a specific test case. +---+ mvn -Dtest=TestCircle test +---+ If you have multiple executions configured in surefire plugin within your POM, you may want to execute the only default test phase: +---+ mvn surefire:test -Dtest=TestCircle +---+ The value for the <<>> 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 <<>> property to a specific test case. +---+ mvn -Dit.test=ITCircle verify +---+ The value for the <<>> 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} << NOTE: Use syntax e.g. "foo/MyTest.java", "**/MyTest.java", "MyTest" for "test" parameter (see includes/excludes). >> Running a Set of Methods in a Single Test Class As of Surefire 2.7.3, you can also run only a subset of the tests in a test class. << NOTE : This feature is supported only for Junit 4.x and TestNG. Use syntax e.g. "foo/MyTest.java", "**/MyTest.java", "MyTest" for "test" parameter (see includes/excludes). >> You should 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 +---+ #{end} Since of ${thisPlugin} Plugin 2.19 you can select multiple methods (JUnit 4, JUnit 4.7+ and TestNG): #{if}(${project.artifactId}=="maven-surefire-plugin") +---+ mvn -Dtest=TestCircle#testOne+testTwo test +---+ #{else} +---+ mvn -Dit.test=ITCircle#testOne+testTwo verify +---+ #{end} Note this feature was available in JUnit 4 provider only since of ${thisPlugin} Plugin 2.12.1. Multiple Formats in One As of ${thisPlugin} Plugin 2.19 multiple formats are supported in one pattern (JUnit 4, JUnit 4.7+, TestNG): #{if}(${project.artifactId}=="maven-surefire-plugin") +---+ mvn "-Dtest=???Test, !Unstable*, pkg/**/Ci*leTest.java, *Test#test*One+testTwo?????, #fast*+slowTest" test mvn "-Dtest=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyTest.class#one.*|two.*], %regex[#fast.*|slow.*]" test +---+ #{else} +---+ mvn "-Dit.test=???IT, !Unstable*, pkg/**/Ci*leIT.java, *IT#test*One+testTwo?????, #fast*+slowTest" verify mvn "-Dit.test=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyIT.class#one.*|two.*], %regex[#fast.*|slow.*]" verify +---+ #{end} The exclamation mark (!) excludes tests. The character (?) within non-regex pattern replaces one character in file name or path. The file extensions are not mandatory in non-regex patterns, and packages with slash can be used. The regex validates fully qualified class file, and validates test methods separately after (#) however class is optional. The regex supports '.class' file extension only. Note the regex comments, marked by (#) character, are unsupported. The Parameterized JUnit runner describes test methods using an index in brackets, so the non-regex method pattern would become <<<#testMethod[*]>>>. If using the JUnit annotation <<<@Parameters(name="\{index\}: fib(\{0\})=\{1\}")>>> and selecting the index e.g. 5 in pattern, the non-regex method pattern would become <<<#testMethod[5:*]>>>. * Fully qualified class name As of ${thisPlugin} Plugin 2.19.1, the syntax with fully qualified class names or packages can be used, e.g.: +---+ my.package.???Test#testMethod, another.package.* +---+ The character (?) replaces single character and (*) represents zero or more characters. Multiple formats can be additionally combined. maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/skip-after-failure.apt.vm000066400000000000000000000061121330756104600335560ustar00rootroot00000000000000 ------ Skipping Tests After Failure ------ Tibor Digana ------ July 2015 ------ ~~ 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 Skipping Tests After First Failure To skip remaining tests after first failure or error has happened set configuration parameter <<>> to <<<1>>>. Skipping Tests After the Nth Failure or Error To skip remaining tests after the Nth failure or error has happened set configuration parameter <<>> to N, where N is number greater than zero. Prerequisite Use ${project.artifactId} 2.19 or higher, JUnit 4.0 or higher, or TestNG 5.10 or higher. If version of TestNG is lover than 5.10 while the parameter <<>> is set, the plugin fails with error: <<<[ERROR] Failed to execute goal ...: Parameter "skipAfterFailureCount" expects TestNG Version 5.10 or higher. java.lang.NoClassDefFoundError: org/testng/IInvokedMethodListener>>> If version of JUnit is lover than 4.0 while the parameter <<>> is set, the plugin fails with error: <<<[ERROR] Failed to execute goal ...: Parameter "skipAfterFailureCount" expects JUnit Version 4.0 or higher. java.lang.NoSuchMethodError: org.junit.runner.notification.RunNotifier.pleaseStop()V>>> Notices TestNG reports skipped methods however JUnit reports skipped classes. Preferably use JUnit 4.12 or higher version which fixed thread safety issues. Limitations Although this feature works in forking modes as well, the functionality cannot be fully guaranteed (real first failure) in concurrent mode due to race conditions. The parameter <<>> should be always set to <<>> (which is default value), otherwise this feature won't work properly in most cases. Other features * Re-run and skip execution Since of 2.19.1 you can use parameters <<>> and <<>> together. This is enabled by providers <<>> and <<>>. You can run again failed tests and skip the rest of the test-set if errors or failures reached <<>>. Notice that failed tests within re-run phase are not included in <<>>. maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/skipping-tests.apt.vm000066400000000000000000000104621330756104600330530ustar00rootroot00000000000000 ------ Skipping Tests ------ Johnny Ruiz Brett Porter Allan Ramirez ------ July 2006 ------ ~~ 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 Skipping Tests #{if}(${project.artifactId}=="maven-surefire-plugin") To skip running the tests for a particular project, set the <> property to <>. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} true [...] +---+ You can also skip the tests via the command line by executing the following command: +---+ mvn install -DskipTests +---+ #{else} To skip running the tests for a particular project, set the <> property to <>. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} true [...] +---+ You can also skip the tests via the command line by executing the following command: +---+ mvn install -DskipITs +---+ Since <<>> is also supported 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 <<>> property instead: +---+ mvn install -DskipITs +---+ #{end} If you absolutely must, you can also use the <<>> property to skip compiling the tests. <<>> is honored by Surefire, Failsafe and the Compiler Plugin. +---+ mvn install -Dmaven.test.skip=true +---+ Skipping by Default If you want to skip tests by default but want the ability to re-enable tests from the command line, you need to go via a properties section in the pom: #{if}(${project.artifactId}=="maven-surefire-plugin") +---+ [...] true [...] ${project.groupId} ${project.artifactId} ${project.version} ${esc.d}{skipTests} [...] +---+ #{else} +---+ [...] true [...] ${project.groupId} ${project.artifactId} ${project.version} ${esc.d}{skipTests} [...] +---+ #{end} This will allow you to run with all tests disabled by default and to run them with this command: +---+ mvn install -DskipTests=false +---+ The same can be done with the <<>> parameter and other boolean properties of the plugin. maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/system-properties.apt.vm000066400000000000000000000077411330756104600336130ustar00rootroot00000000000000 ------ Using System Properties ------ Allan Ramirez Dan Tran ------ 2010-01-09 ------ ~~ 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 Using System Properties There are two ways to add a list of system properties to ${thisPlugin}: * systemPropertyVariables This configuration is the replacement of the deprecated <<>>. It can accept any value from Maven's properties that can be converted <>. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} propertyValue \${project.build.directory} [...] [...] +---+ * systemProperties ( Deprecated ) +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} propertyName propertyValue [...] [...] +---+ Take note that only <> properties can be passed as system properties. Any attempt to pass any other Maven variable type (e.g. a <<>> or a <<>> variable) will cause the variable expression to be passed literally (unevaluated). So given the example below: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} buildDir \${project.build.outputDirectory} [...] +---+ The string <<$\{project.build.outputDirectory\}>> will be passed on literally because the type of that expression is a <<>>, not a <<>>. To inherit the <<>> collection from the parent configuration, you will need to specify <<>> on the <<>> node in the child pom: +---+ [...] +---+ Special VM Properties Some system properties must be set on the command line of the forked VM, and cannot be set after the VM has been started. These properties must be added to the <<>> parameter of the Surefire plugin. E.g., +---+ -Djava.endorsed.dirs=... +---+ maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/examples/testng.apt.vm000066400000000000000000000357111330756104600313770ustar00rootroot00000000000000 ------ Using TestNG ------ Brett Porter ------ 2010-01-09 ------ ~~ 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 Using TestNG * Unsupported TestNG versions - TestNG 5.14.3: Bad formatted pom.xml. - TestNG 5.14.4 and 5.14.5: TestNG is using a missing dependency (org.testng:guice:2.0). Excluding it, may break some features. * Configuring TestNG To get started with TestNG, include the following dependency in your project (replacing the version with the one you wish to use): +---+ [...] org.testng testng 6.9.8 test [...] +---+ If you are using an older version of TestNG (\<= 5.11), the dependency would instead look like this: +---+ [...] org.testng testng 5.11 test jdk15 [...] +---+ <> if you are using JDK 1.4 Javadoc annotations for your TestNG tests, replace the classifier <<>> with <<>> above. #{if}(${project.artifactId}=="maven-surefire-plugin") This is the only step that is required to get started - you can now create tests in your test source directory (e.g., <<>>). As long as they are named in accordance with the defaults such as <<<*Test.java>>> they will be run by ${thisPlugin} as TestNG tests. #{else} This is the only step that is required to get started - you can now create tests in your test source directory (e,g., <<>>). As long as they are named in accordance with the defaults such as <<<*IT.java>>> they will be run by ${thisPlugin} as TestNG tests. #{end} If you'd like to use a different naming scheme, you can change the <<>> parameter, as discussed in the {{{./inclusion-exclusion.html}Inclusions and Exclusions of Tests}} example. * Using Suite XML Files Another alternative is to use TestNG suite XML files. This allows flexible configuration of the tests to be run. These files are created in the normal way, and then added to the ${thisPlugin} Plugin configuration: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} testng.xml [...] +---+ This configuration will override the includes and excludes patterns and run all tests in the suite files. * Specifying Test Parameters Your TestNG test can accept parameters with the <<<@Parameters>>> annotation. You can also pass parameters from Maven into your TestNG test, by specifying them as system properties, like this: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} firefox [...] +---+ For more information about setting system properties in ${thisPlugin} tests, see {{{./system-properties.html}System Properties}}. * Using Groups TestNG allows you to group your tests. You can then execute one or more specific groups. To do this with ${thisPlugin}, use the <<>> parameter, for example: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} functest,perftest [...] +---+ Likewise, the <<>> parameter can be used to run all but a certain set of groups. * Running Tests in Parallel TestNG allows you to run your tests in parallel, including JUnit tests. To do this, you must set the <<>> parameter, and may change the <<>> parameter if the default of 5 is not sufficient. For example: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} methods 10 [...] +---+ This is particularly useful for slow tests that can have high concurrency, or to quickly and roughly assess the independence and thread safety of your tests and code. TestNG 5.10 and plugin version 2.19 or higher allows you to run methods in parallel test using data provider. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} parallel methods dataproviderthreadcount 30 [...] +---+ TestNG 6.9.8 (JRE 1.7) and plugin version 2.19 or higher allows you to run suites in parallel. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} src/test/resources/testng1.xml src/test/resources/testng2.xml suitethreadpoolsize 2 [...] +---+ See also {{{./fork-options-and-parallel-execution.html}Fork Options and Parallel Test Execution}}. * Using Custom Listeners and Reporters TestNG provides support for attaching custom listeners, reporters, annotation transformers and method interceptors to your tests. By default, TestNG attaches a few basic listeners to generate HTML and XML reports. Unsupported versions: - TestNG 5.14.1 and 5.14.2: Due to an internal TestNG issue, listeners and reporters are not working with TestNG. Please upgrade TestNG to version 5.14.9 or higher. Note: It may be fixed in a future surefire version. You can configure multiple custom listeners like this: +---+ [...] your-testng-listener-artifact-groupid your-testng-listener-artifact-artifactid your-testng-listener-artifact-version test [...] [...] [...] ${project.groupId} ${project.artifactId} ${project.version} usedefaultlisteners false listener com.mycompany.MyResultListener,com.mycompany.MyAnnotationTransformer,com.mycompany.MyMethodInterceptor reporter listenReport.Reporter [...] +---+ For more information on TestNG, see the {{{http://www.testng.org}TestNG web site}}. You can implement TestNG listener interface <<>> in a separate test artifact <<>> with scope=test, or in project test source code <<>>. You can filter test artifacts by the parameter <<>> to load its classes in current ClassLoader of surefire-testng provider. The TestNG reporter class should implement <<>>. * The level of verbosity Since the plugin version 2.19 or higher the verbosity level can be configured in provider property <<>>. The verbosity level is between 0 and 10 where 10 is the most detailed. You can specify -1 and this will put TestNG in debug mode (no longer slicing off stack traces and all). The default level is 0. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} [...] surefire.testng.verbose 10 [...] [...] +---+ * Customizing TestNG Object Factory Since the plugin version 2.19 and TestNG 5.7 or higher you can customize TestNG object factory by implementing <<>> and binding the class name to the key <<>> in provider properties: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} [...] objectfactory testng.objectfactory.TestNGCustomObjectFactory [...] [...] +---+ * Customizing TestNG Test Runner Factory Since the plugin version 2.19 and TestNG 5.9 or higher you can customize TestNG runner factory by implementing <<>> and binding the class name to the key <<>> in provider properties: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} [...] testrunfactory testng.testrunnerfactory.TestNGCustomTestRunnerFactory [...] [...] +---+ * Running 'testnames' in test tag Only tests defined in a <<>> tag matching one of these names will be run. In this example two tests run out of 7; namely and . The test does not match any test in . +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} [...] src/test/resources/suite.xml testnames a-t1,a-t3 [...] [...] +---+ The test suite 'suite.xml' : +---+ +---+ * Running TestNG and JUnit Tests TestNG 6.5.1 and higher provides support to run TestNG and JUnit 4.x in current Maven project. All you need is to introduce TestNG and JUnit dependency in POM. +---+ [...] org.testng testng 6.9.4 test junit junit 4.10 test [...] +---+ You may want to run two providers, e.g. <<>> and <<>>, and avoid running JUnit tests within <<>> provider by setting property <<>>. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} [...] junit false 1 [...] org.apache.maven.surefire surefire-junit47 ${project.version} org.apache.maven.surefire surefire-testng ${project.version} [...] +---+ maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/featurematrix.apt.vm000066400000000000000000000066361330756104600311410ustar00rootroot00000000000000 ------ Feature Matrix ------ ~~ 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 Feature Matrix Not all features are supported for all test frameworks, and the following table gives a brief overview of support status: *---------------------------------------------+-----------+-----------+------------+-----------+----------+----------------------+ || <> ||<>||<>||<>||<>||<> ||<> | *---------------------------------------------+------------+----------+------------+-----------+----------+----------------------+ | groups/category/tags support | N | N | Y | Y | N | Y | *---------------------------------------------+------------+----------+------------+-----------+----------+----------------------+ | security manager support | Y | N | N | N | N | N | *---------------------------------------------+------------+----------+------------+-----------+----------+----------------------+ | runOrder support | Y | Y | Y | ? | Y | N | *---------------------------------------------+------------+----------+------------+-----------+----------+----------------------+ | run >1 individual test method in a class | N | Y | Y | Y | N | ?(*1) | *---------------------------------------------+------------+----------+------------+-----------+----------+----------------------+ | parallel support | N | N | Y | Y | N | N | *---------------------------------------------+------------+----------+------------+-----------+----------+----------------------+ Legend: "Y" means supported, "N" means not supported. "?" means not tested. If you would like to implement support for a given provider with an "N" or a "?" (or create tests for it), you should create a patch and mark the issue as an improvement. If there is something wrong with an implementation marked with "Y" that is considered a bug. (*1) The JUnit 5 Platform supports running multiple individual test methods in a single class, but there are some corner cases that are not supported, yet: {{{https://github.com/junit-team/junit5/issues/1343}junit-team/junit5#1343}} and {{{https://github.com/junit-team/junit5/issues/1406}junit-team/junit5#1406)}}.maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/index.apt.vm000066400000000000000000000157331330756104600273660ustar00rootroot00000000000000 ------ Introduction ------ Stephen Connolly Allan Ramirez ------ 2011-06-27 ------ ~~ 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 Maven ${thisPlugin} Plugin Requirements: Maven 2.2.1 or 3.x, and JDK 1.6 or higher. Due to wrong formatting of console text messages in Maven Version prior to 3.1.0 it is highly recommended to use Maven 3.1.0 or higher. #{if}(${project.artifactId}=="maven-surefire-plugin") The Surefire Plugin is used during the <<>> phase of the build lifecycle to execute the unit tests of an application. It generates reports in two different file formats: #{else} The Failsafe Plugin is designed to run integration tests while the Surefire Plugin is designed to run unit tests. The name (failsafe) was chosen both because it is a synonym of surefire and because it implies that when it fails, it does so in a safe way. The Maven lifecycle has four phases for running integration tests: * <<>> for setting up the integration test environment. * <<>> for running the integration tests. * <<>> for tearing down the integration test environment. * <<>> for checking the results of the integration tests. [] If you use the Surefire Plugin for running tests, then when you have a test failure, the build will stop at the <<>> phase and your integration test environment will not have been torn down correctly. The Failsafe Plugin is used during the <<>> and <<>> phases of the build lifecycle to execute the integration tests of an application. The Failsafe Plugin will not fail the build during the <<>> phase, thus enabling the <<>> phase to execute. NOTE: when running integration tests, you should invoke Maven with the (shorter to type too) +---+ mvn verify +---+ rather than trying to invoke the <<>> phase directly, as otherwise the <<>> phase will not be executed. The Failsafe Plugin generates reports in two different file formats: #{end} * Plain text files (<<<*.txt>>>) * XML files (<<<*.xml>>>) [] By default, these files are generated in <<<$\{basedir\}/target/${thisPlugin.toLowerCase()}-reports/TEST-*.xml>>>. The schema for the ${thisPlugin} XML reports is available at {{{./xsd/${thisPlugin.toLowerCase()}-test-report.xsd}${thisPlugin} XML Report Schema}}. For an HTML format of the report, please see the {{{http://maven.apache.org/plugins/maven-surefire-report-plugin/}Maven Surefire Report Plugin}}. #{if}(${project.artifactId}=="maven-failsafe-plugin") By default this plugin generates summary XML file at <<<$\{basedir\}/target/failsafe-reports/failsafe-summary.xml>>> and the schema is available at {{{./xsd/failsafe-summary.xsd}Failsafe XML Summary Schema}}. #{end} * Goals Overview #{if}(${project.artifactId}=="maven-surefire-plugin") The Surefire Plugin has only one goal: * {{{./test-mojo.html}surefire:test}} runs the unit tests of an application. [] #{else} The Failsafe Plugin has only two goals: * {{{./integration-test-mojo.html}failsafe:integration-test}} runs the integration tests of an application. * {{{./verify-mojo.html}failsafe:verify}} verifies that the integration tests of an application passed. [] #{end} * Usage General instructions on how to use the ${thisPlugin} Plugin can be found on the {{{./usage.html}usage page}}. Some more specific use cases are described in the examples listed below. #{if}(${project.artifactId}=="maven-surefire-plugin") Last but not least, users occasionally contribute additional examples, tips or errata to the {{{http://docs.codehaus.org/display/MAVENUSER/Surefire+Plugin}plugin's wiki page}}.#{end} In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel free to contact the {{{./mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching the {{{./mail-lists.html}mail archive}}. If you feel like the plugin is missing a feature or has a defect, you can file a feature request or bug report in our {{{./issue-tracking.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our {{{./source-repository.html}source repository}} and will find supplementary information in the {{{http://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}. * Examples The following examples show how to use the ${thisPlugin} Plugin in more advanced use cases: * {{{./examples/testng.html}Using TestNG}} * {{{./examples/junit-platform.html}Using JUnit 5 Platform}} * {{{./examples/junit.html}Using JUnit}} * {{{./examples/pojo-test.html}Using POJO Tests}} * {{{./examples/skipping-tests.html}Skipping Tests}} * {{{./examples/skip-after-failure.html}Skip After Failure}} * {{{./examples/inclusion-exclusion.html}Inclusions and Exclusions of Tests}} * {{{./examples/single-test.html}Running a Single Test}} * {{{./examples/rerun-failing-tests.html}Re-run Failing Tests}} * {{{./examples/class-loading.html}Class Loading and Forking}} * {{{./examples/debugging.html}Debugging Tests}} * {{{./examples/system-properties.html}Using System Properties}} * {{{./examples/configuring-classpath.html}Configuring the Classpath}} * {{{./examples/providers.html}Selecting Providers}} * {{{./examples/fork-options-and-parallel-execution.html}Fork Options and Parallel Test Execution}} * {{{./examples/logging.html}Using Console Logs}} * {{{./examples/shutdown.html}Shutdown of Forked JVM}} * {{{./java9.html}Run tests with Java 9}} * {{{./docker.html}Run tests in Docker}} [] maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/apt/usage.apt.vm000066400000000000000000000306531330756104600273610ustar00rootroot00000000000000 ------ Usage ------ Brett Porter Allan Ramirez Stephen Connolly ------ 2011-06-27 ------ ~~ 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 Usage #{if}(${project.artifactId}=="maven-surefire-plugin") Best practice is to define the version of the Surefire Plugin that you want to use in either your <<>> or a parent <<>>: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} [...] +---+ #{else} To use the ${thisPlugin} Plugin, you need to add the following configuration to your <<>>: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} integration-test verify [...] +---+ #{end} #{if}(${project.artifactId}=="maven-surefire-plugin") The ${thisPlugin} Plugin can be invoked by calling the <<>> phase of the build lifecycle. +---+ mvn test +---+ #{else} The ${thisPlugin} Plugin can be invoked by calling the <<>> phase of the build lifecycle. +---+ mvn verify +---+ #{end} * Using Different Testing Providers Tests in your test source directory can be any combination of the following: * TestNG * JUnit (3.8 or 4.x) * POJO Which providers are available is controlled simply by the inclusion of the appropriate dependencies (i.e., <<>> or <<>> for JUnit and <<>> 4.7+ for TestNG). Since this is required to compile the test classes anyway, no additional configuration is required. Note that any normal Surefire integration works identically no matter which providers are in use - so you can still produce a Cobertura report and a Surefire results report on your project web site for your TestNG tests, for example. The POJO provider above allows you to write tests that do not depend on either of JUnit and TestNG. It behaves in the same way, running all <<>> methods that are public in the class, but the API dependency is not required. To perform assertions, the JDK 1.4 <<>> keyword can be used. See {{{./examples/pojo-test.html} Using POJO Tests}} for more information. All of the providers support the Surefire Plugin parameter configurations. However, there are additional options available if you are running TestNG tests (including if you are using TestNG to execute your JUnit tests, which occurs by default if both are present in Surefire). See {{{./examples/testng.html} Using TestNG}} for more information. #{if}(${project.artifactId}=="maven-failsafe-plugin") * Using jetty and ${project.artifactId} You need to bind one of <<>>, <<>>, <<>> or <<>> to the <<>> phase with <<>> set to true, bind <<>> to the <<>> phase, bind <<>> to the <<>> phase and finally bind <<>> to the <<>> phase. Here is an example: +---+ [...] [...] [...] ${project.groupId} ${project.artifactId} ${project.version} integration-test integration-test verify verify org.eclipse.jetty jetty-maven-plugin 9.2.2.v20140723 [...] [...] 10 8005 STOP [...] [...] [...] start-jetty pre-integration-test start 0 true stop-jetty post-integration-test stop [...] [...] [...] [...] [...] +---+ You then invoke Maven with a phase of <<>> or later in order to run the integration tests. <> directly invoke any of the phases <<>>, <<>>, or <<>> as these are too long to type and they will likely leave a jetty container running. +---+ mvn verify +---+ Note: during test development, you will likely run a jetty instance in the background. to help running the integration tests, it can be handy to bind <<>> to the <<>> phase before <<>> to flush out any running jetty instance before starting the integration test jetty instance, e.g. +---+ [...] [...] [...] org.eclipse.jetty jetty-maven-plugin 9.2.2.v20140723 [...] [...] start-jetty pre-integration-test stop start [...] [...] [...] [...] [...] [...] +---+ * Reporting integration test results The ${thisPlugin} Plugin uses the exact same format as the ${thatPlugin} Plugin, so to generate a report you just add a second Surefire Report Plugin report set using the ${thisPlugin} reports directory, e.g. +---+ [...] ${project.groupId} maven-surefire-report-plugin ${project.version} integration-tests failsafe-report-only [...] +---+ * Running integration tests multiple times If you need to run your integration tests multiple times, just use multiple executions of the <<>> goal. You will need to specify a different summary file for each execution, and then configure the <<>> goal with the multiple summary files in order to fail the build when any one execution has failures, e.g. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} integration-test-red-bevels integration-test red target/failsafe-reports/failsafe-summary-red-bevels.xml integration-test-no-bevels integration-test none target/failsafe-reports/failsafe-summary-no-bevels.xml verify verify target/failsafe-reports/failsafe-summary-red-bevels.xml target/failsafe-reports/failsafe-summary-no-bevels.xml [...] +---+ * Usage in multi-module projects The recommendations for using the ${thisPlugin} Plugin listed at the top of this page are fine for 95% of use cases. When you are defining a shared definition of the ${thisPlugin} Plugin in a parent pom, it is considered best practice to define an execution id in order to allow child projects to override the configuration. Thus you might have the following in your parent <<>>: +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} integration-test integration-test verify [...] +---+ The child projects can then trigger usage of the ${thisPlugin} Plugin with +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} [...] +---+ For very complex builds, it may be better to separate the executions for the <<>> and <<>> goals. +---+ [...] ${project.groupId} ${project.artifactId} ${project.version} integration-test integration-test verify verify [...] +---+ #{end} maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/fml/000077500000000000000000000000001330756104600251115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/fml/faq.fml000066400000000000000000000165761330756104600263770ustar00rootroot00000000000000 What is the difference between maven-failsafe-plugin and maven-surefire-plugin?

maven-surefire-plugin is designed for running unit tests and if any of the tests fail then it will fail the build immediately.

maven-failsafe-plugin is designed for running integration tests, and decouples failing the build if there are test failures from actually running the tests.

How can I reuse my test code in other modules?

Visit this link for your reference, | Attaching tests

Surefire fails with the message "The forked VM terminated without properly saying goodbye".

Surefire does not support tests or any referenced libraries calling System.exit() at any time. If they do so, they are incompatible with Surefire and you should probably file an issue with the library/vendor. Alternatively the forked VM could also have crashed for a number of reasons. Look for the classical "hs_err*" files indicating VM crashes or examine the Maven log output when the tests execute. Some "extraordinary" output from crashing processes may be dumped to the console/log. If this happens on a CI environment and only after it runs for some time, there is a fair chance your test suite is leaking some kind of OS-level resource that makes things worse at every run. Regular OS-level monitoring tools may give you some indication.

Crashed Surefire or Failsafe plugin must indicate crashed tests

After a forked JVM has crashed the console of forked JVM prints Crashed tests: and lists the last test which has crashed. In the console log you can find the message The forked VM terminated without properly saying goodbye.

How can I run GWT tests? There is a specific gwt-maven-plugin at codehaus, but if you want to run with Surefire, you need the following settings:

Use the following configuration:
true]]>
false]]>
1]]>
Try reuseForks=true and if it doesn't work, fall back to reuseForks=false

How do I use properties set by other plugins in argLine?

Maven does property replacement for

${...}
values in pom.xml before any plugin is run. So Surefire would never see the place-holders in its argLine property.

Since the Version 2.17 using an alternate syntax for these properties,

@{...}
allows late replacement of properties when the plugin is executed, so properties that have been modified by other plugins will be picked up correctly.

How maven-failsafe-plugin allows me to configure the jar file or classes to use?

By default maven-failsafe-plugin uses project artifact file in test classpath if packaging is set to "jar" in pom.xml. This can be modified and for instance set to main project classes if you use configuration parameter "classesDirectory". This would mean that you set value "${project.build.outputDirectory}" for the parameter "classesDirectory" in the configuration of plugin.

How to dump fatal errors and stack trace of plugin runtime if it fails?

By default maven-failsafe-plugin and maven-surefire-plugin dumps fatal errors in dump files and these are located in target/failsafe-reports and target/surefire-reports. Names of dump files are formatted as follows:



Forked JVM process and plugin process communicate via std/out. If this channel is corrupted, for a whatever reason, the dump of the corrupted stream appears in *.dumpstream.

Corrupted STDOUT by directly writing to native stream in forked JVM

If your tests use native library which prints to STDOUT this warning message appears because the library corrupted the channel used by the plugin in order to transmit events with test status back to Maven process. It would be even worse if you override the Java stream by System.setOut because the stream is also supposed to be corrupted but the Maven will never see the tests finished and build may hang.
This warning message appears if you use FileDescriptor.out or JVM prints GC summary.
In that case the warning is printed "Corrupted STDOUT by directly writing to native stream in forked JVM", and a dump file can be found in Reports directory.
If debug level is enabled then messages of corrupted stream appear in the console.

maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/markdown/000077500000000000000000000000001330756104600261555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/markdown/docker.md000066400000000000000000000047311330756104600277530ustar00rootroot00000000000000 Build Docker image and run tests ======================== In current `.` directory is your project which starts with root POM. (including `.` at the end of next line) $ sudo docker build --no-cache -t my-image:1 -f ./Dockerfile . $ sudo docker run -it --rm my-image:1 /bin/sh Run the command `mvn test` in the shell console of docker. Dockerfile in current directory ======================== FROM maven:3.5.3-jdk-8-alpine COPY ./. / The test ======================== Location in current directory. src/test/java/MyTest.java Simple test waiting 3 seconds: import org.junit.Test; public class MyTest { @Test public void test() throws InterruptedException { Thread.sleep(3000L); } } POM ======================== The `pom.xml`: 4.0.0 x y 1.0 junit junit 4.12 maven-surefire-plugin latest plugin version here maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/markdown/java9.md000066400000000000000000000076071330756104600275230ustar00rootroot00000000000000 Java 9 in JAVA_HOME ======================== $ export JAVA_HOME=/path/to/jdk9 $ mvn test Using JDK Deprecated Modules ======================== Since Java 9 some modules previously bundled with the JDK are disabled by default. Version 2.20.1 of the plugin added automatically "--add-modules java.se.ee" option to the command line of forked JVMs (unless already specified by user) in order to ease the transition of applications to Java 9. From 2.21 onwards the plugin will not add that option: the recommended way of using those modules is to add explicit dependencies of the maintained versions of such libraries. This is a reference of the versions which were bundled with Java 8: **Commons Annotations** javax.annotation:javax.annotation-api:1.3.1 **JavaBeans Activation Framework** javax.activation:javax.activation-api:1.2.0 **Java Transaction API** javax.transaction:javax.transaction-api:1.2 **JAXB** javax.xml.bind:jaxb-api:2.3.0 org.glassfish.jaxb:jaxb-runtime:2.3.0 (implementation) **JAX-WS** javax.xml.ws:jaxws-api:2.3.0 com.sun.xml.ws:jaxws-rt:2.3.0 (implementation) The source code for each of these is maintained at [https://github.com/javaee](https://github.com/javaee) Java 9 in configuration of plugin ======================== The plugin provides you with configuration parameter `jvm` which can point to path of executable Java in JDK, e.g.: /path/to/jdk9/bin/java Now you can run the build with tests on the top of Java 9. Maven Toolchains with JDK 9 ======================== This is an example on Windows to run unit tests with custom path to Toolchain **(-t ...)**. $ mvn -t D:\.m2\toolchains.xml test Without **(-t ...)** the Toolchain should be located in **${user.home}/.m2/toolchains.xml**. The content of **toolchains.xml** would become as follows however multiple different JDKs can be specified. jdk 9 oracle jdk9 /path/to/jdk9 Your POM should specify the plugin which activates only particular JDK in *toolchains.xml* which specifies version **9**: org.apache.maven.plugins maven-toolchains-plugin 1.1 validate toolchain 9 Now you can run the build with tests on the top of Java 9. maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/markdown/multilineexceptions.md000066400000000000000000000024301330756104600326020ustar00rootroot00000000000000 Multi-line exception messages ============================= Surefire 2.19 introduced special handling for multi-lined exception messages in order to faciliate vertical alignment. For example, java.lang.IllegalArgumentException: My Couch | May not contain whitespace becomes: java.lang.IllegalArgumentException: The Couch | May not contain whitespace The plugin supports Groovy assertion output. For more information see the issue https://issues.apache.org/jira/browse/SUREFIRE-986. maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/markdown/newerrorsummary.md000066400000000000000000000037541330756104600317710ustar00rootroot00000000000000 The 1-line error summary ======================== Surefire 2.13 introduced a compact one-line format for quickly being able to locate test failures. This format is intended to give an overview and does necessarily lose some details, which can be found in the main report of the run or the files on disk. ### Example output: Failures: Test1.assertion1:59 Bending maths expected:<[123]> but was:<[312]> Test1.assertion2:64 True is false Errors: Test1.nullPointerInLibrary:38 » NullPointer Test1.failInMethod:43->innerFailure:68 NullPointer Fail here Test1.failInLibInMethod:48 » NullPointer Test1.failInNestedLibInMethod:54->nestedLibFailure:72 » NullPointer Test2.test6281:33 Runtime FailHere The main rules of the format are: * Assertion failures only show the message. * An Exception/Error is stripped from the Exception name to save space. * The exception message is trimmed to an approximate 80 chars. * The » symbol means that the exception happened below the method shown (in library code called by test). * Methods in superclasses are normally shown as `SuperClassName.methodName`. * If the first method in the stacktrace is in a superclass it will be show as `TestClass>Superclass.method`. maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/resources/000077500000000000000000000000001330756104600263455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/resources/xsd/000077500000000000000000000000001330756104600271435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/resources/xsd/failsafe-summary.xsd000066400000000000000000000034551330756104600331370ustar00rootroot00000000000000 maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/resources/xsd/surefire-test-report.xsd000066400000000000000000000165071330756104600340060ustar00rootroot00000000000000 maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/site/site.xml000066400000000000000000000066641330756104600260350ustar00rootroot00000000000000 maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/test/000077500000000000000000000000001330756104600243465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/test/java/000077500000000000000000000000001330756104600252675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/test/java/org/000077500000000000000000000000001330756104600260565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/test/java/org/apache/000077500000000000000000000000001330756104600272775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600304055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/000077500000000000000000000000001330756104600317035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefire/000077500000000000000000000000001330756104600335275ustar00rootroot00000000000000SurefirePluginTest.java000066400000000000000000000073531330756104600401260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefirepackage org.apache.maven.plugin.surefire; /* * 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. */ import java.lang.reflect.Field; import org.apache.maven.toolchain.Toolchain; import junit.framework.TestCase; public class SurefirePluginTest extends TestCase { public void testForkMode() throws NoSuchFieldException, IllegalAccessException { SurefirePlugin surefirePlugin = new SurefirePlugin(); setFieldValue( surefirePlugin, "toolchain", new MyToolChain() ); setFieldValue( surefirePlugin, "forkMode", "never" ); assertEquals( "once", surefirePlugin.getEffectiveForkMode() ); } public void testForkCountComputation() { SurefirePlugin surefirePlugin = new SurefirePlugin(); assertConversionFails( surefirePlugin, "nothing" ); assertConversionFails( surefirePlugin, "5,0" ); assertConversionFails( surefirePlugin, "5.0" ); assertConversionFails( surefirePlugin, "5,0C" ); assertConversionFails( surefirePlugin, "5.0CC" ); assertForkCount( surefirePlugin, 5, "5" ); int availableProcessors = Runtime.getRuntime().availableProcessors(); assertForkCount( surefirePlugin, 3*availableProcessors, "3C" ); assertForkCount( surefirePlugin, (int) ( 2.5*availableProcessors ), "2.5C" ); assertForkCount( surefirePlugin, availableProcessors, "1.0001 C" ); assertForkCount( surefirePlugin, 1, 1d / ( (double) availableProcessors + 1 ) + "C" ); assertForkCount( surefirePlugin, 0, "0 C" ); } private void assertForkCount( SurefirePlugin surefirePlugin, int expected, String value ) { assertEquals( expected, surefirePlugin.convertWithCoreCount( value )); } private void assertConversionFails( SurefirePlugin surefirePlugin, String value ) { try { surefirePlugin.convertWithCoreCount( value ); } catch (NumberFormatException nfe) { return; } fail( "Expected NumberFormatException when converting " + value ); } private void setFieldValue( SurefirePlugin plugin, String fieldName, Object value ) throws NoSuchFieldException, IllegalAccessException { Field field = findField( plugin.getClass(), fieldName ); field.setAccessible( true ); field.set( plugin, value ); } private Field findField( Class clazz, String fieldName ) { while ( clazz != null ) { try { return clazz.getDeclaredField( fieldName ); } catch ( NoSuchFieldException e ) { clazz = clazz.getSuperclass(); } } throw new IllegalArgumentException( "Field not found" ); } private class MyToolChain implements Toolchain { @Override public String getType() { return null; } @Override public String findTool( String s ) { return null; } } } maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/000077500000000000000000000000001330756104600241115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/pom.xml000066400000000000000000000174231330756104600254350ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire 2.22.0 org.apache.maven.plugins maven-surefire-report-plugin maven-plugin Maven Surefire Report Plugin Maven Surefire Report MOJO in maven-surefire-report-plugin. jruiz Johnny Ruiz III jruiz@exist.com ${mavenVersion} org.apache.maven maven-project org.apache.maven maven-model org.apache.maven maven-plugin-api org.apache.maven.plugin-tools maven-plugin-annotations org.apache.maven maven-artifact org.apache.maven.surefire surefire-report-parser ${project.version} org.apache.maven.reporting maven-reporting-impl 2.4 org.apache.maven.doxia doxia-site-renderer 1.6 org.codehaus.plexus plexus-utils 3.0.15 org.fusesource.jansi jansi 1.13 provided org.apache.maven.plugin-testing maven-plugin-testing-harness 1.2 test org.apache.maven.plugins maven-plugin-plugin surefire-report true mojo-descriptor descriptor generated-helpmojo helpmojo org.codehaus.mojo build-helper-maven-plugin add-source generate-sources add-source ${project.build.directory}/generated-sources/dependency maven-dependency-plugin shared-logging-generated-sources generate-sources unpack ${project.build.directory}/generated-sources/dependency false org.apache.maven.shared:maven-shared-utils:3.1.0:jar:sources org/apache/maven/shared/utils/logging/*.java maven-surefire-plugin true org.fusesource.jansi:jansi org.apache.maven.plugins maven-plugin-plugin ${mavenPluginPluginVersion} ci enableCiProfile true maven-docck-plugin 1.1 check reporting org.codehaus.mojo l10n-maven-plugin 1.0-alpha-2 de sv org.apache.maven.plugins maven-changes-plugin false jira-report maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/000077500000000000000000000000001330756104600247005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/000077500000000000000000000000001330756104600256245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/java/000077500000000000000000000000001330756104600265455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/000077500000000000000000000000001330756104600273345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/apache/000077500000000000000000000000001330756104600305555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600316635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/000077500000000000000000000000001330756104600333445ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600351115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/apache/maven/pluginsreport/000077500000000000000000000000001330756104600364245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefireAbstractSurefireReportMojo.java000066400000000000000000000245511330756104600445670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Locale; import org.apache.maven.model.ReportPlugin; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.apache.maven.reporting.AbstractMavenReport; import org.apache.maven.reporting.MavenReportException; import org.apache.maven.shared.utils.PathTool; import static java.util.Collections.addAll; import static org.apache.maven.plugins.surefire.report.SurefireReportParser.hasReportFiles; import static org.apache.maven.shared.utils.StringUtils.isEmpty; /** * Abstract base class for reporting test results using Surefire. * * @author Stephen Connolly */ public abstract class AbstractSurefireReportMojo extends AbstractMavenReport { /** * If set to false, only failures are shown. */ @Parameter( defaultValue = "true", required = true, property = "showSuccess" ) private boolean showSuccess; /** * Directories containing the XML Report files that will be parsed and rendered to HTML format. */ @Parameter private File[] reportsDirectories; /** * (Deprecated, use reportsDirectories) This directory contains the XML Report files that will be parsed and * rendered to HTML format. */ @Deprecated @Parameter private File reportsDirectory; /** * The projects in the reactor for aggregation report. */ @Parameter( defaultValue = "${reactorProjects}", readonly = true ) private List reactorProjects; /** * Location of the Xrefs to link. */ @Parameter( defaultValue = "${project.reporting.outputDirectory}/xref-test" ) private File xrefLocation; /** * Whether to link the XRef if found. */ @Parameter( defaultValue = "true", property = "linkXRef" ) private boolean linkXRef; /** * Whether to build an aggregated report at the root, or build individual reports. */ @Parameter( defaultValue = "false", property = "aggregate" ) private boolean aggregate; private List resolvedReportsDirectories; /** * Whether the report should be generated or not. * * @return {@code true} if and only if the report should be generated. * @since 2.11 */ protected boolean isSkipped() { return false; } /** * Whether the report should be generated when there are no test results. * * @return {@code true} if and only if the report should be generated when there are no result files at all. * @since 2.11 */ protected boolean isGeneratedWhenNoResults() { return false; } public abstract void setTitle( String title ); public abstract String getTitle(); public abstract void setDescription( String description ); public abstract String getDescription(); /** * {@inheritDoc} */ @Override public void executeReport( Locale locale ) throws MavenReportException { if ( !hasReportDirectories() ) { return; } new SurefireReportGenerator( getReportsDirectories(), locale, showSuccess, determineXrefLocation(), getConsoleLogger() ) .doGenerateReport( getBundle( locale ), getSink() ); } @Override public boolean canGenerateReport() { return hasReportDirectories() && super.canGenerateReport(); } private boolean hasReportDirectories() { if ( isSkipped() ) { return false; } final List reportsDirectories = getReportsDirectories(); if ( reportsDirectories == null ) { return false; } if ( !isGeneratedWhenNoResults() ) { boolean atLeastOneDirectoryExists = false; for ( Iterator i = reportsDirectories.iterator(); i.hasNext() && !atLeastOneDirectoryExists; ) { atLeastOneDirectoryExists = hasReportFiles( i.next() ); } if ( !atLeastOneDirectoryExists ) { return false; } } return true; } private List getReportsDirectories() { if ( resolvedReportsDirectories != null ) { return resolvedReportsDirectories; } resolvedReportsDirectories = new ArrayList(); if ( this.reportsDirectories != null ) { addAll( resolvedReportsDirectories, this.reportsDirectories ); } //noinspection deprecation if ( reportsDirectory != null ) { //noinspection deprecation resolvedReportsDirectories.add( reportsDirectory ); } if ( aggregate ) { if ( !project.isExecutionRoot() ) { return null; } if ( this.reportsDirectories == null ) { for ( MavenProject mavenProject : getProjectsWithoutRoot() ) { resolvedReportsDirectories.add( getSurefireReportsDirectory( mavenProject ) ); } } else { // Multiple report directories are configured. // Let's see if those directories exist in each sub-module to fix SUREFIRE-570 String parentBaseDir = getProject().getBasedir().getAbsolutePath(); for ( MavenProject subProject : getProjectsWithoutRoot() ) { String moduleBaseDir = subProject.getBasedir().getAbsolutePath(); for ( File reportsDirectory1 : this.reportsDirectories ) { String reportDir = reportsDirectory1.getPath(); if ( reportDir.startsWith( parentBaseDir ) ) { reportDir = reportDir.substring( parentBaseDir.length() ); } File reportsDirectory = new File( moduleBaseDir, reportDir ); if ( reportsDirectory.exists() && reportsDirectory.isDirectory() ) { getConsoleLogger().debug( "Adding report dir : " + moduleBaseDir + reportDir ); resolvedReportsDirectories.add( reportsDirectory ); } } } } } else { if ( resolvedReportsDirectories.isEmpty() ) { resolvedReportsDirectories.add( getSurefireReportsDirectory( project ) ); } } return resolvedReportsDirectories; } /** * Gets the default surefire reports directory for the specified project. * * @param subProject the project to query. * @return the default surefire reports directory for the specified project. */ protected abstract File getSurefireReportsDirectory( MavenProject subProject ); private List getProjectsWithoutRoot() { List result = new ArrayList(); for ( MavenProject subProject : reactorProjects ) { if ( !project.equals( subProject ) ) { result.add( subProject ); } } return result; } private String determineXrefLocation() { String location = null; if ( linkXRef ) { String relativePath = PathTool.getRelativePath( getOutputDirectory(), xrefLocation.getAbsolutePath() ); if ( isEmpty( relativePath ) ) { relativePath = "."; } relativePath = relativePath + "/" + xrefLocation.getName(); if ( xrefLocation.exists() ) { // XRef was already generated by manual execution of a lifecycle binding location = relativePath; } else { // Not yet generated - check if the report is on its way for ( Object o : project.getReportPlugins() ) { ReportPlugin report = (ReportPlugin) o; String artifactId = report.getArtifactId(); if ( "maven-jxr-plugin".equals( artifactId ) || "jxr-maven-plugin".equals( artifactId ) ) { location = relativePath; } } } if ( location == null ) { getConsoleLogger().warning( "Unable to locate Test Source XRef to link to - DISABLED" ); } } return location; } /** * {@inheritDoc} */ @Override public String getName( Locale locale ) { return getBundle( locale ).getReportName(); } /** * {@inheritDoc} */ @Override public String getDescription( Locale locale ) { return getBundle( locale ).getReportDescription(); } /** * {@inheritDoc} */ @Override public abstract String getOutputName(); protected abstract LocalizedProperties getBundle( Locale locale, ClassLoader resourceBundleClassLoader ); protected final ConsoleLogger getConsoleLogger() { return new PluginConsoleLogger( getLog() ); } final LocalizedProperties getBundle( Locale locale ) { return getBundle( locale, getClass().getClassLoader() ); } } FailsafeReportMojo.java000066400000000000000000000113661330756104600430310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import java.io.File; import java.util.Locale; import java.util.ResourceBundle; import static org.apache.maven.shared.utils.StringUtils.isEmpty; /** * Creates a nicely formatted Failsafe Test Report in html format. * This goal does not run the tests, it only builds the reports. * See * https://issues.apache.org/jira/browse/SUREFIRE-257 * * @author Stephen Connolly * @since 2.10 */ @Mojo( name = "failsafe-report-only" ) @SuppressWarnings( "unused" ) public class FailsafeReportMojo extends AbstractSurefireReportMojo { /** * The filename to use for the report. */ @Parameter( defaultValue = "failsafe-report", property = "outputName", required = true ) private String outputName; /** * If set to true the failsafe report will be generated even when there are no failsafe result files. * Defaults to {@code false} to preserve legacy behaviour pre 2.10. * @since 2.11 */ @Parameter( defaultValue = "false", property = "alwaysGenerateFailsafeReport" ) private boolean alwaysGenerateFailsafeReport; /** * If set to true the failsafe report generation will be skipped. * @since 2.11 */ @Parameter( defaultValue = "false", property = "skipFailsafeReport" ) private boolean skipFailsafeReport; /** * A custom title of the report for the menu and the project reports page. * @since 2.21.0 */ @Parameter( defaultValue = "", property = "failsafe.report.title" ) private String title; /** * A custom description for the project reports page. * @since 2.21.0 */ @Parameter( defaultValue = "", property = "failsafe.report.description" ) private String description; @Override protected File getSurefireReportsDirectory( MavenProject subProject ) { String buildDir = subProject.getBuild().getDirectory(); return new File( buildDir + "/failsafe-reports" ); } @Override public String getOutputName() { return outputName; } @Override protected LocalizedProperties getBundle( Locale locale, ClassLoader resourceBundleClassLoader ) { ResourceBundle bundle = ResourceBundle.getBundle( "surefire-report", locale, resourceBundleClassLoader ); return new LocalizedProperties( bundle ) { @Override public String getReportName() { return isEmpty( FailsafeReportMojo.this.getTitle() ) ? toLocalizedValue( "report.failsafe.name" ) : FailsafeReportMojo.this.getTitle(); } @Override public String getReportDescription() { return isEmpty( FailsafeReportMojo.this.getDescription() ) ? toLocalizedValue( "report.failsafe.description" ) : FailsafeReportMojo.this.getDescription(); } @Override public String getReportHeader() { return isEmpty( FailsafeReportMojo.this.getTitle() ) ? toLocalizedValue( "report.failsafe.header" ) : FailsafeReportMojo.this.getTitle(); } }; } @Override protected boolean isSkipped() { return skipFailsafeReport; } @Override protected boolean isGeneratedWhenNoResults() { return alwaysGenerateFailsafeReport; } @Override public void setTitle( String title ) { this.title = title; } @Override public String getTitle() { return title; } @Override public void setDescription( String description ) { this.description = description; } @Override public String getDescription() { return description; } } LocalizedProperties.java000066400000000000000000000061621330756104600432570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import java.util.ResourceBundle; /** * Surefire Resource Bundle. * * @author Tibor Digana (tibor17) */ public abstract class LocalizedProperties { private final ResourceBundle bundle; protected LocalizedProperties( ResourceBundle bundle ) { this.bundle = bundle; } public abstract String getReportName(); public abstract String getReportDescription(); public abstract String getReportHeader(); protected final String toLocalizedValue( String key ) { return bundle.getString( key ); } public String getReportLabelSummary() { return toLocalizedValue( "report.surefire.label.summary" ); } public String getReportLabelTests() { return toLocalizedValue( "report.surefire.label.tests" ); } public String getReportLabelErrors() { return toLocalizedValue( "report.surefire.label.errors" ); } public String getReportLabelFailures() { return toLocalizedValue( "report.surefire.label.failures" ); } public String getReportLabelSkipped() { return toLocalizedValue( "report.surefire.label.skipped" ); } public String getReportLabelSuccessRate() { return toLocalizedValue( "report.surefire.label.successrate" ); } public String getReportLabelTime() { return toLocalizedValue( "report.surefire.label.time" ); } public String getReportLabelPackageList() { return toLocalizedValue( "report.surefire.label.packagelist" ); } public String getReportLabelPackage() { return toLocalizedValue( "report.surefire.label.package" ); } public String getReportLabelClass() { return toLocalizedValue( "report.surefire.label.class" ); } public String getReportLabelTestCases() { return toLocalizedValue( "report.surefire.label.testcases" ); } public String getReportLabelFailureDetails() { return toLocalizedValue( "report.surefire.label.failuredetails" ); } public String getReportTextNode1() { return toLocalizedValue( "report.surefire.text.note1" ); } public String getReportTextNode2() { return toLocalizedValue( "report.surefire.text.note2" ); } } PluginConsoleLogger.java000066400000000000000000000075621330756104600432220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import org.apache.maven.plugin.logging.Log; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.shared.utils.logging.MessageBuilder; import static java.lang.Integer.numberOfLeadingZeros; import static org.apache.maven.shared.utils.logging.MessageUtils.buffer; /** * Wrapper logger of miscellaneous (Maven 2.2.1 or 3.1) implementations of {@link Log}. * Calling {@link Log#isInfoEnabled()} before {@link Log#info(CharSequence)} due to Maven 2.2.1. * * @author Tibor Digana (tibor17) * @since 2.20 * @see ConsoleLogger */ final class PluginConsoleLogger implements ConsoleLogger { private final Log mojoLogger; PluginConsoleLogger( Log mojoLogger ) { this.mojoLogger = mojoLogger; } @Override public boolean isDebugEnabled() { return mojoLogger.isDebugEnabled(); } @Override public void debug( String message ) { if ( mojoLogger.isDebugEnabled() ) { mojoLogger.debug( createAnsiBuilder( message ).debug( message ).toString() ); } } public void debug( CharSequence content, Throwable error ) { if ( mojoLogger.isDebugEnabled() ) { mojoLogger.debug( content, error ); } } @Override public boolean isInfoEnabled() { return mojoLogger.isInfoEnabled(); } @Override public void info( String message ) { if ( mojoLogger.isInfoEnabled() ) { mojoLogger.info( createAnsiBuilder( message ).info( message ).toString() ); } } @Override public boolean isWarnEnabled() { return mojoLogger.isWarnEnabled(); } @Override public void warning( String message ) { if ( mojoLogger.isWarnEnabled() ) { mojoLogger.warn( createAnsiBuilder( message ).warning( message ).toString() ); } } public void warn( CharSequence content, Throwable error ) { if ( mojoLogger.isWarnEnabled() ) { mojoLogger.warn( content, error ); } } @Override public boolean isErrorEnabled() { return mojoLogger.isErrorEnabled(); } @Override public void error( String message ) { if ( mojoLogger.isErrorEnabled() ) { mojoLogger.error( createAnsiBuilder( message ).error( message ).toString() ); } } @Override public void error( String message, Throwable t ) { if ( mojoLogger.isErrorEnabled() ) { mojoLogger.error( message, t ); } } @Override public void error( Throwable t ) { if ( mojoLogger.isErrorEnabled() ) { mojoLogger.error( t ); } } private static MessageBuilder createAnsiBuilder( CharSequence message ) { return buffer( bufferSize( message ) ); } private static int bufferSize( CharSequence message ) { return 32 - numberOfLeadingZeros( message.length() ); } } SurefireReportGenerator.java000066400000000000000000000557351330756104600441350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import java.io.File; import java.text.NumberFormat; import java.util.List; import java.util.Locale; import java.util.Map; import org.apache.maven.doxia.markup.HtmlMarkup; import org.apache.maven.doxia.sink.Sink; import org.apache.maven.doxia.sink.SinkEventAttributeSet; import org.apache.maven.doxia.util.DoxiaUtils; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.reporting.MavenReportException; import static org.apache.maven.doxia.markup.HtmlMarkup.A; import static org.apache.maven.doxia.sink.Sink.JUSTIFY_LEFT; import static org.apache.maven.doxia.sink.SinkEventAttributes.CLASS; import static org.apache.maven.doxia.sink.SinkEventAttributes.HREF; import static org.apache.maven.doxia.sink.SinkEventAttributes.ID; import static org.apache.maven.doxia.sink.SinkEventAttributes.NAME; import static org.apache.maven.doxia.sink.SinkEventAttributes.STYLE; import static org.apache.maven.doxia.sink.SinkEventAttributes.TYPE; /** * This generator creates HTML Report from Surefire and Failsafe XML Report. */ public final class SurefireReportGenerator { private static final int LEFT = JUSTIFY_LEFT; private static final Object[] TAG_TYPE_START = { HtmlMarkup.TAG_TYPE_START }; private static final Object[] TAG_TYPE_END = { HtmlMarkup.TAG_TYPE_END }; private final SurefireReportParser report; private final boolean showSuccess; private final String xrefLocation; private List testSuites; public SurefireReportGenerator( List reportsDirectories, Locale locale, boolean showSuccess, String xrefLocation, ConsoleLogger consoleLogger ) { report = new SurefireReportParser( reportsDirectories, locale, consoleLogger ); this.showSuccess = showSuccess; this.xrefLocation = xrefLocation; } public void doGenerateReport( LocalizedProperties bundle, Sink sink ) throws MavenReportException { testSuites = report.parseXMLReportFiles(); sink.head(); sink.title(); sink.text( bundle.getReportHeader() ); sink.title_(); sink.head_(); sink.body(); SinkEventAttributeSet atts = new SinkEventAttributeSet(); atts.addAttribute( TYPE, "text/javascript" ); sink.unknown( "script", new Object[]{ HtmlMarkup.TAG_TYPE_START }, atts ); sink.unknown( "cdata", new Object[]{ HtmlMarkup.CDATA_TYPE, javascriptToggleDisplayCode() }, null ); sink.unknown( "script", new Object[]{ HtmlMarkup.TAG_TYPE_END }, null ); sink.section1(); sink.sectionTitle1(); sink.text( bundle.getReportHeader() ); sink.sectionTitle1_(); sink.section1_(); constructSummarySection( bundle, sink ); Map> suitePackages = report.getSuitesGroupByPackage( testSuites ); if ( !suitePackages.isEmpty() ) { constructPackagesSection( bundle, sink, suitePackages ); } if ( !testSuites.isEmpty() ) { constructTestCasesSection( bundle, sink ); } List failureList = report.getFailureDetails( testSuites ); if ( !failureList.isEmpty() ) { constructFailureDetails( sink, bundle, failureList ); } sink.body_(); sink.flush(); sink.close(); } private void constructSummarySection( LocalizedProperties bundle, Sink sink ) { Map summary = report.getSummary( testSuites ); sink.section1(); sink.sectionTitle1(); sink.text( bundle.getReportLabelSummary() ); sink.sectionTitle1_(); sinkAnchor( sink, "Summary" ); constructHotLinks( sink, bundle ); sinkLineBreak( sink ); sink.table(); sink.tableRows( new int[]{ LEFT, LEFT, LEFT, LEFT, LEFT, LEFT }, true ); sink.tableRow(); sinkHeader( sink, bundle.getReportLabelTests() ); sinkHeader( sink, bundle.getReportLabelErrors() ); sinkHeader( sink, bundle.getReportLabelFailures() ); sinkHeader( sink, bundle.getReportLabelSkipped() ); sinkHeader( sink, bundle.getReportLabelSuccessRate() ); sinkHeader( sink, bundle.getReportLabelTime() ); sink.tableRow_(); sink.tableRow(); sinkCell( sink, summary.get( "totalTests" ) ); sinkCell( sink, summary.get( "totalErrors" ) ); sinkCell( sink, summary.get( "totalFailures" ) ); sinkCell( sink, summary.get( "totalSkipped" ) ); sinkCell( sink, summary.get( "totalPercentage" ) + "%" ); sinkCell( sink, summary.get( "totalElapsedTime" ) ); sink.tableRow_(); sink.tableRows_(); sink.table_(); sink.lineBreak(); sink.paragraph(); sink.text( bundle.getReportTextNode1() ); sink.paragraph_(); sinkLineBreak( sink ); sink.section1_(); } private void constructPackagesSection( LocalizedProperties bundle, Sink sink, Map> suitePackages ) { NumberFormat numberFormat = report.getNumberFormat(); sink.section1(); sink.sectionTitle1(); sink.text( bundle.getReportLabelPackageList() ); sink.sectionTitle1_(); sinkAnchor( sink, "Package_List" ); constructHotLinks( sink, bundle ); sinkLineBreak( sink ); sink.table(); sink.tableRows( new int[]{ LEFT, LEFT, LEFT, LEFT, LEFT, LEFT, LEFT }, true ); sink.tableRow(); sinkHeader( sink, bundle.getReportLabelPackage() ); sinkHeader( sink, bundle.getReportLabelTests() ); sinkHeader( sink, bundle.getReportLabelErrors() ); sinkHeader( sink, bundle.getReportLabelFailures() ); sinkHeader( sink, bundle.getReportLabelSkipped() ); sinkHeader( sink, bundle.getReportLabelSuccessRate() ); sinkHeader( sink, bundle.getReportLabelTime() ); sink.tableRow_(); for ( Map.Entry> entry : suitePackages.entrySet() ) { sink.tableRow(); String packageName = entry.getKey(); List testSuiteList = entry.getValue(); Map packageSummary = report.getSummary( testSuiteList ); sinkCellLink( sink, packageName, "#" + packageName ); sinkCell( sink, packageSummary.get( "totalTests" ) ); sinkCell( sink, packageSummary.get( "totalErrors" ) ); sinkCell( sink, packageSummary.get( "totalFailures" ) ); sinkCell( sink, packageSummary.get( "totalSkipped" ) ); sinkCell( sink, packageSummary.get( "totalPercentage" ) + "%" ); sinkCell( sink, packageSummary.get( "totalElapsedTime" ) ); sink.tableRow_(); } sink.tableRows_(); sink.table_(); sink.lineBreak(); sink.paragraph(); sink.text( bundle.getReportTextNode2() ); sink.paragraph_(); for ( Map.Entry> entry : suitePackages.entrySet() ) { String packageName = entry.getKey(); List testSuiteList = entry.getValue(); sink.section2(); sink.sectionTitle2(); sink.text( packageName ); sink.sectionTitle2_(); sinkAnchor( sink, packageName ); boolean showTable = false; for ( ReportTestSuite suite : testSuiteList ) { if ( showSuccess || suite.getNumberOfErrors() != 0 || suite.getNumberOfFailures() != 0 ) { showTable = true; break; } } if ( showTable ) { sink.table(); sink.tableRows( new int[]{ LEFT, LEFT, LEFT, LEFT, LEFT, LEFT, LEFT, LEFT }, true ); sink.tableRow(); sinkHeader( sink, "" ); sinkHeader( sink, bundle.getReportLabelClass() ); sinkHeader( sink, bundle.getReportLabelTests() ); sinkHeader( sink, bundle.getReportLabelErrors() ); sinkHeader( sink, bundle.getReportLabelFailures() ); sinkHeader( sink, bundle.getReportLabelSkipped() ); sinkHeader( sink, bundle.getReportLabelSuccessRate() ); sinkHeader( sink, bundle.getReportLabelTime() ); sink.tableRow_(); for ( ReportTestSuite suite : testSuiteList ) { if ( showSuccess || suite.getNumberOfErrors() != 0 || suite.getNumberOfFailures() != 0 ) { constructTestSuiteSection( sink, numberFormat, suite ); } } sink.tableRows_(); sink.table_(); } sink.section2_(); } sinkLineBreak( sink ); sink.section1_(); } private void constructTestSuiteSection( Sink sink, NumberFormat numberFormat, ReportTestSuite suite ) { sink.tableRow(); sink.tableCell(); sink.link( "#" + suite.getPackageName() + '.' + suite.getName() ); if ( suite.getNumberOfErrors() > 0 ) { sinkIcon( "error", sink ); } else if ( suite.getNumberOfFailures() > 0 ) { sinkIcon( "junit.framework", sink ); } else if ( suite.getNumberOfSkipped() > 0 ) { sinkIcon( "skipped", sink ); } else { sinkIcon( "success", sink ); } sink.link_(); sink.tableCell_(); sinkCellLink( sink, suite.getName(), "#" + suite.getPackageName() + '.' + suite.getName() ); sinkCell( sink, Integer.toString( suite.getNumberOfTests() ) ); sinkCell( sink, Integer.toString( suite.getNumberOfErrors() ) ); sinkCell( sink, Integer.toString( suite.getNumberOfFailures() ) ); sinkCell( sink, Integer.toString( suite.getNumberOfSkipped() ) ); String percentage = report.computePercentage( suite.getNumberOfTests(), suite.getNumberOfErrors(), suite.getNumberOfFailures(), suite.getNumberOfSkipped() ); sinkCell( sink, percentage + "%" ); sinkCell( sink, numberFormat.format( suite.getTimeElapsed() ) ); sink.tableRow_(); } private void constructTestCasesSection( LocalizedProperties bundle, Sink sink ) { NumberFormat numberFormat = report.getNumberFormat(); sink.section1(); sink.sectionTitle1(); sink.text( bundle.getReportLabelTestCases() ); sink.sectionTitle1_(); sinkAnchor( sink, "Test_Cases" ); constructHotLinks( sink, bundle ); for ( ReportTestSuite suite : testSuites ) { List testCases = suite.getTestCases(); if ( !testCases.isEmpty() ) { sink.section2(); sink.sectionTitle2(); sink.text( suite.getName() ); sink.sectionTitle2_(); sinkAnchor( sink, suite.getPackageName() + '.' + suite.getName() ); boolean showTable = false; for ( ReportTestCase testCase : testCases ) { if ( !testCase.isSuccessful() || showSuccess ) { showTable = true; break; } } if ( showTable ) { sink.table(); sink.tableRows( new int[]{ LEFT, LEFT, LEFT }, true ); for ( ReportTestCase testCase : testCases ) { if ( !testCase.isSuccessful() || showSuccess ) { constructTestCaseSection( sink, numberFormat, testCase ); } } sink.tableRows_(); sink.table_(); } sink.section2_(); } } sinkLineBreak( sink ); sink.section1_(); } private static void constructTestCaseSection( Sink sink, NumberFormat numberFormat, ReportTestCase testCase ) { sink.tableRow(); sink.tableCell(); if ( testCase.getFailureType() != null ) { sink.link( "#" + toHtmlId( testCase.getFullName() ) ); sinkIcon( testCase.getFailureType(), sink ); sink.link_(); } else { sinkIcon( "success", sink ); } sink.tableCell_(); if ( !testCase.isSuccessful() ) { sink.tableCell(); sinkAnchor( sink, "TC_" + toHtmlId( testCase.getFullName() ) ); sinkLink( sink, testCase.getName(), "#" + toHtmlId( testCase.getFullName() ) ); SinkEventAttributeSet atts = new SinkEventAttributeSet(); atts.addAttribute( CLASS, "detailToggle" ); atts.addAttribute( STYLE, "display:inline" ); sink.unknown( "div", TAG_TYPE_START, atts ); sinkLink( sink, "javascript:toggleDisplay('" + toHtmlId( testCase.getFullName() ) + "');" ); atts = new SinkEventAttributeSet(); atts.addAttribute( STYLE, "display:inline;" ); atts.addAttribute( ID, toHtmlId( testCase.getFullName() ) + "-off" ); sink.unknown( "span", TAG_TYPE_START, atts ); sink.text( " + " ); sink.unknown( "span", TAG_TYPE_END, null ); atts = new SinkEventAttributeSet(); atts.addAttribute( STYLE, "display:none;" ); atts.addAttribute( ID, toHtmlId( testCase.getFullName() ) + "-on" ); sink.unknown( "span", TAG_TYPE_START, atts ); sink.text( " - " ); sink.unknown( "span", TAG_TYPE_END, null ); sink.text( "[ Detail ]" ); sinkLink_( sink ); sink.unknown( "div", TAG_TYPE_END, null ); sink.tableCell_(); } else { sinkCellAnchor( sink, testCase.getName(), "TC_" + toHtmlId( testCase.getFullName() ) ); } sinkCell( sink, numberFormat.format( testCase.getTime() ) ); sink.tableRow_(); if ( !testCase.isSuccessful() ) { sink.tableRow(); sinkCell( sink, "" ); sinkCell( sink, testCase.getFailureMessage() ); sinkCell( sink, "" ); sink.tableRow_(); String detail = testCase.getFailureDetail(); if ( detail != null ) { sink.tableRow(); sinkCell( sink, "" ); sink.tableCell(); SinkEventAttributeSet atts = new SinkEventAttributeSet(); atts.addAttribute( ID, toHtmlId( testCase.getFullName() ) + toHtmlIdFailure( testCase ) ); atts.addAttribute( STYLE, "display:none;" ); sink.unknown( "div", TAG_TYPE_START, atts ); sink.verbatim( null ); sink.text( detail ); sink.verbatim_(); sink.unknown( "div", TAG_TYPE_END, null ); sink.tableCell_(); sinkCell( sink, "" ); sink.tableRow_(); } } } private static String toHtmlId( String id ) { return DoxiaUtils.isValidId( id ) ? id : DoxiaUtils.encodeId( id, true ); } private void constructFailureDetails( Sink sink, LocalizedProperties bundle, List failures ) { sink.section1(); sink.sectionTitle1(); sink.text( bundle.getReportLabelFailureDetails() ); sink.sectionTitle1_(); sinkAnchor( sink, "Failure_Details" ); constructHotLinks( sink, bundle ); sinkLineBreak( sink ); sink.table(); sink.tableRows( new int[]{ LEFT, LEFT }, true ); for ( ReportTestCase tCase : failures ) { sink.tableRow(); sink.tableCell(); String type = tCase.getFailureType(); sinkIcon( type, sink ); sink.tableCell_(); sinkCellAnchor( sink, tCase.getName(), toHtmlId( tCase.getFullName() ) ); sink.tableRow_(); String message = tCase.getFailureMessage(); sink.tableRow(); sinkCell( sink, "" ); sinkCell( sink, message == null ? type : type + ": " + message ); sink.tableRow_(); String detail = tCase.getFailureDetail(); if ( detail != null ) { sink.tableRow(); sinkCell( sink, "" ); sink.tableCell(); SinkEventAttributeSet atts = new SinkEventAttributeSet(); atts.addAttribute( ID, tCase.getName() + toHtmlIdFailure( tCase ) ); sink.unknown( "div", TAG_TYPE_START, atts ); String fullClassName = tCase.getFullClassName(); String errorLineNumber = tCase.getFailureErrorLine(); if ( xrefLocation != null ) { String path = fullClassName.replace( '.', '/' ); sink.link( xrefLocation + "/" + path + ".html#" + errorLineNumber ); } sink.text( fullClassName + ":" + errorLineNumber ); if ( xrefLocation != null ) { sink.link_(); } sink.unknown( "div", TAG_TYPE_END, null ); sink.tableCell_(); sink.tableRow_(); } } sink.tableRows_(); sink.table_(); sinkLineBreak( sink ); sink.section1_(); } private void constructHotLinks( Sink sink, LocalizedProperties bundle ) { if ( !testSuites.isEmpty() ) { sink.paragraph(); sink.text( "[" ); sinkLink( sink, bundle.getReportLabelSummary(), "#Summary" ); sink.text( "]" ); sink.text( " [" ); sinkLink( sink, bundle.getReportLabelPackageList(), "#Package_List" ); sink.text( "]" ); sink.text( " [" ); sinkLink( sink, bundle.getReportLabelTestCases(), "#Test_Cases" ); sink.text( "]" ); sink.paragraph_(); } } private static String toHtmlIdFailure( ReportTestCase tCase ) { return tCase.hasError() ? "-error" : "-failure"; } private static void sinkLineBreak( Sink sink ) { sink.lineBreak(); } private static void sinkIcon( String type, Sink sink ) { sink.figure(); if ( type.startsWith( "junit.framework" ) || "skipped".equals( type ) ) { sink.figureGraphics( "images/icon_warning_sml.gif" ); } else if ( type.startsWith( "success" ) ) { sink.figureGraphics( "images/icon_success_sml.gif" ); } else { sink.figureGraphics( "images/icon_error_sml.gif" ); } sink.figure_(); } private static void sinkHeader( Sink sink, String header ) { sink.tableHeaderCell(); sink.text( header ); sink.tableHeaderCell_(); } private static void sinkCell( Sink sink, String text ) { sink.tableCell(); sink.text( text ); sink.tableCell_(); } private static void sinkLink( Sink sink, String text, String link ) { sink.link( link ); sink.text( text ); sink.link_(); } private static void sinkCellLink( Sink sink, String text, String link ) { sink.tableCell(); sinkLink( sink, text, link ); sink.tableCell_(); } private static void sinkCellAnchor( Sink sink, String text, String anchor ) { sink.tableCell(); sinkAnchor( sink, anchor ); sink.text( text ); sink.tableCell_(); } private static void sinkAnchor( Sink sink, String anchor ) { // Dollar '$' for nested classes is not valid character in sink.anchor() and therefore it is ignored // https://issues.apache.org/jira/browse/SUREFIRE-1443 sink.unknown( A.toString(), TAG_TYPE_START, new SinkEventAttributeSet( NAME, anchor ) ); sink.unknown( A.toString(), TAG_TYPE_END, null ); } private static void sinkLink( Sink sink, String href ) { // The "'" argument in this JavaScript function would be escaped to "'" // sink.link( "javascript:toggleDisplay('" + toHtmlId( testCase.getFullName() ) + "');" ); sink.unknown( A.toString(), TAG_TYPE_START, new SinkEventAttributeSet( HREF, href ) ); } @SuppressWarnings( "checkstyle:methodname" ) private static void sinkLink_( Sink sink ) { sink.unknown( A.toString(), TAG_TYPE_END, null ); } private static String javascriptToggleDisplayCode() { // the javascript code is emitted within a commented CDATA section // so we have to start with a newline and comment the CDATA closing in the end return "\n" + "function toggleDisplay(elementId) {\n" + " var elm = document.getElementById(elementId + '-error');\n" + " if (elm == null) {\n" + " elm = document.getElementById(elementId + '-failure');\n" + " }\n" + " if (elm && typeof elm.style != \"undefined\") {\n" + " if (elm.style.display == \"none\") {\n" + " elm.style.display = \"\";\n" + " document.getElementById(elementId + '-off').style.display = \"none\";\n" + " document.getElementById(elementId + '-on').style.display = \"inline\";\n" + " } else if (elm.style.display == \"\") {" + " elm.style.display = \"none\";\n" + " document.getElementById(elementId + '-off').style.display = \"inline\";\n" + " document.getElementById(elementId + '-on').style.display = \"none\";\n" + " } \n" + " } \n" + " }\n" + "//"; } } SurefireReportMojo.java000066400000000000000000000114051330756104600430750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import org.apache.maven.plugins.annotations.Execute; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import java.io.File; import java.util.Locale; import java.util.ResourceBundle; import static org.apache.maven.shared.utils.StringUtils.isEmpty; /** * Creates a nicely formatted Surefire Test Report in html format. * * @author Johnny R. Ruiz III */ @Mojo( name = "report", inheritByDefault = false ) @Execute( lifecycle = "surefire", phase = LifecyclePhase.TEST ) @SuppressWarnings( "unused" ) public class SurefireReportMojo extends AbstractSurefireReportMojo { /** * The filename to use for the report. */ @Parameter( defaultValue = "surefire-report", property = "outputName", required = true ) private String outputName; /** * If set to true the surefire report will be generated even when there are no surefire result files. * Defaults to {@code true} to preserve legacy behaviour pre 2.10. * @since 2.11 */ @Parameter( defaultValue = "true", property = "alwaysGenerateSurefireReport" ) private boolean alwaysGenerateSurefireReport; /** * If set to true the surefire report generation will be skipped. * @since 2.11 */ @Parameter( defaultValue = "false", property = "skipSurefireReport" ) private boolean skipSurefireReport; /** * A custom title of the report for the menu and the project reports page. * @since 2.21.0 */ @Parameter( defaultValue = "", property = "surefire.report.title" ) private String title; /** * A custom description for the project reports page. * @since 2.21.0 */ @Parameter( defaultValue = "", property = "surefire.report.description" ) private String description; @Override protected File getSurefireReportsDirectory( MavenProject subProject ) { String buildDir = subProject.getBuild().getDirectory(); return new File( buildDir + "/surefire-reports" ); } @Override public String getOutputName() { return outputName; } @Override protected LocalizedProperties getBundle( Locale locale, ClassLoader resourceBundleClassLoader ) { ResourceBundle bundle = ResourceBundle.getBundle( "surefire-report", locale, resourceBundleClassLoader ); return new LocalizedProperties( bundle ) { @Override public String getReportName() { return isEmpty( SurefireReportMojo.this.getTitle() ) ? toLocalizedValue( "report.surefire.name" ) : SurefireReportMojo.this.getTitle(); } @Override public String getReportDescription() { return isEmpty( SurefireReportMojo.this.getDescription() ) ? toLocalizedValue( "report.surefire.description" ) : SurefireReportMojo.this.getDescription(); } @Override public String getReportHeader() { return isEmpty( SurefireReportMojo.this.getTitle() ) ? toLocalizedValue( "report.surefire.header" ) : SurefireReportMojo.this.getTitle(); } }; } @Override protected boolean isSkipped() { return skipSurefireReport; } @Override protected boolean isGeneratedWhenNoResults() { return alwaysGenerateSurefireReport; } @Override public void setTitle( String title ) { this.title = title; } @Override public String getTitle() { return title; } @Override public void setDescription( String description ) { this.description = description; } @Override public String getDescription() { return description; } } SurefireReportOnlyMojo.java000066400000000000000000000030401330756104600437330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import org.apache.maven.plugins.annotations.Execute; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; /** * Creates a nicely formatted Surefire Test Report in html format. * This goal does not run the tests, it only builds the reports. * This is a workaround for * https://issues.apache.org/jira/browse/SUREFIRE-257 * * @author Barrie Treloar * @since 2.3 */ @Mojo( name = "report-only" ) @Execute( phase = LifecyclePhase.NONE ) @SuppressWarnings( "unused" ) public class SurefireReportOnlyMojo extends SurefireReportMojo { } maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/resources/000077500000000000000000000000001330756104600276365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/resources/META-INF/000077500000000000000000000000001330756104600307765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/resources/META-INF/maven/000077500000000000000000000000001330756104600321045ustar00rootroot00000000000000lifecycle.xml000066400000000000000000000021041330756104600345030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/resources/META-INF/maven surefire test true surefire-report.properties000066400000000000000000000034471330756104600350420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/resources# # 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. # report.surefire.name=Surefire Report report.surefire.description=Report on the test results of the project. report.surefire.header=Surefire Report report.surefire.label.summary=Summary report.surefire.label.tests=Tests report.surefire.label.errors=Errors report.surefire.label.failures=Failures report.surefire.label.skipped=Skipped report.surefire.label.successrate=Success Rate report.surefire.label.time=Time report.surefire.label.packagelist=Package List report.surefire.label.package=Package report.surefire.label.class=Class report.surefire.label.testcases=Test Cases report.surefire.label.failuredetails=Failure Details report.surefire.text.note1=Note: failures are anticipated and checked for with assertions while errors are unanticipated. report.surefire.text.note2=Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers. report.failsafe.name=Failsafe Report report.failsafe.description=Report on the integration test results of the project. report.failsafe.header=Failsafe Report surefire-report_de.properties000066400000000000000000000036241330756104600355070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/resources# # 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. # report.surefire.description=Bericht \u00FCber die Testresultate des Projekts. report.surefire.header=Surefire Bericht report.surefire.label.class=Klasse report.surefire.label.errors=Fehler report.surefire.label.failuredetails=Details der Fehlschl\u00E4ge report.surefire.label.failures=Fehlschl\u00E4ge report.surefire.label.package=Paket report.surefire.label.packagelist=Pakete report.surefire.label.skipped=Ausgelassen report.surefire.label.successrate=Erfolgsrate report.surefire.label.summary=Zusammenfassung report.surefire.label.testcases=Testf\u00E4lle report.surefire.label.tests=Tests report.surefire.label.time =Zeit report.surefire.name=Surefire Bericht report.surefire.text.note1 =Hinweis: Fehlschl\u00E4ge werden erwartet und durch Behauptungen \u00FCberpr\u00FCft w\u00E4hrend Fehler unerwartet sind. report.surefire.text.note2 =Hinweis: Die Paketstatistiken werden nicht rekursiv berechnet, es werden lediglich die Ergebnisse aller enthaltenen Tests aufsummiert. report.failsafe.name=Failsafe Bericht report.failsafe.description=Bericht \u00FCber die Integrationstestresultate des Projekts. report.failsafe.header=Failsafe Bericht surefire-report_en.properties000066400000000000000000000023041330756104600355130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/resources# # 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: # This bundle is intentionally empty because English strings are provided by the base bundle via the parent chain. It # must be provided nevertheless such that a request for locale "en" will not errorneously pick up the bundle for the # JVM's default locale (which need not be "en"). See the method javadoc about # ResourceBundle.getBundle(String, Locale, ClassLoader) # for a full description of the lookup strategy. surefire-report_sv.properties000066400000000000000000000035731330756104600355520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/main/resources# # 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. # report.surefire.name=Surefire-rapport report.surefire.description=Rapport om testresultaten f\u00f6r projektet. report.surefire.header=Surefire-rapport report.surefire.label.summary=\u00d6versikt report.surefire.label.tests=Tester report.surefire.label.errors=Felaktiga report.surefire.label.failures=Misslyckade report.surefire.label.skipped=\u00d6verhoppade report.surefire.label.successrate=Framg\u00e5ngsrika report.surefire.label.time=Tid report.surefire.label.packagelist=Paketlista report.surefire.label.package=Paket report.surefire.label.class=Klass report.surefire.label.testcases=Testfall report.surefire.label.failuredetails=Detaljer om misslyckade tester report.surefire.text.note1=Notera: misslyckade tester \u00e4r f\u00f6rv\u00e4ntade och har kontrollerats med assertions medan felaktiga tester \u00e4r ov\u00e4ntade. report.surefire.text.note2=Notera: paketstatistiken ber\u00e4knas inte rekursivt, den summerar bara alla testsviters antal. report.failsafe.name=Failsafe-rapport report.failsafe.description=Rapport om integration testresultaten f\u00f6r projektet. report.failsafe.header=Failsafe-rapport maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/000077500000000000000000000000001330756104600256445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/apt/000077500000000000000000000000001330756104600264305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/apt/examples/000077500000000000000000000000001330756104600302465ustar00rootroot00000000000000changing-report-name.apt.vm000066400000000000000000000027471330756104600353350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/apt/examples ------ Changing the Report Name ------ Allan Ramirez ------ July 2006 ------ ~~ Copyright 2006 The Apache Software Foundation. ~~ ~~ Licensed 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 Changing the Report Name In order to configure the file name of the generated report (which is "" by default), the <> property should be set to the desired name. +----+ [...] org.apache.maven.plugins maven-surefire-report-plugin ${project.version} desired_name [...] +----+ And after executing <<>>, the generated report file is named <>. cross-referencing.apt.vm000066400000000000000000000051101330756104600347310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/apt/examples ------ Source Code Cross Reference ------ Allan Ramirez ------ July 2006 ------ ~~ Copyright 2006 The Apache Software Foundation. ~~ ~~ Licensed 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 Source Code Cross Reference There are times when we wish to know right away the line number of the source code that caused a test to the fail. The Surefire Report Plugin has the capability to cross reference the source code that made the test fail. In order to activate this feature, the <<>> should be declared in the <<<\>>> section of the POM along with the <<>>. For more details, please read the documentation of the {{{http://maven.apache.org/plugins/maven-jxr-plugin/}Maven JXR Plugin}}. +----+ [...] org.apache.maven.plugins maven-surefire-report-plugin ${project.version} org.apache.maven.plugins maven-jxr-plugin 2.1 [...] +----+ After executing <<>> for site generation, you'll notice that from the <> section of the report, a link is available to redirect you to the source code that caused the failure. In the figure below the code that caused the failure is [../images/failure-details.PNG] Failure Details The link will redirect you to the source by clicking it. [../images/xref.PNG] The source * Disabling the Cross Reference Link To disable the link to the source code, the <> property should be set to <>. Alternatively one may simply omit the <<>> from the <<<\>>> section. linking-to-tests.apt.vm000066400000000000000000000030721330756104600345330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/apt/examples ------ Linking to Tests ------ Sean Griffin ------ May 2015 ------ ~~ Copyright 2006 The Apache Software Foundation. ~~ ~~ Licensed 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 Linking to Tests Anchors surround the names of each test suite and test case in the report so that you can remotely link to them. The format of the anchor names for test suites is as follows: +----+ +----+ Notice that there is no "." between the package name and the suite name. The format of the anchor names for test cases is as follows: +----+ TC_.. +----+ To illustrate with an example, suppose the following: * Package name: org.foo * Test suite name: FooTest * Test names: testFooWithBar, testFooWithBaz [] The anchor name for the test suite would be "org.fooFooTest" and the anchor names for the test cases would be "TC_org.foo.FooTest.testFooWithBar" and "TC_org.foo.FooTest.testFooWithBaz".report-custom-location.apt.vm000066400000000000000000000045551330756104600357600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/apt/examples ------ Configuring the Output Location of the Report ------ Allan Ramirez ------ July 2006 ------ ~~ Copyright 2006 The Apache Software Foundation. ~~ ~~ Licensed 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 Configuring the Output Location of the Report To change the location of the generated output report along with other project reports the <> property of both the <<>> and <<>> should be set to the desired alternative location. For more information, see the documentation of the {{{http://maven.apache.org/plugins/maven-site-plugin/}Maven Site Plugin}}. +----+ [...] org.apache.maven.plugins maven-surefire-report-plugin ${project.version} ${basedir}/target/newsite org.apache.maven.plugins maven-site-plugin 2.1 ${basedir}/target/newsite [...] +----+ Please take note that if the <> of the Site Plugin is not configured, the output location of the Surefire report will still be the default. * Configuring the Output Location using the Standalone Goal To change the location of the generated output report using the standalone goal, the <> property should be set to the new path: +---+ mvn surefire-report:report -DoutputDirectory=newpath +---+ show-failures.apt.vm000066400000000000000000000031641330756104600341120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/apt/examples ------ Showing Only Failed Tests ------ Allan Ramirez ------ July 2006 ------ ~~ Copyright 2006 The Apache Software Foundation. ~~ ~~ Licensed 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 Showing Only Failed Tests By default, the Surefire Report Plugin shows the full test result (i.e., successes as well as failures) in the generated HTML. To be able to show the failures only, the property <> should be set to <>. +----+ [...] org.apache.maven.plugins maven-surefire-report-plugin ${project.version} false [...] +----+ Then execute <<>> for the report generation. It can also be set via command line with the standalone goal: +----+ mvn surefire-report:report -DshowSuccess=false +----+ maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/apt/index.apt000066400000000000000000000074421330756104600302540ustar00rootroot00000000000000 ------ Introduction ------ Allan Ramirez ------ July 2006 ------ ~~ Copyright 2006 The Apache Software Foundation. ~~ ~~ Licensed 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 Maven Surefire Report Plugin The Surefire Report Plugin parses the generated <<>> files under <<<$\{basedir\}/target/surefire-reports>>> and renders them using DOXIA, which creates the web interface version of the test results. * Goals Overview The Surefire Report Plugin only has one goal (the other is a workaround): * {{{./failsafe-report-only-mojo.html}surefire-report:failsafe-report-only}} This goal does not run the tests, it only builds the IT reports. See {{{https://issues.apache.org/jira/browse/SUREFIRE-257}SUREFIRE-257}} * {{{./report-mojo.html}surefire-report:report}} Generates the test results report into HTML format. * {{{./report-only-mojo.html}surefire-report:report-only}} This goal does not run the tests, it only builds the reports. It is provided as a work around for {{{https://issues.apache.org/jira/browse/SUREFIRE-257}SUREFIRE-257}} [] As of version 2.8 this plugin requires Maven Site Plugin 2.1 or newer to work properly. Version 2.7.2 and older are still compatible with newer Surefire versions, so mixing is possible. * Usage General instructions on how to use the Surefire Report Plugin can be found on the {{{./usage.html}usage page}}. Some more specific use cases are described in the examples listed below. Last but not least, users occasionally contribute additional examples, tips or errata to the {{{http://docs.codehaus.org/display/MAVENUSER/Surefire+Report+Plugin}plugin's wiki page}}. In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel free to contact the {{{./mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching the {{{./mail-lists.html}mail archive}}. If you feel like the plugin is missing a feature or has a defect, you can file a feature request or bug report in our {{{./issue-tracking.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our {{{./source-repository.html}source repository}} and will find supplementary information in the {{{http://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}. * Examples The following examples show how to use the Surefire Report Plugin in more advanced use cases: * {{{./examples/show-failures.html}Showing Only Failed Tests}} * {{{./examples/changing-report-name.html}Changing the Report Name}} * {{{./examples/report-custom-location.html}Configuring the Output Location of the Report}} * {{{./examples/cross-referencing.html}Source Code Cross Reference}} [] maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/apt/usage.apt.vm000066400000000000000000000034001330756104600306600ustar00rootroot00000000000000 ------ Usage ------ Allan Ramirez ------ July 2006 ------ ~~ Copyright 2006 The Apache Software Foundation. ~~ ~~ Licensed 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 Usage * Generate the Report as Part of Project Reports To generate the Surefire report as part of the site generation, add the following in the <<<\>>> section of your POM: +---+ ... org.apache.maven.plugins maven-surefire-report-plugin ${project.version} ... +---+ When <<>> is invoked, the report will automatically be included in the Project Reports menu as shown in the figure below. [images/surefire-sample1.PNG] Sample Surefire Report * Generate the Report in a Standalone Fashion The plugin can also generate the report using its standalone goal: +---+ mvn surefire-report:report +---+ A HTML report should be generated in <<<$\{basedir\}/target/site/surefire-report.html>>>. [images/surefire-sample2.PNG] Sample standalone surefire-report maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/fml/000077500000000000000000000000001330756104600264225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/fml/faq.fml000066400000000000000000000025001330756104600276660ustar00rootroot00000000000000 The Surefire Report Plugin reruns tests. Is this its desired behavior?

No. This is a well-known issue with older versions of the plugin. Please see SUREFIRE-257 for details. Upgrading to version 2.7.2 or newer will resolve this issue.

maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/resources/000077500000000000000000000000001330756104600276565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/resources/images/000077500000000000000000000000001330756104600311235ustar00rootroot00000000000000failure-details.PNG000066400000000000000000000132411330756104600344650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/resources/images‰PNG  IHDR(› (àgAMA± üaXIDATx^íÝoÌ%Õ]ð}e¬d7«imiÒÄ’Š¥‰«Æ¤±iµ4Ú5šÆ?`c‹‘H †”ûGÝJS­±ª6¥Rª Á „H"ULÙ"Ñ*6J4jlԦƗ»¼À£³†3gΜ™;wî;Ÿ'xvž™s~çsæÞùæÌ.!|Cõèψå¨9W¼zLù¬÷6Õõp}ïíò‡Ì0ÑíѨžð„\¹›=  @€À¡ l1x5?«ä¾a&“ͼºžqôæ§®“QC¾¯æ"ø„GéÃÒWTx.ª§ä‘¸Â!@€ËØbðš–ö$xE+7í+ŸàA«PÍ_ýQC¾¯mÏEvù_î)—Ú“’À|Á«ºÏž¶žðVc´2ÝE=©ÑG9„jCöjþš^H¸qV²„Ó5ÒöÇj„=ëÝ•Œ¨!ê«¢¨¿¢ŸN>¡ý–»êQDCð‰‡ô®a, 0Z`‹Á«ýÏ&ŸÏ䃮ÜPoÏ?WTwWÒEsŸ’/-YÂ)F¾ýQøCkèҮƵí¹èiGŸ¯$@€‹Øbð ‹Ég}&\ñ ··Ú]´#ËÐàö‹7í–{ŸÙŠN…Þ8v7éšk]ÍÕÐ^$«z¯Üö\äGêÉúE¿G(ž&Øbðª®÷͵–pÏ.D¥ ƒWÔE1Õ=Á]$MÃ:Mô¨x¸e¶4ï©e&£+Ž„H q¤ä_.¯¡Ò®óbÕK]Þ¶ç"Ôzþ…ì0FŸã5áËUS °taÁké£U? @`‡‚×ñuM€¬K@ðZ×|- °CÁk‡øº&@€Ö% x­k¾–Ø¡€àµC|] @€ë¼Ö5ßFK€ìP@ðÚ!¾®  @€u ^ëšo£%@€v(^a«/ @€Éžþù#ÕWøÎ @€ÀV¯­òjœ ð‚€àål @€Ì$ xÍ­ @€€àå @€Ì$ xÍ­ @€€àå @€Ì$ xÍ­ @€€àå @€Ì$ xÍ­ @€€àå @€Ì$ xÍ­ @€€àå @€Ì$ xÍ­ @€€àå @€Ì$ xÍ­ @€€àå @€Ì$ xÍ­ @€€àå @€Ì$ xÍ­ @€€àå @€Ì$ xÍ­ @€€àå @€Ì$ xÍ­ @€€àå @€Ì$ xÍ­ @€@Oð:÷ã#G–+•–Æõ­WÝ¿[¨¡̉³[™®Þ·t&ìç`UE€;è^Q‰áÒÞü³óÆÙÜ3úëTƒš{ ‹Oî6®¯äQƒp*«q•—¸“³+7:G @€^aÁ«}á,¹”ö1ý٢YÃèA>p„À¸¾F¯º¶q=‚ºØ¼ÇBXÁ«Ên °¡À¦Á«ëª\_2«ošË$Ñ’Iïõáùó×ìÑÁ«k&¹½YCô}½DºÚIîßbòv%“^å>½KYù˜UÞQ× “Ù.xmø>âp(˜#x5CXÈ2™¬ë2œl­j'“KF¯d›]}µGמ†®}z·GM%}z H5:xõ:”Ôâp(¼ cP2$3VIðjÞfÊd‹M‚Wɬ’XÓµÕn?³0“oÉêQ„YµÓ}Çs÷|îž>ùá_ZൈiR$8`1ÁëÞ?|â?N}¤>òß?ò¸í3ûoÔ¼Â/lR|×á6»IIŽ%@€öS`pðúÇýò¿÷»_¼ãúúÈ¿ßeŸ¸áŠ'¿ð/û9º*ÁkÏ'Hy @àà¯ÝýÈs§>øù“ïª<}Ý·9yâªëoÝs¬dð:÷ùÿÿ¿ºþäÆðÓööÌžÕþM“ê¯õ!Íî’Û÷ÜSy @€ÀPaÁë³õOóÛ¿xöw®=ýþ®|ò=ŸùùW=võÅ÷=üÔÐîçÜ¿pÅ+™–Ú)*ŠMÑ@ꌯ(ÞU?­¢X¾Á9¡ôE€lI`XðúÍÛNýØ»Ï~ôÇOÿÜ›_^WÿŸëég_ù®wo©ÊIš-xu¥¨ÂHçá°I¦[# @`¯ð±ÏüÊgo{ÛÙ[¿ûôµ—ÖG>vÅ…ÿ|ͱg®:ö©Ë/úÐìá «’ʃWóbòd´Ž•\îªW³º–²ê–»ÙÞJ*Œ'0 xÝzÃugoùŽ3'¿åÌ_ûÌÕ/¿ý²ó~æÄKN¾ékþäÇ.üü•GçÑG/¿ðŠïó¸:f8ªsóEgnüºpcñ ?}¬>ò3ïøÚ‡ôÂ?xÇ¿ÿCÜþ}Çßó¾»÷“f\ðJÞøË¯öþ½+[‚×~ž0ª"@€“ ”¯?|Ó¿÷ø^wüß®=þWû£¹°>ò£ßsÞ½?pþ]o?ÿ·¾÷ü_ëy—xÍäUNÒ`æTÛ·'÷°½±*¬yx>x% ²k…l’Qk„ØÒàu×nyëï®:öÔO}â'žúÁ ®>ñ’·ãW½óÒ¯>ù¦—ÞþÖó~õ»Î ßüÂ_ú¶7œØŸá5+Ùù'×w=5ïiúý¿Ë¨jµ¯f\ȯä5»ðBž C]—᨞èê5•)¸žàÞÊ»zÌȯäK6&G]ŽÛ£®Mž®ë¡YÉüÃv…™ó*#ãM! x½°NS’cº.¥™ • ^™“£}±ovZ’ë}êu‘®JÂÄè¡•d¬Aq*E E>L×ëRó¯’•°®‚ÇÇE¼)’«¼ö"xõ^’»®’N¼zSWo¤‹Vtªý“Ë<ͱ$Ù´Á+¶2•DkN½5'ct³ë¤%x­ê}Ù` 8`Ák÷Á«d¥­+xå—jf[ñj稰üêWW¼ko/±±VWÛÛþè U8ÆÂVˆømËÐ °\Á+¼šK2½ãöJLfm&ÿ£®ÐP¼2×ìq—ó®‘,¦+»t­]‹G%s1®ådm^“gtP+¬g¹o=*'@€À:¯ý.^½r3ââÝÌjƒ‚Wµs{Ѩ+ß´/íQ×íkvré¨9Øüe>Naðj(ió%×µsûeÙ•‰KZèA½sQ‚ßuõÎrW‚ï©u¾y5–( xÿäú%ηš  @€ ^‚×O?] @€u ¬7xµo߬kæ–˜]`½Ákvj @€k¼Ö~? 0›@.xE?óW @€ Î=ø4a‹š"@€H ¼(x}å°¾ªÖ˜Œ†X’@îVã’ÆQPk2x=z4ê¿k(8wìB€¦X{ðšFQ+ @€õ¯jÇךœkž}c'@€ÀNÖ¼v­S @`Íë ^V;ªóþ²ï_í À9°Ú©7pìJ`½Ák6ñ “͆‡o>ÌÍ -´ÿŒ+¬¤˜f_Q/õÆõî( °¡Àzƒ×l«%Y!3‹¾áù1í’Øæcém!Ú¡ù×ö±³›Ï‚ @à0Ö¼êùëZ In¯.ÞÕªšß·Ï‰®F’K/í3‹7uïu íÑ®3ª6_|º’i¦=„&N2!umÜD#ÅšÓt¯X£ @€E ¬7xU«] $™íÉÈ•¹ügÖ`štµÐ,’‹:í€ÕÍ|%<+^‹~óR<–(°ÞàÕ\1J®T%“JWdÙaðê­3“/“a(™r2Y­kU©mÒ»¥w*³š•—GÏ%¾nÕL€ XoðJ®xu­¬$AáºQ{Q§^wi‡ƒhK>X±kÇÍÂȸ½à5¡F&@'—Ö¬x-ômKÙX®Àzƒ×ž¬x%OÂH7Cðj¦¢A©4{W¼6Ô¼–ûºU9,T`½Ákô3^ÉüQ² ”Œzɧ|ð*é«ëÙ©üŠWa¿…f•Ĭ|%ës…#µâµÐw(e @àÀÖ¼šù©^×iÎnïbOWLIŽhçvÉîêä‘é«·Îf#ù[™åÁ««ÓÌ(’k`ÕÆ©4zGšœè{Iì³Àzƒ×a<ß“\0tÂh¡ëM *uò㘜Eƒ °=õ¯í™ÎÙòæYgD ¼æœ)} @€ °Þàu«#bSt?nÄËà`‚×aœ#fÐ! °+õ¯J¼ºôúïšvõÚÓ/¬P`íÁk…SnÈ @€À®rÁ+ú™¿ @€L(p¤úš°EM @€$/' @`&sÁËÿ @€fø_ÁGÈ/]&øÌIEND®B`‚surefire-sample1.PNG000066400000000000000000003442261330756104600346110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/resources/images‰PNG  IHDRÜ 9›)\gAMA± üaÿÇIDATx^ì`^ÕÙÇ ƒÁ|6lÀ1`63`Øpw—RZê´´Ô©»»¦mÚ¦i’Æ¥qwwww·æûÝ÷Ioß&•´ñôÜuá¾çýß#ÿû<ÏyΰaêR( …€B@!0@hS—B@! P( ~E õkTá …€B@! P(Ú)Q@! P( ÀI¤¤¡¡¡H]}ˆ@aaa}}ý€èª …€B@! èoN"%‰‰‰‡ö÷÷÷VWï#àããsôèQ??¿þîª|…€B@! P N"%öööeee¹¹¹yêêM@‰LRR’……Å€èª …€B@! èoN"%‘‘‘åååêêeª««srr¬¬¬ú»¨ò …€B@!0 èHJÜÜÜêêêJÕÕûÀy²²²)ã@UB! P(§%%(qÔÕ{Ày*++)C@UA! P( Š”ôñ8SΊ” ” ê¡P(EJ )9vì{¶Q®©K! P(ƒ–––3óŸ.‘’ö罌K>ç|(%<IIUUû”}Õ¥P( Á†ÞFÙyÚ]RÂòÉf¶Šp±. ÎXŠä\ç—|(1Áð\mJØ¡|èС u) …€B`°!€Ï‘ýû÷ÇÆÆv‹”ÈÚÙÔÔ„ïQEVSîá(%%%"ö0¾éÈOã6›@‘ØK†ò¨s|=Ã!FA:7çø ¥¥¥äX\\,Ê!â`î D®­­åæ¡ ‘{ò;v¬q…ˆßÚÚJˆx[GÃ_,'à+C›—œ)Aö•œœœššš¢.…€B@! P I888t—”ÀàažÌŸ?§jÏ>û,¼ÄÕÕõƒ>€=àtÆŒÜà.ý•W^yóÍ7a'g>ÿüsG5eÊSSSÊìÙ³Ñ'-Y²dÚ´i<Ú¶mÛ /¼0gÎŒµµ5™ì§Ÿ~Š“ÓÑ£GÂQ†¶–§›¤^¢.…€B@! P Xâ{†”ÔÔÔ¤¥¥AJvíÚ™xÿý÷Ÿxâ‰×^{~.\¸ð¦›nÚ¾}û•W^þÔSOÝ{ï½vvvíÖ³†ÿ|÷ÝwÄDЂ˜äøÃÕW_ ƒùÝï~ÿî»ïN˜0áé§Ÿ&š‹‹ ‘¾ðwÙ²e$ÚÂ’ž%%§äʈSEgU•T( ¡@Ï“’;wB ×_=7·ß~»0D1”û«®ºêÏþ3J#¡,\ÔƒøüüÓŸþÄÏ›o¾ù†n€ßrÉ%—ðwâĉß|óÍOúSL8ùÉétüE¸Bd%)1ÖsqM‰®¾9Ñ} |Dû™––š‘‘–‘‘šž.O…© 펮Z§P(#%Ø|`œ‚„ãñÇ_¿~ý_þò1 Aÿ{¸çž{0€å¸œ?þñèb07‘pÎ0Ô`Ëß·ß~[È©n¼ñÆßüæ7ÈH„š`ˆ‹€„p¨Ì]wÝÅ 1_}õUn™ô¾Ÿ÷~.á\wßt&%B; "é99é¹¹—deqÏ¿´œ¡&¿¿ª* …ÀF gH‰ì\…[°|nÙ²Ráhnn£Ô;v莑—lذaݺu¨ràŒEÄj3¾ï%‰»»»°€€"¯Zµ ƒÌPlmmÙqM8g³Ë ÓWÙ<<$/}gõ¹ž}Ó”Û€|$'%…YZz.\¸ÿÁ÷þå/Öï¾ë½|y°‰I¼ŸŸFS:YÅvi×òœ¬2¶¤m'F:Èiô']MÕ¹N´ådòd\íÑ©T'’×M‘°!<±©¦)ƒ#%쬉‹‹KJJB^Â¢È®à„„„˜˜˜èèhB‡,[Ù§ÊO‰CÙüEB81Ù-"©ˆ™ì„@Î|‘øÜ?lsŽŽåpCÒÕ‹ÖÁᰘ閤Ä@IÒ³³BCm>ø`Ó¥—®6l¥áßšaÃÖ ¶jØ0³'Ÿ„¯¤efBMDv¢ISÒÓ5áJffz^^{ÈqqJ{œ¼¼ÔÌL-ŽAâ"ñE”–HFBÚõCV¤ýËË#Ï.¥2'Ê&ððW«dZÚ ¡ÎÉ5Q™˜ÔAä@$‘¬ •Ñ©Cvv{àà·ªÖ …€B`H"Ðc¤„¯y¤˜zè›hä"ÄøÞ×·=J§G'bJ ‰ ßËÏàÀÐ ã<õÌ‡Ø 2¡°°0äIÝ!%B,Xí>ÿ|µ‚|è!÷iÓ<çÍsŸ>Ýþã·]sÍþGMNH`!OŠ‹‹÷÷ Šóõ%ΑÅ}|``¬¿» JFFŒ—W{œ¸¸Ì¢¢¤øøOOx+=¢Œ‚RAcü6@*ooIE)z*"tJ¥%”TiiÝIK‹ £b!!)ÉÉiªÁDHŒŽÖkÛÈ(*ÒJ J ‹ àŸÖŒ Çð/==!<<ÎÏ/>88%1Qc«¢Nzà€ïÊ•I üô]¿~šØý·¿…<˜]Uå¾dÉλî"p÷m·if(xc+*ÚzóÍûþþ÷wÝå³iS„••ÕóÏï¸óN×É“3KKÓóóýV¬8ü ¦ÿ;¤Œ(†2KJ¶ýþ÷û|pçÝw{­_qäˆÕ‹/î¸û&ñˆú’êÅÉÖ}ÆŒdè‚—~tüx§¯¾:ðÐCÔ ­“ÝG¹L˜úˆHÆsÍšwÞI MpïE‹Lï»Ïü±Ç¾ýv×½÷î¹ç÷¹sµš§§#Ñ!‚åsÏÑ"ë?LŠŽnçLƒsèªZ+ ¡‡@‘1+9ÃU^ÎY6¥û\"?[jw40±²¼¬ª¢œ†¿ é¹n!Iåe¥•åüÑþjÙÊJ«*Ë+ ÷²Å¦­©æ{ôÛÐÖ†šrC‰ÄÑ”–V”—’OCM¥ghrDbV}M…•WL`Lz59P墑™”+©ÅÕMI 4S´6› ’’£Ó¦Á²++ó[[ù›YX¨)D’“sjk=fÏFš‚NåNà–-¹MMöãÇ/6L4>šš&++»¢b¡!1·ýú×k/»l…á~ÃÅ;ƒÊ2Cd"Àü¶mQGvuõ"£TëôT]ä<><ÜaäÈ ]¤¥2°™ØÐPrnqè™g @T,£°pï½÷†XYÅGGc ä½lÙ–_ÿRBœ SÓì²2¸ËÑ™3á@ä _ ض-:00.$ýQ˜…ÅÖ_þ’È[.½”pèKNuµõoPm·Ýëã£ÉZ”îfPÏ^ªò …ÀC H‰ÈQàá ™¬a%¥%÷~µûãÅ6Ÿ-µÏÊ-Xiæ÷Ð8Ó+ö:GÌÙíùê, Ê/4õyašùôšì¤¢|ñ~ŸÚ<4ÖôˆWlIuåk³‰slíá }.­õÕk-ßœkõáb›§~nªÙ²¾ûœÃÝÂ’ .dûÒ曬ƒ¡;æž1iòæ\ËMG‚5)‹&0Ð~ê»OJ4ëΜ¿·^~9ÂVt¨€ˆ4éÂ7lÝ È©«óì)A € 3§¤­ ͈K.!Dã »v¡::cO!@ð¸…FeŽ“B\fÍ"•ߪU.½´=ÕΤr=[O%¦0¸ãËklÌokCØCBöíÛvÝu’­ÅÓOßÒI ¥óÁfèZXˆ5Éþûï§™D>üüóp£Ì²2iòü‚r’ÁìتA …€B`0"Ð÷¤$C#%%9ùE_¯rÔvWT¾:Û*5¿ÄÄ1¼­­98.ã­¹Vhg‚£Ó¿]¯í >â—¸äPÀ×H+/íÌ@— Ämvaå5Uï̳æçV›+ßX×”5‡IÞÖÖjêá“Îý:ËÀäœÛe±¶}¼Ä:!-Ç-8y—S?§l÷t ˆo¬«àÂ’n’:¥&àp¾¢¢—o¿Ýû§?!üà+´(tvüñÑnnhs<çÏD'%ÎÓ§µµù,\(¤díEÁoòššœ¾ÿ^¤H>4%ËɤÄiêÔBR-Y"¤„8[¶ä57»L›v"|„íUÅÅ¡‡xà½wÜALʥΛ I¬þ÷¿Î¤%eií5XÈ¢‚~Ùä–[R¢Q!m¼òÊà0di7}Œ£VÕY! P Qúˆ” Ð$%5•y,>à›_)y!¬¢1;·à£¥v‰Ù«ä•Ø$l¶ik® ‹Ïœ°Áµ¶¡n·sôvÇpk¿xìQŠ**¶Û…ò¯²¦ò…6M-‹Í-½bƒâ2V›ûg–••m³ ÝïUTZ¶Á*(0>sÚvŸ˜ŒêúšoV9¤få9ú'¬2ÀÔvÆ÷Ф†Ú!NJÚ5¬ñlª./GZÀ {OÂ8üÜsbhp™<zá5o*˜“Ô7“'wVßt…”è©Î“”¤¦jûhBBíhzŸ+¯d»P„­íŽ[nžqfRB«³ 4ææ›/¿a µ°ØvÅ$<ø÷¿§ÐPº›!:§©f)ƒ¾#%(J°ÿØbòÂæþñyE+´5Õå-;è‡`Ã3<ù‹–^1öþq(kZê«üãŸx`­%"F´9{œÂß™w­M@t:¯A±é¨iÞžgåœÔÖÖäàŸðêÌÃß®s†pÌÜé1k§‡odjPLB‘q\žš|086K߈TkïØ¶cõè‰Â2kªºYI7%%²û&ÜÚÚæÃÙ{‚iâì[óZZrZ[YïEâ¾`FJæÏÇÂCHIÈÞ½È3j@/ˆclSrVRâüý÷Ý'%B,^xm E›ä")II;n¿½‹¤„í6¸Ä±ûòK’ÃKöÞ}7 ÉÍsÎv iK”AÉ ž¸TÕ ¡‰@‘ƒM‰fºq¬ç­X±V”·5Ö–”hÆ"mMµÅ%%˜¦Â0ûh¬«’2ÍuZdž­ ül Do””ò×@V´Ü0Qiª«Òž¶Ô‘”¿m-µìÄ©­®,..ÁÖªJìZšj«‰ßÒPM-¸îFlqº¹û†]'.ÁãÙg7oŽtq‰õòŠõôô߸Q”8&üc”‹Kn]]Èþý[.¿\³8¹è"÷~@Paùê«,êý@JRR IÛ¯¾ºR<ø`”«kÐÎ[¯¹F*sõAiùð]½Ã^’ˆͶ«®Â] dE‰I†æ|¦Z¥P rúŽ”´ó£=¸†M¹íseõe_Ìñ‹­6'BÄU"´Ç9ùg§äFç||ß²¾y@Û¸ou7I ¶Ÿa¶¶Ep`Ʊó–[vßyçîÛo‡yh[Qþïÿ¼—.ÕÌQ {wüõ¯hLXÅ7]qÅ®{îÙsǬå"c-ÁY••ð"MlJ¼,@éCqŒmJ$•®¾aÏqФ8lJ¼/^wÉ%í©6oƦ„ͽiÍõU9cW{¶«…´µÕa#‚‡xH[c ?++ R”²ÒVÔ=Çjµ§•åš"¦Y{Z[Ué©U€çÓMRbXµóqËùÀÅ{”“S„MôÑ£I1199øÑ­!2›i“bc1ÅY;Ö'‰ááaVVvváGŽ Ë¼æöСH{ûp++¼¹ÃcâðY‰$Ž••f¶‚[”À@îµTVVšszöÂää*âx*d¸*‰°¶&>a¢¢ØñK‰zYâV“²dgãÕ§#ø’Ç+j&h•!PÜÁ1Z{YGŽHY:çÐÌ]q˜†Òçê«¡G¸\C¸"'ö òa«ª¯P(†&}GJ** %%‹ö8ú'Á-R3ó_˜Ì¦æÚ/–¸¬2 ÉÌÁsZÙj³à/—¸hNW«Ê[ªö8DOÞè¹åHxFž,Z—þf…kjVAsƒf 2ÀùDT¯û¤Dx‰á¤`ÍÕ:ì„íÁ qPfX£Ûi¹#œÚ‰z Ü{iñá.²»Ÿñ„ò‚¢FƒïyÃOþÊa{甊¬N‘ÊÀ-´âÏ`œK}8Zj•Ÿ/õ¡zíµ5®áÉgõiíÍ͵{ï=Ä$x†e'0û´CsÔ¥P(¾&%Ë÷¹&·5U§e¼>ÃŽ2OO°Ê+* ÍÌÏ/n¨©€¬ PygŽ=ûqö;Ǭ>lç“8a­{`lÖ󰀨téï6zfdÁ`úÆ™CJ´¾'‹|§«ã&”ÓDÓ¹K‡ç3î\Ð)âtªÎ)S¾ÖljTçæf<É,(àì½Ý÷܃ºgÛ/ ¹i?™o@EU)…€B@! è[RR\²xo kh*Ûd ‹ŸÿIIsIeÅ5Ãwš:Ç´µÔdd#>9òà—fÃ\ÅVÞwúØù&#MÙhŸ;açÝ›>ðåÁ[Þ1ÁýÚÀßÍ;°HÉÖÙéÙÅÅŸŽå ÿ\§OG$£‰^”îæë ª¹ …À B ïH‰æ§¤¼ÌÜ-nɾÀ­Öá«oµÂ…k‰]”wºC!Yy…›Ž„ï°‰HÉÌ¿þõQ|WÚe1j…k`\¦¥W¼­w‚GHª£_ëýÀ÷?HÉCýar2[xðæË?Žê­UíS(Cœœ‡ÄÄDdg¸†É%1"##ÝÜÜêêêºnØALŒU9¬×Ö;~“e؇(IMuÅNÛhGzVAS}F$Ö^ ›¬Âö:DkªÁ–h“ÖyŽ^éæ‰çø–ý.1[Dl°ÃèU‘’Ó½­üü|''' 0ØÀ‹¯ö úöÃË~Fƃj¼B@! $:;;÷:)‘ ½ì°ÁË.Ôšªe NÌðŠV])j4hÇšª1:Ñö —–B_&­÷p H®­Ö,H )<åù\v®çã<7jnnîíííëëë£.…€B@! P ‚‚‚öíÛ×»’Ý.\ŠðÏàà¬ÝyšH\NúiØEÌ.avãìUÛ.lùa$ççѵ¾¾ž—êéé /ñR—B@! P(¬\¨bŠŠpƒÕ›êY_ëk+³r‹9èƒq›¦y‘†¢ûi-)…‘/5 ÌÉ-ªDŽbð4ßumQØs „LÎcKð™_¤zªP( ÁŽ@Ø”°_¦¸¸§#,B×]q0X7ì¯á¼½Úª X Ü4!P)(*±ô¨˜›Àêªò —(R2ØGŽª¿B@! Pô8Ý"%âÑyÈF˰#^ šHIiRz^k½v$ÞMoíþd¾SRZ>Æ"¡q¯M·»ëÃ}˜µÂ`ƬrcópFNáè•î·¼m‚#ôêÊ Â=‰.¤Q¤¤Ç»²ÊP! P(;Ý%%xt-,*™·Ë/(>w«Mä?¾6{oŽ#NZïûl[Û1Ç ”{X‰ëj*ìýƒb2þø)GûŽ]厧×¶‹öø—””¡ý1Ø¿^¾\OXáTV²ÆÊÊj°÷!U…€B@! PôÝ%%XªVV–aM²Ý&âX+úš†×§ÛBGn{gõóŽÊœ·Ç?· hù`¼¾š»çSÈJÓè®HJÚZj|?[䜕[`8g {ôQ”¤¤Gº¯ÊD! P(†Ý"%²³†}¼x"Ùïóßñ–÷~ºÿƒ á Yxh}s–}pLfK}Nåߘa÷út»GÇX´¶Ô]íž•S¸Ô4G®ÙT¬HÉPêXª- …€B@! 8WºKJ„—`Y‚Ek[s5Nå9ûË’ÆÚJ XùWW]AvÿŠ'öæÀ?pL‚%,ZB°Š½@¦ a”¤ä\{ªŠ¯P(Cž!%²ØÈAI™ÁgšvBõ½Áâ“D|“´³™ã»†ûHo2@ŠQ¤dÈ-Õ@…€B@! 8WºKJ41IY)Ž\ñ.ßv¬3mÕ//Õä%ÇI ¢‘¶æ"°=G'+Ç)Ë! }] EJ姪ø …€B@!0äè)Å 6ªf®±×yLÞà9m³w]M%ÞZšøÃBXz9§ª¢|ù /»Ä¥äð¨/ék:00ÊS¤dÈ-Õ@…€B@! 8WºKJØ ÉX`â¿Â," .ÏÑ? +ש›¼· ›¼É›Ý¿X”l8ºÕ6Ú%4cÄR6Ýàlí‚Úý{J¤HɹöT_! P(†<=@JØÃYŸ’^ÐXÇ^œ Ë£¼²)9×N©â+ …À…‰@·H‰î9­©®JN®äpàæšbƒÏ’ŠòrÂ9˜sm“øÃo=8XS’%)¹0Ç›jµB@! Pœî’á%â!Mw•fì6­ÝyZIiK}uBZndBvMe¹`èRú¡Š”¨a©P( œ”hþX_Ý‘p©ImU9䥩©©¡¡\û Œ")QCQ! P(çFJdíÔÓ466Â$Œ…""óè )1ìJPQQáêêêåå/1N« Z.9J7IɱcÇ‚ƒƒ·lÙÖï}ºªªêÈ‘#ûöí+**’ÊØÚÚnܸ133ó<êVߨ—¾¯W®òê†ØôÒÆ¦–3äµvíÚ€€‰“––¶mÛ6777˜t¯Ô©ç2õóóöˆˆˆžËRå¤P(ú3IJdá,,,üðÃ?ù䓇zÈÚÚº¹¹ö5áQ9f®’!÷Äç/÷\ò¨s8 ÈêÓO?¥¡‡!"’•¤íŽTf`HCÎT‹n’’ºººwÞygܸq²vz„gOXï3~ÏG \ú´û £ÿýï<(¥ÿìg?Û±cGJrRnIýÔ-~Öù|8ß%¯¤¶+uË(¨»·{=sµ´Ûb£çU\Q’PØÐØÜ!÷ÔÜŠˆ”’ÆæVÂtÑ¢E÷Þ{¯ÄY¸p᫯¾êììÜÖv컾ÔmáÞÐÉ}§lö Mj'ag®ëÊC§f 0ËoW{^í¹ì`x´ÖÅÅeΜ9ÿøÇ?z$7•‰B@! è{ÎBJjjjÒÓÓ‰4wî\¾À²³³!%RË––q R__Ï<+7üå^nxÚÚªM÷,¥ü%þþð‡áÇÇ…!µµµÕÕÕBS>·8ïv“”ûË/¿œ˜˜bž‘¹;âÂSŠcÒŠã3Ë^šf×ÇÝèØ1íå~ôÑGëׯ—¢é0†ÿs ËùdáÑôüŠäìŠ+< Ë´pæ+%§âÃ0ýÒzÔy_EavÖäÔsS‚ô^:6ÌøxÚÆŒ3þ|É!"¥AËWËÜmýÓ“²ÊK«´{ÖëÖwMNgü:¯ øÂ¸ôR[¿Œy{‚ÏšÏY#È0¼ì²ËÎSEP(®’’)S¦¸»»'%%ýùÏ~üñÇ!¤\¹reFF_f×]w݃>ÈTÎ=á·ß~û-·ÜbjjÊý³Ï>›œœüÌ3ÏpóÍ7ÿüç?ˆ¿üå/ï¿ÿ~ttôwÜÁ=rrrd%øë_ÿúÒK/ñv2„yI7I ¼íµ×^ƒ#æN‡83÷d½{¡¡¨®kÚ`åª= Œ-XdÊÍMoí:ä‘üìwG /³w¾?Ï9§ˆcÛ^›a¿Ä4üáQæ¥57ú~¶øhn1§'¶Ùd<5Áê‘ч§ïЄ1®aYo̲ÿr™›C@æ£c,òKµ8,ù·¿×¾â~ùå—6ljè+úÑìI}$ð…)Ö™…Uܼ7ßùáÑæ¯Ï´÷Êã'õys–y>:öpM]SFAå§‹nå“¶Û1¡µõXRvù¿Fzb¼åˆ¥î’ÕF«¨‡F>Ýîâ'×Ã$¸&¬÷~h”ùKÓl©žñHkjnýÛ—'HItZɽ!ÕuÍY…ÕùüÀcc,¾Z®å9y³ïì{l¬E^‰Ö.x‰Þ„±cÇ._¾Ü8Ï©[ý3òµ†È5q£Ïã,qÐÕxNQ͈eîÿeþÞ\§ü’šöñ×½ºã™IÖNÁ'UìíÙN~1z&•5ŸØï–Ä‹ø÷Hó G¢äÑ”-~dõ¿©¶’ù÷›ýgù÷¥™ùÅ5#Whe½3Ç)1«]ç%CL] …€B`0"pvRí ÒþódGj«Å¿ÿýoB|}ñ%¯‰î—-[öùçŸâääô»ßýB8?Ÿzê)T?¿þõ¯1} ÉÔ©S%ü³Ï>{ñÅß|óÍY³fýò—¿DT~饗þë_ÿzî¹çxºfÍâÃQ¨(Rrº.)A§À«!BnQͪC(X± „T×7m>ã–Ã=ßâK÷kv'?n3¶y%Õ}cž\liâ˜@ø]™Âš[Z®z~sQy½éÑÄU‡ÂËu ÊÜnç™ûüdë²*Môµ×)aßQ9jÛj«ó¡/¾ø¢3)q Ëž¼¿5ÚõÈ·iyzÎÙÅ5«GUÖNߦyûå‚K”ÕŽ^å•Z¼Ö"²¶þ$=KAyݘ5ÞVÞi˶[Òüï{C}âÍØcüSîߘå¨gÒùéðìZZ[÷¹$®9©?²ÙŸ· ?ïùL+ rfí}RY*RÒO¢P ÎNJRSS‰´}ûviRxxøo~ó›K.¹ä­·Þ‚7<òÈ#HG°5a*„²\ýõˆLˆF)))˜lݺNóÍ7ßHø„ žxâ ÖÔÅ‹ßsÏ=HÂo0Š„ˆ Î‡ßÀcAÝÁ`vˆýD2”••eeeu}Ř”¼¤²>4±(8¡(9§üÅïm Ùb㮑äË & ¿kÑï|½ÌƒKïÔƒnIÍ-­Ÿ.Òˆ&"ŠÿN°ä†…p³µf„açŸþôÄ#/L¶¹ÿ˃y¾1yÓ¶ròsûõÔÄ#Ü]óê6=䔤Ä#<ç–·M^øÞ±„C F¡Xø?^èúÄ8+¸zæ–cóvE§–èùä•Öþû›CK DJ®¤œò‡¾9üì$ëÇÆZnµqÌ„»È£g'iÕ€Üô¶É+?Ø!>ùhÚ¢¦Ù’‘’Øô2r®©o*(­ýó'û_šj+4ËâeW×ÐÎÎJJÐÝH6ZG?>ÖŠº½:Ýþ7¯hh púj¹¢ KXŽáºñ ù׫3³Û3ÑítˆÿÏ·‡‡ÿ`Ås[¤2Ó¶úýës!R(éžg‰Ðå•éö¿þßVBŠ*êF®ð@Ddî?åöK‘’Îh«…€B`° pR‚íBnnî7Þxë­·^yå•hd +V¬ y¿øÅ/Pß°áýËÿøGô5AAAÄøƒ³ ˆ™—ˆ 4Cò¢i ×M›^ú/h p!fXo…†…ïl§‘sxGæm<.fôÏ¥eÇý_hk3ö×kF˜ŒXy§657½\œT×5Ÿ®±ÈÊ>—„ú†fD&»â¡#Öy£… ˆ+˜»K#7reU»½ÝüSBFÕY}ã™Ëzi<$¼£ó6‰Úïš´Ò,b®Ia .Ð §ø VÑ»âa7h54sO Õàé^—Ä%ÂÖ[Ea‡]Ü.Çx2¹É „HÉ­@i²ïh"º›]Ž È*ô›ZZ$ šÁ¶cs<+7²¨Éw;‚XÜaOMÆS\ V›ŽÄ`Ž#iuõ [œÖ­[§gå˜g„5®„„&î´'7Ó£IßoÑUáÉ%rv9Æñ.„ålµcPJN¹1ܯ2ä­Ñºõ–ÑÖ~iEeu;íùÇ=‘†¦Ä9kGÑvꙜ]“^Ê”5e“FõxõÇËŠÏ/mßܤHIœÕO…€B`!pR²ˆÿ¹ü.ýg‡§®?E#ƒG ¦uö‹†„„txª§5¾‘BH8$/4S8)..î¦ú3ÄK¼z[F~%Êô‡ ¦\|—ƲI¤¢º}°„øÇjä²®¾YL,Ô–Ìcqš=R M¸),«cÏÒÊzˆ‹]@ƪˆ°Äd߬޳ƒã ÞŸß¾ý˜N‚Ÿ¬›wß°%855¥º¾Å8•$÷‰Ê³ñM#sÝ”„ DÖ¾iAšh?% †–U5dVcèÊý->ô…êñ“¢páæ™‰V"HÌ,³ðJa RÃÏ#<°¡±óÏÈ,¨’ŸlüÒºè‘á%Dkjm e¯™±MÉÃ?Œg4§åUꊒ³1!Ç7ÍÈ<“²+,¼RÉJ—»jâœ[¬™w¸¨i} ®¬¢jp ¥N†Ö•TÔñBÑ£Åe¶±†'‘½›Ä‡ieù¥#*ã'•d a¡Õ¹ ¢P(g!%9òº}!kÁú„¬¸évfƒ;A€¿Ý””°=d×®]?üðƒ·w¹ô8—þz Ý?$ ov÷îÝÓ§O‹‹“  ŒKHhW©œKÎ]ŠëžóÃ6 {'={Aˆi˦M›$[è28cú£“’ž-®ssttœ1cvâ=˜§ÊJ! Pô%g!%âM÷ÆÁý™/‰y¶XZ†ÆqŒ½}œ5mOE8CUõêu¥-çZä iw$%}ÙE:—…ôÂïø–“~© 溇½0ÔMÆÂ·_*  U( Þ@àì¤ó½` JÄÍü)/T“›3씑8ºW=UWÒöÔZqºâØØÂ#ܾéáÎÐäîÔgð’’Þèˆ*O…€B@! Pœ}÷ ê¦Ýwß}ìñôôÔù„¸ç‚µp/Ë<[i^ýu‰#áâ0^~r±Ò³»˜M:¬ý\’Š=88ž¿úê«_xá~(îê‰/Þë¹$¹ˆ„ÐèÇöòSâHÉA~êþïõª²G)G %sâP%ìpïºë.4–––8…óðð ÎÆ•‘²Œëv~]»©¾QW! P(C³û)á@2"íß¿3FnôƒÊÄ…<{mXõÙhÃŽˆd……œpþ²­Y×E(Â6 |¬°%˜åœ¼›À{¸!á%’I¸Ñ…ÜPEóS„äü†p¹¡²‘‡}=Ä$~’›D–*É[¤,lE…? _øœÇÆ#¶1sOrq«/¬…6 ‘!5ç'ñ¥VçáäM‘’¡7–T‹ …€B ›œ”ÈÙ7fff«W¯æ†óÉøË1ªüeÃŵ×^û“Ÿü„{ì.üñGnî¾ûnqÏ#þîÝ»—úӟ⼕Ÿ,äR$rN4•-Á7Ýt“ðyJ>øö–hðÂ'NœÈ=9¼÷Þ{pšÛn» nqÕUWá· ÁŒ”… ² ~bþ)Žh‰ÉßÇs‚ 7òÚ%£äoÙ%K–üéO’§”…?©[+¹Á/Üßþö7¹Çí¬8 —‹Óg YÂKÎUXr¤zÄlŒdásàEáÑaø{Á‚p†÷Î>s9[Šô`÷èû&3ñ©ƒ ¹ï‹V%^˜»Ä³Æ5™£àË¿‹d¥}}•Ø‘‘‘ÑÎÔ&«,WÈêŽóø'Ÿ|ròäÉl;äÄ/Î >pà«5žÓHÈöô;ÜàB 'Zƒ+®¸*ðè£rnÓD"[3î¼óN¹G&v]r™ ¬I“&ýêW¿"¹œ°CMø‹7zIÂÁoÔ„(eüøñD–pÎå~ÖN¡¶¶¶¸qûöÛo9=Ud0ÔDˆOÅ“M†o±mñÛÆ fÙ» Mùúë¯ù Íb®—pþ¢ÙáØXn:D÷êRBW¶±±177§ô ð¢á¨Ò@›3˜€ýDàÌM†ýã|™ÞËç§W@ŒJþ¬.Ì |­ÉOu)Ί]…u“ÝX¡íìì.œÉ‡ ìjÔ9À™oÎNJÄÍ`[)øIÀZXŠ0jüóŸÿd Æe}õÕW_|1™<ýôÓÐ2ä?ÎÙY *§yóæAMà%ð'–44GB‰p‡ç`Nµ ñ¡t¬[pBÔ _ø´‘šà ϳ°(¢á ‚ ˆEHÉy\çjèŠHFÈCœP^ðET‡ÈÒøëààp"p†&s®bÄ¥!³?»Ž}žNEn¸ºžð‚ \\HIá%tË Õðó@€žÃ¹¶¬S¬¤§›Ì‡ØHdná«gH 'ËðèÑ£õQ…+‹1Ö|ÆC`‰†Eäƒ 2Az±sçNˆÖ¬èJxD*N8CÈÁx3d'p ¤/hU¤Þ¸Y#ù»ï¾+GÃ`öA|NÛÙ¼y3ĈäD1b–.D£þ°Ÿ¥, U"œr l‰T¼fXÊÊÒ}E²eAü€¸‰Ç d'ÇO¼Ð"dƒÓ|òÉ'DÆ>•'O˜Vhh(¬%&&†úˆÅI×/±ÿ=W7óBJðEA[xÇ '÷vex0ˆ?HcR"+4‡æË5x›Ö•wwÖ8:)áóK"ƒÀ"øœ²“Hg~Å =ŸTƒ´‡œ¢žŠp:R¢wÅ.ŽÇžªq>2(䥟aDH´ ö §7ïJžŒ,ú†NJôÉ\ŸÏ¹á‹‹ñ( ]ÉsPÄa íR"^:8T•ñññ¸ÃBÁOt:Ü'''£à×··`#róÍ7#ÂBÏ*iyÄDz¾*¸g1&IÅSò$Bä)á„pñH’à  A'È Ã[)” ÂD~òš¹AÑHm ä†TúV~™§hþJ)Ä”y*eqÑ:"?¥¥4G/‚¤æÄäƒâSV×/)šrÏORB—¥³"„!3€'!Áòññ9kfBýwÝAJÃ;šÃ ;¤¯sqN$M»%(H øð)&ôð¡“à®ób #gx¢¥…ÊзéØL‹gíKƒbì½Jv&% þ M?m¬è˜…{¯§ËY^:Ó‚ŒF#¢3ó±ÃÔÁâ§Þu_¾¦¤„99Y^ÃSúouŠen(ñ’ž$%,ÆLjt_DÜpq#—ñ=h¢‹9rÄš‘ÉÇO=šñ ÁÆ©:çyªœO™SY……’Û©Ÿž5´C5ŒãŸáÑ)³Xº~ 87ó")‘u2³AH£8®Ñä-ÈHcÉѹ§’b˜‚Ö‰§,?úÓ~ü¶ëâ¤Ð”Py0‚1–R.z]ll,´€üŒ~¢Ä%!Í7½½J{‚˜Ä'2êp8è&뤄öFDD`FW1ó—ÞK ×m äËž^zúñéd2 tÒ»Xùª“žCVBb;z]섺ªƒúdÔˆQ&Ÿ+˜Ç$!« ÷@Ç `¯@G* #Äø[4qB)ôTòN™JF4ƒ‚i7Î à›ŠO>ÒvH.k!LC­HHˆq]ç?§×ב;^%ü•™ =oM¾¥§Ìç0"óº‰2/ñWú×=DF"Oû±]g-º'I ÝÑ+(_öü=ÝUUQV_Sq¬¹®¦¶ö Ñj«+Îð”G5•åÆ0µ­«®h¬Õöw¸ª+Êë*êjÊÏ\±3WZZRY^J)%¥%U8D9SÏœUŸêµ=Ý7Æêú+Ó š&µ¬ tJòÄ4˜‹@¦æ>Y–X¹Q“‰ /˜ªX„x Gá'“)¹ p1CRB/Ã&nx$3/“>,VY9Б8Jì„äÓ(¸h2‹¸±~Ÿp¦òÞ±Ù[öœËÔÖÁ6p"t&%,43,Ú"Ä‚’ŸLô%Ö$NbR£3ÐI0®B"H¸ÈN˜(‰L¯ ‡°¾,½ <ù \„©Å ˜dŽP6Þóhhë€:KJ€Qúv|9Ð-A•õ†î‡“5ƒ!É=ƒ$™+$2/H*‚$ofË@*!ü…4ˆ²’.JJsÖ-ÑËðTF7ùЙ‰£ éÞ2uóB±Ùg&'"3êÅŽJ2-–žÃg:OÉ×Íûtà Ã3פ³ú†øt ±R€GÊÇŸŒAÞ ¯YŽÎëáÅYdöÂJé*z?¡Ï¿˜W‘ÙTXgÜ]R^YQžš]è‘îÜÚX]iÐzt¾êk*݃Sêj4sŠÎ%ÁHb“s!.ò”ls Š#r\ƒRê몌“PFCMÕs“¬¾YîÚÖÂ^¡sÝ+ñ5·l™9š>§¼¬<2‘»<–œ_^]O%>æ»CJäˉ®Ì«a¥ïBA ;L(9‹‡º2“ 7Lsò¹FwgÙÝ+Ü‹†ï*ùø:Τ„¦Ñ&\äÕ¬¯Ìþ2ãÈÎa–X±’©–¶,˜KKSSS¹"Cb¸'”OÿÁNJ˜§ "¦3À-xѼzî 6 ô%”‚ Ó‡lV$2Ë*HN4n0Éâb¹¥ƒ-HòHl°(jË‹`f”5{`NŽ=R«Î¤„V3¢ )@ )Ò? d"•¾ÇŒÃ[‡OÄ„°‘ƒ|B0¢ ù={öTÉJìèeS:¬‚8¨¤y$ß$ÒWE`#ݘaÎÛdZ 82Lè’9:^%£† ‰I)”Ž)žZˆ0À?Qzä=ö}&§´)á…ʤÍÈ’á#f ò^¤ Ó%œ÷ÂØ„—@p™¸øŠ011‘ИÜúEiØ{Œ”0`Ö˜‚Ò`YG;_0ò²Ò ë<ÿ÷½õè•n+†ÔWWkª‚ã{¬²¼­…óKkkªÊq¨¶pO@["‰ò¶fëë+ÛyÏ1í'KÉ?ÚKY]¯®ªÈÌ.àÜùŽ<ÄÊÒ\‡ 5âÔ7ÔáQ­åõ™öiyìÜiÁãk›–¼ ð[ª F”n(—øµ-õÕZ„cµÐ²ÅSšùšŠ¢’âµæÁ¡ñÙ-Mµ‡\csò‹*+˜;´R ܨ´¥±½P6籿æÌIÎϦDôü•nÊ-3s¹1Ë0»ÉÃç[¼Ï1yqwAÁA?f妋ÈG0OIÂý€íÍz?)GÌõ|O ³070-øàÐ@ö®3€eCTŒŸŒjîÙ?Å ‡# “c`‹c=’ƒÆÀ×gu˜ :KJD’2@DWä틤ÓIxûtù,ë@JäØH¦?‘Æé¤„… ôHÂTH×¢çˆGf¤/ÂNXSEtw¡‘0¡;Ñß„Ú"u 9<÷€¦ó`>my"–U#=“8òiA'&©„R“›¸q¢ÊÙ–ôU¥Èð…Oó¦ˆÏk•Π“’ó”ÝXp²åuë.U„”ÀZxû fH ÷2p(‚)‚§"žQWÏ"pJI‰¨i„”ð:øIá 2«CJèQt‰¼}™¾€ô%ùH{Jž2À¬§'I Meã+nH¸u™ ¢€” ÚY{(84QÛŽxË;{Ø^3u£wx|æÄÞ™…%ïýèðÄ8‹¸Ì¢ý.±ûê Ô¤¢¼ óØX 3÷øæÆâ¿9Ëá?c¿<Åæïï}}º¥g\S}Uq _ ³¶ûÆ$eÃ0vÚG’ü© VæIЈ4ûçH³)xU-/Mµyj¼¥µã¶qƒEØZóP瀤‰ë=þóíáç'#»Lþƒíë3ìÂⲚªüw¼åCߘ—W”¹§ÜúΞ¿~~ÀÔ9z]dv¯¶õ¾O÷?9Î2 2£­¹fµYÈ¿¿1¿çÓý)yM9‡$§¡tSRÒ™”ˆ"†qº|'Ñ¿‰ÆÐmÔÓ‰EÐ"++±<å‹m€Ž”0Ó4Ñ­BÔÝ Mã›CH‰˜A‹>I ½Z&±³‘M±2éÙ)©Ws;¥ú†Õ‘BG@¹YŒ­j|sOÃ;HJˆ&s"óˆ+¡“ôb²†‘- ßÙ\t92%«šL"{ëÕööcæ§””Ðj0ÁIŒ|¶"Ia,*Â!ŒI ‰}n^y/,0$‡4¾0ú6›Gôj æ…2ÌE £"뤄y­pD©*“E°žQ¢T‰·F''º /i ñù)G‘ö#ÂCµè3“¨'¯ƒ8"ªdØò~¹¡o)¡oÐ…ž"'„WL“aÈ׿€}k=OJà%¸aÍ““hôuVH !‹÷n9Ž`ãí¹tú–wç8<>öp[sõBÿи¬ÚšŠ‘Ëø¬¯ûÝ»˜ð‘—¬>’˜–;s›Tæ­ÙöÉù0"<¨±–f±AJÁÁ„LÙäåšÚv¬n‰ià!÷8-K÷@J¾YáŸÊ7_ó«ÓmR³xI‹öD¦ä^ãñÂd›Mx)1 ‹bSrç›ø%gäÕVU„Åefæþå3¶ ×­8›Y_[‰&¨²¶æï!ªi¬©®üf™krzþ:ó#^ñ¼{Ä”—B§ÎWUÔ‘›tŸ”0•È %–‰|cÁ`–9.B¥§Â6ø¦s3‹‰e( 3OéëHta*ä6Àe§³)a&Õ'SšÐI Ó=EÂÔÌÐå+Ÿ{æh17öÆ,›O±÷\ËêélJXctºI8(­¦™ô cõp5ØÓëÓ"Ë¡¨$€Wt…>ÅèQ„Ã?èBX$ ‡{¢™3cÊ^Ç¡º´œ’”í(á"òmÀ¸c¸1Ä@‰…Ÿ…Þ…LZ  cØB¹,ÒñĈ¡Ê[IîEŒGn L÷&cA,{DþGþlJx‰t`HÝ›œ™(‚„ñpCÈ™:ðލ3ï]†©ÃÀŸ i×:+)‘iGv’òÞ™™…”Èç}‰o0!%¢ÔcQæÕÃJé]È̬|«WH G˜†:¸TRÂRýý&ï—¦Ù!©ÔΩi~é{ä %Å¥+Ùø$E§äNZïÙÚÒpÇ,ùÇXéÿó­Å;s&­÷à ¼1«Ý†¤%¦åÕÔU=3Ñ*¯¤,¯ ˆ<¹Ž5Uµôè.;>^í 8äwY´Çß':ûƒy.q)’Ư–9{G¤‡%å.ݘ˜Y0y‹g¸¦¿¸ñÍÝÔÝÒ—K\ ‹!%swúå—t}uºíÇ œ B*sØ#!§ dô ·òꪧ'Zf‡'çQáôì‚5‡B¬<5Ròà3$+Öuë‘3Åì&)aZd‘0÷‰Õœƒe†ÞÌÅÔƒX2ZÔ“¢ñ‘ï0æD:7½œ9KžöׯsšY:š‡q8MCh>qøB…c•‰›éX¬öh;s1€D²‡ÁÌ/ÛIÀ„|äéPßÐCh>kŒ¸¨¹“.Þ>m-4¾‚”ŒX-ðˆU–$±Œ>'@Tä."p:Rà¼5flqÃ[†hò^è3¼_žòÊqtÆR4f9²âCBú Áaè*ÆYˆIpo #ãã²³ú«MÔ7œ£cRÑb6C&°Þ˜ºÉ;5+^⑾Ä4hþ.?MÚÑÖvõ+;ˆƒ„c·}ÔÖ#(Mò Š3² –ïú~“WtR¶wxÚì¾Ñ餭ª¬ÈÈ)³ÊýóÅÙ5ìqŒrLn¨­Øë™ŒØ# )#¯©®å¢D2VžqÍÕk‡úF CnBÓÖZËÐ]fD)Iéy\š8ø%mµ7uŠùpž¶#Ñ?îòs JÞp84¯¸8>-gÖ6Ÿ…&ö¾ l)Úïã‚  qärWø íwR¢/0tJÙ$&ãAÖ]f=Ù˲!,DBD "bv™Å\NžpÅ4°)‘)Xo‚´Z]ÝÓIŒ¢Œ—K7 ÊÒ!·+=ÃÜ×AR"-c~ãTb]$—ðAI¼.ŠNš@nD€$;k¤·èýĸkI Ž­Äïâ=H£’”н7‚¤8Õ[p–­×@*vnŒÇþFaâH*¹dØŠŠtry¡Ë0y5z÷Ö§ãByÊO‰H¾­%—ñ[¤og€W¨§éµ|J2KË$Æë˜ @™Æyªw½Ÿ X‰4°'%%ˆò`$!‘õ±ÀŸÎ@"¿PÛ{&¶°ìšÉÎ-d£-­ØBRø—™7kWà×%F¯!¢’²Rs ŠŠ±KMLÏJ̆:4ÖWE$dªÛ[VVPT’–¥ÅDç’_X\È6™ò²¼Â"Ê!ûx¹iª«JHËEjBõØÚ“›OMJ1°MË. tt.9yEdEdr zÄIÎIÎ A}~$¦çbM’¯ù`+A™—šCR,r‘Ù—TU–gåjê!1Éyム鉮y^tk¾‘R¢V`Z¿8s“ù¤›”Í œ^E@¶ ‹±,êRt1æCk†ZM>º’jÄa*³SW®³œ}7€Žœù \„†[³‘ ^"ë.ÿaEo¨©ÌÉ+Üï…Gðkª*Ø_c  ‡Ðø&‡(%\nD*CÌê*œ‘hö"¨Ðn † Eh1ÉGOE¸¡.Z’ƒ!¦v#Û}¥­ôã¸!Ž<¥2Ô„§’ÉñBµÜ =£»9?R‚ÞÉ*]YëxA·éÖqJ{"pæ&3ÁÉÙ7ŒN¯" &YLhOø„íÕ²TæC Q»‹ûæ´!ÖºÓ5‡a"{ºr‰”èÛ€ù&ÐĆ«³‡Õú˜¶‰¦5‡ÁY;£`Ò` )e µlOm`Oxœxßl\VŠÂÅáøÅÚFbNcoÀЕ*׳Õ(‚qnz…åF Ï`;dÜ)¾ñVgÉðxÚ3×{Œ‘œ)a=Æ&Ž ñ•Ü\8—4~LŸæï… Â^7øÀYe/Ÿ`éû±ÀxÄØû¾hUâ Fcs: Ò a¨Êì„HW‰XŒh—ĆËÀtÈB§HJ:dDÖ:/ R„Ýö‘¯N·ûdzj|T /ÑäS‡¶ÒÚшÀã8E þ5ÕWÏÞæÃî_áˆ+’3óF-w{î»#cVºS —ˆÈDè…¤•²ôŸBGRWS“aáßlà%_g-=I4Î%/¨UV"o_~]¹ô~<¨dw*/¤„ØL†jZ¸ˆìîVËdß¼bñ¡Ðî´‡L),¯Æ¤dÈ´ë¬ /P]¹Î")9A[Ú#7Õº› Ä' ÷ø›ÅÄõñ1–81km¨nm¬B«‚tŽÆºJnñÊZRÕÀ@¤©®šŸø‰G+iÀZS½&G¹ÿs¶é¶¢¿!Úù&ÎÙé‹öÇ72}ÄÌ]ëØ- · -NÒH«9Ikª¡Ä†:Ô1šF†TZ¡õì.ã,^ƒ—¶:Ÿ„y»Ø;×€Ã4lcI.Ê] 虸çAJø&•.²ºo Èl­ä¯±èîÄá”MÆ_H7 “>@€iÀUW쨇RtÖoxÉ5™³L|uvå:‹¤D¤.Ç É04Cdª[¼êÎÓV v Óü&ág Vó1<—LZï“ùäx‹û??ètÈ-vØïhò˜ÄìצÛýmÄÁE{á(ÙyEx3{àK³ÿŒ>|ë»&OŽ·<ä«h¬­r N»Š3K’÷9Eã­­µëÔ¯—½û£}Öz´6U8séS›ÿõù—KbõŠlä›®·¿·÷«%.ˆCÂrþøÑ>öïÜóé[ßÝ3y£F¬xZ»í]*ÓÒP=I‰‘˜JW4dêÒê¾vš\èuÈ– %ü=+½Z“™9“HÿRÃý£_ù÷À„«;µ’î)á2øŸ¸Œ?uŒñïüF:„ÿìNÝTÚ޽RÂf'§_§þHîJ/Òû€m;³wÏi*ð±…é¾ûîÃÙSž±âC÷S‚ßÕO:ów»M›~?šç4k‡[vfo÷ÉÈ-‚¦|<ß±¥µå>MrlúVïoWº[{ÆYå™’ÿÄxË‚rÍ:×ß¾ÒŠÀ?=$È<<ÃÒÞ™m¿Þ"ì–·ñ)B6µ»£ŸÿîîÎežQP¼×)ú0ÕðY”ò£IàòC¡;bøùý&'¿$Ìý_à­áhH沃¡†hÉÔÐ+$µ¹©º‡-Wϱ;œ‡¤Y±ÞA)MNçbZÔiy*r¬¡GM:“Ú( ðÙqf[ìs|9ƒ2zR8ÌzÈŠÁ‡«³;æAÙÈQéS’t¬72¹˜…陲uQBè¥ò:øØ“x$?I%_z„“jè ÞñÞD-¤““½·ÞáÕ÷yÊÕaPë]k Ï=LJx“´V–ãT;Ñü‰±Û¿dk‡àŒÄ`ÍÚôâd±WÝlºÍ&òˆO"¿åü½šØGŽ[ã±ú`ðn»¨šÚJ¼¢ív޵ñJÈ-.ùàG§£!l!F½)Ásü2SÜ#¶º&ÍÝ鋽ªGhêg‹\Ö%Gç ð³ÊÃ=ËÎ';Ǫ¬½ü"Ó9]¦òýf¯oW¹—W•[zÄ?ú­Å´m>{¢´øšªÍÝb¿Xì‚V@ºÓ6B³n©,ÇQÛ6ëSÇhœÏ",Á0¥Gwøžs'î)¡§²—løðáo¼ñÆë¯¿¾jÕ*q!$ÆçÜkUI ÐŽ%K–Üyç8ÔaÂ?.\HÏÿ7ß|SŽ z÷ÝwåuŒ;ç¹ì+þðÃ_}õUº1=q½úí·ßâÖSßj ðzt&%ô– 6ÐU¾úê+Ý:‚hLéÌiï½÷žLqô/ƒàÒ[èB\ãÆ2 ~òÉ'üñG~L:ÛäD¡\»ˆì²À!dÏ-mà%š?ÍI…áP›zØÉÿM–a‚Àc´-ÄÇêxDRÉÁ7œÄ«Ò{¬ÓW)®¦º£T¹GpR£©\Ê8TOKËVá¦$%šú¦Y D4ÊÙ€5MœCó†RQÞÚÀáÝš»"È?Òâ½þÔéÃÐR_æèfŽþ¢ âü›>Šûaî7oÞ¼lÙ²Ë.»LºæÀìç±±¤Dss×ÖÆÞ±ÁÚõÌ3ϰo ;ï‚i¤„…΀çCÁçÆo„‘\Ȥ­_ë)I ù™3gÞ{ï½8Èp^Á0XT¸ŸûŒ$Døî»ïøfÉágÞ—¢=ò¦`&H 5”žƒûý÷ß—yûøº©m3D)#ˆÆñÉ5bĈÏ?ÿœn#’rà/òò©S§*RÒÕ7®ñÄ›õUšD¤¥ab÷àöÔˆï‚ÈÛèÀH0"ik©Ñ ‰á'ïŽäx©û¹°; ˆJßï-._?éjUû,^wH iQ"ò÷Ž;îøâ‹/°)¡/ÞvÛm¿ùÍoî¾ûnèóŸþô'䶃žÈg %|¤*RÒYR¢HÉùõ´³¦êLJô¥MÍHÉ-·Ü¢“D#òQY‚“9sæÀHp…"‹¥k;ë[¤:“BäÐr”@IÑÝÐ@¾"è$ï¼óB5!¸›6mBLÎYÁx†ež'Dާ^¼x±|è è€Â§çÕ7Ýl0„T½=Çá¾O÷ÏÞá×ÖRmæ»Øgø­õÕš²Fº¢qÏ?nØnʆó~Äû»H "ÄDcê45(}ˆé±÷Iüq·>ÜD„¡ ¦öªºCJ译‘#GbÜ$B$ÃN0ö¤ƒ^zé¥|iÑ †ØgqgRºúæ¹çžÃm³’”è’ºÄòåËåã‰ë÷¿ÿ½Rßts3–sJCW>^Q#8êÄ!²`ðX3•¿ýíoåuðÊ(#—¿PjˆÈŸÿügîQôÌž=‹EeÔSïk@åÓ™”H'Á7ÌÛ˜‰ —Ï¥P Ì¥ÅY3š>L\å^7äQœØ” Ìn3°H ï€ó~9?oì÷ôL4M¶Þñ!±YV>IÏ~w„]9Q 95• _oë“0u³·­o÷ˆœíý“Ƭöà´¼;?4…»ÇdøG¥ã' ½Ì‡(rÃÁ+'ý¾9Ó~Í¡Îá ÍŒJÌJJËCƒu-4óXìa7Z„Aw N`ÐÖŒîzÝ÷æ›oF‡ù«:>­à×zObŒD¾Du?%Ü3JQÞ#ýþúë¯Y >ýôS†ñ€5>ïƒi±³¡+§á`D‰¢”X‡äž¬>¶s%%âÖ®øÿ÷?ü0*º(Ë ÝrôèÑ/¿ü²øœ|â‰'øIwEY+o„‹‰"_ÉÜc‹È“Fd- gÊPSV¿@=ô í@JDwóÃ?Ðm®¸â ŒKèHØÑøÎŒŠŠ‚y,]º”Ãމ‰ÁŒšNEOãçã?NZL¤±°Æ˜éøÔííœü)Á¼ô€KôÓ Ô7ØœÖWÃ9¹Ç}4ÏÙ/"&œëë”2k»× qðOt J^¼7Àìh ò¯ŸĖͽ¥å𛲭GÂñÕ†{ c§lô½ÊÝ#$ÕÊ=~™Y؆#‘[m#ý£20ªeïñÓ“ŽDg°×æÇÝþ= FxwH K/{·nݺeË–uëÖYXXÐ/¥#"*àÓ!i½ßyK0’¯RàBt$N‡Þ,ÖÅuÞŒµ Ð(›ù(µÑ´‹Hž5ZgR"CÑ|½ŒœÁ§Öè+V¬`§ErssY`è®l &„.ÍXS0a!|ìbŒÂ‹˜ß»gEFE8+H ?a!ô.¼pÑ%ø¾âÈmb֊ʆ ©0¤„®ÂÖKä"‹-± ,„TlÀ!9¼zvžGJ øA¥‚R$ìÔåH^s·¸…û‚€uø ÛŒ‚"k¯Ä[Þ6yuºí “­œ &áÛì¢Ø-ŒŒäéIV|yhÞnÿ††êºêò”Œüç;­2 f˜ãÛ~ž^Ûšq•¶ü`è*óp{¿Dï°´y»q‹Ò6ìÑuïÏu|lÌaÜ¢ ëP+VwH‰tk‘àqaæ©÷B‰7ú³ŽA¡³ó4Bôó.d‰¼ÊÎÎÓDÅ d~< ºxõH5ô! ÂÁzC oA¬aG÷–F ø¨Ð$Ê?ܤU2’ÁÛ7ÎZóÎêq¹¤Oæä£"±)‘‹8ô(ºŠqÅ%Ó>éB£ÈHDÎÝc]Ï qW"Èi|ö~IËöí²š³Ã/:9ÇÚ/qÉ>£µ|¶È9=§ 21g‡u„WX*®å‹ŠJBã²Öš‡®7Å ýß¾Â+k›[pò¢=ØŽøG¦;ú'}·Á •PtRö“€=ŽÐ—ú»ýF.?Љ[PÊòýäÜ0}«/®Mœ’Ãâ2ëúÕUÚ)%Àçê<­ÃÙ7ôN¹xßÂEK¢ŒLþ·÷‚á /š&ñÇÕáì…O/Ðæv=ÿÎC²3øg~Îp2(²•½ –”í×&sý‘qß8×~Õï°ˆ)`ùæ,òu…st%Ž—Ô;ú%m9”ÃnšäŒ<Áa'Žox†1PõHßl†½á,HÖ™‡F&d9ù'7ÔV ¬A×SXT‚k5Ä$)Yù¸DC)GÙa•+q ‹) Þå1.á@>¶cn‚úÃä%?8?I‰¸°»`/ùôdH_°œ¡á|!‰\„®¥ðéø*pùœU—B ëÈá²Eÿ¹&ÆÒýAJ œRíáÆjmAƒo4qX¢y/)+Å+O¡)° Âáx9ÓŽnß6\ /!¢„“‰Æ4 ûzpņ¡«wBBj.álÆ! NKn“<Ñuðtr"%[Ž»Â´ºçHt^bä8­ÁHBÙàÉ>!-ÅvðIÏi882ÁÄDŠÖ£I* B¿ÈŒÚj͆¨;²3§U¤dUm…€B@! è=ú‚”ˆA‰½oâ;ý7X„MÝäýi=ç ãÙ¬­e³eÄm¿Ö$0Cž¶È®„+Úa7m-.!«Ìñ–†­2âŒrá:œ‰£åÖVω€ˆR nNZ4•¥ÔTVD'ea\òÍr×QË]W 6wm¨ÅÐ|Û•É„Ý@’ŠÊàrmÔ*wêQmïñEJz¯O«œ …€B`"Ð뤄Õ~à”šï¿IHÍ{ož#'Çh‡÷š§g%)QÃQ! P(èuR"ë:ú‘’âT0_,qYcB{mð®ÐR_…dzÿ}oÉ6«WV–±•ÁƬm¾ã׸#&‰OÉýa‹’ T*¸P[mœ“WôÃfïñk=ž™dYPXÌy7ÚÉ|ÇjÃã³í \jô÷¸\«×íX9Þï°[¶®ÔYHVn!.bá.«•–šºÄŒYí¾îPz%NõÛ`:a­;rô>J}£ÆŒB@! P(ú¾ %²•ƒÄpÜš!;á/ÂܦUã¬ǺÚòÏÆ`vCˆÀMAaIAA1 ~h.JÊJ1>å¾ ¨X\àM‘Ÿ˜¦òTœh¾OJK‰`Ø!ÜN) ÒC&† ÂÙIQ1Ĉ}È%ñ()Í/,&Xµawå¶ÏôÖ%)é›þ­JQ( A„@‘݉Ǝû"1ð KÈÞ[î5Npü±<åŸì­5„kÿ„ °¨Ã$‚$7œ,^Oôð”B¶ç%ÎQ¤8Cþ+2бA!ÈP¯^¼)DƒDUU! P(ú>"%pmûn+»|Z«Å‰p¡ÇïÛwú©E;þÏp²w5ÉÇ8Ugµ‹¤Ò/ÝÖ(UûÃ>pêªHIßôoUŠB@! P "ú‚”ˆ±)»p'mðüÏ·‡ þHê ÎÐÊp/b´-üãÒ|Ì|¼¢îA#´…BäIª+Ûµ0ÚÏjíXÜ“œœª]úÒ‹²Žîe­HÉ $ªª …€B@!Ð7ô:)F‚{’é[½]ü“²‹ËV›qN ^Øöa“°Á¼£¶‘•W„U,k6;nRÒóàdÃÀ0œˆ`,B’¬œB¸ ÿ +œ›’KZ¬L`"¤JJϫӎ}мD‘’¾éߪ…€B@! Dô))mª¯¶t[hp¬± RDMõ•‰iyÖz¼:Ý–-9Í U›,–âl›ÇÆYâË•­7ß­óœºÙÛ/< 4‡=¶aÙ¾@øGtR6ûwfm÷‰ˆÏÆ‹ëŠ!oÍ´{s–=nKØ›³Ç>JRqàpu•"%ƒ¨ªª* …€B ­oHIŽSçïöÚ„ ·H8ÚšªwÛGÎÚ¥9Oûß4›ôü¢¶Q[Ž„ç×ýï{Û„¬Â—¾·½ÊýÙIG .Ĺò¹-ˆ°GñŠÌ¹ìè¿GÞ|$4+¯ðÙ‰V<­k¨}eš}rv‘¤zî»#Ö»SP÷,½›z`JJ8Š“£´9“½ÃȨ«ÃÇûñ¼ƒnÐpDø)ë\UÅQ=yq"ùygÇ©¡œf~æäDàSr¢r“ðÞ©F‡È„Tuuu39e´ÃÕáQc#ç<ôéT£s{¤Þ¾”EÎGS7è2áuŸòƒOwNgd(õÒ[t°Æ ÷)1”4×à< Ÿ­©ùEKö¸…¤:¥Lßᇲç;%gà›µñË%.7½±›µ/$6sá^߈´°ø,Šríð]€“ çÀCÉ»ýM£ J>[èRX^—óÚLûÌ‚’{ü}õTÙù…8;éÍõºKYΔ*22Rú#9==ý”}ŽÁŸŸŸ®Ý±¦¦fÔ¨QtˆeË–§­­­ýòË/333×®]»fÍšsͶ_â§¥¥ÉúMåo¾ùæÎu`Á¸ï¾ûºX·‚‚‚Îkjç´_|q3ì-99ùÛo¿MII9C_ýµ¹¹ù9amm={öìââ⮤zÿý÷}}ñLxÒµdÉ’‹.ºèÖ[oíJ§‹³téÒE‹ñ”÷"q¨Òßþö·îäÙõ´ŒY}||¨F^ÇSôüJÆü/ €²`óÿùÏÎüZ{¾*)ÇÔÔT©ÎöíÛׯ_ß™UïÞ½{„ ]¬rTTÔYcÆÅÅýðÃ11r’šº½NJô5ºÎÚáû¿)ÖG¼´ãfšë«ºÄ<<Ê\;œÃhšj‘LXç‰à£¥±&(.ë‹Å.ðÝeËñ{õß­÷jk©mj¨NÈyyªÍó“IÉÌûûWfÏ~g5Fó÷ÚJª/—%ÕÛpôDÝ%½™þüHÉ÷ßÏ “ÏV//¯?þñÜðY•••˜˜XXÓ.ÿ#<¢À'XótC8âÎ]uëÖ­/¾ø¢„3q“¤ÃÀf}Z½z53¯þñ'%ò“5›ü™‚¹gJJJ¨G²‚P·øøx·èÕÎÉÉáå³Fr#&‰,©:è“!kOõ"„+!!AùÕ¯~ecc#@IT,##ƒTzÛe~$+Vtt´. ¢Ñ ¡¸G}tÆ z«™õXfèÒ( X*¯¦ªð<ò!·’’©!(NÏ%è\]]¿øâ }ÍÖó‘² b¶Ï?ÿÜÑѱ¨¨(6–#Ú/VwòÏÎÎÖ§{IB1Ž92sæL)„’†¼ É“ @¨$o·¨ /õkß¾}ÿûßÿ¤ª ´@ø)Éé!Æ‚(Z'ì6Ê ïјÏ]}õÕîîîÚ®ûòòû￟´Ekz¹´Xh[ïtÚ%ݘC%}[NŸrsù¼ÑÞ8u ™ü„ý°"vèó@­ šF‰OsôQC[h/ÈtH( B‰/²+é'òöÁ–nfŒ!¥ )á/%‚³ñS¹RÊ¢J*o„¿TžŠÉ»£¥Î EH*)—lyÔ(xJoì?9U‡TÒ.=•Þ™õ´ÔD°20¥V@¤s\âìRI £ÂdE÷–|€è’K.á•w(Œ¹²°Fº(oY‰ôZÄ¥@¦;Ind.S„^gêIYŒ‘qãÆéí팶 àô)^¢m nѶ77h~ÏØŸ‹õ+?9°—Ç„p2NûÁ¥¥MÑŽímà_íÄàcÚÑÁ\†p&»†Æ:ÌS*°iÝb¾Ç!:8&“=8Æ©:;ˆï°%¸7)ÇÙó>?R2eÊ”yóæ=óÌ3ôª   Çœfù3fLœ8qÁ‚LåLÇO>ùäwÞÉ‚ÄÜ̲ôÝwßAhdBwss#“ý’aÿÔSOýá°²Ò4b”ñãÇ#8ñô„&¶-^¼˜ ¯[·nÇŽ«V­Ò¿WX±xºÿ~*ÀyDD„Mš4‰ÈÌL[dEÝXqe…Ð/2„<3†„!!»ØöòË/óeOrV) âûiìØ±fffôLCGõ¨‰,´o¿ý6ñ™‰¶lÙB‰tÍ5×|õÕW´”§ï¼ó]\\ø~¢&´]–O>ù„©ð›o¾Ù¶mR *#S3xH5öìÙ, pÛm·½þúëBh,çæÍ›™™X,‘íÆ;“ÄZS§N¥!+V¬  ¥’ü555evf;w.qFŽùüóÏwøˆ§í @YË—/gIàíÓpêOmÁ™Ê0¹ój(W,BäéäÉ“i,f‚^ºÁ¡C‡>L¸˜ó‚zñ XxAAçAbLwˆŒl†@ à~çÎ4„²@€Ÿ?þø#”eĈˆôwÊ‘jÀáÂÃùqvv¶´´äµR-¤V~ø!Y,’*r ¤ê Øc‘Þµk ¡½ÒéZÀNµ¥ëò“B.\Œ¬@òR“…Š÷Bž*è$Dþå/ùæ›oZXX×Þ½{é! 0'þ´iÓ`o$@’€ o‡þFõè$'òã~Ë0á'¯ƒnÃû"7$ˆ4íÊ+¯mr Î²èÒˆùðÃS„ôx/sæÌÑ…’-eO)ëÀ„¬\¹’jÐ éŸ/¼ðÒXø]N…¼Jâ ‚š5kŒ”¦OŸ>zôhh\[îmmméoz*^7_ôŠ£GòaC*Þ)}¸›¡òtÉJ¾UhÜŽ|H.ì‚D4Šo:u   Aq¼n"0Q0(è?~~~ô™[èº ÏÅ»ƒD2HA’¡A&tBH3…999‘EH{ÁÜÀ êLšOdÞûÁƒ8ïn#+’óBáî¼îÎü¾,êç€E H‰—h§õ²wW|”ñWóëjðܪý4læ§xvç‚„È?Bd¯d"\ìÆë£šÉbþüùt5¦×—^z‰"˜¯™ÙÛ¤"‚Îfö{$«ë¢,ó")a¢ù¿ÿû?~>÷Üs,䬻LyäÌü"Éeföd oooæ8¾“Xc˜XY{˜ø¤&aaaì OÔŠlííí™"%7ªÊ„-€Iðùdÿþ÷¿u °Ê|ÄŒÃÊ (k3 Yf˜™•(”hÓ"9°Àˆl‰õÌÁÁºA¾¢®¸â ²âÛ~@5h“;á,i`ËB“`Bg¤ ,Q2QÞ}÷ÝD`™ardáðM›6±FÒäΤ„´Tžf2Ÿûºë®ã/õGªÏG3p‘œú°d~úé§|ì¿—›nº‰˜4e‰€åçÕW_%9Ñ®½öZbBÅxk#fvЀ|?5md*çMQI^7‹ì„ôÈñINÏ4.t„îÊR'.V&ºEÿ¡‡âÕ +ËÃÓO? «£áº†d¬:dK»XºXKŸ¾Á{¡ta6ýë_éº4 dxG´äa6²†é áýÅ ˆø8æ5±*Sù’fig¤Eò*ºœéŸÐ ¦¨‹œÝÿþ÷¿àO=A‰nÀ{ä…B h!ÐMøÓŸþô'À>ñļJzòðáÃé?ôj])Õc ¦3Pí÷Þ{¶Ð©x/Òh=HyM´šÅʂ̒Ã_Æ-ª¤_¼ß>ø€®N[ÂþþþÍHzG§¢“ÓRÔ¬ÐÄ–o¼‘GàÏ[ ƒÑP‚ÌI_žYäd§ßR¨Ò?ÿùO‘ÍÐîºë.H‰>^È“õušfÂføš7®˜Ü2}Ÿƒ„A$PžÂÛ¨ݯ–dhTƒþÌ 57ΓåùòË/§·ÃÿÈ“ADL8¥^–ܰ¢óaÈZ„0{"˜¤Oòf;?1ô€NËà#½~C'§!Âæõ‹Ê“§qqôa‘YòÍÃà†A] ¶¼V( “™K’Ë.»L ÉEIÇ{†ÊÀ®ÆS=<µUèëÐéˆëUƒ£Øzþr2ºžªªríi[C1'é”—7ÕU¶â¥¨ÄÔ1º¢º¼Îó9Ê5z>úù‘VG™P &}ôó5\A¨|a3C}üñÇÜðÁ*k ’&k¦¦]F2|ùrÄòUMžD@ò)! Ã[f?³?s 90oÊϧ<åû‰å™fh «,ÜLX̶R~²4Š^.&,> EðAÉB ;1žqÈOjùâ'ޱRŸŸM>pù|g.“r¡’-Ó(ÙrÃ$+‚!%TžWÌ@Lñ¹I5XHZf7VšFX¸aA’iŽG|¿J4ì¡|Ýò X•Y;¯òÄD Ñ¡|GB XòYeåé½÷ÞËÂ'“¯y ‚v08øÉO~"‘Y#‰ÌB‹JNBPÕ󗵟ELu ”"DŸµi,M(æzh«¬^×Jq,!pY–Uýå]CB^"‹%©x¬I’HÒU{ì1!.^%ýO^Ö'¨*„ƒ:)=ÈZEÿ× ]ac¢é‹ Ñu¦2„|^èz"> Yÿ$­ ô‚{^ L$A›:#€‡!ꓘ°dÑ%ÉÊÇÊ øbÈÂb£å©¾šÂ¤D`éœÆÉéxÈ! -áè+Ö-tø¥#³! ’)ðKÐvš wÉ“ñ˜<¥S‘s ãZ¾=$[¹¡7ÒŒ‘y脘¢édc6Vw2`á.tE:­ô^ŸdN—¦GqOóùÛA©„fDØ*¨JBÝ0L„^À®€”FAËèŠô(Ê’"7Éèõ×_/!^+C#!ŒMZ¸ŽLïeŒH8oœj#‘aN±TOG*ÃP‚WMÄà [éä´‹+¦îLt]ß}&¥««ßèuRÂìƒñGrzÞÜ~±É9Ð瀤”¬|sÏø)›XÛšÞ˜eŸW\bâ½d_`]CwXꪃA9ÈE4†çïß6¦âŠÚ¯;ãÝò—š;fµÛÈe|b6pÂ0,çýÜåÏy~èqðÆÁì3†ÝÂHG\ƒRâÓr_™fóô˧Z§eTVr4`?ó’ó#%Œgù¦aìƒ>È=sŸ; QæS'B˜€Xk™ë¹gú@ù‚Ç%´€@ŸŒû ù‚.™O(âÃld`êg’åûƒ™‘Ù¢ÃÚÀü.OEÙÌ ì5’>Jüì³ÏøeÂ"-Yh,Pe¾€9HVH5DO¯Ï8ÔŸùާ„C¹Œõ>¬%èÑy$_HÈ~òy`†f:h`%Ù²„ß÷|{‰ÌŸp&,>èÉGüåë`I…A˜o5bÂêøâ—µ"xÒjæe&tjÝAJAµY±ˆÌ§_u˜;0ƒëâ(ó)ëo*±pþãÿè {§,–+ê ˜,´|bÒ.yeR’ÞU…Üã„“QÞ#ÜQ48(ú J¤V|:ƒM@@oa…CUgl BdÖ<ÖTnh +%•aapc-7¶14îH¿ýío…%뀰®³Ò ÔÐJÖi>%LšïlãÐD€0½”΂Ä`aÉ%%Ú‚‹†³ðóÍ‹¼Ð`eF°ÒÍ-Yªi <üY’YõéB Jï"OxTF7ñ†™‰2îž{î!7Pê =¢8VV$ܧÎfh¬°Æ =>Í ãEC(©•ÔE  _ÄAÞÀSê œ ኈ1d}ePPmÚ"ŸT^,HäýòjȼƒÌ  )dÎ÷†¼J‘^MWF’ð”žÖÁ2Lè'€ŒÈDÂ3Ä•W +Þ#uà5ýŸÁÈ׋^m±Ðâ;:ÓH9YB‡”ŽÄ¸€:ÀE™qI%œîÁ»c˜Ó…x¿ÔñÅ"ƒˆ.AǦÉô[J§’¼SAžx¡2ip1–E¼§}µªkP!Ф¤¹¡ÚÜ-vÑÞÀcMðœ§UB,{Ä­³ŒÐ†ÖwÖ©yE{¢™ð}RXX²do[p ÂÍ6¶­iøTÛë^Ûyï'¦ŽþI88‰NÊÙlŽ6'#§pÄR¾[ÿü±)•ƒG£×Y„`e2k‡Ÿk`rn^áÇÃKšŸgù¿ïm|ÂÓ¦mñFÖ"V%ƒ”” ä 'ˉè5˜ßùž@blÛŬª‹C˜˜±Lµ’Éè”[ÈG·7„„‰@>7囘ÙS„|•²l0C‰,<õZ±z1S)‚²XçøÙyj#|J!¾”k,¿A6@*ÖƒÎ^F( bDݸd'ˆ®õ zú>Ö©ƒ!R_Qú÷=•ç‚%€‘õ½”H4jÅ¢« Ù4%ë1µ¢hi»”ŽLôDc|Q=’ùh&7=ïN¦xªÇ'2o–ÈLzHÊ’5ÞøíK£øÐçÓô½T†$²sŠ<yr–ÞBžD ½ºý t‡öÒjØÁc„q—àÍ÷%ÿtNS(H¶Sé/T“z6hp…°]+‡Z­³ò§’@'ˆÁÞ¤CJ&Tžînz…‰Ì%–4–<„PV)B¨†T›j¡HP@I7‘v‘=œ§ÛÍ+ª+ÖN½Û蜛×JõÈA€¢þò±NnÔð”»BÈl©Œhé¢Ò±¹ŒwÀÑŸÉ×'M“>à ý H„È_ ¹ñˆÌ%+ã^ì úOç®KL¸¬—†úû¢¶"g¢\¿ŒGº ¹éÖ²ÌÒ¨¯‰ÎSãT g¸qaƒØ†Ö‘¡ÞUºñÒÁVxÀ,%eñÜôÎ#™Ò+¨6íRK¤# ¢«/HI}m…oDêŒm¾Ø‡´4V%§å¢u9äÿóç¶ðÏÆ‡y¤~›uä fœÆ¤ôÜE{"²ð~&’’›ßÖT¶x¦ßd›IHË}~Šõ]íûÓÇû~ØŒ¦¿õÁ¯4»\Ö¿Ô¬‚oW¹ejÓÁÏn!ù¤um͵d»bPnq‰¨oú[Pb0û­¬d‹tuõ ¬aºÎ»_*  U(@Yb'ýÛFar!#Ð뤄/WÞÞZ¯ÐTÜÃ#/™¾Í71#ÿˆoâ: MMØ\_ÍÞ`s·øW°Ym<ß$ ,¡}7”4Ýýréú–†ª ‡ÃLì£ØŒcGcŽòßøÀ—ñR?o—?~cyJœ&þ vûo·‰lh¬³ÊePqI á“ÖyfæpŒŽ"%r§×ÛNçì`ß§`Q(ú>Êô¬k×¾o…*±Gè RÂÔ¯)bŽÕúD¤v‹MÎÈG ƒò%1-!›~ó Ší|𫟅ûWèˆ(YØ\ƒæ…ý5ÄA6ï•;!²£oâ!·8ˆBÄ;>Øë™îšŠìžølÉqôK‚‚ÀWÇ$ç`ñZWSQPXláÇÙ~†==o»zN9*IIt_•‰B@! P %úˆ”ˆ¼¤®º’m8øZ…ˆ`\ÂèQ´º¢¯üÓ´6Ç)ƒAôÊvÇ$ååò”Èì©ÁÄ•GÜLÙä…@”Šr-Cþ6ÕU!}f£±þb)BâœèÈŠ” ¥Q¤Ú¢P(=‚@‘ƒÌ£Ûq(¢{Ñ×{ƒGû%B#Žáæµ¹FüºÊeì}DBÁœò©!¦¸*iÏPÏ¡7xÆ9å©HIt_•‰B@! P %ú‚”I%{}× aŽ&ÿ0ˆ@„.'íäA{ZÒîÈ5;¯p¯}ÔŠÁû9L¡QqZI®{NÓݹž?è—ÈŠ” ¥Q¤Ú¢P(=‚@‘459y…׾З…Fö䜛5AP îÑÐê X©>ÖTãÀ‘~pŽ[HÊè•®‚¬5Ýi‡Ulžây¤Eh©1X†hɵŸ­µ5Õår,ÙµËFú…nt­PEJz¤ûªL …€B`(!Ð7¤Ä°§­å&ms/®JG¯t{d´ùöÍ7¶È9³ hŸSÌFËP¸…•gÛ}gm÷m®«tH^´7 ©®º©®báÞŸD´9³·û^ÿú®MV¡‹@P¾ÛàqÇ{{flóÎÊ+zw®Ã?¿6 ŠI¯­é÷hg&'Š” ¥Q¤Ú¢P(=‚@¯“ÃÙ¼šFRrË»)Aâš¶Í:â›å®ÉyÏ|g]RYmæ?g^ë9û‚òá<ç½Î±>‘éx׌QZk–˜ºÆñMšºU;žãµéù…;í#WÄKwSYyÙ6«ð¹;}ÓóKZš4‡Q\X¢HIt_•‰B@! P %z—”#aÃKCæ ô·¯îÄ×Ù‡¨y»ý8G[íæ•žWXüåbç1«Ü ‹4ƒÔwæ8âñÉ·xïˆô傚[ê9«ï«¥® µUfîq§$%mÍÕõ•îÁ)Öz†Æf²IG‘’¡ÔMU[ …€BàB@ ×I ÎE“¼5Óîº×vy§bG‚ùêˆå®2þƒm@d:(ßÿ‘é‡ó8«º‰s€wÙG><ÊüÏŸì;è›–ûÐ7æ÷}¶Ÿ³úÐÔ4h»{KçtRßÜùÁÞ k=Ö˜‡þá½=»l#9‚ذ¸kÆýKIJ.„Ñ¥Ú¨P(ç„@ï’Ù¾ GsÔæ†*íßJ~r^+Ç74²+G;EO»çP_xD)~Õ ?‰\ ½{Íĵ\Ûh+9µ¡ë±:vk1›ª»r²èwúQË£HÉ9uSY! P(.z”/‹àVUT*üÅé»¶ï÷¸ÏÙ¬»Ñµo6<ÕÓž¼%XËŠœ ùØf|V#Sr“·‹ccCÒ¾–«(Rr!Œ.ÕF…€B@! 8'úˆ”Èi«œÉbÌa³Üs±¸âœîuïjÜè­íìTítyÊ!“›6mâvޏÔ+Ö9~ïév)9§nª"+ …À…€@¯“V_¤žžžå¬mNšþñÇ9P[?¨²SáŒin8(’pnô£Ø9ž‹§\„M]íB†œ-ùÌ3ÏÌš5‹§oÍS"sÃ_"“‰¯.Çg¯]»öÊ+¯Ü³gÏøñã/^L4 %It¢C*èK/ñEJ.„Ñ¥Ú¨P(ç„@_Vz;;»ŸýìgË—/§r/¿üò­·ÞZXXèçç·yóæ}ûö!??ßÌÌ ñIrr²££cccc||üîÝ»á $a ·²²:d¸ˆÙÔ„³“Xˆµµ5  &&æÍ7ßDãƒü>ñÆoPr) }Ð#(ÒÞžG¹ P¤„uµ<Æ×u ÿBÍÍ5î‚ l^^¬¯o‰IðÎávv)éé-4±Ó NvMM|hhà–-q%%¶¶Á»wnÜÔ.}ŽeWTÄ£= ܵ+!<<³¢"³°|:0!%¾kÖ,7€°åª«‚vì8AJd(¦§ÇxyÑêЃÃ--“5ÆSX˜YY¼w/ÿPe¤¢¨ŠvrÚñ›ß@q€tÏ=÷EøáÃÉññJ‰3f6U…€B`P"0àH .StÚÛVŽž9räí·ßŽs38 nã/¾øb„(Bþð‡?`ûÕW_ážõ†n¸ñÆ…©|øá‡Ü`!‹ŸZr@î‚Å«Î׳2Œ¾É­ÇI ¢8 "«¤$ÔÂ= ÎéXVa ¸„süâ‹]7ÜÀB»hذ%¡‚Éï~gÿÉ'QËÐÌLÒºL˜°÷öÛ×_|1ÑìºöZÔ@¨3Pßœ”Œ‡ „U\rƒ xÌžSWçµx1EP(B Š€í¾ñF‹_LˆŽu‰¨Ž¼þú–Ë/_ŒTcØ0Ó{ï%U;l˜ç²ešüNqq„µõ¾?ÿyË%—ðˆ˜;~ýk“ßÿº#zc^rRb°r¥iG>þxž4ü¢‹bÜÝs0º6¹ùæí¿øµåÕÞþ«_E{xDÙÙ¡åÑ„.†Ü (N(}å„ *­P(úEJx°ÒcD‚€„ÁxÁÑ,R”8ØŽ‰àdöìÙœÖ#¾CˆÃn¬Fø‰W4Ü­"Z@jBB<Çûúú’JÔ7ƒ‘—ô)A––›‹ø!ØÌL$,ù!û÷c'lzç+~úÓ ×]·ùÆ·\ýÆŸþT؀Ǽyˆ7X¹QÖ8ŒIªÕP™K/Ýò»ßmºá†Õ—]FHy[[¢)qž2%§ºúÈ›o"‰ÁœÅÍšÜúú¼†‡ ÈpÃ5×hEÜx㆟ýŒ"ÈÍúõ×5=NV”Âæí·±ê€?müÙÏ6üîw뮺 Ú´ÅÀl0S¥þˆRÂÚtùåšNꪫ¶ÜrË–ë®#¾VÖ°aé3NÞ\Ó%R’íøí·"OÚuÝuÈ] G”KMàä¿ù¦›6^sÍüa­­cÜÜÖßr O¡)üÛ h×^»ó@Ö‚®GipúsVSe+ƒDJŒý””WTÀ$p4ÒP__WS]op[Â>¨Æý÷ß1¬8=#!òT~ÊÎ?@MŽ””ÖTWô6/9õ9îæDSÇœSzœ”°¾b‰T )!µ6 ‚?&ËŸ+’!…œãÓÖ†…„Í'ŸðõÏb¿óÆ¡ ¨K,0HV6^|±÷²eø¤+‚ zzîø¿ÿãÆ˜”¸ýø£ë”)¬ñäà4btDS$å燙›G¹¸ V¡’¸Œ£ñxÀÍ7‡ÛØäÔ×#ÿXs饄PnÐ訋õðØ|ùåpH‰ßƨ“’“’02….lýùÏQñ`Þ‘ž‘±ù·¿…›÷’%T^S¿Î‰”PôÎk¯E÷ä>c‡r7ýú×I°`„I‘ŽŽlÌ¡!õmm&·Ý&Ö9Ÿy&¯±‘§'L^í¤ *®P(ú GJ*+Ê[«ÛškZê«YÀ ‹Š“Òóª*49‡îD—¯ÅǪi.IÊÊêk*²èþÍDQcôS»­ª,J̪®Òx Œ¹1c0$,Mq†ÆdâxrñɦGçoeµUøh;ùQ)M¨…••bsÛP§’sš:tÔ1õ,)aÍf‰µyï=ë>0úiVS–ðm¿ü%;„5k’ÔÔÜ––8L@vîôZ´ÈqìØÝþ³Æ? XKnc£Ó¨Q$a©>ðÄ) Ú¦Ùääܺºð#Gà XZ ¾CÚC?ÎN"ï¿ï¾ ¬Rލ¢ÓA;ljê³|¹ë¤I{￟ø±ùŠ+¶mc]w3†ªºæ’Krkk± 9pQ„NJ²kk#ììPîhŒK/ÝÿÈ#o¼añöÛ°þ!;Ù÷׿BzºIJ Pžóæi»u¨Þ%—X¾ô’ïÊ•˜•°Ë³2§ªT¤±û~˜¶£ØR2’þšËT¹ …À@`‘á 9y…{"W2uŠÆ{{H\ÆÌí¾m-µ¬þí¢”²RmÉÇü³¢\þ—Øù$æ“\Bt/®'\}T”·µÖÿÁ–Ó‚)ˆ(z4mÕ7¤‚O³ÑnÄÂôxüâžTBMx*DæÁæyªiŸJK’›ë5iD#Š¥g„ÄfÖ×Vdåvm¨«2Êó¤²:ÈQz–”`ýÀÒŽ…ÇBÃß×_oößÿâ°DÛ»kØáhb²ãw¿Ûú«_íüíoÍž|r×Ýw )…‡exû/)ÛvÌžy&%)I6ÁrÃ:­ù)1ì¾’±å²Ë„ôؾývvµ©D 9xÐô/Ùò«_mûÅ/ÌÜä$>?qû„fÿ¿þEBªºú’KàhsP-“’¼– RMurÉ%{ÿõ/³áÃ÷?ÿüá×^cO¯ùðáö_}Oê&)I AOdrÏ=‹Ð Ø 4hÛ¯~µïž{°º¥±ˆyv]};)yäÚ®¯!05¨&( ¾G``‘’Æú*× ”/—¸ìvŒ^ojé•–˜óÕöÚÔ³ÀóO~¸ACme~a1ô «;©`*ˆ" ‹JŠ‹K‡@duç/r”¢¢â–Æê{>å4¾¦ªÊ2"³¦ZcMuUd³á‡Æ!(¨¼´Â@5È»È!ÅåózA‰UeE8R)!çŠ ­VäFyd•‘]ðÆL»cÕR4©4ÿo50•ù&þ©Ââb{ŸÄ–†êšªòü‚bÚ¢q©r-êÀ?Ê2æ%=KJDRâ½j•çÚµž«WGØØ$„…±¾¢ª@ï€cÏ­·Š¼ÁmêTd'ÎS§Š…(|‚{”<û,;e4R’œ¬éƒ²³õ-Á²N[¼ô’ÍG­»è¢ ?ùI˜…[]È!9!Áâ…Xã¡Nß~‹…ŠßêÕÈ6ŒI rò×HÉ¥—j¤¤¸¸ƒ¤$§±‘;aÚúÿÇæÞìòr&¥`˱¡-öwVß°½(³´:¥mÕEÏq›M}sÝuñþþÁÄÛ÷åk¯¡]¢V4 @=ösP?u %ÊOIßOaªD…€B`(!0°HIs}µWü&Ë0LF-¼5Û1!³hÜZ÷¼Â’-Vá9ùE¹Eß®rcoM`Tú' >œç¸t_ „ÉJm]õˆ¥®cV¹}»ÒÕÉ? }ŽF^ Œ$,.ë›å®“7xÞ«‘’æ èŒï7y}½ì¨{Hj£ÆHJÈgüZ︅{ÈÜÜ5ÎÚ+2ñÒT›ñk<&®ó8LœÅ{²r êªË-<âfn÷!2Œ$-·à½¹߬pûq—ÄbîN¿¿|v`ä ׂ¢’ð„¬1«Ý7[†Oßâóøx‹~t@ 5 ÙO[½gÂGóœæíôKÉȯ©(yší¸Õß®r¥™ð—ô,)aígYÍ­©É®ªBÛ¢‰7dýNN&ÄkáB8qÖýä'v`Bá2}ú RÂ<••ˆUÄÕÇ®Ûn‹rrÊ?v, Ky9;tØf,êñSâ2m†±è†4í·jŽFªªPlºôRQÄ„˜™a/â·v­ÛФâ5þºK.!dõO~Âæ[ØšKJ°}I Ýyà šÁÇE9~õ©ˆOÇ`’‚xƒ½Ä4)HÉÖ_þ’M¿~ÐQí[š³² †®bS_ñ^º”ýÌy­­X¨°)Úþ믡kâë%1&R²õª«„™þç?¹¹˜•´û J“„j‹B@! è+)iª¯ò MEÒ0}»ïä^GƒS"RrƯ÷HÍ-œ¿Û?;¯0'·ðÅ)ÖP–GF™×6Ô˜{%,‚(ä@Dê›jïxoU]udJÞøÕî™9ÕUåXž@2žd›Q”WRþ¯‘æmÇjW¶óOJÎ*˜¸Î³¶¾æ¡Q‡‹ÊËiøÄ¤±©LËV«ð=QˆO^øÎº¼º*$1ï¥i¶õõ‹öt‰MÉ}}†Ý¸ÕîoδµÊ=5·ä½yŽu5ë-ÃMÎÈc†]^‰fæ¯úp¾ÓS­öºÄxG¤ÏÝá—š[”˜ž÷Þ\ÇÜâò/—ºV×Um:¾Ï) ^õâ”#œ;–œÿŠAÇ$V)=î§I‰¶%'c';ZÕÖì²²€;EYÃ_«W^ñœ=÷¢[Ñ$%ÈBØW’šŠÍ)k3á~ØcæL÷éÓ­_{`mlèê4a¾F|W¯–Í5®'æ·µEØÛãMU@Ï<ƒæÀý÷‹1©FJLL`Ž-?ÿ¹TÃæ7¼,°úßÿ´.bèÊîüÏæäØú)"²Úvå•G^~Ùý‡ 7ù dI¢™=OJ&L`EgM…O°¢£ã0öì®-¢l÷-(°|þy~ˆ¨ƒø›/½ò!¬B;A—ùùáÖÖ/¿œ=8,τà °Pá'[`8„oÓO~B|Ò:Œ#'îî¹åöoýÅ/Øtçp1‚$¢Bè²Õ°ë˜›ØG³s§øxu1/ bÉA}´½ÁÇI‰ï† šŸ’¬,N@é9ùU†6˜€´µÖüö•× ßùÏ‘‡à")™y~{øê—wD§æ6Õ¡@höðÚk_Ýéžuñùâ¶¶H/>™Û¨EdòÖl$(ÛmÃMì"©Œ©sÌïß1¹vø®ù{ÒòŠÇ¯s§ÜÎ1{£ÛšjÂ㳇=°² °Ä;<õŠç¶\ÿÚ®í6$ßë5ì«°ÓEs‰q OöÏ5ÏwŠ òñgLqÙUôÆLÈJ]Ï’¬=œÇŽÕ,0.» Wc#ép~¯ÁÕŸø˜k  aqÝñ«_…8à½x1ë7© Zä+âGµªŠmÀHà ÿö7ΑÑÔÙÙHJ°…gP›hpÕš]Yíâ‚Ñ+1±&A'BZÈ¢è¬ìÖHÀOJHð¾}š×ù´41É116~ˆ[¶¨£G9MNCM š¤„Í/7n¸bCž°i“Ù?ÿ¹ù’K°ðpŸ=;ÖÍ fÓáècMTZŠªˆ²¶_uÕö+¯ÜöóŸo»â ý™£¦¡ÎšC”K.ÙsÛm(n`68ºe›ô¾;î@¾røÉ'qCB‹´Ý7† (ØŠì8jö¿$a4 ìþé†jrR(&ˆ”ˆª^#ÑwãÖÕT p)*.E³ƒÐ‚¥]Û>ƒqhE™•W¼¹[¬•g<†ÄÁ†fP\¢í¹Õ~Vž0tÅ|Õ¶™X’ÂuER_[ÉÚ½ª![~V4ÕÃQ¸o=ÖŒœ…TõdhH^OBö*󯸸ôX2-·¶–ì?(Žhì¸in¬¢n4¡­å!†ÜZ`*$7¤j­®$·:~Z¤5‡‚0ªÕÚE媻‹í®M‰0OöúÖÖÒNq+rjý‚,³ii,ºâAÓ Œ-:¦2ÄÒÄ*EE¨cÈË bÂ?Ä╟’ s ­ðädäF ;еóeÒÒˆOq´3qÊË¥’§–yF†ÿ¶mðñe‚›¼£'Âi 1¦ýk"–¹ì’ƒý(13–#5!ÏlhJAÁ)i‘QQIYÿi’•”ê,(Y j~H)šFN·¸¨@Ní"¹f¡RU¥Î¾¹0gRÕj…€B Gh¤„¿š-…¾;÷¸Ç.CÐÈÀBˆµÆ<ÄÖsTm÷ Ü‚‹G’°ó–`É?y$÷º1©þ³ý‘lü%Úñý;ú¾£ç¤$Ç£µçßžƒQA’ùIÙòÔ¨,*§?íIR"¼„=&ì4‘g°x0ŽiØ–rêTÇ—ä»W yÊ:ÝžÄpM{ ”k8’¦CœE@˜ÐøhòŒë¯?ðÏr:é}÷!§S G41ÑÕž›Q¡ÂN9<´È:nNBéøé9kÛ)óSDè‘¡©2Q(ˆ”ÈÊ^Y¡m»…X°“¡ü‘…ø©ª¬À%«„eDZ¦jnt¢@$M¾¡íÖ"èá²îwr§v’{4ý)¼@vù EÐÉAÝô€¤dðtkMRc8’wÏÓOo¿í6ˆúͽÛu×íùÛßÜfÎä¼v1Éài”ª©B@! PtEJ4G#q)¹‹ö,ßÄNÚºšÊÌü¢i›½§,9¢§mñik­Ãžt¾IÀªƒÁ¡©ÄŸfˆЀŒ\îºöPi3r !1H&P¡sA+$rîq"‚âÊAH !hRxJFuÕ¸3 ŠÍ ‰ÍâF\¨õé™Ý7]ì&š¨oÃÃc½½=æÎÅ] ;_Âf³1NM”÷ó¢TE …@Ï#0°HIsCµ½O‹]ì’·Û„o° OÌ.¼û£}[¬#ò‹Kñ rû°T}}ºí6ëßÄ­Öál!9Ša£MëOŸÞœ˜U¶Õ&*ÓÖŒ(¥&86s‹U˜{p2’âíwŽÙjá‘YÁƒYBjYYzÄa’›W•”žSðÙb—Ñ+Üö:F"né_FrÞ[‚9l™Í)íº’Aømûq~>&µ`Ò­‰æ—LÔCêR( ¡‹@vv6KXbb¢lŒ=ÝÅé¼Ú%###ÝÜÜ8È· dÕT_™;_(Šðò4»”Ü’/;v‹µÂÕ;,í‘Ñì¯iyo®}v.–…unÁ)‹÷°Ý¥¦¦¶çLÛê?e“/6°° ˜L3×Ï”v~‘éCþýù¯x„1¸PÃãûz󶑇8ø'¦å==Ñ AËä ^cW»ï°‰¨DžÒß×ù©o\\\òòò õ•Ÿ_`üoP·EU^! P(º†çìrìî!%U~ixùÇ׿¯M·mnªŽÍš°Þ3.=oÚf/ŒJk)ywŽ=¾ÎØAã–†Õü¢㤤å†7L’³‹¿X䜙ˆ‰†ƒÎ±OŒ·xeªÍ=Ÿì?à[^SùüÜ´­<„Ç‘hд…»ñÒ˜š‡ïԼܚ±x»M$›{Qëè[xú‘™œ)ÁþÖ­[7oÞ¼E] …€B@! Tlß¾}É’%111ý/)A}cá;g»oEMUm•¦^ñ Kýx‘SQié.ÛÈcÇêpU‚qÉð©6ë-Â¸Ä ðˆå„Ú͉A}ÓrÑ“›hFTZÞè•nøkw I^clç“Àxøx-®(ûÛW£3~Øâã蟗’3{»/‚“­Vk‡F¥å¿;Ç‘LpݶÌ4ø[¬Áj¶Ÿ¯ó % ÐÔÔÔ¨.…€B@! P NZ[[ûŸ”p†®>áiì¯Ñ6ÑT”§e:ú%bšÊ!5xû؃w²æ—Àä™Û|–ì ˆIÉÅõø¦ÚR"@VˆŒáj|ZžW«3gõÍÛí?e£¶«¸7¹ýݽXÑZ{Æãœ¬Bâ2§oõYw8®ÃYz¾‰š“cµ®AÉÈ`ÄZ¥¯ó#%g~—ê©B@! P(5½nS"Fl‡.è<SSèˆî†D£ eÚa¼ðìX‘¦È#á š°¤©F|hùÔVahÒ@äÖZâ7ÖUâ9þÕšswr 0"rB¶µ¸¹—h(k8¦˜´ÚÑÁx6k©ÅU|o¾Ñ0©¬¬ä,<++«AÝTå …€B@!ÐSô)ißlÂÖÜšJX…NMŒ=‰µ{';þ¬ƒC'ƾI 0øæÝ¤¥×kú^_ã" i5G)……Åϱþ”•(RÒS=Xå£P(C¾ %,Àˆ.róŠ|"Ò#²[{è¬Á覓´SE2âÜBG’3òœ@;°-**1ʤÝ],ÿ‘$¦çb†Â†ñ Ûï—"%Cf©†( …@O!Ðë¤D£åyE»ì"î \dà™^_­isØýË^ <ø‡ÉˆæižܹV Ü©lm¨ÆE;qæXf"¸bÕN™9V‡Ã4œüªÕ}¶È.‚Žf›u¸Wh*Z iá@ОòSŽ<ä·éH$Çö{)RÒS=Xå£P(C¾ % vÊÌÙéW\Z›’뜂¶%$6óÓEÎ8/AtQTT¼áp('ö¡^ÁµZV^1ÎÓöØG¥çÂ3¾]å¶hO c»uÄÔÍÞ8&Á4D¤(œwØ#nÎßøÔœ…{0LqðM:âïà‡{–ƱkÜçìðËÌ-ŒHÎ}b¼åë³=BÒp6¯iyú[T¢HÉBª! …€B@!ÐSô)A8$wò#—»ÌÜîƒYklZîøužîá™swû;ø%eåÝcÕצۑëÓmCb29cÏàW­ñ#Í¢“³9¼oÒzÏÀجϗ¹YáÈäXmRFîÝ›þs„Ù[³ìó‹Šgíðå|œ–zÍýI«n”MIÏöa•›B@! P ú€”Œ:±]­­ÄFµ¡®²® ÷iåøá'Ö!ÕU嘕pÃÏ–ú*ì[k*Ë çý–i© Ñêª+qðÚTWÝ\WE>¤×wæ`VÂöcÐJBü—ÔV•c‹…´Í U(z8솧¤ï(îw^¢lJ†ÈRÍP( žC ×I‰ñF_ÈGy©¶kFt(²;×à¡Dû§=埑Á‡ÄkÔïÛSiöŒHn`ü•ä'òÔ…#DL¢vßô\V9) …ÀÐA ×I‰ð¤ˆ48‰ÿè¢a F?ÛÕ+"_ÁvDÂ6j´íÃ'ÅdÏ0*cªa¬›ÑéN¿ËE:W@IJ†ÎR-Q( B wI‰˜„s@’¥GœC@çäYzÆeäÀ6 r6žˆC´ª ¯ð(-» *)‡(ÂE¢2 ‹Jø‰¾†˜xIÍ*HHË“Âyœ¡JŠ”ôPVÙ( …ÀÐA ×I‰¦£)-[s(xÁÞß¼²}‘iȬ>q©¹¬Êáñ™ì†…À?0‰JÌŽOÍ-(,®Ô.¥ÍuÕVž œ÷‹,"RTR²Ã6'lœŒ“–Ÿ…ãµ%¦?löÉ/,†¦ .^¢HÉÐCª% …€B@!ÐCô.)i—‚”•µ6VQáÛßߣU»¹+ר”l˜Ê>Ç褌|¶Òr‹ýq—ß¼]þóvà†•5ı÷KÄmH –(›-Ãò ‹‚¢3¶ÛDàŠ­¤¤÷kïÌvXw(¤Ípªð –(RÒCXe£P(C^'%ÂKÄËÙ-ïîæ(ߢ⎿ ˆÍznÒ‘‡GÞïƒtä¹ö¥åÞQYÏO¶f£¯ÿÄ¥û‚°G—@AF,=šWè”òòT³£±¸œ_iòãnÿœ¢bŒK):½RµD! P(.Hú‚”hçÔh¤¤å·¯î„pTWV„ÅeNÜàQ\R2g§ïÇè̜¦àѵ¥¨¸ì•i6mm Äg÷¯­oâ|vö¢²áHà‘ËŽfå ©ÉÉ/úz™kaIé^§¨Uƒ‰o`>ƒHP¢Î¾¹ G›j´B@! Pœ¾"%ÚáyõÏ~‡ÛÖ:èC}]•…WÒCߘÿkä¡.1(tpÉúÒT|©½>ÓN$%ø&‰HÌ"ðÉq–ÿ}xõ¡Ô7HJV Æ+Ú>§(Ø ¹ÍÝé÷ïoÌɼWY‰läéÁK©oÔÀT( …@ú‚”VôRMXr¬Ž¿riÇÿ¶Õó¯ wj5Ñɹßoôž·ÛßÑ/‰ÍÇý5ÚI¿†h˜µŠŸ4æ'÷¸â“^]×x†È‡~衇–,Y"qŸ~úéE‹ÕÕÕv¥ˆ~Œ³qãÆÇ|Ó¦MýXU´B@! è½NJd!ÇRU;ž×ð·ýH¼vr¢ýòY9…NþI>éºÌÃè¹v«m 6ìÊ9qÊ»I×y‰PÙllðÇvj ö´¼ ›*iˆÓõ㛤¤ººúÑGݳgOaA¯ã‘è'ÆY>6Öòî÷å—@Úúôª¯¯ÏÉÉyæ™gàIR0½ ¦‚OpBÑ_>;ð߉VúØôhhVWª•”]þÚLû®ÄìJœ†¦ÖW§ŸÈ­¾±¹ ´¦¥¥µCZßè|KïÔÆf-<;;;00&HœÑ£G92//û§&Z?:Öâ¿ã­cñü›£¡Ù]©Ãcã,O-)»!ßãÍߟïÒÚz¬+Y9NZZš···^óîg¨rP(}Œ@ï“þò²Ââb¬Y!…EÚM'‡ielFvR_­ý[rÂ}Z»{Öšªr6c!«¹Š?™™tvt 2§øiL õ®sÜO¬¤8QðyïœÂÑĵÕ=fNÛMRRUUõæ›obüKw1qŠ7uIÒûÍë3¹Ï)®)¯jল¶1£¡T›L^ie½lAcSKJNETJq³amŽË(Í-ªñŠÔ]–ɨÔ /,¯#²ot^J.òª¶òê†øŒÒè´’¢òºÐ¤Âææ)Ñ'ZKÈ5bĈ 6Ƚ¾.:g}·ÉWŸžh•–§Õ$,©È7&/,©¸ºV“X@¸÷Í÷‹åœç6â|¶ø(7Ååµ9E5ÇŽ«mhòŽÊ ˆÍJÓÚË•UPí“’PèÒN ’²Ê}¢òB K ­Ö/{Ï'ûõŸ”•[\}ìX[ë±cá9”™ZÌÓ}. “7ùyEæ6·´·KoÂØ±cW­ZeœçÔ­þù%'¤&qeTÞ3"§º®‰hMÍ-@JeB‹[øyÍðí™…Uàfœ H~»ÚKBòKkçîÆ4J{kî•›_Z#Rsµv&"@âgB¦¡¬ÈœªZ­,ÞB|f™”US×,I~þóŸ¤î …À B wI‰ø}G¾°Û>jÃá°™Û|6Y†­=‚Ç3Φ9ÖTÍÁ4"«À[ þaýê’š™WÄ)6Bˆ—¹hoic’³q[Bd”8- Upþ›A}þa<ªÁ{°Š­ã¼Î×)/ãX`\«Q¢cM5šØãʘÊòò€È [Žn4uŽ ŽÉä ’ˆòˆ-?Tɱæv&¿Ùo—}TsÆ™zDTÒMR‚¤uIzz:]Í)(s§}\xrqLz)ë4!ˆ¥ûÃü3¸÷ŽÈûa[7ÃYcá•6~÷ŠƒaËÍÂG¯öò‹ÑHÀŸ?1Ýf;n7«EŒZéá‘KxxrÑ<“à9»‚–˜†Bì3þ=Ê|ѾÈÔ’ÿ}oš¨ŸYúÐh z´ •MgRâš=e‹ŸDxj¢Uº­=9{WàŒfîÉü<èž4q½÷´-þS·úÆdUXîFø&ëh‡€ +4M˜·'h¹YD@¬aáÞï·ø/ÙvÑ눙”SF„¹»ƒXÚ÷¹$–ñ’¦æÖŒ8¤Ho^%Leú¶€Y;ƒfí \o©©œ– C *«ÒÖþ¦¦&cR²lÙ2£!}Œ’³5¢ÆUZ¼/dÞžÙ;gl×N´vÈý~³/9/?NMÜÃrn~k׬aÉbúõäx«Ô\ ã‹72s ·ÎçXÛ1¸ãÄ >¼‚ûBbÓË"RŠ–£¬9»åzGæÂ¥(zùðìâv£HITÕO…€B`!ÐG¤ähP Gøþúåíq™6^ …Å%Ùù%ëÌC|ÂÓÙŒ((*Ùd~ðhlbZî3ì§nõ‰I̓¶í4Ýû阴"[ß$3×¼˜dåräï^‡ÈÖæZ¤N~‰0ÌÜÂȤ좢’¤ô<ÿ¨ôÔÌü¶¦êUf!l®­®ŒLÊYs($%#_x Äó{ßDüdä[ë—“œC’]¶‘mÇêÝ‚SvØD$¤çWÕT=9Ábépÿè ˜Í€"%í¨kh¶õK[i±Ú<’ÅBSKëV›X$ikk5äzeš-¹'XîTf›]¬ :ÕžL“[´þ݈”ÀÛ–kk;öêLK¯Tû @.ψ\ ¯Ô©ÎHJ&oöMÌj¯0ì ¯€6~é0¹ËžÒŒ9¸_²?”Ü*ªÛe6·¿gpÏsòõÖ'`ì˜YPþ09NÆFÄó›±=€¬$&ÔdÞž`)ëòg6Býí =않 LÏJ‘’Îh«…€B`° л¤D7Â@t"çiÇ88+¿héÝv‘‹öø„§Áfm÷Ýf±ß%:1-ï­YöS6zE&fC ´µÕNÝâÍ!^IÐíﲋDܲÆ,d‡}$rއ¿áS¸Ù'"mÅ üüâO»Œ]íVY]>}‹&˜1uŽÏ^b´×1jÚo¶ã@V3RÁÒ¥¢ÌÎ7qæv_öþ°¯xÕ¡÷æ:š»ÇÅe/5 ÄEÛFËpßè¬7gÙÏÙîkå×P3°$%BJ¸°H@:Â?¬%þfXƒ7YÇðÍMxJñ ³pnø^ç/š…Ë<¸p˜¹%¡©ùp¾3?«k›°JáI‚²Úagâ”`å6n­·}`&j؉ޭ_˜ÂÎív#§#%ˆUXV7ZE§åk}*°Ý.î°gêJ³ð;¡GHÐeè9#>Ýn‡]\Üñ5{ÍáÈÝŽ 0’¬0‹`%^gÁ{×®ç¾Ã«M›•OêG Úú¥›Mr̨2h…ä‚”üsä I ªä+•µ ˜p ^Úb»Ó!žhäI{‘ ´§:#)™²ÅÉ '€”@ ,½ÓÖjÕÐÔ‚R 7XF¡µ!äšW·ëõÑo^žf'Ê,ýB5³Î"ÊÌ#Ù!0óÁ¯Ìj `ßë’¸Õ.µÚ:Ë(dWR–Ð²Ææ×°ì}G‘÷ÀŸ%+EJ:£­B Á‚@¯“á%â<íÖ÷LX& A1™:cøxÓ¡£±u•¶Þ‰S6yE1Ù—–­Ø—–§ï©Á¤#,>Ó5,k«m~åãÓóðúŠ£µ±æñ1‡úÖwµ/Ñð¤ìsó‹?_ìâ‘FÈOþ»ÙðšºÅ²÷ÒóÌ$«ÄôüšJMàÞ;\·Íß`ã§žlgogÝmÂ,îR–¿Æ#9»pôø”„1=è ¥Õ7ÈBŽx§!Þçóƒ ¬Ji3’‰ƒ®ÉY…U_¯ð˜°Þ‡ËŸÑ¾ãYþßžíÄÍ~פݎñMÍNøYYÓpïgšíŒ„ŽOö…¦¡‰YeÈ6ï =èšäž3r…Æfär ÎxèÓýÆ–ž§$%P„Ñ«<„À’Êzô3wbV²â Æ3’sËÑ=Á¥r‹kޟ猜†58ѰöcšUX[Rcí—öýVT…5ItZ)+:²½D–í[Þ5)«n@F’œ]Ž•Ì&A°°Ê)ª¢Ä¯—kBo²éHtP|¡ØÓœA}ƒËèÕqéíBŽ –Ñ!lAÐÔ 5!-B \ðG“`‘Ù<òíaj Ï3Æz4oOhlzi|F™GD’!ÿ˜|”n¼Á†Æf’`¡I",ÍÄ9b·Ç%áˆOªVVeÜ݆²ª´²²Šªæï 6hî¸)1ÆYÝ+ƒ ¾ %ºó´Ë´u±AEzVÁ¤ žS7{]ãᚆ f™iàØ5î8ik¬A2q½'Ò ¶$%õ߬pÛf9owÐúÃaˆ7p˜¶hoàÂ=Ë÷357N\ç¹Þ2lÔJ7rÈÊ)újÙÑôö¤4½7Çq¥Yðn‡H¿Èt¼ÁNßæ;z¥[6§íh‡ë”a3{Ð%Ù 9|¾ØÕ;*sÂ/gÿ¤¶Ö;ŸÄ¯—»NÝäMeUo̶ŽÁʵÇt7²Ó§²²2++ËÊJãçzaèúî»ïJ*Œ7{ÌÝ4×$xÊ&?oYÅ7XE³£õÀè„!,ù[mc¹ Ž/Äôµ¥¥eíaͨØZb5‰zŰNç‘ç<¬76û%d–BPø"×ëV|Óë;«Í®àÎ6%°„½Î'R jÂrE¬"Ð1µ´Ë/©A–ƒ-|…¥½´¢~«M 1ã ¼£r!)9åÓ·ü¸'C ç`ͲÕÚ7mÒF˜>lÐ@!œ0uMD£ÄÉJ ± ƒÖ¯–¹£ø˜³+˜þƒ9ª‹aË "ì<î )(Õ ¢&´?Ô¶$ /ºè"¹7nÜÖ­[[ºß5‘:KEïpˆ£b“6ú‚ !h‚&oôÅ΃²¨e°¨5¾²Ê(‘´«…WÔhÒúšEûC?Y|dÒó*0.–ƒnÉü¤]»ã‰ÿÝF_¡;šMÉFÍ~5-•̯¼òÊ©Ÿ …€B`° ÐG¤„5­‚à<ž{ø”Ìü½ŽÑ{¢c çïqŒDÏ‚@…Gù%—„Åg!S!2$†cú6Y…ñŒÇzµ¾FKK„}NÑy`R]Y¶Å*b¯C”wX:ë½wx:‡ WW”ChÆp:1»y1Ùï±j^¶ £Ô7œÿ›‰ë6TH ˆ­krfž!Ãr÷Îå¡D¶üx…q`‘a“N¹¶o?î)©©©¹ñÆyyøÏ «±bÁ*øWcØ"ßÙµ š±ˆ,È ä^Öl–aÙ†ª/áh:ŒÃ‰)y²…Dï¤ NÈgi”‚؉úÜsÏQcRò›ßüÆÆFÓ­tÞK†TŒœõ¢ë ©×B´ì޵WI¯*aµ¸³ih†~I[ôëÁ¯H»Èª¦¾‰8HCø×‚ƒCT@ê Çç¥ð“½62*ä»o¸goDPBh‘q5¨YÉÖ.`$BŒã ›¡èÎu“VÃlä‘ÔAÇœŸ4Ê( MŒË’VëeMš4ébÃÕ¹ ¢P(}GJdK‹¾ã¶ªª‚ 8¸‡ ²a¯ ?‘‚vâ”5ÔTÈq6r!Ú€Í( )˜wD£Ú¾›2ò!…6PÙåË!1ü$PŠn»à6¯Â{øK¡ÚqÄíV°Únâ£9’í<†‚zŒ‘t_RÒ¿}«¡¡ùµÆuèÀxÔ9¤ë¼È4ôÊç6{l­­_»UMf~ʬzµ9½]y•¿B@! ,ô)ѽ¦Êîm´ßœ‘G'¹ qØsë¦MI×_°Š©P( Á‚€"%ýCo),#DÕS! P(ú EJ )Á¬­ªÍêR(NS'{Êú}¤PªAe¨i¿W¦ZRŸY·.vmW³…WWÐßx ½]a6Š” RRWW¢.…€B AAAœSÍþ*œ rBuÿ"œ¬¢ÃùŽý[™¥S·øøx€Š‹‹ã~@Õ­‹•áýâO£@#""xï]LuÁFˆ99µ_†…ÊpèÊ¥HÉ !%œwãèèhcccooow¾iå:ß T:…À@D€.mmmíîîÎZmaaÑœ¢ñ?Ä÷S°§§ç‘#Gú±2Þ5¡>¾¾¾|4ûøøœSÝôÙ£çJ·´´„QÕÖÖ=z´›Sâ@ìÍ=Z'àˆø¬MLLºSöÆÞ[ä}ÉpèÊ¥HÉ`"%®®®NNN.ݸ —³³s7òPI(;«,"}Ͷ¶ý[E&âððp¦`–F\ÿV¦CéÔ á ¤1 ÷]¯ŸÙƒ›þm«6ë+’8•éz.̘²jWJJÊ醯U^no@D¡aa:Ö¥K‘’AFJd2#ð‰ÃÅﻋL…´ÞÞÞLÜý;¡ôF§Wy*ŒI Ÿ†|C34d˜È…(¥+#…y™aŲ×HI®“Yø%[}ØRîT¦;u8]ÚΤDŸOÎ0¥P[ EOCÜÜÜ [ýUÚÅ›íLJ„û[ã·LMN7Ó½±ÏæaŠ£bƤ„þ©÷Fyé ¨*ØöÆkU¤¤xÆ9•z»oP߈¤Dz*U„ùùùèÑéÜÒíŒ/™’ŒC˜ŒÈ„zÒ %¼C&wÎê”™÷ÆŒ©òTœ$%¬Løf€`b’šš*7^^^DÓ;sç1Â8bÍÍÍeˆ /9¿žß”-Ù2lóòò øfe8W¦CAgƒç]1v %‚XQ=©ë}çù„IÓ>uýüüˆÌ ÔDêß¹2ÆŸyR:¿OóΤ„9™·Ì…þÎxJ4®^‡ªvî]™O™J–sÞ;0ÒÓ¨Fff&úÄνÐ<<<ÀOD—tFéüFÁ)Su %T¬ ©!C#;;»¨¨ˆ*‰ Øž®+vnx_Ÿ"%çDú'rwH ³­ a÷Ê×bX&8:7]M(‹Wå'ôHBHX^^^RR‚Æ]žÊ£©DH+ä†K×ûpÓ{R¾‡*« ’:*jl¾ìéóš° rÉ’¬éÉü•áÀ=7|Â2¸˜¬Yç¤çëI$NW€íLJHE¶,W,êŒ\T'2*/QöKˆŒb©’þSÿ"è¢+ëLJX0X¢¨pqIÝdN±/‚ÈhKzz:ñ%+}ù—™G“Vè e’¥9úÌÓuH[×”èM æ˜¾òº©¡ÔMh“^¨þ6;LzRCgI¥‡èS¢µqÃ%a3r–¼úËG#çÀKô†K5è`b`ñ)@éÝÀ¥.¾Ê.F“jë’)ÔAΙE·BÅ:ôIˆêãE:dçtÖj(RÒ?<ãœJí&)AkŽ)5$ƒCVnÞ:󣱡¡šÂ!|Ê a;at>âÃH È|¢³!yçT<%ÍøK*¾œ>ŒY÷œ×#Xñ’³ŽC¡è@J(9ÔÜÜœÏA¦cQtÒo§ŒéÉ|ª2(˜‘ aàð—{¾yÄPbd1@˜»±ä)YuÑã”’ù &²ÆS7Jä"[Š“…JJ§bIIIR4#‘¯¨ÑøY\¬ìˆå Ü0iÜKÿæ>+ì$%ÀÂB.óƒ@$+7ëç=1ÏðˆIƒ¥é÷|RËGU’Ú8pÛn—îÈÈHþRa¦ nȇ¶°T³¼ àˤ_G{‘ýðùÄ$#EP6bÒõšŸŽ”ˆú¤¶ Ä{$²8ˆg(Ó;ÐQCªDëx¹Ä‘™2mJ»ÀŸÞ µâžÙpòç¢ùò¾äõAbh&?™u+a´bi «ƒ!ÑDÓJˆâ¤‰¶ T{êLZР»Rnוq]_g&%ª“yqÒ÷ "ô.ºÉ!(ò~E'ò'–Þ©Xòžùê;R"Œ„÷½dÉ’'Ÿ|òå—_þßÿþ÷Âé¯W^yåÅ_$ŽþWâJÈöö#jþ¯ýkþüù¢ íƒ«;¤„ÌHcŒÛ1„è"0wƒ|?1„è@"þ¡ë0›0¯1«2066HVoLyR1bIÅ@a#Ã’øôBâ3Ʊpdù28[WTÏ}‡À)I ‹kk S§tZC@”ú¬ Ö3Bàë\ÈBX'JŒ/â°6pgvf¢ceíâjÑ™”ˆªž “1È䛘‚Ds$†ç …0‰•(ߌAùTeęŌ5ufUãžZQg²êޤ„âä ^ŠÆ¦Â< °)—kM}¨ªÈ' L¬£|ÿ0)!„©C¬qY_$¥¶äLÉvÈŸSÍOGJ¨-°ð‚xò*yS2OB8(‹jE݈FÚÅ[ „¹Ž%™™MV_)‚7Nm™3Ažo9òa…& ³„×$ïÎÁEnº¤„¶°TËÇ!ïT,Qx!Ê"s.r !Þ¥pþÔTäO‰ä)¯=8rNGJ ’¢š¤GdW07Hò`xÒýH.Ì ©9mg}4@¦+#¢OI‰ôƒqãÆ-Z´ˆ7ÁRÇ8§a/Âéå4U´k¢­”h¬‹´í”©ú&ʬ^½ú‹/¾ø¤Dgôxcqý†©JD¬Ì¢²!„Q'¾Iô EN|"KœÎ©äÛeûöítD}·Ž|*q‰¾¶ÇŒÊJ!Ð}NIJèç ú¼Ìò2J‡ç/#‚žÌxa€"{t‰I4‰À=iå©°.öü¤„BÉ™‚¸d”NõÄgø)õþ$JžÂtxÏ©æ§#%òfS&(yò*©¼H¤ÂD£òMfB.IˆDTz %g2‘@š¬G^¡¿>i í¥âHcEТ#I|e ™"è%’¶+Ë|×_71OIJdDèëˆô7é{ܤT• ˈv >çºô5)–Nž<™ŠBñDótºëÍ7ßä{KÖ~ÑÈ…ÉL×ãŸ!ÿî<úo¿ýØb‘^@“!›"îëÊ¥û)‘ßy0K >e~‘±¡éß%Y&Ž©ˆ#›ÙàÈTLÔÀ2«ÊÕÅyùœ†Š¬è&ôÌSztÕû¼ä¯}u#úø’Ÿv¥ž ™]Zçñ¨Ú8ã†çv®ã±)9Ã|bŒ•>WÈ,iú´ !Æqt”:ÌÝ©¹ž'Ì ³ó´3¼G}º;å 5žß¾>×u¥Ï·W#ú+뀤^J{iv•R:{tÕßšq÷뀕q ¥]Æo°+c8ý@J&Mš$:Ú¥K—"Û˜:u*"S‘ü‹: ±Â=¦ ãï¾ûFòÌ3ÏL<]¸p!Œ ²²råJ~²²(r#–SȈº²fw3pÔ¨Qœ”Ð?dp¯^¼J}*¤ ±‡U—B`€#€P]ìåì›þ­m‡³oú·2J(´(µè&5ª†g­ †æ™®YDú`Jøà<¢GÅ+\fΜ9wî\Y¤$ŽQÜÔÔÔâº}×Ú½ûØOà %m)Œõ“XÌ1kï‹Tô«½ÓRñ+Ú&…QTtŒ…˜,n“8;5LÃ#ØqÇÓ" öPQôÕí‘D{Ç ¼ \µÊ:¦öN®³Ç/á„£L‡”8å%ÎÑ–\mIJHõ·ß~“T¡ØB âBe——^z‰j4lØ0x >º|x˜Bxå'÷”Å‹ã!EÔ0Qñ“,œ[¾|9«´ƒÃ¶DNs ycdÊ7Ó“&¬/õªJÉj(¯:n‚bý¤Ä’âTa …€B@!ÐyhKR‚£r=d; Èø§Ÿ~гˆ¬ š?>¦Âgžy†)…¡ÌÈ‘#¡÷³fÍ’{Œ+H 1ð¦u˜ý‘• ¼ÂgeáÂ…=?ÿì‡ïºxÆà+ûÌ´ùÈÞ¦›‹Í»aç~²ûš/ßž»Úµ""ž][[$ÖOJð{Ç.Õ5¶„éì[Ú(ù­é(˜¾Á¦ØáÍdCdVt¸0&…%²”Êfa½" ”²ê-‡K[@ÿvHm”¡*å6#%ÌZ‘0Öf[0iŒ=¬#ܰ>»wïÞДÏ?ÿœš„ã fÏž­“>ùè£X Ͷq˜I˜¦!¯½öó8dC¶¾ÑóãéåýF·÷žzþé‡.xúÙÓßúôŒÏÆœÚkºM¯ 6==mÞõ·y-èº÷#?ø#}òªÜ]ž¥¡±•éuå{öÜwlD¬Ÿ”0Ì|ka:|¿\d°1Žƒ…B‚¦…!ÛvIñä§Û†Y°Â¨À“.]Kï-¶c%”ÝØèsPÖÖXD6T”¬ìX Ž/uÄÆCÂzºÄãËÅIû ¸¨„rjA‡”8íQšƒ%W›‘¨ƒl.„¿vÙ‰H6øZ±b?áh8  èh© Å÷×W–k»Ìu¬ ÇJ”ª*Êêk*,«¦ª¼¶Ú¢m’aDª­.oÜ_Óx°¶¡ö䥫 ¯w…m’ë‰D¶M¢—@]É^²Ì͘ü™€Ð~“¨teú~Œ».Lû%ÝbÌÈ &%þ “ã2fÉ-ÆÐátRb¼Ý¥IÅÖÑRØle0æIKzŒÏ~k„”gðh]Á1 3SG¯EyôæpRI‰lƒØVÎ8rL¶É…bÎËËϪ(Ž[¹#òü×vÛ¼°È¦ç×ç}óòÙÝ=û•{ÎzæîSyô´Þ³yü—S^›fÓ}­Í«l¾ö·ézÊG¯ìít×AÿP0læÿ‚ä¸ýû+õ…=Ž”±ì¦Î—v'mêÐM3MÌü•QkÔ2ÿþ³<¼â„9ºŽ‘¢Q±ê=õ>f!Jw|8æŠò²ýõUðÊ.Öÿ’RBW(çÉÉ¥£$'1ÂÑUr‹½jk˜ ’pÓ~I·(ª9)@äBuu l- /ÌI‰ ,ÖwQœ2}&—P.ãÊ@U1ε $1t±v!Œ“L™žoÆ^`œeî­r‰€#o%<ùiÉ6è]”à' ÿÐQ0¿Ù·oÂö1ƒ~Ž|ò›7ìm>°µé¾Ôæýa6ô¶éöÁi/=uÊ3·Ÿþð §ÞvÍiwD—^¡¿++ÊO„23Ä4ð»¼I™éiñÍöÛr ‹±— òåRឯª*PuÔÜŠ2- ƒœ!!9bˆÈ@*µIˆÁDýŸð¤‚ ÑrcP9¥Õ•eÕUåõMù:Lx¥g„ìì­­pöO¸ÀkDµá[¢­(×þmUE9àð© IéyüÓÂiàThÊ„Hˆ`ÖÔaŠòãs-¿ÈŒTÚ_Éb ?2¢ÒÔJ‹Œ×VUD$f/Þî”â쟛’KxRÌ' B üC(é,˜‰Ö`Ô)ßS²Ç ˜”¾&+ø"X!•Ìï!aS‰‚‚\pÁ¿þõ/ùE˜VÅÙVMH‰èf¶u¸øâ‹o½õVÙ9©£d³0&¤D ±ÙïŠM³¸‘`0{î¹ç.3\B¶è^uÕU]t‘lÞÍC¼Ï>ûìnݺ‰ŠaÙïz¼Äœ”€˜@½`Á—è­ÿ¯ª¢÷øå—_Šå´2³8§Ÿ~ú¥—^*›1ñ'²Ù:»ÅRë ¤ätD…‘£¦qorvR¤ÓüØŸ¾Š¹µ[ÜmoÅ_ñjˆÍÿül^µyy»ÍG[lz,´ùôo›}l>ëgÓí›ÿ¾lóØK6hsëð÷\0ç%ûé¯lœøtbàJgg+ß5‡`0†‚¢‚ÂbÂÇ¥ä66T£ÞÓó|ÂÓhD¦Ã¥R3ó½ÃSÝ‚“÷UŽh\‡ã`9$G<j£“²?8&è)GJ°¨¸$D+fa©ÞaiéÙð˜Â¢b蟓Á„Ô¼ï&ïÜìŸWP ©i'­Üb?ÕæLH‰xö1?M‡Ë”6< OŸ>Ò{°ßÏ—-[Æ};eß„”ÐѳSâ¿ÿýonÈ8ãR—Ýæ8´¡1)FÂ\9»0ðœÕŽß~û-›5 ‡:D¶…oÖR‚¨äâÙgŸ¥X{õê%¥ü¿ÿý=–˜úgñð•W^ÉjØ÷ߟÍÝQ¨Ÿ|ò ›µ°Jö©§ž¢z@OY¢ã¤Db•w,JdÕÁLH y„xÁEÎ8ãŒË/¿œˆ…aäÖtn KLh,´ êÃ[o½ ‘ÀB6ß³gO¡õW_}5€sßbæÿ)¤Dg'xˆäWW&gFÇ{»Æ¸¬ 02àÍßv?òCÀ›Ÿ‡]Ù-ü†wCmžñ9ã¹€s^Þý¯ùÚ<íwñë^—|ðâ—a³¾ðvï³~ù÷‘áNRÒך7OÓIIMeYhLÆOÓÝ¿¼ëû¿w­pŠjllxêgûßçz<©°hϨeßLØùëLG{oØæ“°¯¾J7äæõ›åõÝ$×¾ÓÝQ~°ƒ»¿Zû×Bßo&íüsžWX|vãš »b¿¿ãû)»Ì󆦄Çgý<Ýý»É»¾™¸sÆNé}wèö?æx}ÿ·Û·“v:ú&6ÔU,Ù$|òë,4½Á^¢q Ì“lƒ_ù} ÂL]<àΞ¶ƒúòÕlûЂ¢bƒ-G³.@)ÿqã ùÞd¤ß,OØŒ{pòà’}ÿùd5±6Ă‚âA ¼¿›´ó§iî~¿!)=é¶ð;b'¯E¶Ÿ§¹=Ñuüª ÆýÕîÁ)}yÒ®?çy§dæŒ"{àP„¹ö»‰á‹±;V:GAJ^úmsM5 ß°ô隸ùÅd¿=hø,Ý£ê3ÍãÇ)»~œê¶Ò) KƘåÏõÝÔgºÇ&ÏØŸgpäæÁó^[Ü{ã§£]¼CS-t»i±Ó±†æ¤„ž÷믿–Ž‚5}ï½÷7°2„1"?ÛÉ$Ð,)¹þúëE˜¾}ûB’àL¢øÍI {G¡‡ =Äiì&.ZÊеYŽf)A¿¾úê«ò“O> í‹;:…ŠED&ø¨¬Ì`Aè#<ÂO¶·Á–ÆžXP~¢}¥ÝYmö[+˜9)K ÔsàÀðtRBÌ@ÄÙrõÓO?-ä^Pe6–³p#{ŒvÚiP–åùÇ‘ÈÍ^N\d%ÞÁýY¥¹¹ùÙ™¹IÉÞIÞI¡~ÙÉaY!»3wçædådeøÆäåTTif¨N4}s ¡êï5k\µc9óŠJÆ­,()}màV¯Ý)ø—W–=ðmÓfÿãׄ ï÷Õjƒ3icL%Pøp£Wò¢Í»yúôÏö¸ßaÝô‹Ì€©ð¶¡¹XÍ^w?ñ¬¶>d…“vˆèÁ†ªØäœÆƒ5Lßா컿Z—ST:r™™azr‚mÈ—˜šÍnÀ âgÚíþ{vÚð3¿:8ù'róïVm}uEãA$9Rð×b_æ °ŠÚÚÊßfzî)+Ýì·xKX}C-Ÿü0e—oXZhlVÑl£ÇWõ0 ¨tfCH¨²¢œÉx@fŽæýç|Ä”<Ò›£¤ %Õ“×mñMžnºÉ D5Ù?dolrîºÑ=¦Û‡MX(àÜÐ}•©kC¼“ uª^¬2Ð,æ´2² _@‹ÅTµ0Þºí^]UYì?×;(>.…!„/ŸûÅ¡²döeÕ¼5úê1Ò¬Öðlð‰H0O;,ô–«`<ÜLZëwò!¥ÖpGÏ5û4¼ñçVƒxãVm÷M`ÎèíAŽhõyEÓ×óÁ}Õ˜¾ZìP:KR"^zO¶p¤'ÅXÍFGÔ…ÖÁÈÏZ?nô ò¶Í¦9)a„o¼Që öî…”°÷õ,ãÆC6”=¤KIç"%Ò¿¡eÙâ•W^‘„6eµÖtÎ9XËÞ}÷]9\<ʉ(ÄYgEHVŒòð¾ûî»é¦›8VP¦3º /ivúFŽ*Ä"¢“½ ÐR‡¿@†{ìLð¨'ײ …ê!6¶SO=•jÜbÛ±"R‚Ý eOE™>}:]‚ý YôË®$ÜÈêF3¸µNœ8‘¥Â0V.b£z9õM<•èS8¢Pà7Ùi”Ú&ç|rqœ0ñ^ÌMMµF2Z{u"G×ýõÕ³íB—oG±Õ'¤åM\X\Vþæ m(LmÂ¥¢ì¿}8 {ìaèR¿-^ñûë˜Ѫ Îÿ_ÿsë ý6ßùÅšéBè¶{ŒDÍ7 öv¥ YÄa•µ£–<þÓÆ7n;륅¼Zà†ãœ.ˆD߸µ¨Lsb¨©.îW´ñC·?ù“Ý+l¹ÿëu;ü“˜/`Ê­\YQºxkøú]𧃆<Íʺïž^kˆ$,>«Ç(—gú:<ôízÃýšªÒú9”VV<|;Á­ÁC¨Â5(i¾C8g’"Øôõ!÷ôZûÊï[ŸîkÿÃß»Jö”Œ]š ñj¨-êG»ƒë?¶Ià «‚v&F§ÿEá¬/H̰E¾Ì.uyŸº]º—îÝ»?øàƒÒ!@Jn¸áœ 0\s1Ÿ"½J‹½jkmúFÄ@ÒZ)ÁtD·Œ`Ì\ ›Ùʲs‘!à‰âÀËA@~â‰'äø!Ѭñdqqí$lTA1ðûÊwÞù÷ß³Ñ-Æ’_|kAWšÄi–”È´ûabA–¹È;œŒ™¯ë®»N=æÒ-%l!·ã‰0~,%üm‘Ù[)¡áÉšcÜ‹øûè£Ê=9Áዃ*È$‡øÔ0í'É3;šp#$ø ÷ìk^ w¸¿öÚkñN‡S¡/./t˜œ˜Žã¸œNDJðU\²5|–Ýnœ(ðÁgˆß¤ˆDtbö§£wl÷Ã8Q?Ù6Qü$¾›´+65wï¾úU®qKËKötûk[f~qrF¾[ìlûÝ=ã'¬©«gH}à‘ÞèÅZÌ$K² ŠvÇeâëppÍ‹¿ma~G HÉ#ßÛ•T”O]’™[\U[Ÿ–—‘]ÀŒGHªWH î#³ív/Û)ùßo›3r о·|ºšùì=Ä?:søR´/Öˆ?æzŽ_æÏdébVYá‘_RJ´ Yt:xHü<ÝÃà3Qúë,OüiPºçC¤ê ,ÝG:çäæ–ü6Ç gœKúÏ&ð>LA¶ØäìÏÆ¸8ø$­s‹ƒ'¥çGgⓚY°Ê9r­[ÜÈŽ> L<ñÉÍ=V¡à Kò÷À‘*Ÿãé¯tÇW¦T2r «ëjì=“ vlðÅXרŒ|ì4°º¿ù¹‡gŒ\âÊç¦x² ‹ám{ÊC¢Ó™söKœ²6˜’LfµÀùæOmᬈY´5|‘cl-v™šj×Àd\[ðá!Âà‹ÃdV–’ƒµc–û{„¦U×Öì)ÅMv8t±ïxÜYÓr» Æ"R÷åØiYù”Ú°%þ”.,ÌLájƒ ^&cVPs(}ƒt1–˜XJ¤ÓÄÕ‘mxÅp—=éa¹˜°ÓØõÅí¥ÇoBJÐ…Œ5ÿóŸÿ0”ÂóÇd¦ös³mQ6}I°Œw9³ ^‚S03ø”pbm§ó)aäÇþôðË9v‚+fÀ ÏÃ?þ˜Ñ,Î=ø”°Û8Z™‹â@e0{Å–Zr˜0®'¢ž»LÓ0Ÿ¾‘%3Œÿ‚y+ªó\Lqʉ.àÆÎal្’‚¥€'0xÌ*lÚ>gΜ/¾ø‚'À¤(\̼:6\VDJhöPT¼ºÈõž <öØc˜Oع„{úv1Á7‚ñƒƒ†ÊóáÇÓ6.¹äÚ ™¿ãŽ;`Üðü”SNÁ'‹ŠÅI:°!ÅÄÀd­˜X°¿=ôÐCú¾&zÔâM'"%˜’Óóf¬³Ââê IŒ€ûÎðDAs‚ÛºD\êè9VHÉ~n›Ð¼Sǯ döµÎ5Îg~Þ4kC踕sìw£ÚYÙ±Ê9jô2ÿYC_êïp ¾ ÝÆÈž´Æ® Øäw`_^)ù…ÅHëÛIxEÔ:ù%Ž_0nE‘ãXzpoÕJ§èU8»ì­¶s‹CÙc~è7Ó _TÒ'£œPíØ9ð2™høç\/Ífƒ¥¡ GÝ'¿]¯-º©.Ï/*fí1‚ázB6QžaqYÓÖ‡¢¡ñÚ¹qwL§6î{è;̰{™¾yíÏ­ÏÝ´uKNgmĦn½k̈%~ó6í´ÀÇ=4µ¤tÏ¢-áhåE[Ã>³·Ù‰®A)Ë¢ð EÁ#aQÎ*]’!„ÄÚD„ð†Ç¾×¬àŒÀ¬éº.ßR&žyÜÊÀ «lÞ½h[Äîøœ%[#˜º‚f%¤å‚ ¹À•ÄÞ=ö`C5ü`ÍŽhÈAPLÓ(†ä\ÀI(¨!Þ*daÔR?˜¦{œº #Óm]bòó‹0)Á* ( MH;÷XìRLõ¦yí0ÛCq@Ò¨åþ˜cƒÄ.5m] ¦ sÆ¥x¨Œ^îÙìHgá¶ÕË';6sŸZ=3&“&Múþûï1SË  ¢†êp Wû¹šštZkÛHra*ÎËËãI‡¨=Ÿ3ý3ýª „³‹èÙ,¬4æ>%<(h¶þùçÁ8¦êàÐ,ŒñØÌ ‚?.F¨[ò/dÞ ûUwW,Xh+ü Å¹Ë\椄 bt($h(ÐqÇ\„þŤD¥…¡¢^ño%<«´Ð΄á Ç yMv@1ΊH óv ÜtɇàpOÕçž i„º"VÝÈÛ‚vP3ƒ¿†|`Ĉ<CËý÷ß—5>kÜã¾DUƒ”pªŽÐ*%æY|‹,Ä$@'"%tè ¨Êhkù©-1xr ÑñmDÏ¡P70u²·:=«P[*Œ“G•¶ƒµx‡°¢ûÄ«lÉÌ/â ëwX‚·&„#2!;&9…Š{)Z€ž?1x¦ƒ´´Xnà ñĦ憡¼6£RVÊz™üBH’vÃfX°. ­Ïbþj7™ùQIZBÙy…â@б‡·à ’ðúÂsÒ… ¿f_,-ÕÖÚ””`oHÉÊÇ=%+·èýaÛ³r #²XT!À¤‚JŸ|ÑÛƒ?ú…jÀOj‚L^ðP<$øœ’bÐ%{o´ˆ³õ0'%@ÁÐÌbF’¦TKáÊ4  7 ð£#Scü$<ÀJ â'v&N©Ã Øi,%BJØà•,ѹoLj¬‰‡˜ãGÂCr%ªÀO˜,÷ &˜ú½÷Þ{yÂO* s„^x!Öf…øK0N'Æõ“‰îqcN×&%MiÃþh_YªÊOyņלּ`¹ÇßëCQÞÁöƒ ‰i Ÿ¦{,ÞÁ3^‰´ây#qö5iO_ lx®%/™%ï"§°=þé‚i24åB[²+%ÕøoŠHÈ÷²Ù‰¼•bmB^ Tã+ZvEÙ$¡Ä)òc ŠÍ„ŽvLÑ"“\khP":"’á­öí!0õºÑ©oŒI‰¸‰ð„~ë7Æ›>‰Šj?Õkb)aHT„éX;„ )ÙPE&(Ysehvó4x†À«/¢Ä‘YžˆV¦Ä¥>È¡?MÝ`Ñßv=FBîšõ)ÑÑÐ+$ÕRj¦Tc0…äéØJe+Á³Å¦dE–޳ÑI ̃{æí`°­óÏ?[L ‡^œŒ˜Íruue20ìB櫘¸á'³ÂBY¦L™ÂOì+P]lŒÌÔ0%Äsbk’0Ìá¼Ö%-%²%°Ð ¹øîµëÐOy^R\œ—ŠÑ}gJ><ü]IqIRZCzã0‡cn)-‰íaš¤cÛ MBí•ោ9$¹YŽøêÐã<êQŽÄ4¶äŒœÒ=’»Cé¾ÑJ¾XDŸ’“ÎâBNd(| o›¢(”ãÓ[üê$ ·¡Ï< ™$AùršìÉO÷›â¤$**ÊÇÇçàÁƒœK§®öF ¾¾¾°°°U§;88üïÿ“Êš””4dÈf+nrròܹsOB¦ö´_*TE—£ÅŸ‘‘±jÕ*Ž+"@\\\DD„yÈÉ“'gggókXPPÚ~Ò¶*æ9sæÐÖZõɉž?>@µ½½}¿~ýZ v⊊Š8Ü’xüñØØXKBJ˜Õ«WÈ}»VQâ«%K–X.ÛÉIøá‡òòòÎ9眛@HHȯ¿þºpáÂÀÀ@]ÔåË—s/ìß¿‹ò[®ÂÓÒÒ,ï©80•>^µfÍm‹’´U€eË–}òÉ'm›Š§EŽ %¡¡¡+W®¤»¤bQ;ÕÕ®„……1ÄG´XHz€áÇŸqÆÒáúûû?ôÐCÜpPóúõëgÌ˜áææÆOô4Çß}÷Ýt+rPâºuëЂ¨p‰'??ß\…ïÛ·ð¹¹¹cÆŒÑG~;vì Ë@™1Ø’o˜„/^lÜãÓÓñI]]ÁÐ|B3–td3gÎ\´h· véM±ñædžñqãÆÍ›7±¯ \/¾øâ¬Y³äI.fÏžÍßÚÚZ~rOöGÅ=Ü[7ôqÓ¦M#~2ÂÏk¯½–n”\À³y%ÃD" º]IôH!ÁS(Ž\|BéOŸ>ìKä¾¾¾ü1bDff&Yæ+Þš¨yb@×’:ý&…"¢rM˜0x$_ˆñ /p*5}·ÉI–ñññ ‡ý@RR¤BÙIŽh¡üÕ T”EUUO0¹!$XøÙÐÐ@–¤‰SLDT‰o¿ý–ž{Î]I°"×z–áp+V¬èÝ»÷È‘#õ‡Üˆáäï¿ÿ...† R@ æº@<$-üZ¤ò ó0ˆQ%¨111 Ú Tª HR%˜ð<”hùHæÍÏ'Ÿ|2%%…‚6Ršc,¤~OZ>ú(ZD*ØÅ_Ì߉'êæšÏ‚ ° Hqƒ[zz:7Vbb¢T6ý"$!ƒ ÌCð׸>SÁ0ä §´ ÔXK<àO¹P¼½½‰_¯3ááá$JYÐ40f8::ØÎÎNr­_ädÆ/EÀ å Õ&Íw £"a$$t¤OŸ>çwž^!%rp¦¢RÁôÚòöÛo¿ôÒK&ŒYj>•Îg×®]R·nÝJTl“R P½Œ¢çá©¥6lù¹€ (hƒÜ“ú7Þé¡ÔøéêêÊ+Âx‚|BK¤†H¯EAP“úé'úO~R–.]J…¤žK`ð!GD"Å*ýMAPôà,õ Ìå-Í-224 =edæ!Uy¸¡QÀê¨N£G¦ÒÊ'Ò®]»V­€ Ò‚¤E“}2Hqë¨Ë8‚”P*´X {·ºN ôÒÙYxÑ6hr2øãÛ矞: ÁƒÓ;ôíÛ×ÝÝ'o¼ñíVšoÑî¼4h­KÛ;ï¼c’"-Šhÿýwš¥ý£· AÐb g$rÆ…D5`À$!€H¯5†6¢wà^Ò¢…ÿõ×_ü¤}Þ|óÍX>P9˜‚Ñ<$Z^òÝwßѪ‡J§Ol|ûÄOðSô.]ý’#~¢*î¹çú&îQrèiúJ~9BÊ@ R?ƒéÒ}÷˜,MúÍaÆÑ× 0Ô˜”й ÆL¢P:£—_~ùá‡&~4ëØ±cyVà`<ˆ§ïCB2+€Ó]"ò¢ÀHÌ“W^y…Þngœ"ŠaˆPÃ¢Š DŇèEdà+z|òþ矾úê«p8`!BÄà9RhPšˆ*Eüã? ºë®»>øà‰‚!â!?°P.¼ýüóÏI—?üðCâ1®7Üp5Þœd„²ãÃ/¿ü’ž~ŸRðüã?Ð|dM':è0Éì³Ï> ôã@   ¡Ÿyíµ×™Ü ûå—_ÐIÜPj$AB€O¥"uÈåøÕW_ñvÂ+d›ÔdJçþûï÷Ýw¥SEiˆ 2(W¥J#™%Ë€l ÉC’)Qur‘Ô9o¹¨ZÔ^Ôð\@Y ¹¦’#JŽu’tÍ5׈>– ù`)\ꘟŸŸä‚ëÍ7ßD•BAÌÁyÀ¡P„ýÈE·Ìá:äZxÀé§ŸþÛo¿I¾œœœL@ZM ¢Âƒ-À"üùçŸoLJˆbM &wÂw©xP:“¥™Ó*±µÐ' 5ŠtIÚe’4>öØcbSA©cw!~Š€ú,Ðd#³ýôS„o•² ¤`60c˜·tbÆú" ÷Þ{ï¥íð æG´§œrŠÄOZo½õUñÖ[oE`b£±#'ò )_¨-Rñ-‘ÐÆi”©@Ø- iÁ™{1•ŠŠo3Gý´#H‰%¨0ˆ*ЦH;A!¡ƒ1$ÐDi-tÄHE¯†à†6#7(6Fä2´âºä’KøËXMæêyaÔuî¹çÊO:MQüúESDý íèŽå¡hý³Î:‹ndŽÉUW]E—!¶®÷ß±™«¢Ï’'tˆ¢³õËÄÒÎ(„ñ¥>4‘`äš>…n­F÷Ø<¤§£ƒ 'Õç¶$p÷îÝEÇ0òƒ±¡u¾ùæ}ÄÌ Ü®¼òJsáMžÐÏ}÷Ý'êŠóÈ#H˜¯¿þÚx޾^RÔ‰R^ÜèùbP+<òûï¿7W$ؤSã’AF2Ë ù7´,ݽÈ@ŠR!˜(KbjO¾E]¡,|ðAù _aœ*7bKCáÁ“d°1¢ ¸9í´Ó$<Æ#÷rQ1d ‹B‚yÈCâg,Kç.ô”Kˆ*M ’q$¡òWFÛêɈ0'z†§Ô(Ê‹ŸTi"‘8•€†ÀRÂOº{4 ¹ÐÅ0–S¿§E ªüÔÁGRލj}rA*<hêÃô¯ä[&{¹§àhz¨a¨? òÔÔŠŸ'W_}5΄-ѱ=è²…NJàd”…+ÐaÐn qÆ3 ÐÒbþ‘W¤…œÆù¢"ÁÀšÅê i@ÁSÜæ¤„öH ’šF¥…¥qCe†m˜Ä&’YØ€¼‚%mކPÞ2èÕ«—ˆ È… ÿùÏŒí@0!8„Ä 2¶àzyyÑËÉ«ÿþ÷¿Ô@ M˜&†¾§,xŽ)Hj/4ä©{zŸcœ :=X‹”5J&¾õºAltb<' }&-ZLŒ¬4UÊEj&×ÿýßÿ‘5(—XSÀ¸è`¡Ýpn ÓÞ3†Æùê’÷Š”t¦b¥…Ȩ—ήí³Ï>£s¤gÓ%]ª¸¤1 £;Œ¡§›ÊØÆ3ÆÑr‹v¿ð å-ß2¬áÝ ß¢¹iÕŒ dv@¿PôúOZ54E>¡CJèhä­:]˜;î¸C·¸ê1ð–8ÅÆƒ­…!‹èNtÆgù“†"2+6sØʆ´/èÓ…uÑÅËø~Àˆå-¶h.ÎBnø"ý"fO’â¿þõ/òrÛm·1H"˜ëÙä­Þñ Å IÔÆg1äèù¢óâ zÚ¼O'¿¢ðô Ò&üþA߇¨xW )y"ƒ<ô •·ô’º- ŒI d\=)½ „²0–t©E&¤„ÌÊ+ôŒGÿ¢ Iõ º¦[J b ”‚ +¯¿þzîQWB>Ð0!*Ã{ï½ÇOL Æ•„¢¤‹&ʪ( ½z'­ßCe èòåQaxäN\Êš ¯B羉wˆ9)Aó‰­‹:@õC££ÞÄ)±a}1ŸO¡ÊI¢ ¶èÂc÷p—T èB*°LåÈ%¤DÊ| {Ð+ XŒq \ô<öèу:Ù,)!]º¡›-é0]˜”¾ž•íßÿþ·žt,B»/ª“>ÍA¥Õ%Á¶!LK¥ºÒŠÝ5`o¼¢Ýñ zi“˜á@˜@àÁFA”¯´VjÚW\¡'!•„â uIF,rÑ}ÑFä+šžXvu I ã15„ÆËs::}QÓ€ŽOÚŽÄ#¤„GOT*-¼Y¯öXòx{ÓM7›»LPR?@¶ £Nݙ̣ÝѸ´U-PúAzILߌy‹Õs"mÖÏP‰Þ-ŽôtŒNÌ]óÐ(3ÚñˆÊ”Ñ<2¦MÒy1p§SF¥ÑA;‘VMÇGócR€ÎQ\(:Ó§žzŠ~„·htzC-ñ–Ž’xŒ'}yH¯Q€F`eå'–pâàB<2KB×Ì(5Œém' ƒ‘£mnd¶›¾LT>ý7ôMD‚âA ÓØÈÏ%K?È/Ñ+Ä`¼<‡˜…@p;1Ð#K¯Š‰E^‘e˜Â蕇|aJ'£@rtæ™gF|>>úè#^!E IëúÝÃCd“Ñ0’oé»Q~Ìæ<ðÀ2ôäe~µº…Á} ëºë®ƒ @_ÈæºrÑšDN %väA~Š@ÔÄ‹IÀî¹ç(ecÁô¾›A°XnøP” ý5¶"À€ênݺQEÉ…¨$Ö)±ä¡¨ |‹öEy)yžCÑŽ(-1w“‹§Ÿ~ZR!³(!ò"ü•z¤TrÑÐ\Étg]fjš[llºð(KÀD€*Ï©ØÒh¼ýöÛÅíƒò¥v!‚ Rái•X,@[|›@Rè£\t†€@ÅãžqØk1•QÙ 2ÔFú jˆôNT*i„ä+r„͆b%Le‚!Á¤ò ³nl9ºPf¥© ¹ATã9AlÕOs)éLµ‡Q´sj¼XûiiÐú5h„4xþÒsIãËã- †a™Ì¹Ð’Eµ_|"ã:_´5 žæM'ËW °]€¾ƒ>Ž„0uÊDÖþ˜=¡—§'B*ŒÉ„G^Ñt‰±o¹å™7ajƒ ã>1Y @´ ’èðk#$2‹Drtôé(-#útÉ&º%Í <ƒ.€¾€ta$$'½=}™•¹g"*ƒQÐ@Ð@q"­(Ný>!uD" t^ˆ'¤D0'ž@ŒÄ V.R„mˆó2ê‡݆¦IÔsŒ®´Åô"€CûH‘P8oÑÖü$BF‘VÔ3þ4üEO¹üoÐXäEH ‰±,©@O…)’#>—a:ãuƒúLÆsôàèÞ2hÇýÒa”.)"!‚‰ã0ÕŒŸ:Z RKA`žº¡B`iÒqS¬’¨Ô ðÑM÷X)Pxæ9©0jxeÀJ„ñ£ÈW¨¢®L¨-ÁÐôäZŒ%E&æ4ä¡LJwú`&”5&ÆÉñIR„Íð u%f'@&ZÏõ‰3Zð?ã‹Ú‹0¤È_©·(?R‡ß€1àb) C¨r2=¡_hhZ1ºÄ„‘úˆhé&ιÔR@¦Ù"6©(e q¤›L†Bƒ°hR|D"²Á Í×i3¢Ià ˜<) nhDäBŸ=ÑE¥k¢‹Sq"0BR¥Q@(‘æ &AQQÛZjq,!Ébü’ç0’gyj÷BýAƒÏÉ Ñ‚hÌ…QE¥½ëR=, i0¦¢²Ñ À„: Ñ„–ѵŠÿ;ý‰ÜÐË!õVÅÝ vE&_ˆ!—Ÿº[.c*ú7JžÄ+zQå\bÒ(ŽýS‘’VÁe]u7IúÚ°±×$‚ê*Ÿ·Üû¸;âI–è:Å€÷×—„Ð)-íY™WòD¾Òãá¹ÜKZƽ¤Ì¤@5ı@’0éFå91›ÈI´ôk3:•äÂXxã} $°¾PHâ¤ë1¡>‚•<”Õïü4&ÆeLlˆ*€˜€ÆW&i£r ' «Êä×dèÏOýC]aPÛ2tÓi÷ˆg’/Ñ:2:¶ò„NÜDi™”2?&¡qíâÞXèy¤™ ­×4ó I®É‹És†ªBCå‚l1‰ÙìÞ”»Lü™Ç ˆa 2êP§Gæ…h^©ŽVк‰Â$€Ô7ãâ&N“…WÆŸ4ûŠƒ,–b&grIr„7ŽªÙhÅDaü¹9bÆOÌO°5ÁÐD=NéCt!iM\&E&²k±ÈzIDAT}!‰Ó¤MW$c1[¯«D¨'G¥æ£1¿’†Ùb`d3N…ðL*æ “Wg³åÒbB*(R¢ª† IwÞlCD…3 d0ÍÐsEƬ¢2F€É{ÆÙ] 鲨A.FÉÆsgÇ—}47>@ÆÓ%ÇCjFŸœ‹•´''!•ŠBà$# HÉIÜJ“ƒø·ÇÄ':ƒyY,·ÆsV Ag gˆÙìò$c†÷‰‰9ðÄ`°ËÄß1ì&!þ 'íÒw9i)ª„'EJNÎ*…€B@! P(Z@@‘UE …€B@! ° )±ŠbPB( …€B@! H‰ª …€B@! PXŠ”XE1(! …€B@! P¤DÕ…€B@! P(¬EJ¬¢” …€B@! P(R¢ê€B@! P(V€"%VQ J…€B@! P()Qu@! P( «@@‘«(%„B@! P(Š”¨: P( …€U  H‰Uƒ%B/Y²dáÂ…Žª.…€B@! Pt8C{éÒ¥“'OŽŽŽ>¶¾S¤Ä>`a8q—ƒ|9%•kŸº …€B@!Ðy@ÆÄÄp¤ùÁƒ¡S)± Âa‰’€€€=êR( …@gC ºº:888==]YJ,Ñø ¤$00°T] …€B@! èTÀ jjjBBB)élÃB;5)Ñ8}I :U;:a»jN›FeÿŒB<ž‚Wß(GG@‘ }g ÖyI t¤êÀ†ÆÆ²ŠŠ®ÍKÈy¬kl¬nl<ŽœZ-¡ÑòUYYÓØHÖÊkjšøeg ˜V ©Ò_ Š”t&¶a¡¬””P«Œ]¿Þéý÷KŠŠÊÊËC[wŠÖ+Œ¤¸ À«oßÐiÓ*J[£¶Ñô5°Šº:«‚aÊ««ËªªvÏšåùóÏ))ÔØZX¥Òš žüBÒŠ}û–²àþä  RT(EJ,Tô)X³¤¤i ˆQÝÈ®®õ·Z ý_sêÄ46 £ht£×³#"4ŠÓ8ªúÆFï?þøÛƦ$;[3–9ÐlÌ[rSBÆÂX(ž÷#³Ó|¤ýÂS¿iFžæ`Ayef.»å–m½{‹±DÏìá²8ÔDMR‘øMŸ>÷‚ 2*á%G‘¡ù22–ϸ¬É²áŸÄÖTš‡¤2¯'2ÿ¼¬¬´¼|Ç_L±±™ac8lØÒ7Þð3¦¢ººåšvÖÒlîgÍ ƒT½cáp´ Y(.®Ø»7ÕÝ}⥗fVÔ×óD¢U—B@!p’ é)Ÿ’ÎD8,‘Õ„”HÇ[^U…Q}¯ØÕEIìÙC_ÌÜÕpC-d}=ä@fxXImñ4hšMYn.! _qh @Ì0/ÀCã,˜4Ô ‘ðÕ"™…Ü0vç anšÐ¨®4øG6Q¥"?²1²o§´”{ 7"/’žÈì’žùÕÓÒ¢9’rÉ4 _U644ÁRU¥‘’ìì•wßíÔ§O•M¼ÊJ>ÇD„´ZºÕHHÄÐrd(,¤­Ú¿?ÎÞÞ¥Gü”>‘ª¨­m’Aòb$°Wm­`®Ã¥Ý—•éà#C©!õ¦j@–KKy¨•fe¥¤ÂOʈØSV]­}n¸×Êtï^-êª*ò8߯&ÕÉ‰ŠŠü®_~»v-°#¼–ÁÚÚJ½¦•—S'RMÂCEskÂ&$ÉUTpC |Nqå'hy ù‰HSŒR’(ÏyÛŽ¡²i9ª«#0WaJÊP›=yyܹTݓܫä Ú"%–(úÎƘ”HÇŠÆbB$tæLû'Ÿ š4‰1ºÆ$ª«SvîÜòÒKyIII»vmzþù€‘#é ³cbvõêå;|xü¦M[_~9ÝÏO;2hm¦¼<;::`üx‡^p|ûíÄíÛ €Jã¯ç¯¿º}÷Izýþ»[ïÞiitúh¬wwÿ1cÖ?ð€ËgŸ¥ûú–74 *Ðjhš$''"qþ補¸8”ß_Í„”ìÙã?jÔº{ï-ÌʪܿŸÔQ'Å……A“'o|ì1ïAƒŠrs5ýd¸+Ú’äwúðC,ÈÊÚúæ›^þ ©BÍ»ÿôÓÆGÕôÓÞ½üÌMHþûoÇ7ß´ê©øÍ›¡>èþÒŠŠ8ŸÎKN†g‘û?Œ'@§æ§¦úüñ‡ý³Ï"CYYáÑj.Ÿ|"ùuìÖÍ»B#¼DcLÓzôéCr$êѯŸkÏž%×HÉ*HÉO?¡/Swî\sÛm„Ô”}iéönÝÇ']òXRP0j”óÇ3b÷ÄóçƒR‚££6?’–†Fßò ¾Ã†'…å3`¼ÀÉÉ<_ÿàƒÁ“'çÆÅí)/î%‚Q^èÝDgçm¯¿îܽ{ÜæÍEyy(iêCà„ š²¯ª Ÿ?I¨9EÛÞx#aË–âÜ\¯~ý6>òˆV…˜kÛ°aËk¯íèÙ3Íß_øÍš»î‚S®½ýöÐY³¨u^¿þ ¼ÄF€uwݵ§°0ÙÍmëë¯ûO%¿d &N,ÊÏ—‚Ö ”›êƒÇ£z XØ¢E¤K$6 äž{.fÝ:­L÷í+ÌÍÝþÞ{Ѷ¶€ ¢’O CÉRý¶¼ü2ȧûûSå,7>žÒO°·/LO§¶lyåû'ž˜nc³éé§7ÿïDž¡x‰R “€"%‰mX(« )ÁŸ³ê–[ès§_zéÌ3Ï\púééÞÞè¼h;»ñ66ö>ºèâ‹'œuÖÎ_Mض`3/¾xö¿þ5››SOÛ¸õs˜” ÛöìqëÛwÚ™gκꪹ×\ƒrÿî;màÀºGvÖY}tƹç2 ³æ`(ÎåW\1ë_ÿšuÍ5s®¸‚hƒ&L ÇG‡¹ýü3Áf^zéÔóÏG†tW×1c€öuÑEŸþªë®ÛST„"É ±½óÎYg5ãŠ+f^pÁêë¯Ï-g€nd™`Ä DŒÔ'ÙØ,<÷Ü—\2óŒ36>øà2r}Á“Ï8cíw2|ÇÒ0eÊÔÓN›}啳¯½v–ÍÖÿýÅ©Jrt´½åìš9¤ªj®MÔòåÈÊÂsÎ! 3/¿|úi§mAUÒZxÆÀe÷ä“S/¸€9 Ÿ5Va¤ûшÅ99ë^ziÁW,3H>å´ÓVßx£6e“—§YJ~úé@ccÔ‚Cll ±Z•C˶¾óñ“ëW_=ãôÓg\|ñ¢³Îšhc³ë›oxî5l°gøùqÏÍô£F²`H½òškø¿}ûd›)Sèý¹x‚: 3Fr›ìíÖIܺõ0)1 ²ÑÖÚäê³°° 5e†²ä[ôœÝsÏ-»ï¾šèÙÆêúú—\â?nÏQ¨êü|Ƹöo¾¹â¦›ö䄇A³˜r±+ ª©[__Mž}ûˆ9jåJf—6>û¬ûÏ?‹œ\.Ý»oxàì˜7­KJpÿ\|Á(r±ÉûŒIl©nnÜWÖÖŽ´±‘¡6„¬“Iq1Ê -5ÎÆs©0vßúÚk˜y@ 3À‚sÎ!_ééK.¼0lölÙ\»ìúë}GŒàº³ôÿþO¤ò:tåM7aŸÐGØš¥R’Ÿ¿áÕW7¾ü2|…`$H»çÍ«*/×IIÌÊ•cml8RRVZºðÌ3wtïŽ ›ž}媛á Ï_~áÆoôèy§–Êý¬SNÁÊB`.ßQ£VÞygEYvH {ñWÀžg˜ëiRùååÄ òéß_bF¶¼ÄDd›sÍ5X³„”xºøÖ[±”` áfãÿ‹³‰„™>}ù7VjWä²e‹N;Y.ÒCÈÜ€¦¥-¸ñFŸQ£ˆ-Ñɉ O˜z\”ÎÒo ž>]Ä&ÞÍ OÕÒ QyŽfúYg¥yx@m¹rÃÜz**eQ‘±öŽ;B§OÇvµôÎ;>ûLË0ùMH€›Æ®[½råŠ+¯LÙµKäĪ7ÁPÖùQQóÏ>Ûñƒ*ªª$*¸#Õ£ÜA­º*×¶jT¹ï()‘ΪK]Ƥ¥X˜‘±øüó½ûõC `P#ôѨáÒ¢¢xgç™]”ΚÞýôªçžC”ÓׯzàLî(ŸÁƒ7<ô÷«o¿}öÙg/¹ì²Ê‚‚]_}…zzqž@/jÓ7ƒ¡,+˜ÈÀ}aÿ~ä 1"70CÅÚÇßòÑGvo¼±åãWß{ïÌÓN#kúºSM~îúî;@¦Ø¿óΦ·ßvx÷ÝY§æôå—‹n»Íwôh nOYü»”ãGy âðÚkZí22P–ã7p`IbâÜSN 4IkÅÅT4OO*?¦) (åèÚQI¥ûG@‘’.EG$3¦¤„þyçAJÿ1 E[`šÆDÁ´H‚³óôóÏO÷ñÁR¾‰\´h„øœB2Rœ›H‰Á••îíÈX6Å×wɵ×2Èfª¾(99xÌzs±”h¤äÙgQ!è$YyÿýÛÞ|3ÙÕ•9šx{û’´4ôÊ‹/®..ÞññÇÌŒ857ˆúz!%0•=¹¹š {÷¢†C'NÌ Âh±î¹ç¿ùÆ¡{w‡?ÞÚ³§ëÀE99âŠÒ9‘’Õ7Ü î“’çž›‡ÖA2E¿vmqjêÒk®Ùùå—)®®yÑÑ)ŽŽ ‘s¢£C–ÇwÞÁbÇçŸÇ;8IÌڵȹ™D¿ü’¤`[¯^XS4RrÉ%+¯¼3Á|†ŸÖY¹QQ¸Ñ Œ6ÚÞ·„”8}ó 9ÂÓ“¯–]|1@áO|xúfÑ"0ä­¦³«ª``’’””¹—\íà Í%lèûfI‰ýã“_æ>ügÎ\øïçDF‚dVXXÄ’%p¬Í¸þ¼óÅM$µ"*L c¢j÷œ9nßÏ$WŒ­-_M¿òJׯ¿Z¿qãÝr‹XJæ]½ßر⠣‘ÈÜÕWã¥+űíóÏzöÌÏÏÌÔH‰½½))Ù¾*8”²FW®„”lÂ:rR ÔkÜ8 Wæ²jð/R2çºë4™ ¤Äí‡æØØ€ÿæO?%Ý-=zléÙ3|öFJFޤЂ?(/»ì2çÏ?÷:Ôþ7ð;!]H!bÈÑI‰8 i»ã<ˆ1†j«9>ãðdp½ùÇ+€Bàd# HI'%šëeU¶·ßŽg }=:ÆáÙg×ßsÝqì–-3.¸€®f$¨«c5˜âµñž=cÇÎ:õÔÄ-[4·ÇÊÊÍß}‡zæ«x'§9§†Û£¶è£¦ÆwÀ€Ã¤äÙgW<òHõ¾} XS=<ær ®˜U%§æcXQáÜ£ÇÂK.Ù“‘‘ð5_ÃF„Ä"`Ø0,%:)AÃ*Å«‘)œC«Ðj ˆšèà # Qf¡Ë–aÀç'–˜í 7Q€”,<ï<”°¼"~ýúü°0FÛH¥-©¯^¶ *841!`GÁ÷–T ùÉÉ«®¹ÆoÈô1YÃàꂵ4YJÌH 1àdzîý÷“wìºâ¼¼õ¯¼²ùÝwÏÍ4ooì.É..L;­¼ç|J /ÌGÀÛ¬§WÄÛÙ£:ØîÙg™L!cšì€àjfú¯ 'ž8LJ®¿¾ !¨rbcÉå¹j‘ÃÀ¸÷›3ÇwÌm^©¶–y1Š•‡L9ayÚþé§К'Ÿ$ï$]˜“ƒë s"BJæCJÆÓJª¬ ÿéÊk¯ÍŽŒÄ´ÃCL ›6ÁóÒÒÐú‰›6&%£GkÓ7Û·S €8,Ãð4²½é&ï?ÿÄ·¸ð<.­@óò\ ŠÞ¸QÔ`¶RBùŠ=cÉD,] Td¥d”äç/¹ãŽ?ü ÉsàlláÙg5kVÝp†1Ò¥æD,^ åÅn”1ïÔS“’ %ü Sb jâ#Š—œl•¤Òû§# HI'%Ú„ºº¬¨(¦N–\~ù¢»îZ~à «®¾:ÙÝŽ>rÝ:LhDè4FfÎ~þ]w­¹óÎÕwÝ5דּpÂÐÈDeå@·o¿e }ÛË/Ï»ðÂ¥·Ü‚ÇÆûïphúfÓ‹/bNßðÈ#Ko»mþ9ç ×Q`˜ V\wÝ¢«®âáö·ÞZqÏ=³O; ½NTî}ûâú°ø¶Û‘ãê˜äÛ¿?S6Øù5KIC¶ lƒ•–”¬zðA¦×ÝvÛÂ;îXzÞy,t";°Ÿß|ƒ5kÑwPÜ Ï:ËoøpäˆkŽÉ#Fˆ¥[džxbÁYgÍ»í¶¯¿N}P«oþéêQå¿#P¤¤«“Ãv®îc¨Ç w!æ}Íš]SÃß}ÇzQm"_–‰ÖÔD,_¾åƒpŒ³µá…<0n£‡œ>ÿ<ÁÁú‚1<'>ÿPÏÒüüàníÖ‘¨æèúì³Ë￟'¿þ2{6ã`"$-Rôüãì¸\ĬYãÙ¯q:}Ó:;üÑý—_ï¢ó´y“/¾@C`BÇÞ°ýÃã·lABâ£À]}û:}ñEôÚµLO°1æÿÑ£:k;ÀvñøåøDªjïÞX;;–øff2:‡œm~í5檓¨XÙëÙ¿?«°‘lyûmÍ›Á°šW›pÉÉ ž81#8X[J,X›ÊÇÄìž;wgïÞh;¼LXzŠÊôþýwÜe$-˜xüô“ÄC–IK,(u]Þy‡…<»¾ÿ>|ÁmE1\­ €•±áK—jeAî²²\zõò8…¾$¾x±¬bÎËùË/½‡ ©®¬D"-~Û67ÒJN†Ø! L%lßηL‚`RbÙ+¢·wï³~=Œ„ìc £ôYlLWC¢©>>¸ˆj‰ÄÂoqë!’ÐÙ³·¾÷u#1àrÈîýú‘AÞJ7EyˆýÃ篿\zö ™99©@½ý“OX›£­yÎÉñøí7.Av),Ç?dýmÓ’i¸ÖF0ÙñÝwAÜzˆŸ:ãÑ¿?óJäʱp!K´ðó}V´MSª«3CCCgÌ 2%í+ÉÍ…ð¹öîù¸ˆ µiA|z ]¿ýÖó·ß’0PÕ×ó/?)‰™ Üo…$qî±,twþâ‹Ð9sà»Æ>ÔÑ9«4ÿD)éâ¤Ä03®™¢µ ¬°`ï߯mÔàÐ:íge¥,ÅP/käBbÕ×ü6Ï k¹a ÑIÚ$ž}¨:þ1Y#;qá*±úÙgµQ;þ²‰¤^S#n¤A;òJÖÍ¢ïëëyExIE `ØJD{KœÜ 3 8Y`nhÿ~]¶ß€»o="Î&9¡DzZ†ØšÔ*»ª ¿aâ€oµT R¡·´'“AÄ *¬ 𴬑1@¡¥ÅŒÆ!L$-MÚCi‰£ë:ƒO ’ÃQ´0‡6I -×ò9:yˆÐ€•6L7l»¢_$faØ?É5C<½0ÌÉö#H¥¹}¶;# dBÑ–‹“©°}à°õ*À‘*!àk9… @£á€Š½ô›jÅÁ&4I44À5”˜ŸC0¸‹a8ù Ù‡8…8 hª“Tƒ»Òã¯4I °öÉ¡²Ð* BbýÚ¿_*LQF>¹,¶Ò"±²,©ps¸ŽñÜPµ4| õùy(b3C0ÙâöŸ¨Tž‡€"%]Ÿ”ˆb=¢{µ`¼í˜FIJpnXsóÍì'ïn"óÏ=;zÔøóCŸê¬b¦7_ƒ ýÉ'¾Kä‡JKO´ÙW&ou™ÍëQΗ®´ ÍÉ8ƒ¢xš64;ÃÁt@Ž„EÚ¦ €‡ä±Ó’%Á9953µ°FÔ§(ô´ )j. âŠÁ>˜LÓ°RóŒ)Jæ2˜•ïa¸ôüYšô½ÑÃæS9ÔU5áfR…ŽüÜ8†¦dQd“2®*&Õ²)A½š5Wuµ}Jp þÏÜ €Ÿéû7[IL$?BHc ¢IÇ©%•ò?š¤Úѵ«ñ“ÍÓtÞâ ãlÌï °ô#zÅ ¶ÍЉ·8F 2¨ š8=*±kË–-7nôññ9pà€»»»½½ý‰Å§¾þ'"@-Ú°aµˆ†±cÇ;;;žXȃTÔp$tuuµB ÍáBæ5kÖ¤¥¥Ñ6¹?ñÆnU%‚0dÊÖÖ–…²lÙ2k«3Ö×qÈCqtt^???úyk@Ö¯_h¡U¤ÄB :>XUU•›› `ç _NNNÁÁÁŒÆœŸ‹‹K›¤xÂ"«¬(2µˆ†áååuìZÔQ¢#•¿¿?z{{[§„&ÈìÚµ‹\Fº©V5==<74ÛŽÂüØé’A-¦52ˆÊä§uÊÙy¥¢Î &€744”ÚlF¤†ð÷¤eIÂÂÂ,T¢Š”XTÇRÒ&ÝNJ貹׫&7µ‡‹‡ÒÇ¡oÚŠ ´ :9˜* ÕFê^‹,‘„jFøöè"‘Ç„”HZ­•Ð’\´UsRB“7–¹Yvz´SÌBæÆÓÓ³U„¦­„·$!%XÚ$¼qÍ1îŽ,‰­ À˜q>Z…”*dµðJR‚É„\轺Ô";¯Ú£Ñ5["$ªHIÇsˆ6— ½I u—¾,&&&66–0?±VTT¤¤¤lݺµ ¿Šªk `LJ¸G#†‡‡Sè ¹¡EFFm¬¦#@çN­£ÃbÐÜæ]¤ )!-¨¨(ääâ¦E Ora™‘9""BdŽ‹‹Ã n~RRRmm-74Øòòr 'Yr “3!%ÂH˜kž'((¨Czp¦Óïéu1ÌqEN['/1&%Û¶m£YÑ©64±Ý»wGGG2†C´ |ý¤™)is>`¶+)k^MM ƒjmYY×­[GÎóóóéGGáéÇ ÏO.žK¦ŠëOhvR*X'EÀ„” ;é¬éþ¨¨¥¥¥Ô.ªZ–:ÃÅT3>ä'UÅÉ æþýûÑLü¤¥É[êÕ Ž›MH é–öîÝ‹ÚF΄„„øøx$¤ö"›þ—ÔùÔeˆ)Âð—Ÿ2½"ÓöHË>ç§\mBªLH IÀíDfœCQœb~—öÈ… 2Q…^çaQQ‘Ø!| L0¶/Y˽<㨔¹i½kLJÀ¨)ü 2ëëëÉ .!¸ç‘D‡Zd3–_¨ ±éå%•‡L PÒM% Hë#0lV‡s(€ãÀG¿Gó9¥΄”)K™~â§Ž!Ú¤œH‡`b)AB!”””Ð0©ðàL.„W!°Ôò€DzN^¤¶K 9©)± ÑæB´+)¡iÑYã€Æ iíÙ³GH 4…I‹Esð¼®®Nfè©© Èø‰S«dHGÕ§[!$ …:dÄs"-G}Û*ŒI‰>ßGïCÏž››+ €~šÀÂ1.ò“¨O*Š–hYq˧á¢/\–WÔ"|žÐR'bÉ0!%$M_LZTTz[~JäHˆô×8spÃÚP±Q<¾¾¾HŽ´\<¤ÎÓР4ߊE`¢m"nBJÈTƒ$°É‹ÌÂ-hƒ †¨\È€‚DrT)Úm*¤„ì bù;M¯dŒR <ð$#BT/OhÑd<¢ºDéâf+OhËí1 dBJtê'_$§8È)R"Î_òˆ%G/ÅA]¢ìRi©<F` À_rz C©iÀÅ’CùЬQd= S$t…Ô.È ž~±>*Pü[©3ô‰T< Üð9Ÿð-ÂCB¶‡O‰¾Dçh¤õ#yß.ºlH R"£pò%iÛ¤Â7KJP‡¤"ü€tÑ£ Š 1,oQ04Xãs” Î‘ ÅL%>%Ü€9¨¢P )!fQü4j˜-ÏÑÇí±€¹£+eMÝ€€" U]He‚ŒÊ î “nQ£ø¤‡Í $DzÅĦ›"³ˆÍ_>+ˆ¨Q„¤+Cé¦È>j˜Z'¥&ªéýè÷Dóæ9“$bp،̣Á¨!$0|ÞV»6wkm–”ÐSE©3Æ–j¯ 2&%RIÀ x ì²ÆXædO0EJ)i¡æÐeó4}ŸZ¯Øºi·\4{8ÒÒhÀâh"ÒÓéèÔ¨Ðô<Á.*k÷¹¡‰rÑ’ÕÎHÇ×z;ÑW椄Z$S6(B}¡ ÷R+¨0T*.t¡lŒ-ó2¿@—‡&_%9N·'¨æM¦o å’í·IE\kQŠ\ú ’º0!ê!ÉÑÙB¸ O{FÎÅ'íáSB*è R4æâ»¤âÊJk…?YCf—i2¦%’GrÍ Ê†ì^–³’¯ b] Œ1¤tà::m['I‰p,éLH0e¹Fx~ C%_ˆJ—Âäšç(Z‚QÙøÉCP¢òðDŠƒÎJÌ$T*ù„bP b–e†úô ÏÁœ¡nÜC: Æ'@+¡}¼y°"úFQÒ|%¢æÛ–ÐV 7KJ@˜bOBN„R@#d‡ÚBM IMã-9…‚C¤þƒ'æ¢ãÞìN‘’®LJÚ¤ãÓI Ê@oEÂK¨2 ÃOñ¡%s#³3üä’·X~Ê: *´þùqWß¶jœ*žöFÀœ”ˆŽ¡>4[©dvFúR‘ô`R—DMÊ[ùy‚Y0!%Ä&n+’ºÔs’Ý#ÌCO—ðº´2e ö @`]Ú6i˜Äib)‘T¤Å£aÒù©#ׄ—}_$³òŠ0ò•.*7€‡b†ÑsÄöʑI!ê;º2:—^¤瑇"ªL'éÝ7ÒÃHyË/•G‡E²)Kv-ì¦$6ÁA–"K*’¨1JR+dc:Ö›Dpn–”Hç¬×"ÂHùêC²)-N(¯à £G~O¤KW¤¤Ë’©[²ÔåD.jC",%BüO$*õí?Ô'¤–Æ&X!Ôs}M„uJhÃSF¥´Mñð°BTOD$TFFÞºwȉĦ¾5G€:#èØÂeœ5\0QŒ.*fµÍ¼…@u|0üä±¶acŸ£¹Ð"Ø?™©•¹Õ‰J}ûE3¯¬æ…àâ‹`…8P·eÑ#´uJh Âô?¤„W˜Ù­ÕI&GdÑ2£g݃òDâTß#€‚`¶x™¬¡…Z 8H"ž@–\Š”X‚’U„¡ŸÂ™îÄ/Ù™ &r%÷òW] Ë0¯E–{rBêu[¯ç''ÝI™Y_ŠC%2ŸH¬Ë5¹ÊËJ+ËËÙ×ÁüÕÑž°¬‘µs˜^øË½åª V]RhÔ=î­ë—Ð4V®Š±¤«6LÉ Õ†I+¬3]$i‰À+‹Æ­$;H"›ËYr)Rb JVFH :@¿Jö”&¤eDÆSý ÌÄ¢‹šJ”ð—{ùF"7KÁ¢› ¤KÊQä¦Y8Z†¯Žxy‚òµ•ÇH×úRjmƒôZd\—:<»ÍJh\;\Bsd‡PÚ¦qS´r™[#úIH ìÄøÃ£åWza©|‹0ü#!=uÁDbå'a 7eQI9›<✒øÇM@dzmµ¹|B i®G|UUŸ–—–]PƒÀªÃ;²jV媂]˜Ø}«Ã•„‰„È&»­s`Û‚ ØŠÎÚÚJÕÜRŒ¬¡X´h”°˜k“ÙråDHR"y¡sc% »“a{£)Â<–-[Æ9pìÁ[¨ {¾±§>'»¼€ÕsçÎe]T†beu:›¡ux•kíØÄR¼xð€§5-\¸à„—´GÒLjS‘’ö §NJ  ^™˜¹:ØÞ%Ý’¨qî—oõ,È/©¬ÐÇ®s&¤R€Ò½ä­¥Ö„ Zà;x‘_\JîÁ½ÕÙ9…ñ©9 i¹èxXvAþ¥eåǧæB´ê^W“œÃϬÜBô:Î)ðœ¼ÂÄ´<Â÷åìœå ÀÄ5A-ô½ïëµC—˜ï} ¡ª²¢43§ .5'5+ŸÀȰ¯¶2*);!-/5#}ÕªÑ#—ùG%æTU–ÕTU,Ù1pÏ_‹ýþœïëœ ­É+(NHÍ%†œü"èÄ÷˜¸”œØ”œ‚Â>á'÷ éy…EÅ{«\“ÿZìÿÖàmŸŽvùs¾Ïj—¨Æ½ÕÀ›¬E’_T,$¬é«´Üœ¼"ä¼È÷ïõ!Åæ“I'¹Y[_r椄'¨öü½âŠ+èi3-VÅvÍ–±„({4Œä§Ÿ~úì³Ïzöìùî»ï2øÆѱBš `BJ  ,f~ÿý÷¸GãÇ—ã^­JæV¢ )‚ð„ÍK.¾øböwGeÒÑ‘ÍO?ý”,øá‡ì©J˜ß~û'Ÿþy¯^½ hPÞ~øŸï½÷6CHJ‡hÜVe¿½“ê´›mpÿøã©óݺucœ“OÝ)éxÑ“Fóùù¥ýÝíÒmH™5Í»Ãþš >ë—mvÙ[»·Å1½9)©ª*{þ×Í"ö€Eþ+]¢°Ìß6v…ÿØ9ª«Êí=âF,õŸ±!dôrÿ ètX‹dúðÅ~˜¹1453?)=w²mÐÔõ!SÖcyêǃø¸§ ÚÖ6î¯î>Ê™Ã&Ô`•ˆHÈž¶>dÌrÿÉk‚‚c2ª½v§_â;j™?ücomÅ„Õwâ羆ê›ÃˆYû¶±.3¯xwlVCMEptƸ•£–ûÏßíÀn³Ò)ŠÌó‰KÎ…a¬pŠäóq+×íŒ),*aqÿÇ'Ž m@*¨k@ÒÈ%~|E¹ùE»Ê9НÈ8ò@ÃzŽÙñé(—-^ñÜÜNö£½û°ˆßÜAåAƒŽ7îᇶµµµ6R‚<¿üò˼yó¤ž3uv·¶ R‘š}út÷cÆŒajª*¶íû]‹c4‘y†:cÆ FŠÜ_pÁˆjý¤döìÙƒ B`†¼_ýµœQw’•ŠÅ·°ÙérÕÀ(ÂÈžûÛn»MŽœ3gÎĉ9†æí·ßæ–-¦u~ýõWŽžéÞ½û /¼Ð¯_¿ï¾ûâòÚk¯a5á­‘¶d*nYÊN„”0—Ê™5¿ÿþ»Êøì³ÏÊù—'"EJ:ž@´‡:)©ª¨HKß3ië¼51“÷¬H÷-®È‹M ý|Îíïͺmæj¿ÆÆƒ&«!Lš˜9)ÁÉì¢7ÿ¯ßæ^\™OÁ°xKøS}ì^ùcëÿ~ÛüøvLÊ,۹ƕ]ùjQçoÚFïú‚Ñp=–õ»bç;ìŽIÎÆ”WÀÐo–'ìD&zxˆJ·¡Û¡ þa¸§×Ú7:>øí†Ÿ¦¹ïk¨bRæ®/×}0b;„£qÍ6ßÄ…[Ã1®“D¯I;Cc2ë«+‹K4Ÿ|Z°Ó`ƒy}À–×þØvÿ×ëÖïŠÙWW5|‰ß]_­Ã‚U[ÎmŸÛ¾9Èñù~Ïÿê°+(¹K ¤Ä.tÍ”àFÂLÍ?m|å-o t¼â½å.~‰!ì@÷Þøó ŽÊÜG<ÓÖ‡®ÝÛ¸O›Èÿ÷uÍtÒæ*.rúé§_uÕUgœqÆ9çœs÷ÝwSIŽ]Ûµó?)‘…Š”´+øG‹ÜÜÑ•b¢8˜_`‹}Ùcãh¤÷HÉ?þHÜ#8«É8¬&O<ñ\]Õßx㎭r©q¢Š”´‡òUq6€NJê*ë×ìÚùçŽÆ¹àé(¡ŸÙ£ÛÄÛ¿^}Ï“=Ÿl¨g=رfÊ›ó))ÿïÏ›˜Ý°÷N¿2Y’Ñ+v$5Ü·w_}rzvŽeŽŽ„ÁX²ï@CLZé{‘©zˆÎ<‡0Ø4hâšÀ¹ö¡$ÄsZ fßpfŽ| Ky{p³gÜ;v¯7ükì;ÓÇ;,Í% 鯅ÞüÜ·¯.¿°(=§÷&%¸Ðb é6”´ˆvoRf!Äko êª~ÿ†è¤¬ÏǺðjäRÿÕ;ã`ðíð>ÇŠ0™¾Á/«'Çÿý÷¨ \:ÖûÁœ”0}ÃŒ€4™Î2}3iÒ$ <LýëzÓ7dJv»jÈQJ\—]v™ÜÈô 4úô gòÉ'¼b¸Ïß/¾ø; EÉ=ïÜsÏå¦yp‡·Oó鼃ñ)<™¾aÇw5}#h¨ëDR¢ù…åW}½ü›É Oÿºå±7‡ß8iÅÀÝÑ yâí‘·uï+ý¯íõëÄc·LSR²šò²»¾\‹ê…$lõM„‘ø„§axè?Û«ßLÏaK|il³íw¿1`ë ù>}¦º-uŒ‚¸ÌÝ´#~áÁb–Àèô?æx—hó5xb½øaÊ.8D ^¨{žýuÓÁMoÑ 9û%ö›åAøŸ¦º/wޤKùe†Ço³½úÏöħîÂ<ÑÄÕ?Lq+(,F°I¶A?Mqûm–gïÉ»¶zÇï)Ù3em?‡.öýßoK·‡ç–|;i'jsLéyLá´ûûlOMþž1IÙ8±BqƯ\²-²Wö.Ó™“š¡‰Á·,ÏIËÌÿqšÛï³½Ì÷ò Mƒ~ùF¤ý4Í ¶„Ñux¯c5˜û”P¬ÔOê^‡Þ;\=˜;ºâ É ãi¦°öÓ¦¬ÜÑU–Þ¼ùæ›ï¼óbã¯Ã¼†¬’µšŠÐ:AÌ]És4‹;ï¼?VªÍßÿÍt Y~ë­·8Ë ²Ë4 Pj0NÌ¡àˆ§oß¾¬(!|Ÿ>}ä-®Ãk]ëàhëÐæŽ®8 zàÉ_p)G×UÆê{A@'%ÅEÝç¿õóö;¿]óà;ny¬÷¥÷¼êéo¯zùûë^øúš‡>8ÿóïz¶Š”Ð.ÐÐQIY˜7°Xì­­dõMCmËRv%í J.-+ÅKtŽýnÈJ`TÆ®àd¼D±|ྊ¯ÆŽÀ¤ÈÄlÂcÃмAqõ(+å ¾¢hz\@dê#.9Çàï¢Mß°¦&,.ËÅ?)(2õºûë+w&ï Ná|Gˆ1pXq J*.Ñl¤åä§¥ŸÍZ›ºêr|WÝCSðñ OÅô‚¯«‹"¦gTU–òyvn¡“"XæÃÜ ÆRÏÈÆ"ÂV¤šD,o†©8¾JËÎgÖ)/¿È5 yW`RHLfãþZf‹È8>4AQé˜zÔeb(6Ùzáî/¼þá3/¾÷ø³/·Ø2M,%ÓE)š¾Ékb¶ûqE—ó%»üž¿%ÜÞ3I½4Èîgè~Ô6.3¬¶qˆ,QÑ8HYi}u…¶Û¡Q~/¬… ›¡iÛŠÐzê Qi‘k3%Zä69œ–AN}O6M<þÁ6ˆE„©Ò„iúœŸ¼%‘A¼[``"‘fy:â«=,`–k«+IÂÔV•“¨ZzcÂÉLT¾þĬÄÔ\BžÈ¦[²±µ104!%"![„!3nžÖ)s«Èº¹£«ìG¹ð‘ÉÙà:"mŒË ]ËWT31tÉ¡à#[%O lBJ„”ÀÛQ›Ü(RÒ YÒϾ¡ÛÚgLí¢û",À–œ}ÃÖ#r4§îøE¦…Æf°¿ˆñi9z€–Òlþ½É¹;Ç>†§Ù´Œš°D<“0–|r|™íb_¡]d²F†¿V˜;]B”–±„Ô«=YFt6úÃOk–¹UE¯Ÿ}ìñ‡’A½\L~òØt|Z¦y`V ³ž:¯Î¾é𤄆JÙYAö=<Ú%aŽq€ñ"¤DðØáåíÞúšö,k)rK¢RaºT?YÀI^¸·Âé2@´N ÍAƒ?É)ÁÒÌ­Õ‰‚ ¸ì F¥>?ÀKÛ´ž:$²%—:ûÆ”T…€B@! P(ÚEJÚâ¶J€ñ[å´Å…6ö4,%˜R¹o‹(Uÿ8pš“™8ƒÞ:kRÑ™ë”мҰ 8vÚfW­O’A …=XÛªCëªXG¾¨ç  ¼ÌãPÿ#†öøIdRÉ’K‘KP²Š0Ø–úVx :@®4þKIóŒZ嘒œšž®¿iᆺB”@M¸—ÐD¬ÿ³4¢c†Ó%EbãÈrp¬ïçÓbñ@@‹ÜäË#9I è´ $]*´¦t4 y“““ U舫Ãs‹„Ôp$äŒY‘ÐDÈ—Ð\” :R‚Àzc7†Õ en•HdPV‡ÂNŒ?”<êOô,­ÔÌ´JŒ®Xê9ðb/¡þ[Xç›E¾ÙêgÒr ‘„ƒ$-T¢Š”XTÇ3!%PˆôÔtvQÝçjŸ¹l•s`Vz–è…ëŠ9)IKK-ÈM/ÈÑþegšöÝ©¹Ê1(øÃƒI€ìÌt¢åaFZZ^¶!rCù9ØuL¯C¬èðóŒô´LH†!]ÞæJ 9éÜ©–&QEÝ$dV&ZR2tøBž¼,-’Bƒ$Heðˆ0æ’¤§¥f‚‰!X‹Øþs˜À‘ YÁÊL5sò‘i–”ÐYËšŒ(.a‹¤ ŠÐ¡#0SQÖ)s«JÖ„”èmŠrÑsG–•#Ì rO^É æ/åÈ_ù ?†zZa¶ œÜ,)‘ùzË"|p–¯@- DÇ–Ïeõ‘ÈŠ”tp¾} ÝŽÝ¢“ WI47;ÃÕ7jÈš=9®~QQ±‰P"!º„„KHZ±-dá¦À[BmZ²)8>1‰Li2rj’/$áYl|’{@ "ñÚx[Ä¿k0&%Ô(z. eKMv2eÊðáÃééώʯ1)‹ +{p;–sw9nMfmjÌÄRBÛCI¬_¿~Ĉ f…2·ª|›µ”àô³mÛ6¶Jƒ‚pÁnÇ?jÔ(+@ËR‘xE©q¸›¤±ljÂÁÂd¿Wðá ûª±õ­ÐšVÉÓÅ›“УaN˜0aذa;vì þè½7T0ÅòåËåC¤¥ <˜Ýýi)EÃŽv€O»fã]6¯ãakAV¤¤=(AÇÇ©“­ÍÁgÓ3ƒ£“lÃìw䯛6"´`çj'ŸØX˜ÄS<Í69R‚®ÍÍJ¿øíeóì&¬ôé?s—»ÔžÂ,T{`X\@X²ÒÓ¨µŒ°¨xŽîÍËÊ@ŒÂÜ ßXDÆ&¢Ô±7“xTlR{µ¦§u¼u³[8ü;$"núZ¿ÑK¼ïürÍ´5~Ãzæefd¤ED'øïŽÛ¯ñClÞÁ1¤¸;2¡8?sÎÆ€?ç¸ûÇì)ÈZº%hÀ÷ +|ƯðáfS(ÉÅ%ЊH1b‘˜ ‘‚ë”d~9Îež]@tL"‘æ5I“H£ã§Úú-°8÷µ%‹‚Æ-÷ŽMHÊÉL#§HB¾ˆ‹HÑ¡¯Ã̦]á_Opv ˆ†£hØw±nìx³cBJW9::þüóÏìù=`Àl°tv2Ì=ÞNô;R‚¥}QÙÈœSÜ8 äÑGÕâ'šRÛ}oBJ zkÖ¬awpNŸgƒ|Èew×N­zMH 5„bBeRaØ3^lBœÌÅæèï¿ÿþ¼yóУGJ}å{öìÉΤœ’ë?ÿüóå—_æ0???Çá¡0¶¶+Γ1)jðÀüá‡8+øé§Ÿæ¤*•pqèE``à_ýø€ÌOZÄK/½D5|Ž5°³³Có=õÔSÜóü9Q>o4Š”tÊiå¶à’‚̲¬²‚¬†9¨Î+-€±¤zÅ ˜íöÝÄýfîÚiˆÍaWØc¾™à2r‘S<Ìvû_¿M_s®*Îþx¸£ÿîØÆÚ‚†ò\X,Ä30fì2¯ÄÄèË¢M˜avÇý5Ïôö ­ü¶È‚âM ½'í8×Ý'$^õa+꺯â/är¦‰$½'¹:yE ÉN¿(2õõ—Q‹=uì2ïg~¶{wðVu)Rr¨72Ÿ¾—ˆ#g—0ÒbüÚÚΫU=]‹MH »ò Ø°7°!Br 1¶hkSð&¤¥2zôhH£oºwïΨWŒð-fß:˜Fê䋽ÿÿûßÿ®\¹’¬QLW\q•‡,s‚Ò Aƒ¼¼¼þ÷¿ÿÉî&‹/FÅBÔ`'üä„BFÿ_|1ÞÁ|hm¥yò‹À„”ÀðæÎËPAö9|üñÇÙŒæ!¤ðñ쉉‰¹ä’KÄoV)ýűšØ«ä«Ý»9ñ´‘"8FŠ”´%èø8¦oR2R3·z/Þ=Ç%kÅd·<â8»·ïÊÿ~<¡G¼fÅhaxÚ )ÉLâÇÌ’ ì'®òešcÌRïùv¨àøÄ䣜BÂãÆ/÷F»ÃN²2R_îïи¿ð–ÏÖÔ–eWg-Ùô÷jßÈøûmró‹68Ždô™â/$°(Ö½=pkq^&Ö´ûØå>‹7r㎰¾Óvî­Èƒ(Tg3WRQœŸ±Î%tÆ:™»±s ½Ä +ˤ•>+¶†0˳Ë?;JBbJYQÏ é÷õx¤úcŽû6Ϭ&5y·õ\ƒóÇ܃æ¹#LRrJcuþµ­ä/÷?f®óŸ¸Ò_“踤çÙÔØPðÀ7ë1˜$$&‘Þ'žAÑXw˜ "p§Õmß=6ëèŠVà9ãW¯(ÔŽÕ&¤ÿJ $ô³²hèüóÏçÆÚÔ˜9)ÁfÎȕر ƒ™¤èÔösŸ* ÅÉ`²FŽ‹»é¦›$³Ì2šÇ"ãø™3grž0%Û»woæàPœ°–?þ˜ù '¢Y;¶Öµ}KkMŒæ¤„S‚1^‚ sJ0 é¤D€âùþó¨ ÐAS0(rÕø"Ç q¾&ç 2Y†¡Qw4iPŠ”t<h tR‚#çîðäQS–…(®ÎÊô/®Èósê1óæ÷fÝ>j¶m]y©¾ÖÀÂ雼œô›?µ¹Þ»Èv¯ÈÆú‚É«|ÑñX#°—ü:cš9[§ÐŠâì”ä”7li<P‡’›o¾YÈY³¤DNÆb„ ‰)-¨ S9ç¸AwÂÞ:¼â„º}´$ŽAJXÒ%¤7Ù[R"ë‡ÿýïc¬¢]0›†q…úöé§Ÿ:880®Àcï+ †öÁ‰uNÓª<*KI»p‚TH ‡Œ”ì™öGø~%™éôÞ€’vò޽Ôës(ó6q§ÔŸ³ÝÈHvFËþ:­j«:°9)¡~ÒÙ=öØcøcZÀÕ|ú6mÚ4iËÌ£Ó[¹¥„)¦™¾áí»sçή4}#“2YÀAÁÜÀE.¸àº;î™zÀ¸ÅÂÏ<óŒ”Äåí·ß†ÄÈAÁÌgш(Jy{ÆgðW‘©-;(ÅôéÓ™µd>üðø¯âì…_ާ§'T¬†·ß~;x‚9?q1Á@BžC9«GW—‰3 ²°®U}—"%ÎÚE€&RÂÀ"1£ïÆï&Å?ý§óSO¼sȼoœ¼íº{ü½Q·÷˜xß«ý¯ýüû_몫Ñ2ÍI s*÷³®±®6ƒúÞ/$¶ïô]¯þîÀL sE9ã—ùÜýÕÚW~w`ŽÃÑ#¼¼0ËÑ3â±6<û‹ý§£œB#âp1é7cW¢æîª‘Ì /ýæÀ´ŽXG’“’ŸûÅ¡(7ƒÚ GY>æ:X•÷Ü/ö¯þ±ùÍ[6¸îÆAÉÈÅžOÿlËÁõÍ›Ÿëkÿl_»#¶{Ç0=4ÅÖ÷…_6½5pËðEžX;xøùh'Ø @ŸŒÜþé¨í•ÅY;|¢žûÅî¥þ_Œuö ŠU)9÷õ%X_¸gfÇ7$æë ;^ìïðÒo›±‘ì«Èë1Âñ…~›º Þ²ts°aUNꌵþw~±†™,2ÒºæØª¶Û©›“túè#&Âà>œHÃ!¥ dýꫯ¾þúëÏ=÷\|w°}2;FY\uÕU_}õ•,k-Š”´ 'èðHuR’ššýé¬îïÌú÷[ïxªßu·~xá /ŸsÇ<Ðí¢»_»ðúÿÚôÿkpUEU2û©å2_,ûuhk`X–‘ƆèïÔÖÛ¤$%Ög¤c/aÅJANVì,-hnVÓ:„á[4wÓŠYmu°1°'%”B¢5¤`Pꆷ¬âoRih'$JLDE£‚Ðhb'0iÅ1ˆ¤½MJÁXÁôa/DGÛ›„©"ÃRdM½ð ŸÓf´Ù–´Ôƒ„¤‚qFR䕘j/MK¶S!LRb2bLËS¦d)ÃÚc&$$ËîtŠ”HµjvúF¸Ÿ5({R‚`˜¬éUe£I†’V¨ÝÍ7OC€'ÓàUÖÀöNDÑš/ –R:Ã[ò‹Ö¤ìȲ˜²Ä™ìˆrºK ?eÆAÂóóø<N$;Öö­ )`¥þpQ¸×«=Љ£±Ø5ea¿äˆ‡@Ê[½Éð„o%¤"%άBݧ$/7—Õ/_öñë ÉýLìûǘŸÿÑ·ßð>ýþúéçÁß|ÿ+N¯­ò)‘Zh  McFF ¹QášVNM·Ôk¶]€¬1¨œ&n¡…1<á’õKÜGô¨LOQÿV¸‚ÑOí+ÙEÒ20ƒ#”Ȧ¥{(uÙ0‡ÆìÇXBQ–²»š±œ’Ó¦·†´ôlj’bQÖÖu <Í’­"Y¾µp;KoLJ¤EŠ>]ºi+d$HØìŽ®V.s«Š±Ù}Jô ÊÈž¥Œ¤.ÉþDo¹ú[=¼n•<],°ù>%Æè™ÐÁJ_QÔz9ñê§,%VÁ!Ú\ˆÃgß$&r._MEyuyYueYMeEMUeM5ÿªj1eVV¶xfý‚l3/k%,9»KXd|Dt|ZkÙ±$f¦“" '(QÏ­öd$”)szÕNqö E?ûư-PW»$ƒ²Ípžwz: ‡¦:ì{ë+ÔWÖVk$$Ñ÷u5n!)½§ìÂ^’’•?`žwdBÖÁ½UõÕ{ë*˜O!Œ´ö7Tòso-±hr쯫âaH¶Q]UÑØ =ÙW[™[PÔc”KãA̵³6ì>ëå…Åå¥|QŽÉ8åùy¾a©ûkøÉç1ª´6Y]Ùx°†ÜÕTkéî­©”´Ê+JÓ³ £2þ˜ç“‘WXRR\WSi,!täÐW|RA$äúž/×560‹LV'Þu` Í’𠻀£-82CÆ^V"¡°¥qãÆM˜0 £°å°‘¹8‰w¬&ø˜”ÄüùóùåƯ>>>ß}÷¼D4G{"I›ðgI9ç%Qg¶lÙ"3;>ø ,„( ­*ZÞu|ì‰|eNJŒ2ææT؉õ“NsK “]ÏR"žaäîË/¿Üºu« î#<ç7ˆñãÇCsß|óMñuÅRÂ7hGoooî¡)<òHhh(G‹cDV¹©®mòm³¤„I1vz…Ø‘„Txˆ™¾éÓ§XJ ¼´Yn˜Çyê©§0A1³páBQd¾¾¾;w0YvŽ;Š”´9°Šõ™¼ª²Ú[Wñz{øŽ×;+,Ö†?Lz»Û¸;¾ZrïS½îŒ)i¨;Ö¬³¹¥·[—hœ?ð‡(*ÞÓ–gÁž²7lÍË/.**Y¶=ò£áNø¢Ž]íØ_ãè›0t±oCuEfnQ@dzZV¶–_fx†Çk¤ä¢7— RïÉ;#pL©ÁVÝ"#§s‚³_baq‰WX*Ú†±Ý/qÖÆPœja™9¬†)&*¸Qv^ÑÄÕA>aiD»Ñ-vÄ?ñ£ýÞÍ[uÔŠ§ Ô9á«]¢°å@ ŸÙ 9œT +„ï7Ë+(:g‘éë‚]ƒRæm‰\ì9¸¯úÆO˜\8 “’¿×{A,ªÊ6{ÆÿµÐÂ)Ö`4Ò\\+´õ; wNLË+*.ÎÈ-töO¬«)‡¥ågç}8t»¶Æg_õÃßmÜ¿·ŠçM¾ÀmÒÍXk$æÓ7bx è¡#œ)ϨœŽÊ9)=zô¤I“O3Ótá…Z?)As ˜1›sˆ= ‹ù”H a%Ô;ï¼³téR9!åÞ{ïÅ:B]ÂLBy¡/!%Þ˜ƒÃv„£°yyïÞ½y(Ó7c”¯H‰»ÓˆÙ?"rƒÓ,ÜÅ3455»`ú†fj˜”±se 1¬ŸuÁÇvWp2y·RËlDb6n¼dÉ,»P\I˜¾®ÇeM² "¹†'€õÏÈC޶ù'"9]æIùäG}“£Ú3íµqãF c¡>:R»Æl*Ý»wç'&~âk‚'–€Ó1¯â¸ÓªŒ+K‰5Pˆ¶—Aú·¦²öûY?ÞöÍ¥÷}}ó o]~Ñ#ç^tß¹ßwöåuÉݧŸ}½Ízûõ¸˜X>}CõÂü€òöKÅ´•^Rª-9Æê€^ç'Ëk¡ iPùP£¤yâžÆtON~?y›–,¦ m6§¦<%3¿¸X Œ—(Ꟙ}ÂS™¬!p~aqZvIh|¢´49#ÿÞjV»0í›Áli™£—lôˆËŒNÎaQ !˜Xü"Ò°©0¯„0yù8“Ö±Ú§¬i‰ÁpÑÒeQ +ÝÃBb2aî Дƒ{Ðï+«¬~sà–ÆýÕŽHÈòH‹NÎn¨kòQ…P3AzˆJÁT°£Œl1œ@P¾B :x)i{B` 1ê>%˜Ècâ6lsÜæºk«ËÎÍNΛ¶mÛ´u»Ã6ÇM[¶m°ÛÔPßÂøÏÜR‚EB µTTÙ,DÛåL{‚j—Æ„FˆÏO$¼lS¦õ¨fÇÌeHÖ"†Àåe²6˜Z±¹È¡íÈô{Ò"ß2eƒÅeøR?ŒØ3d‘³l%‚‘F‹Äð-é"Ž0v~"31ØÏ› 1'„©ªÔÄÐÖýV–ßñÅšWlÛêÏâm}oU¹¶¶Ù ¹¡aó-¿‡6‹3äË aµfåB0AÀ @Óf'‡Ð;™QǤeNJD ç*ø`ǯ?j–6ÑÓ±ÒÕZƒ„æ%gNJ/AfTu‡ó¼¯jÍîè*ä’ýÓH…Ìò“çR£(, `¼šj&†.Ѿ/Ήƒsâ14ëS½úJ2Ô×óΧ#¯ƒÉCÁVš³€Ü$^‘k m/žç­ìfˆ’­®¬®®’55Õ5Õ‡ÿiãþcŸz@¿@…ú.¶S"Ôb6Dn¸´û¦‡úÃ#ã“b gÜ4…?Xÿªõhcc‹G~î1rd¢‡SÔ>$çai ¯gM—P)ÛS’™“Ÿ—Ϭ“¶¤!ï’#bl&~£0:Æß£w¤t]í—Ô"qÑk‘qµéð 7+á¡jfVØ.®A9†ˆq]´r™[…#uó³oÌ3¨?9²#:¢ÔÌ!j•$]2°´DZ%4îpßn„¯y 5ÚÐåšâl¦U詳oÚžXCŒôSŒçÉŽFF´¦—æ7aÙ×Ù’À'? Yª­5ä°Ý®†ºÚú:-vK¡ëG,'Zs>EBþZ³Æ²1eøAÛìª5S2(ž˜¥P:—œRç­­o&jɥξ±%k £÷ÐVµy„m%˜ŠG!ðG Ë·Í.ŸÁŽªÀXEJ:ªæ´:]¦ôØh™=pŒ¯ä䤔ääTþãβ‹øúá‡HÝÅq‰{Ë¿µ,ªë#@Áû2+‹àÚŽVX‹DBj8â©g…š×df)&“b¸vÉ:DÙtD»ÁeUõBN“Ø iY‘mréñœ`FŽ!Ì¡˜ ²#¹er›™eu‚P¨yj‘úAC: ‰5äZÈ·ë”м˜é¾uR"6Õ6£›NP9Ž."R‚Éĸ÷гi^‘L^ÉOcpŒŸtjpN\x©çÀËŠ_ê‹­Ro§æÕ̤úWÅÖʉ$ÊRÒæ” ã#4!% HKŠŒÙ½}SƪyŽÛr23a%–hÊæHIJ^vzI~&¬‚¿9™éMUð0_q¸ùÝk·™i´‡‰+|Îqÿk¾GYQVòQ§fe¦•e•NËùrÊ‹,t ;* &¤D$dHÈ:“.»£ä4Nׄ”hÍ<#C[To8ß•žÝ ennÍ’fÙ˜´‚ãJJÂÌX‰ÊÂ.l]ÄÏ)-²)PPˆ ÏXÐAê? @±²ëµ²VaK`sRVTu©ó d\j—ÅÕ”OO0žÐ„ ,Pó-øùÀØ )éxÑ“­{MK‹‹O³ tsÊÞ蔿|¶ß”5Û|ó³³-i–æ¤$;3ÝÑ+¢ûðíßMÚñõ—­îáé©ù9p¨@zZjn ¦¢†¹)ÊËàqNfô…{?¡Ó×ø-Û²Î%ÔÎ5¬ W{NøÂ¼ ¢â†„ÏÎHËÌHõŒé6xË÷“wôšàâì™ÅP;…ÅùE¹†– }¥à«‚œ&b‘‘–J Z$™ihy¢¢7*ÌÏ€Ž`²·Ü»ª$§´0sµcÈ·\¾›¸ããáÛüBc5‚•–J$|XK–ª—œ çi4Ž„$ZW­ä+?CK%9…·Üðy}yÎïøn’K¯ñ.@Ôgª«³w¯r³Ó‹ Ÿ³€ü,ÌEº”UyŸŽÚÞX§½¶¤h,iáVƘ”P£¤/ãè¸gŸ}öàWá%(­1) éU9Áø™gžAB[[Û—ÐR‚Æ%llúØc½þúëìjŸSósRB%!ì+JîЋp ÜM^xáv eŸVvñ‚ˆ¬_¿žzÅÑ6¿ÇO8Ê”)Sî¾ûnŽâC ão÷矲‰0¤­c«\ÖvIÚœ”PÉçÏŸžœô÷ßëõG‰——‡UqØ Gi‚‚rÕO‘’ö ç‘–’”ôÔ ¯ð¸ qësm'úôM) sô ö ˆÉÉÒ Çnæ¤ÕûÚ›#bÜü£\ý¢¦¯õ‹OJvôŒHO…8§â¶²Ó? …—ä3ß.°(?Ó?4–` 7…ÅU–dïôzsÀæ +}à7Î>‘…9~!1ñ‰Is7&$&‡„Ç/´œnëe³[ø'#£bIî÷ÙnP‡ÆÚüyvs6,ÝÀY‹´¼ƒcæm ܸc7T )™bë;c½¿OpliA–OH ¶8yGnqüû kœBaæzÌ^àŸôL_û²Â¬„¤d¨ÒÌu~¶N¡Dá@€¬ÌÔ©¶~é)aQ dF·§03("~úßùö~¡qExˆœ+¶„ÅyņÇ}2|û*Çÿݱ‘±I5{²·yFÌÝð÷*èšð0"Ÿ±ÎoÙ–` bwTÂeï.·Û±y4öÖRÑtx§f¹&¤„q<»Ë£$8ß‹½#¯¸â zCtjfÙ„”0ì7n{f#!ç·qj ]0ÝnJØ")A…pJ0çðqì§³í:b[•Ì–×BšñA1bî‹/F2d‡Žp8 »»²¿>EFa½ýöÛlÂëîî§ä JCká+ݺusttäÌB¶E‡tvl}kíؘ”,,œ£mØ$žÃÙ¹`Ù›•J%8pö L¨9¬êå—_FÏÁ`x‚ÇÞ??Žþ†”°,˜shâš5kˆ³µÕO‘’Ž'í!NJ´ú”–Ÿ˜½Ìo‹]Öìe±£—ç¼ù.“F/[\SrÄÜ~suß„”@;°ÜùåZ¶œhÜ[ظ·ýÚP–óT;NNF:LâËqÎЂ/Æ85Îiæzÿ€°Ø! <§­ñ›¸Ògò*Ôö.ÿ¨×ÿÜòÛÌ]ù¹×¼ºñ@ág£>²m‰CJz­rÆZÿþ3wÆ'$»øDþ>k׾ʼê=Ù½'¹îŽC…O\éý·­ïøÞ³Öû“Ç/ǹ|9Öyúÿa ½6º„Vgÿ2c×´5¾Sm}‡-ôŒˆNXº9øÙ¾öc—yov°Û¹û©Ÿ6.° LJN<ßÃÑ#Kã¾ÂÛz®­(ÎJHLZ¼9ˆøG/õZ亱ûêþ3wAƒüvÇžïN*Ãy†FƇGÅYàA™´Êã’Èã‹¿mâ­{@L~NZEQöÏSw¢°Ž` Úâ>a…÷d¨ÒZ¿ßfîÄ@b¿+ ñ&¯ö…‘ Ÿà˜?Y½À>Ð=0:ÔuI ûj0®E=0¥þŸzê©’ŽUù&¤4ÃqL Ï>ûlÆåb²n' qÑšXJPÒ“ËI%ñé§Ÿ²_¸LsGäÖðI³–ŠæÃ?ä`9Zåºë®cÔŽ·ï´iÓ† ±p/½ô35¼âθŸÉÔ%ò‰{SçE¦MJÇ„”'ý‚˜¸qÀªJÔ|Üz ¹œ·Ç&XP–[o½•0€ w¹çž{f̘A”õA/g2Si>­Y‘’ö §‘¥$%7#g¥£÷°)ÛSý¾ñ-ÇðeÈ×kñm/z%=)?;³…ÁŸ¹¥²`Sà™//ºòƒW¾¿r—_tã¢Çܘ›™ ) ‰Œƒà¯1x®䣡"w¥cð¨¥^læYW–=eïêíÁ$°y„FÄóáÕ¬h ®ŒVQúý¤;|£Ücð;áç¤U>³6ø7Ö>ñÓFæGë Ðôsd>è¯y;|¢÷•ç¢æ¶ó@uÞ}߬kl( ØÈÅ^]Ã0½Œ]î½§0 ËJ\|â磜ªJ²köäôŸå¶Ë?Z‹­±ôªV•dåegh©7ÄÆ'œë±¿2÷߯Â(RYœ½Ù-¬çX'CFr ë]Bá4{öVæÎXïg¿3læú€É«|Ë ˜ÜÑÈSE?þ½Cc™é˜| V–k9¨¹ò¶/laB£–x­ß±»ñ@qe‰6ãE¢7}j =’¹ØÖ6æ6é§Ú)K La¦#“m.¸à+$%üñ½ª,É9ÿüó¹±~R2qâD¸{„sJðçŸÎi®]‰”Ð"dþ…CàV¬XæqÓM7 wá8L#‹óÊ+¯PXÔ¨Y³fq¶œÖÝõê…ú0`Àµ×^‹ÉDÖ‘ÊÑÁ]©•µ¶ñš“L !° N:)Áòí·ß25†™c D„0gœqÜëÍ È| O;í4ॲñš¾éx6`%è¤Îáæ7tûŸ«"†rðžö¯±qÍŽÙݧÞÑsõ Ÿ œR_QulýgBJsáQYœÕ¸¯HûWŸÿ…‚<û‹=ú'ˆèįÇ;'%'a–Ð&5гœ¼#®ùpåÃßm¸ç«µ u ‹ÏÍÎøeÚ.&\÷]÷ÑÊÆýE½'ïÀÄR^˜µÕ#âé>ïéµîþ¯×=ðÍ:–û È/zkéÍŸ®0ǃøkòa÷|µž÷ôZûû,7Öîà#ÂIMiö†a`Vç?Ò{}cMLbäbO·°YëüW:†dg§g¥§FÄ&|4̱´0*ð÷jß{‰ç«µç¿±”ÈqUqõzõ÷Íw}¹îæOm¿ž¸£±®àúî+¡ ‰Ix¡fnرûâ·—õíD{f‚¾òpo-_oÜ—ˆm†¥’|͇ ˆðÇ¿]ñ‰ÁU6u/T龯×ÝÛkíó¿Ø×–åæe§A¼®ï¾ ¾¯hhÔáSÙ¥ “‰£«ôzx鼤 C©tìÈÕÜR‚s:û3¢žsÎ9‚”L˜0±x÷îÝÌYàÐÅH U‡ /HÉ 7܉‡©à8„ 3VÌ,ðŠ ¸9sæ|ñÅl*û–~üñÇ8 ˆ¥„儨ç¸ÅüϼÌIÉ¢E‹ %p5!%XJ¨ÿâ>)áዞ0¿;0Xu»ÈÔ©S1–PòCmT–+¡/†t[zrîØ s†¼>Èé…I~IÏIA¸¯Æ½ôÎØÛ¿XøÀ¿¹iûÎøÂücxÍ-%ÄÌÔKÜ#cwGÅÿ2}¾¯ØŒVÆ#dÂ*ŸwocH3l¡‡WP4Êx­sȸ¥ÞLô”e2—ÁÄhkÏ hͥݖa/ùj¬3“Æ“cᦀ=ù™x}î`ª'>ÉÉ+rè •ÎÞç¹ãúæÀ͸‰Ô–æäç¦oóŠK¹ÄËÉ+1–m <Ï}_eîS?Úa¨ƒ¡ =ñw™fë·`Sþ¶ø›DÆ&~:r;s7x ¼oplcC! ©ð»Ì`½Ø[?h®ÇÁÊüËß[ÒFiªAùm¶Çp'ïpfjøYQ”°;޼[î3×.€u7:)ùf‚‹[@4¤B3l§‹od}Yîš¼å[‚s³Ó’“’q§­.ÉÆºƒ» F NþÃüCTHÞ•Æpæ«oP˜‹­2rÅ,Œ9>_ý¶R'&¤„á ßã¾€ÁŸŽõâ‹/ÆLbmk“é¦ÿQÌœÏ<áöìÙ“mWò)‘²¦ª¼ùæ›ÌýáÊÛÀƒ"BÑà>‚C&¢W_}•Ù+ÀS‚f9Þrr2 ¨ásÏ=—Ñ?6$>”-^Úª uºxLH vŽåË—ƒ>IÜ3}ƒw®¬X4©NŒS 78àL*aî 0É8ŒeË–qz0öÀçÄf¬SK—.%žÖöcjú¦ã D{Hpˆ”¤&ÆgôZýɸ˜G~ÝöÈ›c®ýzüË3VçÏ»ßþë¦÷†ÜþRß+ÞìÑkomÝ1Zf3Ž®éixrôãÔ{ÒŽo&ì°ÛÆ aü[¿ï“¿WùB ø ? ¬,9ü½ÚëÂ7]f®õGµc½ÄË?4æ{éÁšü¿æ»ã›“¥1)|c¿¸ƒð£–xCvúE1ÍÁªZæ;6íb"&(>1™%3Ìøl»WDbRò»~<Ü‘Õ@ÎvÃé:b»=ä³QNL$M]ãÇO5Ö¹ìÆLBüÌ­àV]€vàâèÉ’YˆË R ˜ëNäø¨â2ÒP–ûü¯›pšÉÈH ØûéH',CVøÄ'$±Ìçäk‚Ë”Õ~yYéøØ:…äg7Ù„y2|§/^«¬ýÑHF2sI¬Çé1rûâMA…¹™+¶…àÃûÕxç5N!¸þ°ÌÇ;$æÝÁ[1ik³5÷‰æ¤„AÕàÁƒqògÔ‹šéð™R‚<à‰ï$ë8è™°ÂUÁ&¤ÕΕ1.ŠyõêÕä¢c©Þ ÖÉf]1±ÜãÑGýàƒèèvîÜùüóÏ?ýôÓ0¨Z½øÜsϱ%ŠØŠð‡Àg7L Ôº_|/Îø“Õ7° ªŽ«²š‰Ù.~ÂtþùgÈ .òþûï5dLÙ@Ö×­[÷ÐC±ÜûŠì%Ó¯_?Ðj ˆT¿ã0*RÒ” ããl"%š–Íé·è·W‡ÝÿÖ§Ÿÿñ¡ûÞ¿ùŽW®}à­›}ç–_½ñ¶g._¼bÙžâcù"5c)IMÍÍLg± ÆMŸ—“ÎøžG t?:æ!Šì“†²×Þ&kZ_–Ãâ Ë?î´-|S`Þòžc ϲ[-0‹zšú6ÖÜjìåMº¤•ÈÚàÜ̈x,ø¯ÉÁcˆ?7+ Fäš„iM‘È¢e¨o‰yô]äÄDy·°BòKË‹¶ÜYË RñН´‡ò•¤… ±v,$u-:Õ¥Ý"6IÃ9 ÏÙéYûOBxÃòãôX¶{N‘¯N°K·¢Ï›Ý§„>Q6w·†M#Ì÷)ÁÆ Ë=0\£½¬P»›ïS’(¦ÙŠüšÚ6»O %%ù¢òp£%÷d_ö'åâ‰,dÈ%ê“·â-aE䤋bBJ´ÎÓà8Âà)ËÍ e»±ºµKÐ|*O) YN#!†ãn׊”tª›\zŠ„7æÐ[MÃäÒ¸ˆäΛFç¢)æù2xÛ˜Æfœ®ð!‰Y>×êÁ3—ÖLÆNö Ù]¥#³ÅÙ쎮"¡XM¬ðÒI‰®\µ1€AfþvjÔ,)Ñ EŸMÓ³L—R3žn“mÓäîòg$à “8·¾£«ŽžŽOôº¤C­£'PK`r£?9>„)iJÐñq2UOÑÂa¹P¬y¹¹9y9ùy‡þåäsÏ R|Œ‹‰[*"¤„ÚÖbàcGÕo#ÅÆÆ‡EGÇ@ØÛ#g µˆ†ǵÂZD‘P|ôè[­SBóbÀßwNÚ&¯hémPNVdÖ€BaZÊÊDë âˆÅx¡¸[I–D|°äRòY‚’U„a)9~éú%Û7{köž¯ØU0¦c¹o1üÉP]]UW‹t'?e•¢¥°í4µˆ¶Á²)¸µ]HEBBþZ§„æˆá˪Ú¦µÙVòAŒ¾Šìn®®¶E@ê9ðâ/l=u-#«¥,¹)±%F! P( vG@‘’v‡X% P( …€%(Rb J*ŒB@! P(펀"%í±J@! P( KP¤Ä”T…€B@! P(ÚEJÚb•€B@! P(–  H‰%(©0 …€B@! P´;Š”´;Ä*…€B@! P(,A@‘KPRa …€B@! hw)iwˆU …€B@! PX‚€"%– ¤Â( …€B@!Ðî(RÒî« …€B@! °EJ,AI…Q( …€B ÝP¤¤Ý!V ( …€B@!` Š”X‚’µ„9pàÀ~u) …€B s"pðàÁc+TEJ¬…p´(Gee¥···¯º …€B@!ÐÙðóósqqÉÉÉQ¤¤Euß9äååmܸ1 P] …€B@! èT„……ÙÚÚÆÆÆ*RÒ98G‹RæççïØ±#===S] …€B@! è<ddd¸ºº&&&*RÒ¢ºï %ؾ’““SSSSÔ¥P( ΃7ÎÎΊ”tÂa‰”Ƥ^¢.…€B@! Pt àNŠ”X¢è;SsRb E>ñúj’ŠEù †‹¾R …€B +" HIgbÊjBJ(ãÔ´´´ÌÌcüKMOׂÀe’ )¶¡Žh ¦§‹`ÜèóM' ˆúT! P(:+Š”X¨è;S0ŸáI±±É ÍþÓ^%%ì¸ ÂHR’“µ¨âãù×ôä(DGì#é¹¹i¹¹)iišTññii99é99-šÎÚÜ”Ü …€B@!p,)éLlÃBYMHIF^^¤›ÛºgŸÝôÎ;æÿÞygý /ø/]šQXØdº0šRiž¦  ½5Ðd¯Zµöùçíß|só‡F89eäç7k,‘‡$çï´|¹ûÀ[Þ}×á½÷<† \´(ÆÓS£G ÿäÒÓ2­Î&ÒšÓ  ú…€B@! 8)(Rb¡¢ïLÁLHIVIIàÚµÃllÆÛØŒ³±™fc3óÐ?~òWŽ¿ÿžU^Þ¤þSSÓ˜RÉÊÂtÑd´Ð5ý¡9ͪ‘•%.oHNΩ©ñ;–Ø¦ÛØÌ=ãŒ+²«ªšÈ„QUF’YTµk׺Ç[ô¯Ͷ±™hÁæžyæò›nŠööÆ^ÒìäÎÔ业´2•1ÈÓ”`sxw˜*Iv˜Û";Ä`Èï1œ”F¨Q( A@‘’ÎÄ6,”Õ„”Àâ##½fÎô]¸0tãÆå7Ü0ׯfÍœ³Ïupð[¸ÐkΜHx@v6µâéiÙÙ¢ªÓ 1xˆÇ‰vášRX˜ž—§1deað`Î%5##kÏïÉ“!óll_rÉîµk3KJtr ·7âHÏÏtv^ýÐC³ â=k–ÿ²en£G¯ºûnxRˆƒbh‘#L^ž–!-ã[ ‰ò”­ @0óa„ €" qÑh? $;D¨=9”_î%ÅãžÉR=‹B@! P7Š”X¨è;S0sGW4zvyyViiyc£ícaœ˜±äüó˳ËÊx…òÖ %%1^^^£GÛ¿ðÂÒ»îZóì³î„oÞœj°šhβ{ö„®[çÚ§ÏÚÇ'35 ¸±qéý÷/½öZè1Ï?í´7ß<ÿ¦›"ÝÝÛ<ĆÁžnyyŽŒ ü[tþù¸¡dUTdWTz¬ÏÊ[o Ù°³M”‹‹û AÛ?ûŒ„–ßsÏÆ7ÞØõûï¡6ÒÈM^^R|¼÷ĉÌþ¬ºï¾åwÞéÒ»·×È‘øÇ@A`$0Œø  ßÉ“7¿þúŠûî[vÇn/]š–Ÿß”’’ˆmÛ܇ ÙðØcKï¹gÍã{ ²j•fiQ¼ä¸;õ¡B@! 8^)éLlÃBYº$81±°±lKÉÌsÏ-hldæEûg˜R^,»æš9§6É0Ñ3…ù”ÓN[xá…~Ó§cKÈ,.ö›={î)§Ì9唩† ¦]f÷Ö[# ó/ 1c,áÛAØ<6o6ö,&ãë»â®»æØØümc¸`An]f´`«7L3EE۷LJ†æîÛçüÕWD.3;üaº¸p¡fÌÈÌLŒŽÞôÖ[³N9‹ Œ¿£mlb==qp!L¬·÷Ú'Ÿ$Âðv²-Í9÷\×~€Ÿa# Y½zÉ7Î9õT 6’ÿV>õTRTù=<Ës¼­K}§P(­B@‘ }g v´ÍÓR’’LH ?egØ¥×]‡‚‡²ì^·.a÷îíß|@ao|ñE™ Yùïó[Èöž=ãCB .ß¿£OøJ´‡‡ëo¿F²è ½'LˆÜ¹3).®i2åÐdaVYYÐÒ¥¸’l‚ ¦è…¨ùËÞøü_vm­ÓW_Ù½ürøöíQîîa7nxúix ©¯{䑬¢"¬ ~3fðÿ˜7ݸlY¬¯/bÛÞ?á3JJ`6ëžzŠð N;ÍcÄ$q>ÚDî–Ür æÒÚô¿ÿñ“ì_y%!,,ÒÕÕý¯¿ÈZBd$Æ!EJZÕ•¨À …€BàÄP¤¤3± em-)àlá9jÔܳÎBÍ/<í´¼ÆÆäÄÄàµkÑâ¢øãƒƒ#¶nÅ䙘{ú鑌âb¶–œ†hDÞ¾Ó§K€%—\noŸ»w¯‰Ÿ,æÜúz§~ýĦ)É®¬4ž(†¤Ñ“¤¤œÚÚf—ÊË!LÜïüóOÄÀ 3 *S\œYV¶á¿ÿ…!ÞÊ;îˆÜ¾~ƒ³-I˜@Ò³²‚W®\|á…p¬å×]íæFv˜²ÁX‚x|â3iR¬—×¢K/•ÜméÖ¼à“àásãĘŠA! P(,G@‘ }g ÖjR‚ŸG~¾ý믣¡Ñúø…ÈD†Æ0Î;oþyçqîáÁüκ€"_tÞyŸ{ÎùûﱑˆÏŠ×ĉBJ]tQˆ­-,ÁDµk‹tª«=‡ #Ì-¼IŒ÷mÓÂVôhŽ#©©» °ùeÛÛoG±Á•”`) ^¾QÅÔÁßU·ß¾ù­·¼ÆŒaÂ(-/oןÂH4^Ã<Y`r‡xÈá¾ý6§¾~ë{ï†h™ZtÆc˜3Úmo)Ñ-7–·%R! P(NEJ:Û°PÖV“VÙäæ®yñE4´,ÌIŒŒ [¿>lÆÝ60u‚shRt4¶„H—¥×\³ð²Ëd&íŽ:ßøä“ ° H ? %†Cõ‹ÚŸÀseÉu× ¢×ÑœZd5Ì!O‚íüùgÈ6Û[n µµuüüsq…á+Þ²VˆE¼®ü±àŠ+ðzArä!0ÿü¦Mc5²Ó?h‹“ml–^ziÐâÅ‘[¶#²£ý[·w|icp:yþù…—_¾àì³e¥4Wüç?‘;v`žQÓ7'ع¨Ï …@kP¤ÄBEß™‚µš”ªìüõ×yøX32yûö1¼ îÜhK]¢£“bbða—‘ Ï<3ÿ”SÐúèòµkó<ÇKÉâ‹/F÷ãÁj²7«ÐTW?ø Ðˆ-ï¿ÅÛ†¶š—Õ¹LÓÄøù%†‡/¼ôRX"yŽYÝØè>z4á±”)ÑÖ9‡„ÀKX_ÃLÍÎAƒ–\vÖmEÏå—3©ä?g΂3Î •%_Ìž(LÊ-G55ÙÕÕÄ@^’ãâ‰É€9s¶|öYÓ¢$›]C†4™yZÛžTx…€B@! 8)éLlÃBY[KJ4G×üüÝ7.ü׿Ðâð’mݻǸ¹Å²éjÔÎ,ÍÅ34ÜÁÁö"QçYÅÅAóç/8ýtóIèúõ8‹øüýw“£ëyçÁZ‚‚ðä8bm­a§2Òr<6Ã?,n’J\PÓ@îþ ­ suÙ¹SŒ.óN=Õå»ï ,Û¾ø‚„šHII ¬bÛGíèÝR’’˜ˆ†UÊ–ÝrK~c#~»«n»Ÿ<Üôâ‹Ø{₃ã£wí ˜;—ÌâÖºùÕWçÏOŒˆÀ»–#›¬Šû˜1į,%'б¨O …Àñ  H‰…о3k‘”ˆïȬsÏÕWßhÛ¡¦¤ìê×oÑÀÐå+o»ÅÃ+ï»oñþÃrÙHô:N¦ þïÿ–ß}÷šGYvýõ2ß'&l-Ñîî'„—à^:ïÚkÃÝ܎اİÄõÏa7¸Êb™ -þÚÞwߪ\zóÍĆ/j„á«õ?Ì[äIJêþûñZŸ\C0cà²êÎ; ¼ô¦›VßwßÚÇ›wæ™|Nê!+Wf––Ò IK/»Œ‡˜X–ýûß¶=¤¥rÓMˆ½½W/X IÏ:óÌwÜaûàƒüã[¯}è!L5&bOÛRß( …@+P¤¤3± e=))jl\` L‚Œµ±RÒ´;*KN’’¶tï¾ôê«Ñýc ê|ÍCÙ½÷^BL Ó7N}ú¬ê)tùHŸXûðÃ;ÿø#Öϯiƒ×ÌLß©Sa¨vÙY$b×.¼UŽ09~h¾#ÉɾӦ9~ùåü3΀ëà¾ÊÞk›?ú&!‡9— /½„ ¼ÂuíÓOËN$lÂv&Lô,YâðÑGË®»Ž‡ì’ÂRšÍï¿ï;s&î&šy†¥Åiia›7㊠}Á=…-Lø»êž{6u놥ÜGŒØøòËóN?Tø·þÑG]~þ™uÎ’µú¦•‰ ®P(NEJ,Tô)ØQI K³³ã£¢Øuž¿±áá²µ¼¾k»l·Êέì”F0ü?´mÍ8\†E1†9Âó0>""!*J[gkp8Õª¡,œ!@b¢DN¬Í%cXj«5÷Ä'±%$h;ʳi½aŽ&[jj\x8^´B›âÃÃ5±wï–µ9rø_‘1h"loø¼‰‘ÃøZ˜ˆ¤b3ÄÓ6­7œ•#Çå@¶D`rªmfhÇØm[ê{…€B@! h%Š”t&¶a¡¬G#%æ‚&FßkÿLvã0¬Ñêá|; Ót,Ÿ¼§ÃÙuhn^(ÅaÚ!ô½þ­‰£ëáÊiœ–!6YM£Ñ¶?´‘švøŽ¼"ÑC÷š!D?TÏXTù\ÕlvôTeÊ"Ù‘TŽˆ¡•mIW( D@‘ }g v R":[¿Ìg(ŒßšÜñe³‘4÷ñQ+èÑS©Ž!‰ðŸ£0NñØ‘Xà 60õ¹B@! PXŽ€"%‰mX(ë±I‰å•C…T( …ÀÉD@‘ }g fLJŽÏT ¾R( …@‡ ““ãì윘˜xl½k#WgRÎÿßÞyÀWQ¬? ¾äoo׆åÚ®]À®Å.¢(ˆ¢ˆ ^PzQQ@éJ‡@’¡¤Q’BB iFH?锓^y¿›I‡1Ws çðÌãîìì3ÏüöÌÌoŸçÙ™‹UWH‰——WJJ 6U’ ‚€ `>ä²¢7û¹ÆÆ )±“‘‘agg·k×.I‚€ ‚€ù €dïÞ½+W®ŒˆˆRb!¤¤¬¬ŒÇ&IA@0+ÂÃÃóòØ'þ\IÜ7BY¤‚€ ‚€¹# ¤ÄÜŸ è/‚€ XBJ,äAJ3A@sG@H‰¹?AÑ_A@°„”Xȃ”f‚€ 掀s‚¢¿ ‚€ `!)±)ÍA@Ì!%æþEA@AÀBRb!Rš!‚€ ˜;BJÌý Šþ‚€ ‚€… ¤ÄB¤4CA@0w„”˜ûýA@ A@H‰…qâÄð°Ð<}Õ­a(6ÉúpnAyKä%f ÿÝ·%%[R¦¶¶vÛþxCÉŒ¼’½!©¥åÕMîMÉÖG%„‘ïááñÅ_<ôÐCªÌìÙ³Ÿ}öÙ 6œ:U½`Ó±ÙÁ6;¢8[àÊ--ÑaÞè?*6Ã>hæ†àõ»O´DΟ–Ù´iÓÀ»téò§%¥€ m!%mó¹ü‰Vz½¾OŸ>êm>8&Çfg”G`²wpÊ‘¨¬¾Ý~ž›TWWGŸ}öÙ²eËTÕüªÔÁžàÔ¦z„ÄäŽÌ˜°â`^áŸó’ø´ÂÏ~õj­&TVÕ<:xÓŸJ;‘±; Y£9ÀkhÂÈ‘#gΜ©.y§P²ÿ/žëv8‘‘y²EÎýÖU¡s}¼“}BÒlwGM_ø§Jþiªª*ÊtìØñOKJA@Ú&BJÚæsù­Š‹‹!%8(·Á3zÓÞXã ‹+w õ L!“IôçuÚ„wc[Ï€”Þµ)(®˜lãÿ·ÛÒrKêNÕõŸî…%ãÒ—4>ñõïûzŽu-*­äØ~OÌ?û¬ý¿×­G/=È©gPò€_<ûü¸k•ûñç¿ÙŽ„ÌâÒª»>¶SU:tùòåêØ0£ï=š:qÅ!•ùÊ8]¦žƒ§¾ÞÒé5ëÇ¿Ü|äx&§1)O Ý|å›Ö7¾·†ÓÄŒÂÁs½9Øâ·Ü%ëEDBîå¯YßÐÛæíïw*Qó6½üuë;>\oõèÜZ:wo‡^+øÌ~§¿Î nïö•“!'4.wêÚ€¢’ MÉg^óöªžã\´Ûçù\ñƪëÞ]£Ë,âO¡ £FZ°`±Ì)küSs´†¨ôÉ ¯ëßµ±zqIx|§é'K{ÿ¸«Ã++º~µ99«h²í‘ö±½æm›ÍûÎxFo~ç—Vh,–ã%Ûî|kÕ¥=—Ûì8®.Xè÷WVük€ý–}qœ~1{ïuïhuEesš_úÁTêzâËÍ¡qZí¤N:5+§‚€ ˜ BJÌåI¡§"%IIIäžÐå¯Þiï³qo Œ}"'¬Ý"}j±A'²çm á௮ܜRZQ}ß'öûŽ¥ñÏvgù·õ]‘ÇÕÓ 2жû%ÌÛxÔ¸2g¿ø•îÇ„¥?=|kf^)—m UvwǪð!Cš“Ÿ£©#û©oLtOÉ:=—'¤þêœ]XkáX•·ü`na9!,!ÏÚýxa±Æ ))S?l/Ó3n•ùþOMY·ë¸ínÍERT\±`ó1ÌE†[ %OÛb8ÔåÍqÔZgõÂ"cɇgî I=}WU•1)™?¾Qẉև R*O“O=Τz¯åï ×Hwÿ3}îho\—:Æ€œß<_å¼<Æ¥ººv³Oìï[à%sô²˜jT›?Ðêâ);û5 *RòG¨J¾ ´}„”´ýgt I —cÒòí¼¢í<£öÆ~ýÛ>rV¹GúÓ&Ëð„<¬&ÜÑ= ƒøï%8Hpò‰#äó˹{9ÅæñÊxWöÀl"9€µü¸ÆÿWûà¦ìÞ”r(2óG›#UzŒræøª·­ 9@JÒ^üvûÜG'¬<ä´/®¶¶®¸¬r®ãÑ)¶#í»ì`euÍL»À°øÓ!±i9%½Æ»-ÝžyR#@¤ã‰y“VÂÞ3üw¿%Û#<“± ¨KoLÔtÞáŸøêx·ù›"pÊÚD ZAJž:ƒ”œD™òÊêáéãVüy} *ŒóËfçqÈœº?È9HÉ$ëC±¤dñ¶°ÿþæ;mmÀüÍÇ^øf÷Æ¥̲þ~ÕaïàÔšúˆÚÛ><‹ûævÆ¥ôÔ*­®u=˜HTÐÂ-aÿ`WVQ]ZQE£ÈÙàCk÷ˆ¯çûN[Hæsõu3‹@¢U‡=ST]$!%ƨʱ ˜BJÌëy5h«H‰Š)IÎÒ§åhΕîè¯ùSVºD0ïr°Þ3ú絚ûæúÞšsä¸îä _5²Õ/ÞÑ;¦ª¦öƒ)»8Õ—V=ó_Í¢`çyR¢ÃŒaŒØÊªêÅ[öù%ìK³ô€ª¢¦¶vÊš€-¾ñ_/Øg¨÷¬¤ÛÌWó÷éK+1-ÔÔ;Z~\s„PÓòªêÀY3íƒõeUÓl¢tZÄ(A©Ô’žWòñ /$ö@þÇÓ½p9è+Øu$iÉvf!öÑÁ9ؾ?޹™Y9)K¿!ß ¤§ËÐÓ¤üYÁùz-´…Öa«2OCÃ#@#%ª:Ò¹I 惥äçõÐ;t+*©ÜêÛQ[V^‘W:}]Á4H»é=[ƒ>†ƒÙŽ!ð?uŠÂ¡ñ¹ûC3pKåiº½1ÑM_¢µÖ9Õ¶Õ/aáÖP0 êÚæ×XWEuV~é » €Fû’æhKŽ ˜ BJÌåI¡'‘˜~øaAA¹‘‰y+\#°äˆ`»+j¹K™ûަal Üd̲ƒsêÝ1 rä/³é¨Å·Øq8i»_¸TêêðI¡ q3ÌÙD]ð m´Ù‰ªwöÓÌ?ÑÉ'—9‡ã½Z³ó¸£wlv~™A+œ HLkÝî(b\¨è×5;£Ù装z@ìÖyD/u7švíÚ)!£G^²d‰A A½D¥«rGfÚ슲÷ŠAÚ,ÍMv4.—ælðŠ^å Á"g…K¦Ø3í"ä[»iO yR;ý“ñÑnôŒv;”øâ·ÛÊ+ª ¤…Úï‰^½ãxDâÉ£±9kvEAeöÄB‘€l…K¸=u¹G¦6S!%†‡%‚€ `v)1»G¦)Œ¥„ïT§M›ªÙ bÓ `?Ö{4|\Š/À/,i;· ,£þ#Â;´˪T s?³;(Çâ4× fvšž[¢<Q"p‹oœÛa¯æùÅÆ1Gc³?úÙCaWTTäííÍ7´Æ_ß8;;''é Kª›7 ÅÙä‹]AHžA)pŽíû8ÆmÁ\ËÁ%ºŒ"<>oÜ«•w=”˜ž«Ù„RrŠ÷'p©×8µè‚ìð×qW“'ŠemAB\z¡ŠQݾ?ïîCa‚p|ã+ªOED„/^¼ØØ}Ó«W/ÿÊỂ”|ƒ£‡Û‰Ggè‚u<é$šcp?‘ kL6r**ÝìGILG*'1³PUAÁ#àRÀàÞ 8‘Å)ÔS•?‘œ¯êâ©qzèÐ![[ÛK/½´ r*‚€¹ ¤Ä\žÔzòyÓ¤„%Ë.DêF-ÙÏ»»ªƒ££ãäÉ“YaLåüðÃ‡ÆÆžñ½I+ê¹; éÛÅ~|™‚­(V‰ ˜>}:+¯¨S___š³sçN)iõ[Kàž={f̘±bÅŠÖ(rA@8Ï)9Ï€·Zuð’ÒÒRµ4ÅùOñßËP5æs+/?m¢@+l9¦[3Ö”Ðøì7­Þv¥<.J²j]EEëWÔêšC›XTW-#IsD@H‰9>5ÑYA@°@„”XàC•& ‚€ 戀s|j¢³ ‚€ `)±À‡*MA@Ì!%æøÔDgA@AÀRbUš$‚€ ˜#BJÌñ©‰Î‚€ ‚€" ¤Äª4IA@0G„”˜ãSA@ D@H‰>Ti’ ‚€ `Ž)1ǧ&: ‚€ ˆ€ |¨Ò$A@AÀRbŽOMtA@,!%øP¥I‚€ ‚€9" ¤ÄœžZEEE©$A@AÀ (++«©©9÷¤+¤ÄlH‰^¯?räHPPPHHH°$A@AÀ|8vìØ¾}û222„”˜ í8·¢999¾¾¾ÉÉÉ)’A@óA€™+++ R/¤ÄrHI@@@aaaQQ% ‚€ æ‚á˜ut:Ë!%¸oNž<™ŸŸÏ_I‚€ ‚€¹ @ L``  a$4÷ ¤Fbœšüa+M ´ú©ª±¡¢sö†VmqšvîÞÛRô¥´°RL‹FMH 1‘BJ,š”@ ò þq\oD1ݯ_®j4Ôd¨½ÉAAAK4i(S/ðtyÅ{H†Ö©«¯i§ë:«ÎõèýyJ$´¬¦{"YsA@H‰åpCKšZJgÇBLôúþ•”–•™n²l:©«¹¦^ßô_QQA ¦m%°@±'hlWQii!-¢]ÅÅ´‹‹—ÔWF](vV…5ÜÐáܼǘ*QXx‰¹Œˆ¢§ \P„”X:)QÓ¹^ÜÍÍsøp¯Q£uŠEp–ßu—ÝSO9ôè±ò†ÔkbÿÜs6?îóÕW•ȯ©ávn,,-U äëõÅÕÕdR‹¾ªª¤®.+.nN‡aŽŽµõªÂ{(¼d‰S×®Ž?¾þé§íŸxÂ¥gOÇ{îá*Ĺ]+YU¥(‚f).F”ªK_YÙ@ËhQU•ªKkBYYzD„SŸ>ëºtqxñÅÕ;ÏiTxõÃûÍœ 8J8å5ÔÈ€KÁ‚n £/*Zleµ»_?ÐÐÀ¡iÏ¯ÔÆGQO¿‰€’‹ƒ”TTì?~㦇†žÌÎ>™•µí駭ᄎÀüZTY™yhúôý&ÄìÚÅle%73óà¤I1îî™ 'OŽptdö¥0“:ówœ——ßĉAK–d%&2µk¦‹ü|aÃ2NœÈŒ÷Ÿ5 F²õÉ'—ZYù}ù¥ß¨Q>ãÇ䤦–”—ï9rõÕW§ÌÉÉÖé4™%%'œ÷²tiNZšæ‚)-E‡Äǽ‡ ˜5 [Ü(pÉ’EíÛ»½ýöÑ£÷Ž•š¸áî»|ÿ}FTTnzz_¸‡„Ì›gÊŒ‹ _¿ÞwäHl ~~PÍSV–—›åêªÕµdI*hœ<É¥¢ª*]@€÷!GfÌH‹ˆP$iüƒI]ºtþ%—¤‡…Á•°Ö f›h77ï#‚æÍËJJ*†š””@Úâ÷îõûî»CS§&<ˆaÖÖ °ñÞ{ý'Nô:4ùèQZúçÁ(³OËí‚€ ˜-BJ.Râ5v¬ãóÏë «ê[¼ûý÷­o¼¦‚ ß~sø×¿Vvè°ò²ËV]vYЂ¼ÖgÇÇ3¡Úß{¯Ûk¯­¼ôÒU—\rð‡˜­a0ž¬¹æëË.[}ÅŽ÷ÝŽ{£EAÁVV}ûnǴб#·¬´²Zfeeݡà ++ ÔÅ” ò›0aÕUWå$$`WÀ0ƒ£ó†íu×-·²Zõ8ÿç?11X¼>ÿÜîÖ[‘`sùå¶7ݲzõ®>úíÚY_rÉ+«ÈM›ü&MÚöŸÿPÅ´°‚Kê”âȯ¿Útê´ºC$ÛÝy'DIvjªëk¯­½ñFê²½êªÕ×^›pàtgÏàÁën¾YÓö²Ë6>üð „h‘7%%@¶nÝÜöísRR è µÚÑ»÷ºoŸÕ—_¾¥kW˜ øM›¶®sç•ÿïÿ­êÐCÔÁŸ~ò0á7+«íÚ‘3…·lÁ #¤ÄlGKQ\LŽ€’‹…”±æöÛC—-;±u+– fßH;;| Ñ;v¸öìãêZZPPŠ+'/‰?'==?52áþî»éÑÑ9:&ø f ¬!ظ‘L|»?üpk·nX)°7L³²òþì3ÝÁƒY11…™™¾_MÉ̃±.¤GFª@æø}ãÇ[_ye&eÊÊp‚x ä1`@Anny>ÞýŽ·Þ‚@d&&ââ!@çPv\Ó9F‘Ôàà%W^¸xqžN‡+''&αwÐ ¼?g„¤à£)*Ò¬ññé11‰~~n¯¼+RE¥ø]»Jrs3££­Y““™´p¡S·nyYY(PRT8gŽëë¯g%'kޤ¼<ìF¡«WÏm×Ó LEs„}òɾQ£Ð¡¼ 9óç;÷èÑeÝ-·øOŸ^RX˜—”³cÇq'§‚¤¤•—\âñöÛúœ°ÊËÎÖ¢tŃcòaM*sE@HÉÅBJü&O&Âc†•ÕÏ$:t8áêÊK?–ß1cVuêäѯߞO?õìßÿ˜1s­¬Mž\œ—‡9aÿ¨QØ6´‰òòùVV'ÜÜ\_}³ f(6Q¥Ë:vŒÙ¹cÉT+«(''hb¹ëÐ÷ß/²²*ÊË+ÆŒQNA2&%š…£¼ò±íÉ'qxõëç3l˜ã]waÁI„…[KØêÕðï’µèškBׯ§^”ÏMN^heµoÈl?Mâd©.ÞÇƪK/…c¡9­æ®ô'0‡ØÝ~;¤êdn.7"vím·ÙÝr U£€÷ A.Ý»ÓðhggªhBJ¼þyÆûóϽú÷÷8Ð¥W¯Õ7Ý„ãfÛ»ï®èÔ gSjD͇oñ±F¯O>!•T\‹¹¢· ¦G@HÉÅBJ¼Æ·ïÒ…0ŽÔ£Gñ)˜Ç ADq’Ã_õxØÝ}û–07û €"0yÃiB׬Yså•›~Ô˜°™¶±7ÌïØ1ÌÁ¡¤¶V#%72s·Á]&L€”äähŸù4~³s)éõ?Õ;w`BÔKí¸98.ÌÊbRtrÚÙ¯¶õ÷ߟŸ»ðª«Ž­]K¸hå1p Û»ïjѦz½ÖY°C¡q!¸~0ièüý9 _·n:ô¨¢Bãùù¡¶¶®½zÑd—wÞ)*.^vóÍê5(€a«VáîiBJ¨(ÎÃÃææ›a9¸ÐvyÇŽä~Ÿ=C†À{(P\WÇš*+Ûµóüøc65~æcúN-5‚€ `®)¹hHɸqö]»æ¦¦2AFlÜÈÄçí­LØÚº¿ñ¬Á‚'r“’pßøNy&cL ÖVVy99D¤6ÒÀ¿#sælºÿ~‚a±yH F$ï;–‰7Å4;AýZR’Ëw:\r~î¹À¹sk§ ý Ï õ’ôÙÙDÍš›’²ðŠ+,€NÃA< Ê¿É@„ƒL81¾¾óÛ·O>p‹\!dáBH T&'#» òI©‡ïë»ôhœPÆ `ç($ø…•ûÆÆ÷ #}m-ѲD±„mØ`\^™j2u:®«¿ÅÁìTY] †0<ÍÚD8°bNb,1×ÑRô“# ¤äâ %åå»GŽ´ý÷¿™YqÄ0O™=CHrhhnF†ç§ŸÚßsÛ[o¹¾÷á›yÄoüøâÜÜ•íÛÛuîìññÇnï¼C*Ñ ð€¼¼<ûÎíï¸Ãýý÷]ßxƒˆW¾ÙA&³õ÷DÔûV4#Jm-¤ÇæÖ[7ñ™î¸õêE¥*¦Ä{ôèe—\’yâ„”ZYµ};V­Ï<ƒ@—7ßt~é¥>ˆóÅþ®»JuûàƒíÝ»”¶f µà[Y{õÕî|àü꫺˜é½¿þš«×>}h‚ûk¯á÷A,‘.vwÝåÞ§­ã; ‚pQ€ØØõ7Ýäúæ›î}ûâܱ½öÚ”ŒØXjÜü裚ï¾KÔ­Ã}÷Eᾩ®V¤$dùrÜ^ZLe%ì'zçN‡{ïÝöì³n½{»¼ÿ>½¸´ˆvyùeçîÝ]z÷öèßÛßìP£ÇçŸ[_}µë[omyá…D__œ )1ù°&‚€¹" ¤ä¢ %8P.]êþÅÚ'¸¼¯2×ú ¾³OŽY† ¿ 3úš®]·¿ôRÀܹLÀy©©„t8¿øâžáÃyÄæLJ¬Š„ï~ùÔvýcm{ï=<#ØE˜ªù»ü±ÇbÜÜ´•NêVhH†u—.|°ƒA›ãëêV¬ØÒ³'_+·Ñ£¦ì7Îá™g6tëFTÇñ-[p[¹rç{ïÙtéSa¶“lz\] ð5ʦk×MÏ?Ÿ†ñƒz©Åý£Ötëæðøã„©Æzxà:ÑíßïÚ·ï¦=Ž._~lÉ’UݺaGáæ#¿üâüæ›¶O<±{À> „dét4pËsÏÙvíJ¥TœÌ%ZAsÐǶgOÂfµÈ˜‚L2)ÁÁXn6=óÌê'Ÿäëâã[·b+ ß°¯ra ]¹R[s¥¬Œ@ZŸ#X”…ÖÑÌ!%æ:TŠÞ‚€ p>Rb餤Ñ_@ð©fÏh\âL ËÐT/)áXsÇÔÔH“Bûð51×ÃÁñãñGhž‘š «õÇø…YŸÂZ>Bê'oWT¨KÔš¯Úšl••¤$2ò¹½´”|µ›f6¨_º¹Ÿ¦ðWÉÔÔ¨«Ó2Q‰òD‰²Z=ª’IÕuuZ]Ô«×CVÔ ·×;qh¬jˆX\/&h2ëÅòWû@·Þ©¤µˆ4¶¾Qj—*-./?½vœA¸B9õ‘¼j…7Mæi¥056*¦­e"f’ó1¬I‚€ `®)¹H‰!ŽÁè{Ô†Ï@Ô:§êDíiW?I3}fÇÆ²çË/UZi˜ ‚€ `^)1¯ç%Ú ‚€ ‹€³y´µµµåm •••¡IQ¦ à!*‚€ pv-«ªª˜c ÊÊÊεBJZÔ…/V]]ŸŸ²Y*(((*(8Ë…æE[#'77—nVSSÃAkÈ‚€ X& ’%%%L–Ù¼·*//O¯×·pRÒB .|1HÉYI~AvöÉ”´œ¢¢ÂóCLrrrЄÄA‹“RP‹HIqq1“ÇEþ Gó…”\xÑê`œP}{‰f2ÉÏ/,(HNÍv>²Á.û#á‰ú‚¢“Z¶i?/EJ8P–C}êØxàiPµ1K]Å´c(CNac2´Îøêéö6¶Ûëm2Î5Wà ÐŒ41-L"].z°(RÂa04 zg?ß ƒ¤*Ü|Ð3–ÖöaKI«ó6!И”¨©Z_Xt$êøöè­>E~Ùj[”¯Ç^bÌLñcmBJ45ôz<¦ü5pºq/R§ª›ÑÁ***Tᢢ¢ÒÒR:-‰òg0.O1ìŸÈWÔE¹fÕíê^UQó~kPÀp`Lac¦b ”D¦ ƤD9†AŒLE†‘“†;ÈÊUB18%“K(!¨ü&´¦Í.¤¤MpˆVWÂ@JÔO¸¸°(6!cáž™NÛWÚ½ÄÑ»¼¤T…—˜î×iLJ¨Š0dȸ¸8úýª¡ÇZ¼KQŠ4€—!1bD»ví:vìHfPPÑ*†ÂJ%7lØ0`ÀuËÀï¾ûîÌÌLNÇŽ»xñb¨Œ’¬jä.XUzŠýpU]â@“¢d:üE² ˜ MH ããƒ#ÞÂ… Õk•‹”ììì:uêÔ¾}û¾}û&''3ÊM›6’—_~ùàÁƒ)ÌðAá;ƒGyÄßߟñÍ,Æ1!%­ÎÚ„@cR¼š—Sä¼9n­Kòš9¾ß”×轂}vúW–—i\Úd½¶‰¥„²nݺ‡~xÊ”)111¸ugÍš5{öìÇÃÒÒÒèi3fÌøõ×_)O[³fMxxøÌ™3Çg·K—.'%%ÑW¹dcc£ÓéÈ¡7Ò­­­ëêê(ÿè£zyy‘Ï1¤„ØÌ?þ8gÎwwwNÝÜÜöïß?wîÜ]»v¥¤¤LŸ>ÝÃÃCõ^{{{Ôøé§Ÿ,¼Äd¿,MH /Kxâ‰'Ô ÷ÔSOy{{+ 1c#Cb=Ô¥áǯ_¿ž‘íP9‹-š4i‰‰‰ nŒ¢ÇŽRÒ&ææ‹V‰Ó¤„_°¾(82i…ßÚ­I‹çüÆÎ°Lß2ôëù?U—ÕªW ƤޝHÉc=-ÈÈÈ€‘@íW­ZµtéÒ¡C‡Â à_|ñ ÒÓ§ãÑ(¼cÇŽÿþ÷¿NNNÜ¥èöû￟7ož­­-ïZœÇœ>‰Åò÷ßǸ2räHØÏäÉ“—-[Æ]‘‘‘ÜB£ƒ~ùå—¯¾úê‚ >ýôÓÏ?ÿœz)#ùæ›oÐgíÚµÏ<ó 7½&ÂJÄ ‚ÀÅŒ@sR‚]ù…^P³XÏž=á(ŠX0òR×»woFQ.1dmݺ5,,Œ¡Of0üí·ßrçϟψ÷þûïÃNÌeK‰eò)á;›ìL½µÇv»°ß‹"œ—D¥ååç|aýà;³žÜs@W[©QoMÜ7Ð|z‚|p‡Ë÷éÓgâĉtª{ï½7""bûöíýúõƒ|@8(Lå¾ÁSƒ­FQÀæ1fÌ äó®‰pÐuy] Õ<¾úê+Õý(ƒ7‹ÖØ •|Ì”¤Ò7Þx†„@ ù~ø!˜ƒ©S§nÚ´‰{»uëöÃ?üüóÏJ!%&ú‘ˆXA@8«¥ä¬¤DÅÕEGGCJ”ošñ“W5$¼÷Þ{ žÃ† cpcèûå—_°Œ?þæ›of\ÅdBaÓö­õ…”X8))/.õò?6iÇ׋ ÓeDŸªÕÚûÛÆúÎÿ÷ »ßùæ NÕ.­õ“2–Óœ”àÚÄ8ÁÂÔ ;5jÛ£ƒƒ…1oàLÁƒEÀ•c %ägee©¨•QàíÛ÷bùðóó#žñÉ'Ÿp€4È }•ãÑ£G÷êÕ ã&ÌpnšƒeeÞzë-^Dð¿BGœ¹—¾yófÔÃdÙOPd ‚ÀùA ¹¥„ѯñxïÚ·oï]ø¬yI;~ü8ÌC-2Æ(ºzõjÖÄêaÜ]±b/{Œ¢QQQ¼‰1ÊÝÿýؤÖÔRç§9¹!%–LJˆ=™S:Î~ÊŒ£/w}þëE¯îÞ¿-¿ pÀÔÿôžþÀ'‹{iÄ Wyœ:U—gš_jR¢¬Žt!¦ùììl €>£ÒÓÓy3À•ƒ)òÅ_äTuEúQú'æ•õ ¢ðàƒ*ZƒcãÆ@50®@,>øàÊpÌ ý“b>>>W_}5î8Ç}÷ÝGç¤Ò>úˆb°z/ež}öYØ }ž» I¨„žÈ$áÙKÉ_bäFA@h MH £%ÆãîÝ»3Á9Ö " D—]v¡&¼P1úá_fsuueì¢ÀòåËèxU£F( ™&Œµ¹ bBJ,™”ðõHfVÁG6¯/HxòG¿gZß×oæ£ßÌ«ïO|üË}ý§=ðú¨»¿ý¦é~¬Í? Æ/Ãøî»ïŽ=J½„ƒàŽ!A&`ñŽàOÁI¢ON×âÔÓÓ“ÂÛ¶mÃæA ¶õÕ Ì†ÐT2 IHHÀªI'DøPžUXbñ¼bù  2‰#Á•¿QÁ¶tf¥ D„.“ˆ»¹ ë ¤gPjj*’ÛþFK>)#m&¤%ùB4¯Iß~ûí‘#GÔz¯˜xùË1†R®òŠÅèÁZ SáÓŽÕ…LÞÄËã£õ‘pÛl»±VBJ,™”𬭪ºèw«k.owWg«›o´ú¿Ví­¬Ú·ÓþÖ'í÷­/1Ñõ¬‹§Ñ[0?ªÞ°g@#`°~—ô4NIpjøÈžS ÃBÔU’ê`üUËØ«ñU+(†@W«z&~ƒL*R(ÃU £ eÔá.ƒn†ºÚ~g AÀ|h²xša43!ÉdÄS—¾ĸÊ(ª–0Qoe †Æ+š¨µÔêf‘„”X&)1,3Ï>w ‹ ‹òNâ½1I’eæM«‹C@–™WT–™·LR_VËì( ù’I»6¤^¯–™7iE"\³FÀ°!#¶Y7äo*o g-™›eC¾– ÔVÊÀKð&^؄Ą“Ú‚2 ©]s  IæA‰)£…ó¨’uá‹ñûV‹µv°S†bšä›èʬ¼žø2MT…ˆAÀ`$âÉð†4ê/4A¶pRÒB .|1bbccO4Kq11 ñ±,¼Óü’)røˆ†nFß¶™B¾ÈAÀ2`T+´òYe´è¯µ‚%hùà±…“¨’uá‹ÉÁºÂ|Ƈ²Æ)$ìÄÞCበ‰ügúÄ’¯Z`HР¿V[“&pªR ¥Ê·ü–æ’ÿ§[¨˜AÀV(`&Þ'ó/¶ñ9kIRÒ”ÚD™f¤$Ž¿+ì€ÃQ'ÏÇ“uI -ÚÿòØÑ„”лPƒeZ(ò¬ëªøÙ “+‹ªñ—µ ÏÊXEùª³™Ž*¯nQùZ5HÆ•ªÛ ™*A ‚€ ð¿"À››”ÆF-Ÿ‹jüRÒ&8D«+aLJêçáøÄØ„}!Ûc¶zç9LsY“”Ø0õþ¯§åå›e¼a2ƒn¡ÒYsè¡¡¡° °Ìùä“×]w{scÒ ÒQíÛ·ç/”ÚAyV”g{`B,áèÔ©ÓwÜù`¡Cò!1°–K.¹$((£5²»»óÀHØ× +‹ªtË–-˜^ˆA£b»E·hþ¡á‘ö¨8yÓGÃMJÕåëtš)ÅD¿Æ&–lô+¶Rþv¼›9s&æ&röûeWˆ›Ô0Ù³?–ZEP~6ÏcÓ¼9ìÌuà‹ú'<€Ýõ8˜={6è@;.\Èî¾ÜKR–xϼyó 8¼yðs‡ñ`± Ð7¶¹BæâÅ‹Ñ3$$D`Èa{?>fvqq!‘@µ “c´…¯ ¡Ú AïŒx­Á¾Ê>ðšÅZññ»aÁEМÏ}l"ðE¬ ˜ÍI ã$…2 ²‡{”îÙ³‡!ÔtÃuÁJHI›à­®„”$é£O$ÍÙ¶ÆöØÌļ°­Ë£RƒâR¢>^rG¯™:¸ìÏÏÎ&4ÃD?Ç&¤„y ¶ÓcRgñ,ýû÷g#_hïÌâlÿËþRlqÉFzP5åãa.ç˜Ýû0?° 7öLv&§G왇!dàÀ`aËß~ýúqI¹f >’ùóçC2HB 6ß~ûíã?æF4ˆÝÝÝá4pö¸b_bÖ/‚î@J”mƒ¿è-¢ 6çD&ö*¢ §ìÌIð ÔçÍ7ߤ ˜vØë‰'ž ™ì+By˜´F ð1à&zŽ"VLÀ‘µK—’³Î’òõM«“S 4’T]ª£‡ÏOÞC–pä”¶`à©Yvc?œÿïÁþýÆ7SSJ’Lf,in)a^‚3É`ûß¾}û.Z´NÀDŽ!¾·sçN¦s 'œ*RÂ_(ñ­˜+ x©|¨ 7.]º3 <€˜Ž‘É% 7'%Ð n„‹@)ˆ8vP‹§/½ôѬ¼ˆà$‚@Opf,|ÒŒ£:Ũù€ôÀ¢à÷Þ{¯Š–g§bœDÜHŒ7ľ,Y²ã ürC£0½À°¡•¸oL=¸‹|AÀhNJvïÞͧ½çž{ŽS±”4™2…”˜ŠC´º\EJ´—ò˜” NßÏŽè9q× Ã÷Øäi–™ôéôîïÍxàÓ…¿2ªó”¹kõùù&2–4!%Ø ðzàµ!,»‚““Óˆ#~øá&ïiÓ¦Á!4!‚+1"Ìß°ì”!â; lÌM‚ˆíh”„ `êÀèâè蘙™‰gçwÞ£¦ŠAïÉgŸ}'€¯ÖŒ+S¦L¡Æ©S§â²A2|‚œ—_~™ \B@ ½{÷F7v¼9'¼<$ìŠDËzFyÔ¾âŠ+ÐaÒ¤I¸pÐù—_~á:ØØØ d„ hˆ-Ú(sœ0DgAÀÔ4!%Øe h{å•Wîú>ÿüs^ Áõ¦VæÊ÷M«ó6!Ð@JâbRÚô±ã߃Ö=ÖkÊí/~}ç[#º>ÿÅ-=¾ºµûà[º|ØéÓ¡CÊKÊϺìÇßÿ]6_§Z@à'¦‘LjêààÀ1VìP OOO¢L2%¤”îÇüÍ›Ó<¯¸fð°0¯S˜®" µ1´ÉôKï B°µ`¥€^¨/_ ÛP™Óýû÷S·@€‰×°‚]¸EÅkâææFa˜ ¼ çÎËGŧFr¸l3¸‡°pŠ…š…"KÈGZÁí`Ë¡Ö.AËÄwó÷W"A°<š¯SÂpÄÅèÄ`A!´îbpþ )i¢Õ•0¸oÒÓÒW8®uð‡ï3ø½¯>}mÀûÝû¼Þ«ï»¯÷}÷•Þo¼ðZwK1ÙLÙœ”Щ °Å˜Å±aàQý À)I}‘¯‚L9U „’¢®ÂfTP*EÓ¿šïIPªcED ß÷«S%„bœ"™Â†S%“ÐånÐÊpŠ>ê{fU«µLÔ±jjp»*@‹àUêTEÚ #±¼¹DZ$´ Í×)A¬aÐScàÅ0€)iu>Ð&H “¢.!):*!.F“˜Güÿããtü‹‰Ž3©“²ù2ó®Ð’õZðG©ùÕ&9j¤hÒ“Ï]¯±„s×Þý›—i•ÁK„‚€å!pÖ]›Œ!–×êæ-ú+¤¤!´Dþ'‚€ ‚À…Càÿ TѤó¿hIEND®B`‚surefire-sample2.PNG000066400000000000000000003021271330756104600346040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/resources/images‰PNG  IHDRÝn½VgAMA± üaÿÇIDATx^ìxÅׯcÃîßúÙ+ö.öÞ{o(*ö¨("ŠŠJ¤Iï½Bo  Þ{ï•Þï·÷„õzHB¸IÎ>}Š^Š€" (Š@+B`Ú´iå%È‚‚‚J˵gÏî ©Õ¸žŸŸ_QQÁQ`D8D4y y×®]-//)¢´´T›õÙ¨Ž¼yd]? ‘„*BÄ;X]šOÈzò’I“&•””dè¥(Š€" ´ÒÓÓ!µó1Ò)))®®®3¶iÓ&HƒP™¹áÂ~ƒÉªU«xÓ‚bF÷ƒÄá‚‚øúúzzz 5!UNNŽ¿¿¿³³óŠ+8=eïÞ½Ö9›Þ I^ëÛ»ÖlâXÿ4e€O@°\\\ââ⨠)žÔ—SV×­[Á ^²d â!¤MÖ?›ƒÔ“—L˜0!333V/E@PE µ “••uP^ÂÞ“eË–rÊ)ßÿýÛo¿Ý³gOx‰¹)na}±Ç÷ÂQ`¸ÌpŒºuÂ{ì±ë¯¿žæúø$8=ìé§Ÿ~á…ºvízíµ×Ÿ•2<’7þšÛ€ ZdýI¬eƒ'Yç7âçYg5oÞ<Ã,‹›… 7ÑÑу¶.„’V.Ž>žÔäÔ¤¡¼‚¥—" (Š€"Ð €_egg×ÎKð `}çÌ™ÃcøÁŒ3®ºêª#F|ðÁ ,èܹ3öø7ÞxõÕWúé'r™5kÖSO=µqãF~ôÑGDøá‡È!<<ü‹/¾€|ôéÓ–süñÇ“á‡~èáá!OÛ·oß·o_øÔäÎ;@n^zé¥W^y¯q8‘Ržþy–φ 2fÌ,÷Ï?ÿ¼cÇŽßÿ½cÇŽ¯½öÚwß}òè£þý÷ßäúå—_¾÷Þ{HKýúõ#yþúë¯p F†«¯¾ú“O>‰ŒŒ„Áº( Éyä½óÎ;T 6FÈ¢E‹^¶\¸RÂÂÂÞÿ}î)Èù‹V‡ÍW”—´‚®¥UPE@8 êæ%â?`Ežqÿý÷Ã-øÙ¡CÄ-·Ür '°sÍ5×ÀX Á³²téR8Äé§Ÿ? &VüÏ?ÿ|衇`$М3—_~y»víøò fº-ÀM2pà@lãããsóÍ7C#0ù—\r ²]vÙeÜlÛ¶„¯¿þ:ÄåÊ+¯„I|üñÇÜ 6Œpd{öÙgo¼ñF²â/ˬ[B$\/Ý»wüñÇ‘ÙÍÍM*H†Ÿþù\°zõê /¼pРA/¾ø"’AЀŸñ”*³âÓä.å%‡¡ÊšDPE  P7/ÁÆc‰ñFàcÀœcÔùÉ^h7Ðnî¹ç¸Ë%x ð—œyæ™06‘°¬ãè舗⫯¾2—?HuöÙgË:>ÖqˆŒW†»ï¾’ÁvTâ°…}-ÜüòË/Ç{lrr²äȽ÷Þ Ï€ÓP:?‰ƒ«ƒHÌÈ‘#aB\¸@xc’/ÁÃA‰wÜqÌC„‡BqC]ºt÷‚ŸŒ¬ã¬\¹òŠ+®˜={6?)}Ô¨QÂWø oÀÙsÒI'ASØcW¼ÄXaŒ‰1þEGWÿ“Ÿ±±­@_µ Š€" (­ºy 6KÌöO¡½zõâç† ¸Ç$Ë ^( {há%¼$‚Í®^rpèÔ©y‘ŸP –{„p-^¼˜{\]t‘_Jùúë¯%>ÄO|ò~ÃÇÍÈl9ãŒ3Ž;î8É“ÒÙ/ÃÍðáá,f4h®|ZœsÎ9¬ï_ü"\â×±ÉüyòÉ'³póæ›oJn|6ܰH3ㆿ솱^"{ž’’R Ò÷íË«ªâÍ–¾worQQBZZÔDÙIëîÐZ;E@PZ8‡â%¬•˜t„¦¸CØ”*¼F½õÞRYÐÁSÂæ‰Së…ƒÄ:™˜[\%>dO«y±YäÊ#sg«Mn6 Ys‘›"¬£á­©³8ü.fŠÆIÓ„—¼ÍTŸïã˜ïã „âIÌÊŠŽˆØ6jÔª·ßîëà0ÈÁar»v+;vÜ:dH¸‡GlR’Ä´¾lB„¸ØÆ±ú- o“CÍ@Cžú¥²-ì@*k õŸâ²çÜì‰5+ØÂ;©Š¯(Š@B ^‚d†——^ ¹¸¯ù“m\Ÿ~ú)EÙ/‚ï„E‰is"뜭S™…Öš¡™Ê憟5E°–¿NñQœ `… QcnÀÝ»ìÂÕù=áy‰Å'æä„º¹Í¾â ü?¬9M>í´‰§Ÿ>îĹàà0ïŽ;âøϾžÌÌÄŒŒ„ôtîYâIHIá§ü£N4ž!™™FÜ0©©üŒ³Ü ÂCbÊOÛTIIf*É¡ÖTÕäƒ-EIIÕ%fdpo&á&þ¿âQºå_µ–âªÅˆ7¤ÍÌä¯ÉØÚPŸÖª*Š€"Ð’¨›—°fÁ+3‡¾""¡#8WrvíŠŽŠ «+E}ŸGEFD’{¯ø¸èԤ؄Øh’×')ç¦DFF^Y6ù“IÃåý7Ðf) ÄK ËœŒ9_x×]£Æ:8¬~óMÿ¥K–/÷?ë A³nºÉ饗àD‹ rvÙ²…Üc×Ãvìqu uw'<[ž˜)á>9??Â×7hãF,¿Ah°úYYá;w†¸»Ç§¥‘§’˜¨(2!U°‹KLxxrAA„ŸŸMªˆ×–-”’ © '!ô(lÛ¶7·M› %‘h…î@›Â¼½yDæÁÎΉ»v!@˜‡GèÖ­aÛ·Žì¤ÎDZþ…{{#ñ«û¦®^µäAJeW6…@¼„¥Xõ8øe<ç ’òÒbÖ3JŠ‹Ê°¨u$9d~’Uy9¥“yá¡¥8Šèûö”Ʀ;º‡ûE¦æÖ%ŒQBiI1ÿ ŒÊ:lñIIH~Ø9’%!½þþZ197×sêÔ)§ŸÎ¶äáØøÌªªÔ’’”ÂÂä¼¼Ð-[|æÏ7¢ååí7n„ƒѦœxâÎI“x|ñCsp˜äà§I-.Æðû-Y2õ䓉ƒ¯Z³}òäYíÛg]·n±ðN//×Aƒ¦ŸþÄNpùî;蔦â¿|ù4‹ÿ88¸õí»}Ê”Y×^Kªµ]º@n"¼½I5ã '{¬s÷î„ þ‡pùùg^âšÔ®‘!U«>øÀù§Ÿ ’ž_a¯Ì²^  É92$dM·nO:iá}÷-ºûn’ äº>J-/'rbZLeÞµ×RG§çž¾¢»jÚÔ ¦•U@ݼ¤Ö#VÍÀ¼¼Ý9»rç8Ä%gì«(ÞSZ8~™WrZViQþþŠâ}åÅ¥Eyú^ZXTÀþ”Ý{ËøŸD¹ÕO‹±Á¹%Ää_YqœéJ`QaþfŸ¨¿yL]íŸBÂ=¥Æ±ñå%åÅ…%…D&sr.Èß-ÉùYZR“œñêïN?Lr_°)x´“gei!¢¢¤°¤ÈHµ¿¼¸²Œ¬,§àgŒä.u ù}Æ–±Ë<ÿqòŒMN7ä,/"%ò¸¤0_òG†Ý¹»‘¬Ÿ¢© OùY\hÔ—TŸ\˜Vµ·¤ö³i¦ÕÓ†ò’”üüí£FM:餉z±æý÷ý–. Ú°!*0箋¤œ¼/?ž—§Çcæ-¼$^òÀX}²Ã9­¤$i×.|-“O:‰8cÞqÇä³ÎšpÜq0~.é¥U¯¿>ñÔSùÉ?8›W`E‰ÙÙ+VL9í´êT·ßn¦"óeÏ?Ï–—‰§f¦rëßßH••å·x1IÆp´ .˜~á…SN=ò«˜×¡CTp0®”Œª*§gž¡h$äï²gž{ÒIN9Å¥wo—~ O-+Ãgƒ;gÛèÑä@¡;&M’¥å%-zRáE M!P7/9äøvççÏßè·üÓák±ñËÜC.yoJBZ4e¬“×Ìuþaqi¥¥Eëv„3“ÍÉÞµlKHJzVÕ¾Òéký¦­õóLÞSV¼Í?vѦ ék|ý«*K0ü˜ù˜Äôg{/î7o§gX’OXüöÀØ ž‘PŸ-~1;‚ã‚£R‚¢’#ãÓ6ûFCkf­÷Ÿ¾Æ/(&eïžÒA ¶ßÙmθ~ 7ÿ0q#dÂiK( L[bb“2¼Â&¯òY¹5¬jo)ŒùóvçíÍ~+ù…>KŸéÎ+ÌTdÊjßõžU%!1ÉŽn!³Öù/wÝ_Éá°en¾Ñ“Wù®ÛYVR“²=(6-#Áæ8ûŸýÖ„>ÓÝœ}¢`N‡ýžNC÷½ÊN<ónº R‚_>ã’Kæ\w'Ý}÷]ÀÚµ0̶ÁK&NÄêaò)§ìœ2^âøàƒ0ƒÉx#Ž9†ÏÀKœœ`ÂV¾õV øúkŒ=¾ñvDúø,¼í6~bþç\v^v·¬Z5õÿ«Nõúë,ýP4©!•Ë7ßjQ‡’jöÅ'° ºm‡ÆàÎ Ûº5ÜÓ3|ûvÄ£ 0¡-ýûónQÆþýË_xò„ÔÎwî\ÖhW­Š ñ]¼xÊyç‘!ŒjûرiôÞ;B¼æÝv«<øc””´©M+«(-&à%¹»r™æÚc¦oǺàÞ¸òéIéÙ8E<ƒãÝb^ï»lõΈG˜¿zG,ë2¿7)61ýÛqÿœé¾-0¶ÓàUX÷χ¯ë=Õ«ÿX¯E° \x,`9¿Lu}¼×âYëx¨ë?Î/üæÄ ‘{Œß8{ƒÿ“?/~ìÇ…×}6£Ûè øE£’ÿi‘DòÌõþ÷};oîÿ–ì¼ñó™ûË‹Ú<­Ó •7|6ãÅ>N}g¹E'¿Öwù„>P¼4`îÖ‡~XØoöÖw­ôIXáùXÏ…©Ù_þ³~ÒJøÓ‹¿;9ïŒ|íÏe 6ù„%>Üc³gdwCŒ€ +¼ŸüiñË¿;òÊè ;#®ýtú°…AqP«#ÉKŒ}ßÜ+¯jYï5~Æùç»þú+ë&8NÄK {?bïv{ÏšUÍfN:‰£|?.«?,£¤±ú°r¥ðB܇%•ïÂ…8T1|3'ò9¼f*8‡±å…-¶••{÷²%…­'ÎݺA>  ¿òÝwÓ÷ìI·â%È“^^ž¼k•ÅC´ðž{„èÌ¿ùf–®à";ŽŸXr²ìzQ^ÒÒ)•_PÚMÀK²²vý½hÇ|— [:cßí]feìÚµÁ+êéŸ8tÍýÝç­óŠž»9ìÑž‹îúfÞ¯SÝxÃöä—ÿyõe] Q˜¶ÆïÝÁ«ø»¯¼èüN“–¹…ìßÃr‰±Ê7Áº¿Øgé¬ Aï ^ýìÏKHûÙ°µ_qž¼Ò§Óà•! é™»®þxÚk.ÿøï5Ïôvtö‰Ùÿà÷óC2Wm ?ëÍñU•Åÿ×qâZÏȬÝù¿ÏÜr[×Ù¸vžèµøÛ1ÎU•¥ÂKúÌpë1qã³Ý‘™¯î|=Þ¥C·9]ÿÙðôÏŽ¿Mß2q¥÷{ƒVVUí{³ÿª/Gn€ˆ\ñá$âtí½š—œ|òÎ ødÑÒG\¡&/Ù2hPÆž=ÞsçJ*xÉŽ±cI…ÿFRž /IIáŸËO?M<÷\ÞBTùWÍK:v¤h^’šŸ•‘×{’²³·üùçDËÆ”©'Híàd¬ù9:ÊÎYå%mjDÓÊ*Š@KG ±¼„½9ߌqNËâ¯Ê5ž§½66!9óÁïü<ÕuGĹo_¹#<.-ó¡ .ê4y±k«$Ïô^ÒyÈš-þ±¼"=‚ãì±àŸ%^l×pxfä<çÀª=°‘üÐØä–xÎuxè‡+¶†Ív¼¼óT7¿hˆÎGC×là×¥9¹¹,Ç<Û{É÷\\}¢VoCŒ•;"ˆé“ºpsˆÃcà;O só†+°TôÊïËæ¹"Ë.Æ^Ë:T—ÖãשÚSòó4·ŽVŽpÜÙþ£©Þa Ë·†ù†'Ž_îAY³#ò®¯çNXæèâN“×zD¼;xåè¥^Îr¿óë¹iYD~Üã:ró‹)>²ë88"Wm³²ø›”›k¼ãåµîÓO ZÀñqìE…+ìÝû//aLž|èuá%¤ò<8/©Õ_²eà@ƒ—Ì™SÍKÚµ³á%Õl&+Ëc̈>’Ù—_°z5Üð’Uï¼S;/9ðâ1›fX¢šþ¿ÿ‰ËdíÇϹújH Ùûï+?-½›ªüŠ€" ´ËKŒ]£»r=ƒ²rv±4>9c‰[Ha~oçL[ã;s­¿‹WTû@«ÊX=ÙÆSŽ c[èôµ¾S×øÇ34KÂF×Å›ƒc’Ò -+ %E‰©ÄÙâ½§„uƒý 7M]ãçä➌íg×{]ËŠóg¬óg; .¡Ñ)©™k¶‡ñªm\R:IJ‹ oJHÍ@¼²¢Âíq:i…;HHk8eòr=Cã·øÃ$ò+J çºø³Ýuå¶ÐÉ«}'¯ôÝè5ÆÉ“eñ˽qÀTícI9ôhü ïµ;"¨NXl²³W${bØÌ[R”Ïwþp¨°&eÉü0?5ÜP müþû•¯¼ÂóãEÜÔTvf„lÞÌÚŠ±±ÔÁnÁŒcưý²2õÔS½fÍbmeÉ#l‰ÉKá/9(/©¬ü——Ôð—{lËÊ`âA16´>ÿ<\ zˇêÉKb-;fV¼ò 95:ñDuqýýw@À¡Rý*r›éÏZQE@PZ:â%–Oéb×wóöñŽ §”ä±5•PÜû÷ðŠ ïÂäóλFðˆ)rsówçÊSþ••áÅE8.rIKdó­îåAAxáÅHRQ\^RH‰p)TÊ⟑¼0¿° ÷bxù‡äÄ' áÄ1XB^.©$2/ÑÈR ™ð‚O9¥ Xž!?"ðÎi˜•%Cx|2l-{^ S,/AA‰G•å…ìšå^ùa1HÄ.*D˜J9lR"(nØû811©¥¥›zô€"L=å”S§Fñ&Kx@ÀÚ/¾ÀNãXСÛW±Ö6L>öXc“G»vŒ²à¶Û—HªyÉ}¯„þ’¼®PsÇà%åå ²èá‡åÌ•…wÞÍù-;vàb©/1–hbb’wïöY¸ÐØZkùgäs×]lU–))iéÓʯ(mÆò¡&æ^Šƒ½+¶Ö*šùÓ:Eu ùÕ3Ëë¼µ\ ¯=Û¢Z‰ò¯ü–·“<ù7=ª² ¼¤úæÚ%©v˜ ñSÌKL2åÿþÃÌVÓ¿ø!Ž6[Œ?æL~ÐúõÕ¶ÆÄ,{ñE¢ñÇÉË9%²BÎ{¹¹þŽŽ?^"À]ŒuœÉ“Y^!dÂ1Çàqaµ…·‹á¤¢8Ù_â¿lüCR¹öí /ñš9SRmûÈ‘¤Â7#©XWJ-,d oâ̼è"â *bO°ä@ÈÍò7ß4¶ÄîßOåßTyyr€¬ìªag+œlúÙgS |kÃçŸã‰1éqjmpHÓ*+Š@ G  xIV¶EG*#‡‘±Š/a+(š7e6÷ì¹¶sçy7Þ8û†Ý{/÷®½{soÿÆrªåLwwV¿ÿ>G¥-{öYN`[ýÁ³®¹†øÓ®¿>%/*«WÏ»ýöY×_?å’KvŒÏak¾ Lºè"â̽õVØ«-«:wžÙ¾½‘êÚkqZ*híÚù:jê%—l=²ÂæÓI^h¤ºå¾.Í:k>þXRM½újDBηÝ1nÜœѾýâ{ï Þ°aÊ¥—ι香W^¹¡GŠæEóuŸ}Fª97Þ8ùª«Øëj~/.N.¡Ž¨Éô‹/æÅc„QgI šT|E@h£(/9bd£5”—ˆç/–žM¯l1‘3Ý9b•pãK1iiÿú8섟QQ°“¨°0¼#D µœCϫƜ(ÉON‰ qq‘ÃÍXpá)!ü#'±rÖÈ¿©8ß:ÕÆ¼Ák¤Šˆø7Uh¨‘ÊËKR…lØÇñóˆÎ©¯©©È@Y¬4qæ=®#‚«k„q¾~r2xÍsèCë-–.kì­).\¹g^–•¯½fC\ÚhÏÖj+Š€"Ð2P^ÒºpÄ¢/j"ˆ1¿ÿà¾zû§¹¨añ$'Çó…<ËGjjýnâ?ŸÄ;ðµ?ÂkùÚßA¾ÛÇðòÀƒ¥2è…EfóK{Æ'x$Éñl%´&%–ux ž!vÎrR ç¬'Ûê"NËTjE@P”—1²Ñ€‚—Tk³Ð««–mÿ}Z3²mHnÒ j2t`·Ç²ª_*‹ÓãßËúÞ\‹9Xu oPNëJì¢eSË‚;îc&Ô®(Š€"вP^ÒºpÄ¢6Š—´,lœ´ IOß1aÇ´ð‚ÂOá9ËXS+Š€" ”—1²Ñ€‚”—4¨7p~{JØ[ÃÇ„ÅûÒ äYPEÀ~€—dee9ÈåííÀÉGòÝ“˜ë6µþ¼„˜ |DW/E@PE U €QÃÚ+/±/ÊSO^2|øp777g½E@PV„À–-[”—´H^"»(xÿF/E@PE Õ €iS^Ò"y ß4ÖKPE@h}(/Q^Òú´Zk¤(Š€"ÐRh/1Žio—ýìö­çþ’–ªn*·" (Š€"pHŸ—`A Z¼û÷ï‡_ÙƒçDyIëÐ(­…" (ŠÀá!p˜¼DH †üá‡>þøãO>ùä“N:éă\<"‚\ÜŸrÊ)fäC'ù¤H0vìØ¥K—Ž=zèС۶m[°`ÁóÏ?Ï™÷<‚süù矬¹»»5êË/¿LJJ’„Æ ›>}:Þb’rr2Ë=„fçäT—UdçW–ì­¬Ü_ÏŠ<šò’FC¨(Š€" (Mƒ@Óð¼#ŽŽŽlA(É“'¿÷Þ{"àüùó!+Œ#Flذ?þøC±C' G—ÊÏnݺÅÄÄŒ3fÉ’%¬ûà/aÊÞ½{ñ£áœ9³}}}·ûø¯Z»Ék £÷Ëý£>;hqÎò­yÞå9»÷. ÊK9M§(Š€" 41MÃKØ\ò믿æçç#8Ê_|“ƒŸ,‘,[¶ bù_³f ›Qºwï.•àŽÂ Žü|óÍ7srrXÂõ2wî\6|°$y²Ä:Ñ÷ßuÿ´Ë—_|ÑcÀµ?Žwè¼ÈáÍMoúõAàUŸÇ¾Ý7m¢SŽ»gIQ^CR^ÒPÄ4¾" (Š€"ÐL4/^àÉøöÛo{ôèñã?42±}ûöwÞyç§Ÿ~bu†/ÌÁTØ÷Êz ¯Õ°ÏT*à ~R}÷Ýw={ö‚ÂRÎG}ÄNîW­Z&‘÷íÛ»fíú7Þ}ÿ®Þzî}wûXçã?p|×!Ç|¹Èáýo{œð¦ÿƒ_éÞóK²ÜaEyI3é–f«(Š€" 4Æò’W^y…SLÄ·ÁnÖM›6q@™ÁOÖtøüƒ-®øBX‘a­'33óÕØMaK,ÛSà1èçç³!>÷ÙÙÙ /+-wqÝ2kñÒo÷éðô'Ç>qû wÞÜî{N~úµc^þæØŽcÞ[éÐy›Ã;^Ïï<óàKÞ ¹õý G»D= aŲ̰Èòœ¬½µÁ£¼¤¡J£ñE@PfB  x oÍ4¡pl7Ù±cGÍ ¡>ìxMË͉³Øÿ˜'BŸqìwÝNÿæÙ“_¿õ”'®mw÷ÕÇÝ~ñ7¿êpï/tè4Ï¡Ë4‡n!øûîìs¾\{é‡^wvI2&ÃuGNZd…•EyI6Ÿf¥(Š€" 4»ã%uV¦´¼<ÂuCð¯Ÿ^þŒ‡Ã#«:­pø`¦Ã{ýÞùÊáÍçŽ}âšãîý¿ã®?ö˜‹Ž?öâ[.½Ïá–—žüÝáõuo;¼îðúîß¾ŠŽù#0`H~qÅ)/©s (Š€" Z/\*ªª¢Ê3Âb¦‡½ûQÒk#/y%ùŠç"ž‰tx%Öáõ‡OC>{ì×S>íéðy‡—žq¸ûn‡[ït¸þ ‡«z|rÛ¨?^4ôÑŃîñš?|äØê¹jGFá´E@PEà´T^"UâH“´Ê²¸Ìèè-!kî÷Îïþoöò}½kèM=öQðIÏíhÿfÀeïF_önðåÂÛwö¿éûðÎ?D¬üÙwëo«— ˆ‰ñ>|”òí$Š€" (Š€= Ðì¼?„YO#©YgëD„£a «ö喤禧Å&¤íŠŽ[³5ÑÏ#Î{{ZoZ€OR¨oVZRFXt’_hzvrqq)%ê:N#a×䊀" (Š@S!Ð\¼„SÑ8!×€{÷îý÷ßûøøpÒë?üÀGòxmX¤ç€Ž¥ÿùçŸ \½zõĉyߘ·…9–7wˆàïïO osïííÍ=ç g`` !¼æÃ1'd;• )SV¬X±û ;p}&l‹æ%=Çá1œ¥Ë»‚jEåÞʽûöZÑÁ¦Ò•:óáå)šƒ£{åp^d›={6­ÁÏ}ûö#XÅžZ_Šª%ïÌÜ’ðÄÝåõŽ_§x6Ýb„wÔQ]Þ)“hlÇæØbΠ䞊ð¯ªjÿ¾ýû\NlÌE5++ɬ±ùˆ t·áÇoܸ±1"iZE@PŽ ÍÅKfÍšEÖíÚµ»õÖ[¹¹è¢‹N<ñÄÛo¿ý¤“N:çœsÂÃÃy‹çõ×_çQûöí¯¾úêN8{¾ëÛµkWRÉkÃo¼ñXµ¨¨¨K.¹äÜsϽçž{þ÷¿ÿ‘'9ð±HÕUW]pÁܘ_l”-š—Àí:uêôØc%$$Pk7ÿ”QKƯž²:4(޶›ÆÎÕOÞî¦ hÞ ' „’&ƒ˜úûzûFçŽ^8qeÈðE¡ñÕo’:[Wÿ”áŽÙùÕ£®§ ‹™¼ÛÅÇ ¸æ5Æ)¨fäâ²=+¶ÇI¸§§çÝwßýÉ'ŸÈÏçž{¨Äýbט–[ä?ziÐðEþ™»KêoÏÞ}K¶Tml9,>÷ï…~ȳpSô®Ç×È ªÊ÷è&ÌG“+Š€"päh.^²hÑ"²îß¿?üƒ#׸ç˜Wæôœ1ÏýÔ©SW®\É ‡ªA;°©¿ÆOÜ!|·ï˜cŽÁ¼qJ=”…¯íÊM7ÝYáÈW>\X> |ù·Õ0•{¯0Û{ÍŽ„¯F¸M\ ÃX»ÓøôµÌÃòá-ønÌVüó4ÌÖî’E®ÑÄ™í‰Mçõê/kg® géá¶OIÎë½ÿ^ ÷7Þx£Gñíh <Ï×特ëË¥„Tì1¬;4h±k¬£«±¤2h¾Ïº‰«¶ÅOZ:eUh@Ldˆð'xxGD*³`S´³wâ¤U!ð蔼ék×o[ï•ôÅpW~âë„_dgâHÇŠ0ÑÀ“4±ZB ¼·ÛþbÝWzÄ;¹Ç !˜íñZŸu«w$H–ÍÏ&À±ä{“ríÝ·®K¤G°ÁT¸¼#3'¯ … .ß?STaÉžµž‰3ׇÇ`DˆMÍ{ò‡UN[câÒ«©†$|àFh¢Ü—UTZ(uA*êE+$gƤäág‚,ÎßUP\—;yU9ÓXó6Fí.*ã~úÚ0þÎZ)Y±zË-·˜Òê" (-æå%Ë—/>ΫÀÏÁ=NŠdñ›Ïè°²#•‹Ÿp¾íÇ=Y—9ûì³q“¤¤¤"‹5¸XX2‡åÀ$øÔ0'ÌÞ§O"pÈ,ÓYŸm˼Ÿ~‚k?˜{ç—‹_üyu`œAG~™¼Ó/Ú0ê\~·¬¨lOçA›ØÈà˜ÆÜº ¸Ü7*KØÌ-Ÿ,à/üß7Ó×…›;0 KÊÉ£¸Ð5úŸ%æzDh|îk¿¯#Ï‘‹Â¸hµš¼dØBÿu;ãË+ —ÆCß,yÈsïÞ}QÉyýgžŒË;Î’À’òÊ]ùe8càCߎvÇÅbv'ñL@&æoŽ‚ZÁ d'MÿYÞ,áþ1ÉÇ“=VäW;ŠˆP“—Üø‘±Sä‹a®XzscG\zÁ÷ã¶™ÅÙðÙØ$WQéË\ý ýä‚BÍÜÎMæîâ~³¼Éç¯ù~vÕHœ=_Žp«¬±õû…ŸWWü×µS¿Üð! ˜ëí’Acý>ÝÒS,™ÁEà+Üä䗘㑸xW{Ä[oOQ^b¶”Þ(Š@ËB ¹x ÛÉöPîÙÉ=‚ûaÆñ}>nØqBœuëÖ]xá…N†TvœÈ2 µ]ºtá'ßÐ e+".Öƒ„∿„l™š¿üòËm™—ˆæáT`*·kÄ"ÿü¢ò~³}øKï±¼°´¢ëÈ-DcáO ´À7:ë×)Æ»÷u5ü80p¢p/Yêfì‡`ãş׼Ýwà ?¯rñIdåbGˆq×Þýû.ëh4ëàù¾ñiÕn€Zy ¹a€ßúsý}_;¥[–Òó»ÞúÖëŸê¹âë ‘®xÇð™WHü®W~]#”E®µ;ŸùqeçÁïéâ¸tKìÚ Xhy4~y¼dÍÎØÆ‡ƒ7¾öÛšs|Øj¦­ÉKnþØàa,”¼öÛºo’JáÌøflýxI™ÁKÜð’åÛâîøb1œï?Ö÷å-+S}fx>öýò›£¹/,݃S§æ~ä{º°[_°Æ±NÁoü¾þýA.w~µØ?ÆðZAÑùnÙðÅþ4®³oò_,¢¬7ÿX÷Û4OZ™õø÷ËgY|3\ÊKlPÕŸŠ€"ÐRh^?¨Y[¼#dÍ—„y/9î¸ãxw†{Ù¬ŠÃƒ{ÖhØ+°vÃ_8áp ¶›ðˆ×sÌœß{ï½jY:vìXPPÀÎBØhB6Z>þøãmÖ_§ˆ!8>wÉÃrE%sèÜ‚Ò>Óvz†÷ÿ6~0h#.„Ïÿvå'[¦®cY‡ˆÞ“ŒWN:|a|7qÙÖ¸1Kƒ¹™²&t™»±åÊNFÃq±X3oS›=ÝŒ­rÍw‰Â¥—ÅäµòVŽ‚Ð#£‰+ö²Rã¸ÅX¾ÁÐþcÙqîËÓ%Ïàø]¬‰àÈYí‘úcš—8ZN~v’DÀ[°Ø5QnŠÚ·_AÑžkÞŸ—’S¸Ñ'wŽÄaoJ©%•\›ýRÆ-7öyÈkAÜ\ßÙpàÉ’ËÖ–Œ]ÅÑ)ù_t7Ãmü%lo2á/a9i³¯ñÑl.ü4!Õ~ÀØìÔìêm<:ñ™‰ü-,©xÀ&‹?ÈÌøá£Îƒ\$ˆ¥\>ÔkÆ:Ãõµp3ëVÿn×}õ·µžá™3×G8ØÃ V‰™ÿ~œò/L‘”—üeý¡(-&à%ìí¨µ¾l~”!’½¨ÖßÐÁÉoîNå&22Rkx›Ã ç¤>ég“-ñŽù]@ž²ãÕLS9˜$‡nvºð¢r =ï•}9xŒÌm:#Üðá¼»¾ZüüO«½#,›OÓ 0f—¼= ÇÀ›®Ï/ªøz”áœØì—Šƒ=">QY¿O7hÍÃßÎ-¶sNXað’Y"œ¶¼dgÂÕïϽ·«ãƒ_;ñŽÌ(Ç@Ù…*WrVѱŽõ‰¬ÞKˆ¹¿$>>þ‘G‘h/ôßäWmÂ%„Y~·Q[nÿ|Ñ-À…Ë0^úÖì;¿XüÆïëÊ÷Tz†gÁN*+÷»¥âàilj>¾qºæƒy 6ž’QKoýdQ÷1î,$±šõÛô7²àúçY^Gú÷ ˆÎ~ò‡•¬pÝßméEoÎÀ«ôà7Æ6—÷º\ßyþ[nOªÞŽŠç㬗¦IʵkךûKØÀ„»ÎÌ‘$l¹uµ¢hßÛvÓÇ úÖIüLƒæú\ÿáü«ÞcîÒ…@ÜóÕ’¹.Õ. 3«ÄŒÂKÞžyÛ§ ¿ùÇúB8«Bø„øzéuçE$çm N¿¬ã¬>šÏ&YËùeÊNÊ"‹Çx¡YW½7gûý.P¨›o¾Ù½WE E Ð(^óxöÙgÙðÁ‰#\ÁÎV¹¸g…í ŽŽŽæ=!‡Í°Äç†wvØ€ÂÐϬ”â›qøÉ#Î2‘$ü%+Jd¢Ir’XgES†úÜ-KHxb ÐBy oˆðf5Ôäð8Yãu”7GúÈÖˉ2|úŒ3Î÷„¡›lO¦±äšæ»ð¸ žçƒ¥i‹[HI·nÝ$[ô„WŸøbvÓ–Ò¹ñ2K¢>ø`sd®y*Š€"Ь>/Á½-du†±›×}k^ßÿ½xˆ{™—u&ÖI$¼f4›lk&©U0›Rx”ãRpÏàÔaMêè^ÈÀ™rLv·nÝZŸ†Ç]ûðÃ9È®>ñ›6ÎþýûX71=¼l5hÐ à•ƒ}+**¦OŸÎ® ŽùjÚrÍÜxfì²`vÀÌÛ)ž†&¼8HíÓO?ݰaƒäÉÊUcËvÑLYAžx£ ÊÞLùk¶Š€" 4‡ÉK0ÞXP¨ISPÙ|5¬Oμœl¤DPm/©Oíš/;4Y=i¾üëÌ™³UxÙxGh†¼^«—" (Š@KGàðy‰Q.6|´ôËNHI‹ã%-]ûU~E@P{C Q¼äè.y´ÊÒ[–¿ÄÞ´YåQE@hé(/±/z£¼¤¥÷(•_PE 1(/i‘¼„so9˜®Í^|ã—½´¼þÛ>ìYn³8ºâ Ä @lè%î¥#€ÛÕPÐL¾¬tŠÓ"Z%ƒÎÞMÎúj•µ;X¥dŒb{%„FyI‹ä%§»~ýz^rn›×š5kœ‹‹‹9ü†·ÇÛ&uÖ”x1‡s}8õ‡·ë댯‰]’“$1'¼˜ÆëñjÐÈ 5yD€nK­9ƒƒoÅ·)’ŠËÊKZ$/á4L^“¶yAJ6oÞ̬”·£1m„:kÍÎÌÚ±‘ EÉÅÅ…´€lÞÔY–FàðóŠ+@OaQŠ€ô;Ž€JMMåæ`Z$=´¡™Ûs|©Žòûb$"M=÷—/¡!!ÔÖÊZÍ#̴厛ÈoÃK¨ 5²†¢åÖ®>-XŸ8µòkˆ@¬æÐ&C!ë®®®äÀ2P·²°>è^“—pªh µfÅNg3Vˆñ«YGÑmîÃký&IU“—Ð kŽó­¯c*/±GFÒP^ÂâææÆGn9e•¿œ’ÎQ`øÐcþr™ã 7"O™Fst=ÂçülæÜ†— 3U`/_¥¶\ÀB½sÒ/3 sža"(É#" nr#W‹À¤æ˜X“—`ÑA)$$„¿h•µVR¡WìJ‰‹‹#Ÿ*‹e˜[(LÁ­V-²¹In{ÎĆ—ˆîÑ×pTgµŠR™}ÐTW³ÛZk ¨h­:iÓÙk¦’œih¶dIïà„@f5"ƒurùÉS()ª"%ÖLìÿV › /A  Œí¶)ã<ŠÄ´“⢢à+¢0æX'MfNP[Ð8¦¼¤5ðZíäû8ÆgùøË=c µmÛ¶APØFD/ÃÀ0$!¨8 Y¹¬¬¬$²i†å)“cû7Ã6¼Dº%•/>²f¸@©2 ,@…Ø`Æ\.v¥…Yeº7ñÝÝÝŽ%2©ä)È`§[â ²&/‘`9#˜Ͱ àC•M…Ù•ÂIöQA•È|ð8è! G4¡/\’\ŒœÀ€bÕ0Ò2ÛÙüV`6]^ÂOxÇ6ÆÆÆ#àCP6f˜ÀÅ ˆ‘tCÑgE¥Ï‚­Á“¿d"žI%°ƒ°™Šh”"˜“V>9ɧ!è tZÙxDVæXAˆ|*•8´µÌah\iVkk×êÛñ(VІ—Р|–•1M¾"Ǿº-­Æ×ÇD—h 4¶–¾Ì=…Vˆ†ðWÆ1.™Ūºhå%­—È:ûì°4¨ŒsËäŒ­ŽŒ,0̳LzÐff½(4ö†ø¬qH<ßA›}¸A˹=ÅÆØ­îŠ`µòjDg̘Ág•øvP0·`w7g{?„¾Íú%º..L¯?’!œ=ð8 µÙÏÔ„ŸDà§ýcR‰““ñiFê;mÚ4Pb5 €¡‚°°ª èã njÍw£„ìæOô©ÑH(`‚@APøÉ'9Q<´‹L0r¢Šø®xžBVZ÷eÃKè’œ9 †€ æàpÔÌA}X¢AÝ•èžtF¤cÒlU¡KÒ‹¢@CpƒÒ‚*O)‹^Oþh)<æA)´9!!˜ÃK¸§éé|‚ÆåKpMò$IˆOï ­)ÆÖǤ‘3%"$yÒˆvnØZ‡jÙð™[Òïh,& è ³ âЋi#4‡ñЦA+h#´ã/“qžå'Ý“§èúcÏ-X/‘S\õ:ZÔçz,ŠtBƬ&Î,V5e˜ãâ»E°l† 0æ„Æ/¬µ¸†°Ê$$9xŠåf”䑸켇×ÊKèŸð3ºýÚG>ÿ+.tú0(Ñuj©#;‰Ì0-(†SfŠ\¤åži.æ–ÑY¸cR^ ÄÈ…!d˜C+°ÐyCˆÐ îQ´ÆSÞ.áСx„FQv¨,ðb ‰ ˜(Ùòˆbò“ÌÜN¦æ-Æ6º /AyäãP`½ÀÀƒ6˜„bõ¹'Ø!ÖX ĊȆeÅGB@ò@•ž7o6IRÉ2á²…†“ϰ£áè¶¹1Hx É…y# ¦ ^BˆIè;¤‹téb¨Â02ðˆpL6ß lx‰ôYÍ¡ ¦hMš†>ÈH%NI4~ÒÝP”@Z6à ‘¨¡Wv;Ū—ÐOP\Æk½Ž.Œ C‡þn_M^°…ÂA¥±¦èc ŠË ŽY^ ákÁð„²B¢©£¬"3t2Tñ”1ÃÃpÖ ^tT"×ÊK¨8óÁ0'¼Å1}ûöEQ9\ŽRåÜÕ¯¿þíåPy¼€„Ìš5‹º0†‹cQxÏÚ;Ø´bknv…€ /¡Û¢B¿üò ãüøñãy½N:²tph.ÇlvïÞ½OŸ>¼&Ž–_ýuúùçŸeÂF†¾#ÍØ(G0Ûa¯W^ÒJx cܸqãÞ{ï=lÌØ±cßxã 5ÔÄöÜzë­òÝ`;TÁFŽ6¼D(Èûï¿ÿÏ?ÿÅ»ï¾Ë€8,¥¥'·á%t{ô¾C‡|hòäÉŸ}öÙ„ i}êqΆ—óëÑ£ëåœ ÚL`$ às9|ðÇœÐ[ïºë.ˆ]¾Èéò|ÊêÇ„ʼð ¼#Ê!ž4Ÿ1‡èQ¬}d°á%¨Í‹/¾ø÷ß3¸uíÚuÔ¨QÂTPXg~<õÔSp\"|÷Ýw~ýú 6lÒ¤IÄ|饗HŽàúwÞyçꫯ–Ùv¨HÊKZ/‘}1œÉ'¸Î:ë,þBMFŽùÕW_õîÝ›Ï[0êÙ¡ 6²{Ûðº™Ü~ûí‚C¯^½°¸ÊKjå%HA %aŽ¥¼¤‘ªh“܆—ˆ³„~Šåà DÐæ«4˜Ô•{ØÉèÑ£ÉAz.×”)SþüóOÚîÈO¦|Êê´ÓNã ¤¼¤iËns«ÉKÞ~ûmyQ…š‹RÉd ×z5bÄqÿÅ_Èw”Dÿ÷¿ÿqCÞ¨0e® Ú[õ•—´^"ZÅ'¾XVd°cŒ:t(ûè£>üðC¾‰€ r*ïØ';nL¯¨ÉK˜ Ü{ï½òm暬mÉRk[¾ÁK ¯Ì¨p +/iZ ±á%²´Èo½õ‘\˜¸I8ïŽ{æµ'N„µ\pÁü¤Ÿâ¥g‰‡qÂc0']ºtùý÷ßéà,)5iÚö²ÏÜlx‰x:ç9äzðàÁxÔäK«¢]Ì}úŒ9ÒæÑO<ñóÏ?O™2¥AåÚD^»vmXX«W¯Þºu+7(ÒW_}U+elLAµ¦¥DÁÒf̘QVVÖäEám·Ý†94sÏ™3gò“¡¶9Šky2hÐû–ääd''§½{÷ÚHΜ‡a¦©³F°Ø ¤¦¦Ö÷óó«3šF°7”—Ø[‹ÔKžÉ“'ŸqÆâÏ`„ÅÈ=66–i‡Ùcß~ûíÞ½{›s÷ÈÈHžâ!20µ²™N:ýùçŸ{F’ÄÄDù)ñ¯¿þúˆˆ²•ŸŒ¼8Q°yù–‹øÅý®]»ÌâøI`yy¹u%¡˜ óˆ< g"ÅŒŠL å^RÕœHÏ„Y_F´ììl Óäœp Ȇ ˆ'N¢‘3©Äå@q sdN]H)QÄ£‚”kí½ ·Š"$›§øšøÓO?áR²®#SsŸ"‡áƒ!ЕrA›)#vZ 0/"KY$$pذaãÇ'+⛞J'24S‰2HsSÖSO=% bü¥ˆ@žyyy^TTD|òÄU6kÖ,kÊ4«ÀE*ä"BÅ͆–@%Á“V •ƒÔ½{÷P"Yõë×oÛ¶møQÒÓÓ­ •ûšõ¤F’vŽŸ¢uRSò$PfädKK‘„Ÿýõ×wß}'ê'Hrµ‰1ÁSJ”–â"DêkíÄBÀMB¨š4¢ûâ‹/Ÿ‘Dd²Li" XMÛŒJY"¤@ÊOn( HÁYJ”¶HÈh¦¸ùEë‹8’J¢!s}R!­Ùõ¨ Iž››Kþ¦ë 4D½¥­iVtyœ{B蘽zõ3fŒd%\’ЧܾÀH)D ­9RÁzè gfp\Ù€´ÍÞ!!ü´Gy„ ‰ úÓþP^bÿmT‹„ÌÀ˜13òlÉ’%C‡e¤Û_zé¥_|ñc=ƨÊ”ŸfÆb¢­Y³æÂ /¼êª«ž}öYé«$'­Mî;wîÄBªo¾ù†GLþHÂ_b2èàGaZsë­·2v0­_´hqp\øá‡ "˜Ð%—\Bà/¿üB>W^yåG}Ä0Aü·Þz«}ûögu9XÊ CVÄ<ÿüóCBB° W\qEÏž=Ÿ{î977·?þ˜TT¤oß¾6¢òôž{î¹üòˉ‰‘puu=çœspœyæ™?üðƒ>#ú}Í5× 8pÅŠHBãÆƒWŃ>Ȱ¾yóæ:0k§ Xn zæ™gv‰éèèH4jA]ø9qâDr£v“&Mâgÿþý‰Lé˜XòÁöðIrß}÷Yó"cÎ;ï<ê ë˜ä¯¿þú¡‡"Ppf¥]$9‚™DPÆk *1ÁçóÏ?ç'¬îrÿý÷F8´õ“O> P$B–/_Nqü$œUÑ–Å‹S7£Gf6Iï¼óŽØà÷ߟøTŠð•+WZ£}Ë-·Pwr€u}ÿý÷HÂ…¥!€ƒÿÝwß Èf’þùQùɼöÍ7ßäæ‹/¾Àׂ' TùIn§v˜£T4Ök¯½víµ×>ðÀX#ërÑjŠ£   hSÔ!‘ÍÁGÑTœ8<…ß üTЬ˜ KA”{ûí·£ZhõñÇl˜½ë®»ÛO|Øi ___Ø$ üÒK/ÑÊø#1{4+ŽC2Dµ¬×°° T_4I@[Êâ/ÊÌd€öº÷Þ{Y-ÂfS5ó)E fdˆØ8&­—3((Ð(ê"Úþî»ïþþûïT–pðI*ùå—‚ áD›={6Õ¡â€ÃýM7ÝDÓSºMAU„ü¥áè¼W_}5n°U«VÑ»ibz: o@Y šŒZ„TôBœ^< =X ¢$ÜGÈ1Çsâ‰'Òˆ80è)Â}IE-^}õUF:&• Ì£çŸ^˜Ó$0ArÊèËÄ¡áhJd@æ)eñ“¬Þxã ²dZ¡&?³EÚ!ÊKì°Qê ËDf™féÒ¥sæÌ5jiþïÿþOR2²Üu×]Ü0lÍ;Wii&L;0r?ü0!˜d›Å~‰É°eN—ñºCb¹È9…2¿^ÂàÈ8H|B0NÌá:wî C2‹“YfûÇdœEfÌ­‹ú˜mÆ>ò”‘á’zqÃ@3bÄlÖ«¦œŸyûlë´¨E´öà ½ÞÀ @Ѿ²8ˆz“3G!ÉŠ™Œ8?`iÂçè¤TêEoµ©ÐÀyóæÉê!BCpC/ i}Ñai/$a<‘-PŒ*ð:  AÅÖ¯_U¢P©Œ™šÖ„BCìå%vÞ@µ‹7aÂæÜ<Ã*0•qJF .æd29†:Œ;VeâÈHÇhˤùÕfpa"BffDÆNÃo°£XAk^ÂN¦¤ŒGd u`êong¡8†Q< ä€áÄ{¿ÆÃ¨j³§³ArÆkÆ&gøÙEÖ‚¢1 <ƒm½™¶&>`…£YA{ Á‚ÏÑÄR z"öÛ¼@»]»vü„&~ûí·.hP¢¸@l.,«ÄÁ,¡2oîÖ­›ðR \Ô„Ž‚]Yçƒ5BýhÖ­¤8l!ªBÈÂ… Á »ª€ ¹qƒ%ƒ€!ìÍ’´—L„:Pð±~JÑð-8¹‰и0xn ÀK«Y;±DrÂøå—_–¼¬ª0Ë—å ˆ9 ¤À.ò“?E³RŒàl½JC£®¨ }Dœpphq.Â8©‘YZŸ„Âht C9MRK|ð¡e1óÖH57þ^tÑE°mÚ”8ð jþš3y„óÏ$OøTCh7𠔇d&!•|:Mžâ ÂÇe¡.T\¼JŒN6¼D ‚¸ÈüÊì³HøÉ'Ÿ&%‚3M,Ò@Œl² ñÿI?E>0\€’§òkhA÷ÊKZPcý+*Nx1c8EæÄ…Žá‘ŒŒ•Ü`Ëa(]šq›$d…¿Ü׬?&D&.øEõ1ä¸X` dŒÝLß™Ð`àe Á†Á$ð3.S1‹Ã42¸°„Dˆ˜I†$±Læ…3ßLuì±Ç21Å,O÷1À2v‹a3/ÆJŠ“åv, LŒwx¹%¨0؃ì¤Ãð“¼w…x‰0ð9¢ •ÂRŠÓ»Î¨ŠOEÜï\ødÅÊä%Œ}Ì#å)"îþ ™£vˆaóò‹$„œQ"<†ñ)Éq· !≑ ¾Ð s·!Ì}MO6 ëÈ_F1ƒÄ)Âh±ÍH2SA¥dw“W¸Ìëˆ9ÁMB >謬ß# í ’”ËOÌ-.zL‹ä&vEª/ÞÃ%!$<ðÖ‘åžF‡„‘¼“&§à‹' Ó+pQÊæDÌ­8êÍ‹%J´.Ž{à‚¯P®€,YD²:‚b ó3› 3‰œ@G \AtÌ|Š1¦]`xÐÙæBLÙe%žPµÁ…‡Ë¢x(ý…ª‰¦¼ÐJèlèD-¥,¸£ô>æñ(•¹¹‡Eš€ KŒ=faTV¯Ðv”Pø¨ˆìMàÌÀÏd’E@L$Yä… ÉN<@HHÎâ<ãÂÓ€òSShf*nÐsq90æ@h¸÷ˆ¯‹I+MÖ0Š€’#¤øK ¤D‡4=úÌj¦u*¼w<¢á¤u„s!!ð¢ä&œï¸ãŽã/ü ^">!è.Œ:Òµñ— xüdÞò¿ÿýO¼_øu¬+¥÷vŽ€ò;o ÚÅcˆ”Ñ ›¥‘·3°@ÌÕ`$tZ™Ûa˜pkÁiÁ÷¨ì/aN&ó›‹ø2gb R˜sË¡ÄdÞC> UD¦w†`y„…`˜£8æ=¦Ý•GŒ¡Œe ‹ì€c¢9GZ1É\`"›ÿ©5c7S1&m2WfMЧ2Øc,Ž*Å` »b ?acƒÀ €Ï_ê…µÃÏ/lŒALˆ C0s8ì+!üed·ÙmÇ8ŽH &Ð8SŒ–Ly §± ”ËÎŒ³Ö¶AÐÖ<"&“Ny¿Cü% òTuZ‰&6‡¶à&»hi,ÙðA»ÈöÌ-B}!¸2¿GlVpiÀÄš„¬ð®ÃÔœla9òš «V ØOÀ_qBˆu‡Ná„ãýAK) Ý Ùç‹äÇ·.ú+»O`6²$>à€†í@=PNBÄ¡¿^P)Wt›½#f†]±s讘 Œv'>ö‘P!ð”m˜…Ú <%§Q$Üú‚{É–Àå“¡ËÀ*•BùÉ&þRÜ ™©É­—‡™|Ð(ü⪡idíKA²Ÿ&€“º$ËmÐzYy䢹éD¨¬cšÂC‰ð^P.»1ø ]å.îÑsô‡Å/›Wíè$¡¹qÊÒ~ a™bðçbDß¡'Bb‰¶=aiTVö€3 D%CñŠÑŸÊ"3UcK“,c“ÈÔ%g`!-LšM*"0ëM¨7ýˆR”èÑħ:L~p^¢oôYt —®ÄÖ"k4ôÞÎP^bç T»x v²Û†@ì(6€!^VgåbD㧘@Æ쥹§„¹šÍ«1’„ ¨¹Àlƒ ñšÈâ …ÂNÔd_=™“!ù0:0Ê“Ð:C8žÊhN&v Ê2»µ¹0 Ää’Š˜oÄpO¹PëkÉÈ â‘3c:?Í„jŽøL É„§R4òcŸ”QÉ©¬nÇPNnâÆ—GB@ÌÌ Ë'(‘§\æ 5J‘"j¾îýFeâÓ|ÖïÑHqت)/­Ø¼|$’¹¸Ž˜©Ë `É“²`6h à Òpò–“$3HJ7²5[„’›ï\Ø´‘„sQ}²5Bp°ÓVDÓ€ŽÖ ¤,.H§¸…À_à•íÃ6å"¿lrh5JÇs µͱ~­šEÑR¢u_”Äb¾=DEÈÁT‚‹RÈkÕ[šC©‚ 9‹3ƒšJ3IYæ[r@žØËšïãÐ}¬•Šî Š˜`hƧ PK2ÃÄ dxTë{æ’ŠKh9[W e›M¯Òˆ JÒŽRY‘Ê á^Ô›*n *BÒ”ËOà5½D2DˆßŽ„’êôÓO1ä4UŽŸD#ÄvԤт6Œ€¹¸Ö†1hëUW^ÒÖ5@ë¯(Š€" ØÊKì§-TE@PE ­# ¼¤­k€Ö_PE@°”—ØO[¨$Š€" (Š@[G@yI[×­¿" (Š€"`?(/±Ÿ¶PIE@P¶Ž€ò’¶®ZE@PEÀ~P^b?m¡’(Š€" (må%m]´þŠ€" (Š€ý  ¼Ä~ÚB%QE@PÚ:ÊKÚºhýE@PûA@y‰ý´…J¢(Š€" ´u”—´u Ðú+Š€" (öƒ€òûi •DPE@hë(/i‘°lÙ²7ºè¥(Š€" ´.”—´H^2lذààà;wzê¥(Š€" ´ 0j!!!ÊKZ$/™4iRnnnbbb’^Š€" (Š@«@£¶{÷nå%-’—L˜0!333V/E@PE !••¥¼¤eó’8½E@PVü*;;[yI+á%µÒå¸ØØ¦ÕU›Rš6ó&ÈÍJ¾Zën-½À9 ^‘› š…" (må%-’‘ˆÐæ:Žè/miüoûOžñ´) ùij£%;;y÷nþ%¤§W—k'è¿ ˆü·ÖH›˜ž.Âó/6&¦XlPm í*CP;D@yI+á%BRR32lþARS!5tC5Ò %IIÑÁÁ>K–xÍ»söì gg;¢&BØ4•žž˜™™˜–—`M›¸¢ WWÏÙ³½çÏ÷˜2%)'çP¼Ê’aüTãSSá|öÅÃÚ„_PûF@yIká%11)ùùnC‡®éÚuÝ·ßšÿ6tï¾mÈ€U«b££±¯t™ .IYYË–M:óÌCV¼òJZe¥áu°‡ Ú”šêïâ²â³ÏÖuï¾òã£#" BvÀÉÁMJaáâ×_ààð·ƒÃï9UUžT 1ÑÑ[GŒXÝ¥Ëê®]] ˆ‰ŠŠÿ/×±‡z« Š€" ´”—´^’YU5÷¶Û  £þ±†¿,Öwâ1Ç̺⊠_}‚·CÖt0ÆÆ¿èhãŸÜÛ¬P˜»0$š%‚ð’ uëf^uÕxK)k;wNÛ³Ç&·ê"¤›"¬K±–Dò7ã[E«Ä:«ƒ¬Iâeg»;Ø"Õ÷÷ÇWdÍKplúã¹wܱøá‡g^{múÞ½²”óŸÒ þá _ôàƒÀ8ÜÁaε×F‡†ZV3hEE@°”—´*^²ø¾û  “Æ{¬û!›ÿøcåÛoO>ùä±ã\ÿü“%Ì-N…ä¼·„ïä“ç\wݤsÎÉØ·Ï^–®ìmDQyE@hÊKZ'/}üñÌì¡••nü¿dŠƒCö„â·p|üqV:dm‚už²ô3µ];X‚¸4°úÁë×O¿öZY’˜ÃfÞúž=<2ý%k?øÿçܹ,sñ]wEøù±¢´â¹ç†ZJZòÁå0ùŒ3ü—.lÃoÉØá86ˆ&’àïáç–?þH-)à´XýÖ[„óT²2|?íÚ9wébl—IL´ö[Ô‡—°¿dyçÎ# ÈŒ‡Åš½{‹„R 5+¯É“ã³²úXDÂex¡,êØ•Ò¸©©E@hã(/i…¼„% xIæ¾}Xî´òòM={Ê:δ“O†@Vwì¸ä¡‡ÜûõÛ:pàæŸ~šqÞyiØá˜m/‚7nd vk=ÿ–[Ø9»åÏ?çß~ûŒë®cõÇš—àI--zâ‰Džýõ¡[·âI-/_Ó©ÓâtïÛwÛ_QÄüÛnCˆËÒçžÃ_áÀm3õä“I…´Ž÷ß¿}È5ï¼3©];Ì?…º÷ïO&ø$Ö¾ÿ>qø·òµ×vŒëòí·ª3õüóý.4¼/V{MêÉKV~ú©” ÿØ]Uå³`ä9íŒ3Ö}öÙöáÃ]ùeþµ×úΛV.]ºÌ¿é&"ðoÖå—Còp«$ñ‚±¾0ÜÆÇN­¾" 4ÊKZ'/Û®³í¿zõ¼›oƦâ!pþî;c¥Æò~ /ïdìߟ¾oÞŽ¥If_uUÈ–-l(ºd*Ïö—”¢¢å¯¿^½¿ä¡‡XÆÂcT½+¶yú¤æª(Š@[F@yI+ä%¸°î8Ì…ñÇãô쳜;’œl¼cé9mÚºnÝœž~§ž có„…»°îÃF“¯¿/Á;=ó ñM¦²Õ#'‡­æþâL?óLþbÔ7|ñûg«ßUILÄ#â»xñ†o¿%‡ÙW^ ™ á%Q¡¡0•å/¼@þ$œw×]Q¾¾ì{eʤÓN3y „fçôéD½PYušx ¸UÈgùGÉØÆðñ—L>î8Øÿ( 7Ë?zÏ™C]¨2hàã^²ðî»cþûâq[;´îŠ€" 4ÊKZ'/Á¾Î¾þúW^É«­Ëž{Ž… Þw5V=Ø“±ö£°ñ˜öy7Þ¸õ¯¿æ¶oO|x ¶?kß>v™,¸ë.Œ´ÁKXv—ÈK+rÒ«å=añ—jæyçÍ8ÿ|l¶ÓcAwØž‚šBØ Bü›yñÅ›{õZÙ±£,P¼„]3Ï?ŸH¸àž{¢üýY òž>Ýš—^–Q£ "¤B·>}¶ÌúŽû€ü£F>sçÂ~ÄOR§¿Dä7E……Öë8Æþ’„ço¾™röÙ“O=y Pð3À¡8cïmt´ÓóÏÿËK"#kî·mŽž©y*Š€"Ð6P^Ò:yɘãÇØ³à²qcTXëò0ë8ëÖá~ÀO9åÏ©S‹«ªœžzŠŸÂK ILÌêwßÉÒ'Ÿ”Wx0ƤeOkbNŽÉKˆÀ–¿eËà“?~cÏžq¼Hœ“ÃjdE6m¸ŒObçœ9{“—À9–=ý´ìz™w÷ÝQ,À3&~ºé/áýdß ¦œz*’ X¸¯¯ñ’pY †­'äÀÆX›lk®ãD>ؘü‹7xÉ'Ÿ˜ûKXÆb] îå¿lÙ¶¡C7tí:ó¢‹Óð!v{„L ¯aï6³5X7—´ÍñRk­(Í€ò’ÖÉKFŸpVœw}±Ê†SÁrÚ‡ñ–ìîÝcưăùŸzÊ)^3fmñ½÷Ê+'˜NõÀ­ÂÞOÙ_Â4ãÆ±fKÀí‘R\l½ïuý§ŸbÚÜw´cÖ%—®^ ÃØ1aÂøã§rÀëÀŽM¿ÿ.ûKø9\¹Rvu̸ä¿E‹2I5nܤSN16íØ_îé‰7…$°öƆº»#\>ÐÞC6މ;¤¿$&2á9sÅø—‘¥€ÖXó’‹yÏšÅû2¼âk8-#ƒ‚¼çÍÛ9y2›Z ö“žÎçxøé=wn¤Ÿ_d@ÀÎ)S¸ß1eŠá¿±lõ`Ï)‹2!®®þ«V±8•™ü¿ÿá2™xì±¼3ÌÙnFLËËºì· ÷ö†Q¨Ïüùžžlš!К”È=î0//)׿µð]ºªäâ>†0&@¡äœ7ÖŒü–.eÃMàÚµ¬4»R|ðOv׆lÞì5g¯7‡º¹é“6:^jµE ùP^Òzx‰,Ó¯òZÞæ5—olµè€×„8xØ© ƒ±IU½úCÊÄÄvfää$XbÊbqp»%Ð4êò‰;r3Bðaà§±8øI)ìœåŸqoL6g°ucîUWù8:÷¹¹¬-ìÐA¶¸.¸î:.3÷Ä™'$™°¹„L23aò–íGj,rèªË(¬þÉ)øHhF¨v{ðJ0.*…üıl[«·¸"ØRKéÿâÓü]TKPE M! ¼¤•ð±£Öס>,gÏ&™õšˆi˜«Í°éÖÚ¶¬yÚ t ‚äÀ'ýX ’³êÄMõ&’3ÏÄÑ™¨&5êõajvVjü¬U*›JUÓ«×k¦jSÄVVP#†€ò’ÖÃKŽ˜Ò4AA|''‡SCV½ú*;K¦^yåÌË/_ùòË._ºmŸÖÓÝM²f¡(Š@ D@yIkà%uùìñ9%Þ²1…Íì>ác±†Wy32 %ö(±Ê¤(Š€"pDÈÊÊr«›è6)úäÉ“óòòØÅ‘ÜB¯””>@“••–š•Å}rJJrË­N m[P{B£–ŸŸ¯¼¤Eòšþýû{zzºê¥(Š€" ´"0mÊKZ$/qwwÔKPE@hE)/i‘¼dŸ^Š€" (Š@kD@yI‹ä%*´" (Š€"Ð*P^Ò*›U+¥(Š€" ´H”—´ÈfS¡E@PV‰€ò’VÙ¬Z)E@PE E" ¼¤E6› ­(Š€" ´J”—´ÊfÕJ)Š€" (-å%-²ÙThE@PE U" ¼¤U6«VJPE@h‘(/i‘ͦB+Š€" (­å%­²YµRŠ€" (Š@‹D@yI‹l6ZPE@h•(/i•ͪ•RE@PZ$ÊKZd³©ÐŠ€" (Š@«D@yI«lV­”" (Š€"Ð"P^Ò"›M…VE@PZ%ÊKZe³j¥E@P‰€ò’Ùl*´" (Š€"Ð*P^Ò*›õ¨UjÿþýG­ì¼wïáˆÚ‚*Ø@<4º" (v€ò»h†Ã"33óù矧wìØA&yå«=\|’=B3*÷î;ìl/!Â<ùä““——Gééé§Ÿ~ú%—\²|™Sž*ŒM~ÉË·ÆÕ3ó­Aic—ïÊ/«güCG+,©ÈÌ-¶Žóúïëj&)¯Ø›”Y á , .Ÿþ¹üüôÓOùùì³Ïr¿3,ÃÅ7Ù;<Ë#$}ÕŽø‚âŠ:…Ü·BzÁÁ¨Ð2÷¸ ž‰Ñ)n¿ÆŒsÌ1Ǽøâ‹ÏJsPEà# ¼äÞÄÅ%$$ 0 ""‚|wå—ö™î9džïày¾¿MÛ1qEpqYe—Wìîºë®¬¬,"ÆÇÇ?ýôÓ’â゚ Ûü×|¿! ü{Oö¨G6UÛCÒ'® Í-,¯Oä:ã¬óLúc†WÑRwuåfFsssëÕ«—øHüñÝ»wsSQ¹oúÚðߦz¾üëê/†¹‘mZÎO­¥””ø×¦Zý8aû ¹¾Í÷ýaü¶ Þ‰u YŸ¨Ä­·ÞZŸ˜GP»B@y‰]5Gƒ…ILLìÝ»·——aq7ù¥ü2ÕÓÌ¢°‹¾Äbÿø\ | sqéž¾³|f®¯¿s\zÁW#Ü>äBàÞ}û:öݰlkì7–VþÃx¼"ƒx„¦_÷ἇ¾YÝáçäÕ!~‘Y|ã´Ä=ö“!Õ†ÖÕ/uÚš0)åÆoÄq œéÑG•@ìnPÜ.¹¿ý³ÅüÝ]XöÓ$îßúc}`L6!x®xgÎý_;½ÛÏ™Ÿø$¦¬+-¯Dþ³}ÉÈ-¹ú½¹wå(’pu ~àë¥t_öØwËR² ÷íÛ?x¾Ï_8Þõ…£o¤ÁÌËÍ?e„c€uȳ½VñÓ;"ë±ï—Ýþùâ~³½ùùæŸë¯û`þ­Ÿ-’˜«W¯îÞ½»Üñþ“ƒ£[ŒWø¿¥ü9ëËÉW ñ‹Ë÷|9ÜíþnK‘™Ÿs6Dž÷Úô'Xáèc-Æ7c¶îM—ÏÚ]ÂÍ<—(*uÇç‹fn7Ù·´S`‡/oøp~p\!CæûÝñùâ§{®\³Ãà1å{ö~ó;e]ñîÉ Qo¹åë‚ô^P€ò’ÑL^òË/¿xzt$29oà<¿àØ]x|#³±èöšäáeX}®¿]º§rïÝ]–Ìu‰ŒO/¼ó‹ÅQ)yüûnôVžžþügŸ¤€è ^HBî‚ÍQXGë‚·ÄÌX6s]Ì ¬b/ºŒpó±˜G·X3òM7ÝT“— ]àçìXZ¾‡Èt_nmJvqŸé^û÷í?íùÉaÂy—3}}xxbî·ñ¬¯á‹ü¡VNî±sœ#%ÜÂ{rpŠü5ÏOBéî´ÛÊ×R“—\óAÞäbsÆî’Ÿ'+brÙð’ÀÀ@óQQéž)«C]ý ÂõÏÒÀ…›¢¹o œë“šßw¦÷š fü=•û¾c[ž>Ýk%u·© ùsÐ\ŸÍþ)üûq¿N&èÚôu¡Ä),Ùó×<ßÐø]f{/uµÎÄßß_yÉÁPÕpE@°g”—ØsëÔ-›5/!6¾·­ß,Œ+äƒ?gzù[¼\Oü°‚ù·£·qï쓌]çÖòëÃ?ôíRþ.ß7kƒ±*4}]¸Ó#ÌcŠÙ"zNðXå?|Q@è OÏ{uzYyåÀ9¾™¹ÆDŸ«V^2ay0KK‰맬 !Ú®‚²åÛb ²À÷çI†Ñ5çú’_tÖ¯ÓÞc…µTܳ1h[púÔ5¡KÜbÞíï왕•[2nY0¹m L%ÂJøÿÚ ™¼*¤ïLc ¬&­ ™°"8à@[+/±AU*Š@KA@yIKi©Úå´æ%)ÙEáIƮ܂ÒAs|ròK™²3,ÑXÇY°9ú?Ö”T|9ÌŸ.>)¬¼TìÙ íøÕâ!¸ë+Gþ.ß?Î)˜›ikÃØŒÉÍ=VF%ïfù`ÌÒ l!¼ÄÝb¹àÝFma9Ö²»¨zƒj­ë8£–°ßs»Ê#„,L@€þYž¸†Ôo–±†rêsÕþ¶‘30&‡ý(°+ƒë±ï–G&åE&íî=y¼³ Ÿ9^ým-”bõŽ„.#Ý¢’óH;~EALÔ6û¥À¬AdMD~Dg/ržº&Œ½±‘É»¿¹ÅŒvˆuœ¢²=“­ü%/ø{§ã&ÉÎ3XZbFaxBî½]—pŸ_\Ñi€±>es\z›– ^á™c—³Œ…¯è·i;íâ²=p΢RvÏßÝw–wDÒî¡kv$°¼E„ä¬Â°„Ü¿v’¬”—Ô„ZCE E  ¼¤E4ÓA…„—üñDz¾€ÒÐ}ìÖŸ&zôœ°}é–Xx.„Æoï:jËŒµ¯ý¾.¯°üËîËõ^I“V†²/Á3<£—eà6˦ ˜Ç?KŒÜ˜‹/¶ì„øeêN6‚@>²yÅö¸!óý]ý«< ‰ÛuÑ›³X92E¼ãŽ;Ìu^Ï‘ð~³½¶U³~"ØÎ°Ìߦyö™¶Ï÷c·•UTB5Ø×Òk¢k~QÙža™øl Vl2kYQb[ õ8Ç穞+æ:G²cÔ’ÀoF»_òñMPФÌBòDàÞSv.Ü û1¥bG§.„Ãi¨á7|dðÖ_(‘T&XæôÒÀo”„...?üðƒÜ?õÔS±±ÿ®•àÿ€úl´l%áŠH̶È7UŸižN[cñy,Û×cü6ÖÑ~·ì·EQ¿NÝéð/’vêêÐ.#·ô¿ ÛÀÿAÎܳ¾å™œ×u¤!½§ìøô|??O2ÊÂCSQ¹JqÛ~š´ã×i;%Ï]Ç1[_oE ! ¼¤5V-¢ÂKxuĈååÆU 3~ˆµ;1~l€ À ·ø¸Ç5ÂþV¶#pÏû·øWØjš_\Žƒ&ßüÅØ'frÃS™ˆ³+–M\ýSÙ ËzGná¿ïîfï.}ìûådKÌŠŠ Þ >î¸ã22Œ¬xçºë®óõõÝ»+!³ˆ×…¬+€ˆÉYíÏŒŸ-±’ÔgÃö`ƒåPVRV!BYc¥®%[b`TüKße¼“œU„#$&­`ܲ \,„`×Wn_±-’a]\Q©áƒÒ’ÉÞ}û¥¾®Ø¯’í8\Ône§Haaœ¯sçÎþØcMœ8{/?÷îÝGé¹ÿB·‹¬xI;k·QÓø]H;¤ ’„-&k=ãÒò­“{|N#sk0p¶Ë8{'Q}V…hZ6ãÀ«ÎøÀ(‹§ÒF¬pe¹ÇÊšïC͘1ƒµšiˆ" (vŽ€ò;o :Ä+**>|ø3Ï<Y½ôHÖÒ3`Ž÷zÏêW[óóóûöíûàƒ––†¹  €—Yºté²sgõ$¾ÉeƒÁŒv ÂçÁ–ŽLË›,Mxmß¾ÓJÆ/yΟ?¿S§Nýû÷oÂ"š)«õë׿þúëýúõk¦ü5[E@Pšå%͇íÊyïÞ½ÅÅÅû,þ†#|á ØäS½!E—••‰çF®ÊÊJ8 6“`ìÆXã™À¶’Ôì¢&/±KJJ¬¥.T°É jò É›ö&X3TEÀD@y‰*ƒ" (Š€" Ø ÊKì¥%TE@PE@P^¢: (Š€" (ö‚€ò{i‰É‘œœÌ;/z)Š@¤¥¥ñ¦Øž={RSSëŒÜÜxa-'Çx¹ŒMâÖÜÅ54Ä+,,dg¯úsßÐäv`åSV»ví²Cí%1hn9ß!77÷¨€&úF?Eå% âöyΜ9ù¥—" Ô‰À’%K²³³ùÆõ¢E‹êŒÜÜ–/_¾e‹qpg9995wq ÍÅŠaaalšÞ°a÷ Mn'ñV>ͱmÛ¶eË–Ù‰Tv.ͽnñ‰u ;*š¹råÊ5kÖÈ·è•—Ø Õh‹/Þ¸q#§~öEòFæpØEkBEàH"°jÕ*¦€¸àG²ÜZËbèß±Ã8^944”QØÞú âEEEñÞ™««+Ô¤þp™ã‰= ,k×®åØ$@æ„jTÿZ´å˜4÷¦MÆ‘›~~~‡ÐÌæÓXÑ7üˆÊKDì(²£££Ùÿ-—4ªÖyr ¯’:óÔŠ€}" ¼„Ót˜Šá¡³H¯iPÇ‘´¬c­¼ÄFäidIÎÉ7ÑÑÑ&/#d÷µæ%^ž2ª0¶,Zcd«Z@¶æ%æPi¶{ý³jò˜&ž‡±°ñÊÖ á‘gófã l“—ˆ6Z+'ê¹çoƒr®gdÑå%vÄ3*Šð¡¢=\̸¯S H…þ%%%ÅÄÄ4ÉP[g‰A8ŠÔä%tz ¦Ôvë´D¾VgÌC×Ô†—ˆ•’ž+½XÌÀтˆ— ‚!žÈfzPlÄ#ç ³™ƒ wxx8aŽb-jò„¡¹‘“*H;ñÀÓº­Øšm-;בÒ†—ˆfV¢œ¢ºœäÉßæ &ÊKJì.¾ð”#"ÂøäG™qqã‚t<æ.\ŒÈ¢@„Kˆ\üd™’’Â#~Ò=$7›T’ƒ™JHð£;·;Zc·–Û²°æ%¨:û'8£çè/쇥ãЉˆcªºt.ñÈ6 zÛfÙxÁÒ»ô)¢™ý¥þöÆ—ÈÐϹÉl5ÅKÁ¦?:&»"†B¥"ÈÚ¿tg.QåÒòWLšÙgj?¬y Y‘![ìŠâ1hˆÖEð3((É•¯O°d/‘ñ‡¡†|ð ˜’›ÁòÕ”ÓÄœ´‡Mmx‰°+*ÂP)'%BžU]&xÜ€6ÒÓ”J¦m4„©âÆ0ñ—ä\f*Ü ¢ f*i‰œI[cÝùËöR)ÝZ—„<ñˆ©£¸ lT±þÊÖ ~jÍK™„_ʆqpC9¯­mØ€[·n¥v‚˜`nÒpÒw€ÈlG17õ‘Dy‰ÝñŒ† dòƒPeöô¡è è¨ã “õnnnô™¥K—ò%^àâÄz´ŠôžMatz)!h[ÍTŒ2Ä$+r ×yxx„„ C2ÖGç4Ž"p´°ñ—ÐØ ëîîN§C$x†ŒÂX\´šI?´@l'[S%„ï5¢ü24³/« »^^^t "Ð5È­ž½&/¡! ëtaú¦‹¢!O°%&¦äO/æҩéŒü5E¥tD%¾‹/ÞÞÞôhÄ –„ü• õGÞ†—9ãâñdãb  uglá3L€ƒ< ¨ ,”Ç’7¸c‘Š0K@DF$dDbaa¤"¹ÈÉSrf8"²•ÀÃöjØð!²ÝdöìÙËP‰T”…´” >´>M€À(è1¾ÉNLÔ@FN[,.ÊCuˆÀEV²¯–T¼K‚äŒÆB#P’PA¤Ê¢T^Â0;}útÐv'æ&2ɉl ¾¡lì ÑæèÝLµšþj±`ÁA d § çô@`o,7¬øPkd&àPYTи‚ƒƒ¥FüE±ë£ÊKJì.¾5/z³I ½a@·ÂŽº3<1v0ËAÑåC¸èšÄ šD×bÔìÑmÄgh 55SÑëˆFæÄA3â›&Ðz6PåÓ8ŠÀFÀ†—ˆ«C¾Ù„m w Ì˜ ÆPaû ÇÒHO‘Á…æóê)ŽFdî1«<ÅZÀ ÈJæˆõ©WM^BY±"óu2¡ Ë›rQå{Œþò‚1åJ÷ä)&ÐŒ€ahT cßÐõ”ƒñÓ1€xÄ![pŒÅa±(‘‰5 /ÁÖ2òà”Šˮ*(²Éç§Œ]ÈÏ@ácÂ<󈪑3¨¶®ÉK„ü!¥P˜%S5ù¦7ˆ- Ž$4+2C ax5ŠA)=!„²,q`9TŠ:ÒŽ¢<ø¤.¦z`°©2Ü…TÉŸl ÄÞ“*j†ˆB¢~¨¢|+”|ˆC½©N=õ­>:)qlx‰ÒŽŒóHE[€ª´ •’ "!x¢™€Æ>nyŠœòdDuá+äS§$ÊKÌ.ßRoL^Bg@Sé 04˜AFÅàû„0  OÂ?`µÜCðQksà“·×Ì%!3! ¤š7o=.”@odô‘L÷@áÔÍäW¬S5‚"PÍKP`´ï4ã/ü‰ÎË ˜Œ#/°¯t"¢IgÁ¡ü*,‡l=©$Ä9/¡«’9™…c!˜6P4£9½U\; ÷3,ѰŽPLšH¬¦ìTÅÄò³'†ŸNj®IÕS¼š¼„^OnXSùôž¤‚½qí4M;žîM^‚­EN¤2­¾ŒQd…TTбˆ{*‹üŒ'€)ÖŽñŠ‹Zˆ“ãð¬o­ë8X}A˜r!”æã'Š7Ë*T¨ÑªÈW†>t@^`ê¼XbB¤:´àÃ=òËŠ†(æœ ©‚éK#Ù×)ä L(ˆ§8$ÀŠG„ã` ÕŸš’Èx.¼„80?’4ù¨[+/ÁšXóQ9êîïï/$Gš(­8ExJêÅ tYìUÉ:5PyIK¥#¦ÜÖûKè$&.t!Yá#eâĉ„pOˆð’¹sçrϸÀ˜…ÞÓÐraß$”žI*Ñ*Å#‚çSN\`„¢¢…ä†Ë„îÑ_kjª&A N^‚Vc¢° °|œLé&2•g^ˆyà/ÑdÉ_^¤¤ ð” nýÝã%²Äó`ç¢gaæéƒÄ^"rîå1«ð$±‹ 2v±eU³5ÅrP…ús&ñ…˜ïãȾ›u`ATÆä™6mšL‘1í6¼” À˜#Æò$c_©#˜ÐÂr(ù±mX5¡† >‡=ç©é/‘µ0F?°eÜc#Žðæ]âð0y î1˜À¶ ‰†P#†Aàڇش>yAè !.­†Êa³‰@LÔF6Ù¯øKÐ4È ¬…ÁSÜ!4(’êDiò„!— ÂÊø\ÏEÃuŸCóÙ÷jÍK E;r/X@@NÔCìþu$ç/}ÊÚßv0©”—´^‚¦2NÑÒè·Ìø+ªÏLŽ–ª(TƒA„‘—@Y1•…O"sÏ@?¦JΣ¤/I*¸¿xŒ…ÁЙ!((¨,Q\“3÷u'¬š¼ÄœÑ2°J¯‘­XP:´›!˜G˜ z ͧ‹%‹Ø$z °XõìÛ_¡»aÛ°R?ä‘m†Ä« Õ œ¢‘“Š`²JK’0Ï{`ü”½/°ŒD#y‰8MM»Bq˜†$¤ú$žb“°@Øodp€Ž€ª¬ˆ1æ³A*óÝ]DÂð3Ú`ã›´Ø`Ò"-õÂë€ä`Þ„¼„<‘A¶†¹ðŠ“ñ¦gУ‰1¥  ?@rˆ © ‹;ԚꙦAlâ­ "¶8<€ˆT¨‡(©Äý#Ë"⃑C7uGÓ(½"‘ èQ4ªEYÈ)äü¥Ñ½AmZÏñá`¼„††l!?R‰$]Y:¤¿À¤i,dr&r 7`Näúøí”—´^‚&Ñ“ÑfF+ÓáI ÌóFæèt6F4î !2KŠ.ŠºÐ…JalµN%ÛÙÈœÐ?9ƛф!.ÄE¯–Qïð|­õì-Mh$5y J‹¶‹žþbÝe0N ¾x†T4œ.#ú/»G¹ÇDÑ5HH¯‘.FÌúÛ‰š¼„á˜|Fº'dHvzÉ;#b-dï¥ð“â$2âÑ餄 ˜ìC0éž$ÇP\ƒº§¿D`"Õç’E+:¾”Â…ÌÈ@’ËŽHFY¼Xn¤EH†"‹‘QÉYj-Û2dlRþù°Ç–šë82TRœˆ ”EéHH ¥ËúÀ '@I¾({x‰,¯ÈXJ4†G" ª9ºR}¡’è 6êAA |äe+Ê"bÐR2öò—‘Yœdëœ1N²¿„©0½i3?4¶MU–œA"¯„à½ðúç\3¦MHý³ª¿"5Gžõ/ÝŒIsË›S8lÌWÃ#ŸšIêYAå%-ž—°;•}Rì9jÖ‹µCÖAåZh¹šµ8Í\høÈ%[FØ.0cÆ Tº9Ѝž¼¿ÀøËL&‚Õ?ᑉÉk2lbo µÜþÎRÙ,ŒEð#]K/…æ¦Ñ èØ­|䫃•¡PÙ©ßíkñE+ (Š€" ´”—´È¦dƒ4ûºõR:à¥Þ’ÀEa?½axa¡NÉ|9 ñŽ|ÑM[¢œžÎߦͶçFÓËá.€&÷Gø’BÑ=õ—´HR‚Ðlø3°õRC#À‹ŽŒwŒ¶¬æØV¬(Ñ…Y+‘óÎíê+ùt‹œßB/j!Ç—ñŽn ­ÂQ[Nˆ´£¨™B(Õ_Ò"© Ñíè^¹¹» òŽ® õ,½ ?i}¡  ïHÖ‡óóvæó¯>Ö³² ŠV* ÊÌN#3Ú2Øá`¬7Ed'¬\6B× iÚZ‘?çR0èpR¶_27…iîÒë¬ È—íD*ñêLn'VN?jH­Ö„½¦VX+I­ c'Un¼€F´zjæÁઉy}›B¹”—´HF"Bu^b ¯ùyIiYGÒfßËÍMMgþ59¨–êÄ$eð¡-jT'‰9LI¬’oˆ@ƒòv‡Å¦FÄ¥%¤fÁŠêÓ{_ôccü_\˜7:’å6•üõÏdž—È`*Ÿ›á²‚™dc•­MrýK©gLk^‚`R–Q.\Ù¦<õ̰i£Õä%È#‡¦sO‹P•Zy ’#?¯ æ¦ 4-1O!¯ü”ƒÂ¤¦æOɳ¹Õ£i[³A¹Õä%¢ ÒôÜØP:9DŽG¬¼HŸ ¦f'…'¤NÍQ^Ò‚‰ /…€é\×Ò‘äFþV?â©å·µšJœ -õ@ü9Iïý7gë²çã!Ÿ ÝTThØq³t›lmJü`Š©)‰µ"¶µ$TKb¯f½¬3,ÈßœùûÔíU{™žVÇ=€Íl-øì)-œ³>„ÈùùÕhÔ³R£ÈÌÿ6SÌja[+<¡$yy¹K6‡ œµcàÌÜì)+”|Ì´ßDò€ðÿmâ™x0áMy¨$Ÿ; ŽLÎÌÊ*Ö Q² #×ä%t"^Ù˜4iÒÈ‘#…š‹œw̱WÄ7Ú¦y‘‚d § ~b)¹>|øäÉ“åh×£HMÇÚ_"/Gð/Ž?Ú„mn&dš°Åkòd†s0ç\WêÅ äÔkôèÑTJªÆû±üä¥$ùZ qÈ=¬m±È¡´rvó©G‚ÐЬlx‰ ÆÛìS¦L¡›È)ûæh,_Eæ˜Í±cÇòòŽp;@6l!ò±6·‰ìœLÈÓCkŽò’VÂKŒ1.?¯j?”–ýJÌ¿è`«¥L¿ÊK‹ò÷Vð5)ãQUU¥µÃÀ}Šùœ&ʰJ–™AÙ¾râï©ÚSlP ˜Ge±$¯,7L¦uYLî ¿ùãEUûˆÃ$£´¨€Þž[QJ¶åFªý†šc»‘Û¾’Ê2«(+)(-¦Ï———` ©BU©ÄO£”½ÌY öUqvåî5³T¤²˜Ÿ•ü4dCþ=TÓ,Æ婵Ù’á¾’ÂüÝQñ¯ýºÚøTVyQu½ö•°tBd³‚SQRe!j‘“Z”ƒduÅ«±2$ü·R¹°™õÝ[Ì#’äX˜ÜÞ2#“²â‚½FVÈYƪYVR”\dÔ{ÒÖÜ‚’èøôÝ…ùÔt?íµÖdLÜm6+pYWV®Ú[l‰Vnä¹WZ¿œhÙ9Œ¶e `4bUHhKCï7P…EòXÐÃY2q™öî<±cÓÐqÖŒoÍKŒF¯ªbèüí·ßú÷ï߯_¿¿þú‹ çg§NXî©éÿ?ìÒmÚðFm†ø¯¾újРA}ûöýóÏ?9IÓ4MUhýó±á%xx{³OŸ>‚ÕüiVRýE=DL^"•⠓믿þ£>bîN½øTÍï¿ÿN¥ лwoì(ÇÛüøã4?1ÆèC=ø‰ª@aù9tèЙ3gNN«E®&Ø2±æ%tã˜WÀ%@øòË/9ž~˜–9UPüüóÏð6þN:|^ýubÒ½{wé á]tÑO?ýT'áV^ÒJx SÔ{òÖ{¾r¼ÿ륆E¯*ÿl¨KPdÊýÝ–°*áä~oWÇ'{,¿ù“…ÌÃ-žƒÃbº|B;þ¹ö®/<ØÛŸøä¯«¶E\Õiî„e~†aÞ[ésçØÚòïF»Æ&¦ï//þk®§«Ol¦×xãƒÆ¼¿¶Ì5tÉ–ˆëBùÆÉ?:•¢/툱\–-ðø‡'?øµ¢îÝ_6xÖŽ¥›Ã³²r?þËÅ?:½ït†T"8hCd|†›OìãÝ+÷•%gå _äöá_.1©Ù 6†œ÷êLü‘ÉÙgïÄÝÒgê¶åÛ(‹í©, €eE[|c‡Î÷LÍÎß»¿Ç?9_öÎjÛiÂ2ÿ)«ƒ}Â’¯~o~@XRÅÞRÐØ`|À,86s¬£OZFvtBz×› JŠwåìzîçU©»vß×ÍqÜ ¾•Xùݘ-á1p—ÊüâŠ/‡¹¤gÒv†V‘š‘õ¯Ï\ï…7få–ˆ1NäYXTÙÊ-(|ꇕô[T;BÓÞè’”™3t®gPL:LY8v ‡`–ÿĤu;¢ù|T²ïŒí^iÅEùÓji#i=åµYÇ‘­òJ$Cíí·ßÎÍôéÓGÅ×=0N¸¯›ÏöÔä%ˆ'¼9aÂ&ëvÅKxàÎN•WFá%Ø¡ÇKdüœdŠdÒÂo¼ñÇÂbh¹¿òÊ+Ñ š?ùXÏk¯½ÆÍ\ÀÊ„õ믿fÆó€å?’7m­§J7G4›uZ¢,kŽ\ÐSÔÀ\‹á)ˆÉ;½(mÇŽEùôðëÒ¥ gòþû?ígRIvßÞ#/ÁJM[0w]0Þ\ Ïÿ¸ ¹±m†Ó¾¢ÈÉ5lä"ï cÅdÏË¿¬^"/œ”â¥8kçã¶¼õÇZì.ŽŠ»-3ª½¯øïy^ œC1ÃK\C¿µ¹×D÷g\“˜±xSÈÔ•x8°Í–…€=÷u]j¬wì)ÄLŽ^⛜–õnßõøN~¼’4ló~éB/ùs}b&Æ{?®$LIËÄTGÆ¥Á©†Ìõ¤ c·<ÿã DØ–òñÐM~Q)#y³…m¡÷u]‚ßq{ý·5+·GM]2wc˜e-cïå0–W¨K!8l&/È6¦zåCçx.u ÍÎ6xI@LÆ Ù;Ä¥ôÅß.±I[|ãzMÄ©S–•½kôbŸ€èôχmŽKϽÔÏðU•¦¤g œí—¶É+¦Ç˜-ï XÏ‚—…—0fjFö¤eþÝF¸âFÂ3×~€C¥’åÚeæúߨYk‚ÊYëÙWÒæÎW][¥c¿õ]†oÊÊʉI¢ÄM™•ûêokcRrþžï ëCBøÐGƒœ¿Lî÷6 )x÷nBáñiߎâ»ååÅùK7‡>ôÓÓ¶ãy½Ïš‚â¢_ÑúûX?¢‚ïpNÍÉ6ß D)3W]Š·©ôéð×ýP‘´Ì¬>S·GƧÃKZåPtφ—ˆ€==ýôÓO<ñ„Áƒƒ±L/¿ü2?™ÞÝrË-¤w}“_µò’ÿû¿ÿ3Èea!“r;ô—È—oñ+\qÅ-—— ?ûXk€t‚6…Ý$â;Á_‚•…vp"0?ù€Ѩ2÷>ø «l½zõb‰çÛo¿}ï½÷äÑ¡Ml“«ÍȰæþË,® ºÖ¡C|!²¿ „˜òZÿ /à8& ˜ì8yþùç?þøc¾f×?÷Üs¹¿ï¾ûN;í´~øA’l¨Q^bï´£NùªyIAks 'GiyiþÓ= £Ž¿¤²¢€)»ãæ°‘ ½Œ- UÏÿ´*#+‡ýX8þ&¥dŽXèÍZCD|úôUA?OàÌæ}÷vY";EþšçµtkäªíQÿ,öñ MŒLùjø¦°èÔ….!Sà%UÆæŒÌ,¾o^y×WKŒ-åk¶Eþ³Ä[øÝhw˜oX’WHbZºe…Åò¶2¼ùûÚ(Ã@îei‰… ˆÑ€YžñÉCçCƒB"“ƒ¢pu@Yöí Nøj„û¶À”ÑŽ>¤öHÆ×ÂrŒWH9W”ŽuòŸ¹&в¤ò²Ž/¡ßBMX@aIb´£7‹A™ãéèjð’þ’3wÂÿ诱Éxt~šDÅ+p [à“ñéÐM/Yâ7ªWYœ”fP7¿ðd’BcR©Ý=D¥,ö+bµX(a&™¼Ì-ü'ÃýW¼‹0{÷í)µÄßà%>±`hl©,ús†î òñ NˆLH'mXlÚ§C7²^òò¯kà%NßÎ ApˆŸ'nEÿˆ$ï¤ÀÈd6£[Swí*-.ˆHHƒfÁ;K óðõãŸî”møWn3ÖÂÊ€7:9ãþ’³vÁùb“€½|Æê`Aþ¾1x!¯x§dd±àÅîë=:G`<ÂEجã`–pM3!–S·ÅÆ0“æ‹0¸L°:Ï$¯™„¬ÉKèËgu’°uƒ©§¬Ä-šXsçž{î‘ÚãFºð [â:Žé/a×*Ë7òÒ 4”'2ã¿üòËé`ì5aÅŸ(Ë/¾ˆ•ÃÌ:NçÎÙfÁ*?Ûµk‡m¾Hͤxuf[Ó_‚‡‰­EÐ5H<—m%BÙÑUM¸,ý9Ý#8:eG`<‘·%L\ÈÖË–Ò=Wv¢cìaYäµßVCμByûf¥{¸WhþÀ¸Ôôì΃\’2v!üV¿¸.!¾9›Õ™àèÔ_'oó K±Ðë‰ï–Å¥æ|ö·Å_²Ä×pAU%¦â/ÙI]ÃÕ'¯Ã+ÆþY^£È}õ×59¹»¸ñ JØ’¸jk${q¨{G`QËÝÂøzéôu!}âþqôe~Á~™ë‚ç® ŠNÁ5i…?þ²ýüïM,uede¿ÚgMtJ6ÜÅà%{Š'¯  X ýÓDwÜ<ìê;cG\r&$ãÓ!ál€e‘kÄBŸ˜Ô^Ñ€\Z^üз˼C‘ÌñÊÉÛÍÎVzgPÂÈE>+Ý#öV³MšÂ“•ƒòÌ[’–‘e 8­t!§æþ’n¸ÉöÆÉɉ¯Õ0€Êä˜fu »Í稷á%˜7Š{ä‘G˜z“˜›bebZ§!iŽ5y ~v}²K”·W^yå°jqë82MOHHàm–¥ø¾4v”ýÎØNêŧ ©-N5¡&|vŽ—t°¸Äž²÷óÃ?d;l• °ÞÞÞ¬h[KyeºþJRs /"±@ÃçZùžÕç°5–½X‘áú ;ÄÙå ì2ñðð`g ÛŠÙ¶E‡‚—à8ÂÊj)Éß~ûmnídR^bï´£Nù„—àQ+.ÊÃÐ2if¾^QQŒI›¾:]qeÉÎÐäž¶…Åg¼Ùg]ZV6sô ;¢ •eEi™Ùì>é5Þý[ýb1Tí;Í<׫ûh·ÍÞ1/KÙêí?NØÊ;#ð›ìì]ÌÂ!”ÅêOIYuÆê ö=à>aꛄTì aYáû1[æ9ãÅ©Àáçž¼#(‚â¸9œ=ªH8sMPQÁnü7ìðÈÈÌáÝ1޾½&¸÷ïnÎò"ÜW˜MJz6&™lC¢SY¼è=iÛ†Ñdëï–D5a0c—ú^æÆî]öÁ|9lSñ[zŒs_³=’ù0¼déæ0*è•Jíœ\ñâÉ©YÈ¿3(±×ÄíËÝ#—º†nñ_ïÃÐŽ D¿ð$øVVÖ.7ß8Vyp,±žÂ–^:bù¾Ì5œu\>£}¾ã6tž±bÅA 8?>ä0K6çXÔßìɘ5÷½B2°—ìfåU‘O?ýT>éŒY¥^8Nd«>dÈ—^zé»ï¾#>”^ÂúąȘX^!¾ÿþûñ ´ ¸ /˜˜¼Dï¾û.ÛDÐÏØØXzÄ¢{qèAô#X݈#€{ì1ðä.óh>ºÜŽ­úKê´ì-;‚ðš“g,gì/e‹ v‘¦û+Šeg&{‚cR—ºG:¹Ç|0Ðã‡éa¯Íx;—×MÙ#BÂý¥˜sþ]ßyÊ~ãÝ’Ë‘ÆÛªü3ö”+ ¼0l[–¥0ÖkØsJ¶pcÛÇþRÃòYÎ A ìŸñro{$Œ7W÷•ï!“k@F¶˜ó=Õ’ˆ½ä"‰Q¨åeZÂï¾RGd+äE\ž’­‰cƒ¿†kÑR‹Þ1Ãxá€-“A˜R47ÆËÉÁ,’ì†ýàÛXä5gC[a#’Ù[†f憄ì'ÎÏ#£ÖU¥r*+˜ƒ ø»UDòÊbËilÆCÎ=ÅlaÓh›¥¥Œ?ûÙƒb‰ øÆ./êXRåáû!7ÜHF<Ö¤Œv”f-á¼MMV$áŸQº%âZ^i&ä*ï¹è­Ù4¡4™h,›ŒŠË¸™“sVøi¤Ú[Ò÷—X÷á†Ášu*lÃKŒõG–ç,Þ£óíßI‰€`sÞ«lÇ‘«¥,^Ôz~‰lq•KÎŒ1Òî²4cSSÐo*ñTÖt¸Z%)=¤¾ÒÊr/q¬Q-‡Ëɘy™˜b}^°ä#_684UR‰5ž-ò—šÅ0YÎ=³º,!†Nñ§¤(Ï#0~Œ£~V@˜èK¸èœu*îÙ^:ÎÉ"œµ%jÆ©½,9 ¬¶l­3©ÇVS›¢kJb•Ü›!° GÜ|bÒ3²b­Õ¨{÷f¯q&-÷cÏGa¤¨¾j«¾ ij­ÂÁ’œA¯º±þSp ðkɹFëÓnû* Y6*-γ´am }@ AÕ:[3¤õݘë8°y³ÖÊejû‘AƒâäÀ.yCØFkaŽJC ‚aWÌž%75±:*âÕ³P¤’ÔÖ£™M£ÛÔKºŒ¨„u*ëaÄFaê)O‹ˆ&§ü hrob¶þ¿ÃÔ¬¬ÃϚݪN[=‡¾E2ZάãÚÇŽW+/-dª]WlæîE¸êŒfÏØ’…w#ã /L=.ü€Ã?#I=ÓÔ#Û£…æ£Vév[.">d.F½£.$SF97E&G]Iü%';¯žp!¹¼ ;i¹µ¨ge›*šec€Á˜ÑÏ£šª¼¤óÜbõ¹_ª¯zÄ&f=bµ€(õ¯1‚P‹¨{+iĦÅÀÕ´yvnòi»ínVv+^=a·sëY‹#Í@“å!ýžp f'*º" (Š€"ÐÊP^ÒÊT«£(Š€" ´`”—´àÆSÑE@PV†€ò’VÖ ZE@PE # ¼¤7žŠ®(Š€" ´2”—´²Õê(Š€" (-å%-¸ñTtE@PE •! ¼¤•5¨VGPE@hÁ(/iÁ§¢+Š€" (­ å%­¬Aµ:Š€" (Š@ F@yI n<]PE@he(/ie ªÕQE@PZ0ÊKZpã©èŠ€" (Š@+C@yI+kУP¾L““#ß§>ºb$''B†òòò„„þ]9[Dé©©©|òþˆJ«eddÈ·L}åææò%ôºbÕò¼²²’v?Œ„õOBþ|ýµþñJ̨¨(ÊMOO¯OHKKÛ¼y3‘ET(88ø¨ˆmShvv6²yIŠŠŠvïÞ]E=ò²µ²•—´ÈMLLœ1c†P”””ÈÈHFÞš5ñ÷÷‹‹kî2"1"))©™ ÊÏÏ÷ôôÛ²e‹|z¾¢¢bÔ¨QÜÀ##""êÃlV®\YO$aÀ!!!………õ‰ïããa"&bÄÇÇ×'I“ÄÙ¸q#£.ì¤IrÓL€ò’©sçÎ¥å0ØHïèè8|øð‚‚‚š5ùùçŸ4ŽŒq]»veŒ8¼äu¦Âˆ~ðÁ‡ˆvúé§ËS&¬5Ý6ÌoæÌ™3eʉÃðZg‰G,ÂÈ‘#MÁŽX¡P·?ÿü³Îâž{î¹Õ«W×­ñhµú êÓ§Ʋþ%^}õÕëuÉ%—Ô?áaÄü¿ÿû?ßa$<’I4(î™gž©“q¢–¿þú+½©¸¸Ø”°´´”{!C†Ô‡C\xá…õ¬nÎßÿ]}â› ƒ2,^¼¸>Iš$μyó,,M¯fE@yI³ÂÛ\™CÛ_{í5f´ó4hæÖËË‹çÅ_üæ›oÇCpË-·´oß~̘1ôd¦Œ÷ÜsÏóÏ?ÿõ×_ËXkqss³ÑÅÅ…ÞþË/¿<øàƒ3gΔ§Ì“~øafœâ€½ûî»/½ôÒÓO??†ëûï¿'??¿Ñ£G [ºù曑䫯¾’ñkÉ’%L·ß~;#B&L˜ðÄO ÈçÙgŸ}ôÑGÉG/¼ð‰'žHqRt¿~ý{ì±wÞy'00ï¾û%þüóϙƹººNœ8‘@¡ô»ï¾¶c;í´Ó.ºè¢Ù³g“GLFX*Hœ÷ß_\JØà·Þz‹jÂläùçŸüq1wäxþý÷ß @qÛ¶m#ÕSO=õÛo¿Ù¤?~üÀ?úè£{ï½WD†Zxen}å•W^qÅÈ`“vúôé/¿ü2àPh/nøùÈ#ˆëè‹/¾pvv&«U«V­X±â•W^A™µ£÷ß?yb&©ÚäÉ“emkÑ¢Eð3nÎ<ó̳Ï>›JqÔÄ„‚tìØQd`RøÐC}øá‡§œrʦM›LÁ˜&b«¨f§NðÏÑjúä“O‚'qÊÊÊÈy@I ÅÙŽ;V mw×]w8kÖ,ü.\ˆ:99È—_~)K!$ùé§Ÿ¸™:u*ESÌÍ ªÀØ»wo “µ‰š³êN8ÐHÂêL@$eÊK8ƒ3hóg I>ô› ‘óÕW_E Ägƒ`JO¼äªS„ôtlÒ¤I´…u>èø Eãæ;vlff&hAJÇ*üñÇýû÷0`@XXØÛo¿´ƒo‰@€nƒ€z-« Öñ‘ç?þ½÷Þ{†æ‘ðz¢···uLo¼ñM&ôe4 VAe¥;sÑÄh7Hø¿ÿýZˆ²W¯^€Lž6\G:&ESGôŸºËô}Òýéæô\Ø€ o ¢3Æ #ò\¿~=ó.F‘øü%æ û#áå—_.îÒ;w‚-U@‰è6ª‚Œ®·Ývʀ̟|ò MCë3`£é FÓ¥9Ð(¸>áD†ç©—źCÕy¯¼¤Nˆì1Î&Uô7Fj ¬\sÍ5"+]ŽqMú-“6 ¤¥qkãͦoËÓZ7pa¡’„) tilã#;Þ†9†`s’ʰEÆ«fíÚ¥¸Ë.»Œ‰Ñ–aQžbiÖ®]KÏ'Óí¹±ÞBFæ“N:‰±ƒh$aˆ§ó‹HG}ñ3ä@"ÈhËÅL“ÆÄŽÉ2µ%CƒxAØ—ÃøhÐfž„0‡v`•%Ðúš¶k×îºë®“‚”E`Æq9ãŒ3–GâÝ1/LËmòS>ðÀò“SÚB ³±)ŽZ— dò—¡ßô©àbaX¿õÖ[Á“Q›!˜qù1‡ qÜqÇQ}S6Ø$#¸ ý?t†x!rÃŽY)s_òDB¦þpª)ò`›i)S6_C<(Xnî¼óÎCCHb7m¹L ¡5²Õ£ˆ¡ÅBðל+cqI(Ip0?æ‡\“1?Ôرðc³! ©° mƒžõOx‰,=`þU$¦zDžÐÖ_(NæÜô¸ zk³ @)@'ZL†Gx\èu¼é¦›0ŠüdöŒ¹Åõ/±‘¶ PŒ.áL¦1RNè©8“Jz4ôËf¿.RÓ¿(ÖÔ\«‚y Ù5/:8Yaba«L?/Aíe 2¡ä†./.+óI)‹ Ó ñÍŸnHþ&u°NB?•Ÿ(EÓ´7Ôš^ÔÂD阹‘ø P4=t–{q’IøYgÅ_ø%,E|]R5ÆÜ¢tÈ:Î w·¾1;xdŽœf)h J"k‹RJaú„òÓs¥Ñ»©Ú"õ¢\™A\d.Gr0aCÕk]d·‘JZ# ¼¤Eꕹ¢3”ã'”™:3© ]à ¶ kdöÛúT•áž@bÊd‚A“! !Ã^&»æn¦¹˜=º+“]¼86e1„1=â/ …—0«Û°a<χ–‡Q€É3r|Î2‡Ã0ÐÕ…a0ãdº)se“—Àà=f¶ˆÍ(ÃO@} XJ¦e¬y™I´ÞqBíg­ÃxÔfAX/&—üd„—ÅÆyn¦|ss‡©–§Ð˜%7ä\“—ЦÀeýrvÑ\gadæ 5”·àaÛ·oç¾…]”q–‹©œ‰' ?€Âʺ¹ÉJÉú©²)3š Ÿ8±­y Ò@Ûñˆ))Åz HˆøØM<‘PœäXqq’S(Óqkl™Sb/ñœ‹Ãæ“ ¿N ëøà&þsôöÂ,YG°¹Ç*È’ fÏä%(*͇À¢ÕæàHˆbc}mv°"3fá%̆¡eè<>~’ ^É ¾Â’ ǰáºÀx×*ކ’!l•ÆX2³‡ßóÍÁ: àæ…„¸‘ø 7½øâ‹¹1Û 1¬=vØEò”î<´|Q€efo³À„fÊ{7T\2„Ê2±yQâUW]ÅOZ Êe£öðEá Ö—ÙËYÜH6šÌ€€®Ò@P(kU$&nBžŽt.©¦lB[dݖ˺G[—¤†3!§Ùé`?D$¹˜ÉPÂàzͬƒ¿ #4 îC²’ph *5é©ä€òذH0qÍêkÈÁP^Ò"uƒ~…EDt: “N,4÷X&z,ä,ùþXÙÁ`Ä ÎK'Á˜Â$ɜЛ(,X°€‘." ê„3Ç¥O2¡d ÷ǃy +¥à`leLaˆa:(3Yè!+Bð£À!°ˆŒ ôyŽ1ŽBÏgBŒÀØ ë×m˜Ž0×d‚‚% ~’?U“KÉ\aÝ*2Ýdqiˆ©/ƒ)þägdÇÊB ÷H1‹bðå/u§˜FëBžü:±‘æÅ bDfE@Æ>†$± Ø{"3ôSxöÕ:!ÙÂ0$D2š3|cPá:²D‚3ëˆ´Ö ™„1˜âP¡:8гÈÀLQÆwqe1Ø‘ÚÇPH°‹¸|hepc„EC°ÊŒ¤ØrBA(ø™m Ôš6å)XaDQÚÞFuø‰ °^_4ÔF¦ïØwæôX_Ú‰MeÑŠª‘®l$˜3÷ÅT£4®’3ÇìQdsÙ %Ã=™˜¾…á!5£ÃS ­xVų޽[«YBý¨2î:Œ®ØT.ܸpx *¨(µ@0Y.AQ™[¯^IZDl<¢Âà[„°—‹Gh¨sn!Ôa„IÛ\hÕ!+—&CÃÉSö°cùp¿‰G}6âù@TkjHÑ@“¦„0y ćÃÙl¤@KiSÐCp!À¿ñz’SjCiYz.m¼²a¨¦¿]½Á# £e© Ô~FBZ™~$+;Ös:8- ó%ú5zˆJ£·z4²¡-dNÑÜÃ~h\ºy¢$ #,lÑÐTî#­Œœ2úÑ뙇ÈËe¸HéÂG£“6"°…ÉY«11I+ì–K2¤! cH…—0j‰_DËÚ¼Œ9DC ðîÀûéæôÊb´x‰PÚñèÚt%iMÄ0§Ž5uCC¬P^Ò"õ¡Aö[0‡ƒ¶ËpÏÅøB·4}›„Ð%°ŽâÀ¤abͧ¼šo0vàˆÆN@5̧tHL)£=PܲYA¶˜Ñ1œ21¥ïIì(ö ²‰O…‘‹„2¤W3¦`xl&I¸‹ tió]Ö#Ä©ËÅ ŒË—Ò±‘æ{Œz¸OqŸ` ™ô3â3ÖÈA¹°µTøx_$[È#”L(ÅàL WÓ{ÁSÙ:C‰2d3I2O`‰šš²lÆ>¢aþà¤t!(T @¨šµsž ±¬ªX_˜=Ð&Ü<1ËÇO“©¼¼K³²È…›„zÉ ^ÂÔËœ#"*!˜gšÉÜȲ‹ðC-TÓ%¹( `ª~ÙµcμA%Á È~&.àÂ\‘Šù:£<¼P†løí…*Êb’›¬*Rqk^5y,®l¦Y@¤¡¡³¦; •;Øt™äf27ß-ÂΉ› Á€T$A›…-”Ù¦9D0ÚŽN!ýŽVºÓ}€#B „Z¡‡,7@ßkf‚mCáM¶ ÔptU„!¡xGhkÑD51sÃÊî1t€vgA ĨfÍ=ìÄj‚ê¢ÃüÄè5_iF ¿i°QÙ*k^”ebHwF?™ ‘1§ÖÒI‹ÃC<+Ôõ Ñ¸‚©©QDã)E\käI)qèPu)…1û£R‰ëŽé©¤ŽàÏ€õ´Þ»-¹™ZĽ¹ÓÚH¶ÎP†´¢²å–ñVÆ  '[„‘ÜHB/ .2GBñ«QÇàFBq¨— q´†Wï­P^¢úð0Ïæ²EBCÇfˆÄ£À„cÓ„9kV6ý¹-‚}‚ÁV¥²°®ƒÙÅ¡¿>gýflƒ’KdfíÌÝ#áa$^4÷ûχ!•&Q‰€ò’FØÚ’3ý­y4Yã+‰Û‡ãµ9Ai|žšCM˜’¶zXp·ÀBä½è&¼˜æâlü±°xàês¶G“HŽgX“d¥™(öƒ€òûi •DPE@hë(/ië õWE@Pìå%öÓ*‰" (Š€"ÐÖP^ÒÖ5@ë¯(Š€" ØÊKì§-TE@PE ­# ¼¤­k€Ö_PE@°”—ØO[¨$Š€" (Š@[G@yI[×­¿" (Š€"`?(/±Ÿ¶PIE@P¶Ž€ò’¶®ZE@PEÀ~P^b?m¡’(Š€" (må%m]´þŠ€" (Š€ý  ¼Ä~Ú¢’¬ZµŠ¯œóiu½E@PVƒ¦MyIØ€ýD]¸payyyŽ^Š€" (Š@+BÓ¦¼Ä~ÈF$Yºtieeån½E@PV„À¾}û”—4€ ØOTxIEEEnnn+ÒF­Š" (Š@›F£¶gÏå%öC6 IËå%¨A§Ú£’š¶¾ÊšõRZܦ ˆV^hUX P^Ò6`?Q[(/Açò‹‹‹÷ïo}ÖÚ¦‡ÌË+ܳ'¿´Ôpj5‡¶×®†¦j†QÂ6K£^ùùeeT„l)ìD m)Ò¦Ô";D@y‰ýÐŒKÒy‰’ôèèð… ÏZÛa/ª]$ )áQ¬‹KJ@Àî‚‚1 ÌgaeeYU•½±7äÉ+,Ì+)I ‰ß¶mWffEUUѾ}…²ïKtH Åk G´ïš©tŠ@«B@yIƒÙ€ý$¨…—X¹×M+hír¯^S°ÌÝÿ㊯m˜¶IX­ø5²û×ÜÖVº‘Ê:É®]¥UUþ£F ;ñÄ’ª*,÷¿"I6‚ÕÚÝj•ÁºôZrúwÙ¨ºÄU¶ LQßÿÊffk¦È+*Ú•‘1ïÑGÝý[øŸÊˆT;ª’={¢]\6}ôQ‘űdÛf{ sS¶Úºf•¥mª`ÖHN¼‚ŠŠÀ©S§_xáßIÁÁn_~±|¹AMêjž¢=­Ë²Ñe¶Y£¹mTIâÓ™ÑÑîßM4¨‰]ú¢Z•yÑÊ(‡…½U×qì‡i4L^b ½ØŒâ⢽{ JJr˜|æˆ{öäqdDÎÏÏ//Ï/)!&órcfÿ_›aŒãøêKK‹*+ ÷î%­‘½Å_VF8!ü-(/¯^¡8àÛ7Ѝ¨À=Pm„,ÿaÁˆœ—Ç„Õ{Р߸1+*(H"K°F&eeføtÛ"OEc•¤¬¬ºîååFM-¹‰üTùÉ ÈYÂó‹ŠHR]e~–”ð¯: 9——ˆbȺ,27ʒ𤤰¢Â°vä`W ÈãN˜rýõ¿ùw’2¬ï¿¸øØm´©,@ñp¶öì J{p™Ð¬T­¼œV£¾F  F;–•I³ro+ØðT–ltO òH•Q£½Ð–]» ñ,šCnÕk4ïH‘4Sa!qH˜”´äÎ;]¿ÿ>ÒÍmoUÕŸ:u*¯ªBÅÈ™ V·‹E7þmPÚë@CÛ4¨ÔróÐ^r(.6T+/§hã§´"9Z´×€K2”æ¶(ƒ²!¶Ea€4ÅËk˜ƒC¤£#¨³ÄkÕDŠ€"Є(/i°«Øÿò1·Øà}ûr23Üݳ32ØÀ™ÄeÄÆ&ûúò–¸}{Zx8Ž ÌLzTTNjªÇúÿP ÉÀd§¤${{'mßNr¡/ ñ©YññÌã3cbRCC¹1Æwâžäá‘&„ÃXËß½›´ž ±ˆH²++kúÍ7oþþ{L&Ñâ\\veg‹Oòô¤i { ÖiAA4b ¥ÄÆR àǹ»vº°0ôÂÃ™Ì {oiñ¬¤¤¤;²RR :E•­ü@©²Ð‘ÔÀÀÔà`ƒô§²2qçNڈ䄤GD${y‘ 0ãœsÒÒ@’*$ïØ¨T‡8äOCW ={üÇïà0aB~A¶nÍLL$çœôt@ îi—”à`t€ÈFÐÖ± ­ü=€ æ(€S)š>#>íE¯PQ1 Q!XrEEüæÍä4"’Œ 0-:&è5¥sãK¶m´’?:xÖ-ûÇÁÁäÈŒÈÈDOOC—j0ò&^5+E@8 ”—ØÓh˜0&/»ˆ…síÒe‚ƒCo‡q›?ûŒñº²ªjSÏž#¶ýüó¼K.ùÉÁaþ•W2-^öÀCÆžtÒÔNèïà€ÿפÉl¾²Ò¹S§̆spXzûí‘«Va9v¥¥Í{üñY·ß¾êÉ'‡;8 "ç>}°dX5/¿Œc¿ƒÃ_”rÕU©ááÆ,Ïž¨uëfŸ>Dd¨ƒÃ¼+¯,).Æ0Ð{Èr ô-_mø6 û÷;wî<ÆR…Q®]»Î +K&ÞŽœ””y:L¸è¢Å×_ß×ÁKíì¼üá‡)ܶ÷êÅäöCrpøÃ"ÿœ .œ6 3F¾£GϺðBؘx8ÝtÓ}ÌgJhèú·ÞBH¼£ˆÆ ÛXˆ¹÷Þi·ß¾ú™g¨€Ä:;ÿ‡šXˆ8nß~ÖÅ»¼û.b€íŽ?þÈDZ{÷ô›nÚüÝwd•°}{/‡˜õë+ÅÇgÌÿýߦþý‹á‹¥¥[¾ûŽZDÎóÏìàà>p ª°¥kWpÀ!œSÏ9g•W®ûmšãŸcŽ‰Ý²Å`!¥¥«_xêSA^z÷݉¾¾†ãA.¼,%%Qk×N?í´ü›vê©Ûzõ"g£®¿™AiÍ÷ß>í4l<á?;8¬|ì1·®]8QË—‡/]:묳hSd›wÙeøQÒƒ‚&|2…‚Ò’^ B®ån"6lÖžœî¼óWŠ;÷\ŠXûæ›"!Jˆˆ *ÔDÜQÅÅÎ?þ8áÒKݾþzZ»v=ܺw§9æ^r HRÊ”“N ž3õ Zsþe—­}ë-ѾÆN–ªªð%K\{-OÀéÞ{£- 'íÜ9ì´Ó¶ ¸ìÁ©"¡u0*ªFøg!¾z)Š€Ý  ¼¤aTÀ®bÿë/a*Y^¾ù«¯¦œrJðìÙi¡¡áNN“?Þ僰jÛû £µáw–/ǹüÑGç·oÏįÃúwße|ÏIN¶™jc|{Ÿ>äLË{LxÉÆœvÙe8H„¯Ì¹øb¯#â·nŹå7a¢[nñ7.#"â²¥{÷9—^ €“&A}GŒÈJK#”eÓgŸq³i„lõsÏ…,X€ƒ„f‚H-¹ýöOO6vÀ–tèàÑ¿¿¹ÕFxIai©{ß¾p—Mãâ‚oUœvÚiУíüÇŽöð+(‚†^pÍ5lg¡¦Ûz÷ž{啱nnTŸÆZÿÎ;x¶pج|úé¹—^Š‹‹*L¹ì²¹×\P4 ðB³à»¨_zXX‚‡‡1«¿Än¬‘ ¢ÊKìŠi4L“—àH‹ˆ˜qÉ%AóæaiðicípYOþßÿò23=úô™|â‰9IIò4ÞÃcâÉ''ùøð›çû÷ßLdy*¼äÀL{7û p•{¹¥G¥÷Üùæ™x¿q`8>ûìÚÏ>c¢]çšyöÙkÞ~”ä=tèÆÏ>›õÕX>ŒO·÷ë7óÒKa-Ø3Ãã"ë8ø9H‚qe½WAФI9±±Ìeƒ“#"â||’##]{÷žwÓMˆ!{bD6á%‹î¿M×®$çrÿö[œÜ`ï3°p¾#GRJNF†ßøñ¸"V<ñN=5dölÄÀÉ¿¹K—>"~À”)p#7l˜uÅþÓ¦IéY³¯ºjé£b¼=þøŠÎÙ:\á—_˜”÷L¬ä†h¯¹fÕK/)°æò§ŸÞØ­[!¼äÖ[kò(ÔÔöíwüóÂL=ÿ|ÏAƒÈÁp;EFN:óL‹¿Äã×_M^2ç꫟y†@Švûì3+-)Á‹@»$îØÁÊ—¬V˜¤‘X™Ú•“ãôÐCÐP0d‘ß•4™ÁK}.eð’^½L^BqîÝ»@hhª³îÝwâýýùσv$¸º&®^#*fÅ æüMŸ~Ê uG{l¼«+9m [±‚¦ÒôøøuŸ|²ðž{p­™Ê&¼Äõ·ßfw蛕E*ÒÂPž¬ììÿ„À@þÎÃ.](\Þ{O$¤FKxÀoòä-?ý4ïê«Yú¡v†ññó¯»Îwܸœøø±çœ4>Õd•Š¿¬.Ál¢œœŒý%¬KÖÜ‘£–APŽ6ÊKFì*v5/±lWŒqvÙ®]¤«+î}¬Qayy¼¾îÔíÛwþùç¤N`VmlGÀOž<ô˜cX¸ÁØËTÃ_bá%†m³ìJÁûŠôbá7®{ë­í={²ÒñÏÉ'³¡„hð’Õ~(¾oa=ãÊ+³ããç\v™c‡Îï½çùûÞJé<]þâ‹Sn½!;+qKP¨ðn 7˜1Œ\ØìÙ±«Vk×nÜi§:ñÄ‘Ç?ò„ÆœrŠãÃãS1ö?²×„Š]»L^²ê“O0êäìúå—¸ (‹¥xzâ{š8‘u¡E:,¸þúuo¾¹åÛoÝøaÔqÇñr²ð,ßòLJ'­ïØqgÿþX©€ùóY@wÊ)£N>YJŸtÎ9³n» ò´øñÇ—½óä²¶öèñ^ÂÚ“±kÇÂç`“®¹fÅsÏÛ?Ùj“Ÿ¿ô™g–¾õVaaáŒÛn^BEþ¿½ó€¯¢Øþxì>}OýÛ{×g}>õùì½<+Ь( ˆˆ€"Ò¤÷ÞB¡$„Þ{ï½÷Þ{BBÉÿ»wÂr¹7„$$p“ÌšîÝ9ó›r~{ΙYHv=ù$Äbõ¥—‚†òwá…›o»-ÞÔ4ÓÎfƒñ†Î¦ËKÎ9'ÍÞžp:R²µ5$`ýe—­¼øâöýûß÷ü÷¿ä hH¨ÄÞ"­†—5FÊUDúî;¢S×]yåJ =ÿüU]„ n£F ^âòÉ'´17„ÂX>ýtÀÊ•;_zÉòÁAU„(U™ßy§ûĉØùà%Q›7‹žƒé GoOÚ½Ã0‘œ³­€dù¼Ä ˜F÷„Qí%0 üØ«ý§MoœLîAsçn¾ñFœ&¸6^x¡ÂK4‹,°{Ÿ~†—JŽ—{ª½„ ¸!¢£ÑL¼Áo42‚ˆ™â­¬PhÁKFŒ@A¢”ЦèÈ éÓ#LL0ØT•—‹ôžß}'ì%Á‹›^yeIv¶Ð‚¥Hˆ‘ ­ð’£G/‰ß´©ª¨hãùç“UqRRIxxqd$6y<)Љ»v)N ¢êê{É3Ïøö[ªCe½Gjç%ÍÍ‚—$˜›gìßN-ÊÌòÀÃPi($ÈI,ήûïÇQ…ýŸÐT.âeØzíµA³fÇÄ”DDEFýŠf­?xPð¨°øã%¼jó â|ILD"ÆÆ{ïµÓÄ[p®¸Šî¿GƒâÇÑØK¨5Á¶Px ià%¦·Ü‚½¾µùškü&N„ëð vã¿ÿ=pþ|Òhûq¶Ýsà%ŠÚÖð’Úšš2ÍÞ!ÀXUXˆ9xd¦ tww%j‚E´¦ä뛚J×]~¹›Æá‚oßsÏqB†.cÇšß~»ðã@¹S!‘šÝÒ !2ï[It4-Rýe1NêÞ½4™ÊKT?ö’å眓êà€y ÎЗàY³ð‹‰%€OM¹ðxsóœ°0BgÚyÉ¿þ…çE¡ÎG¦»¸(@y{+m¡%*Š=`h}$¤S¹ &@Ƹót´šùe—&ÌEþØU'Z¬‰IYv¶ÂKÌÍi;f:þÅEH7 n´ÁM @–Á%R3J ÉKºG *õñøͲ‹ð%K̯½Öù‹/|~ýÕuÄóË/™;„•5†^YžS[KÌ~ >'`yï½¼ÔV`ZolÄzùÀ´€ºJsrbƒŠC†øüü3!´û^yeÙ…²n‚d¶C†lºî:ϯ¿&øÃúÕWͯ¸‚^hcc~ýõŽŸ|BÔ¤÷ĉ;n¹EpÖA2²óᇑÊsÌNꪪÂ-"êPð’Lww˜D”±±Â¥æÌÙqçÄINšDøªë÷ß{ŒƒªFÙ¬½î:‚R….á…xÇOز·‡†——ËQì%ÍÍyÁÁ¼Ǭ]‹hÓ•Wxÿ}Œ%î#Gº|û-×a]hD4.ÿbiØõÄÞxCäYVTDʽϓ&µÅÃo¾ývR’ž SÏ#”•ÉØ¥ššˆ™µ~òIÇO?Å`8y2õr6,uÿþ´½{y46æFE9|𯼨^QÑ1í¼äðažõÿóOeŎ†¸;·ß}÷¶Ûn#B%ÒØxÃùç+ö’º:â^w<òˆó°a,”ØÿÎ;èBeNYÑ…[o»mçƒÆZXà!+êC>Ä%tbvé¥Ûo¿ÝïÏ?‰^·„-Kœé¦Ë/GZÅ‘ÑÜgi‰çÈìÿ0¹ðBüÑææ,fF“k¯Eùa P øEE6/½äôÍ7è±Ïº ‰‡ÈV“ .ˆ55E§ÚÛï~ôQh“׸qØ g„S¨âàhjÂØ°á¼óX4$Vð*‹œóò¢LM¡bÆçœC/2# –†ýo½eÿé§ÂíEÜ(4޲ŸK|<&%bYÚyÉe ;Ä.¢øÔÊʶ?ü0ŠYÙô¥¥…€M³Ë/'‚`Ò­wܲt)TTTÏŸOsìzä‘… Ï;¦t˜¬àRb§ «Ç³}ã ·áýóϘˆ\!ÎÔíÇ·\w~:û¡CÓÜÝ±Ü Þ4‚~àXtB, Äuã¹çR(íXVP ìØ¼ö€Ï›‡¨;zˆXJ¤Q kTSìpÏ#8´ãŸÿ„ ’9 5íÀ–ö¤ØÙ!˜Â 8ãÇS¶ ^ˆµÇ¢âRÁ‰ÕÒB¼0ì5ûûßiИ-[XƒÍST f@3Ñoý¦NÝõØcp#á›Ç`4BrÚÿ À°ªK”ás9Òô¢‹ÜFŒ LŠÄ´ ‹~}ÿø{d4`Ö,`•5Õñ\{-]KÙ®Fl½S_Ÿlg·çé§AÛæ…X$/M&ƒYÿɺ&’—t Tjí}ÕD@¨â°¯¨€‚à;›tñ:ˆ ¹ÒÿÄNkÕÕ¼¤*.˜ÊJt /Ž{žxB™µÙ‹Ý,’’Pbk,f|lãl¡èTV6Ý*-Ýóæ›ß}G^xgFUö oö&oh@µS¾ `£ràsN£ì`ÑÜÌEô%Æe›/¿€W^4„² [c±;HUûa^Ù4Ló-CòÁïPš­<M).VvãÐìYÂÍâ´4òWöê€|±½‚!$òÃÔ¥=ˆÁöí[i¬ùÊ#š­ÀX<¢<¥Ù§K)+;[- pаQYR¢l£Â¢b¢§ccS¨jjÁ¾dlcSTÄ’6ƒQ𝹙 ¤%%:O)”‚ëII‚ÓˆDƒ"òÓdÊ$šíD$ ]EiPRyyJskñ ² »¿”•!ž#¥âÊ4J|‰û°aŠxš]t•º³"½¡vEAb£Ç«é…¦bˆ|ý¤Ù=ŒÜ„ŠNÕlZÚþEÓdíw5”dڊ긾Ôpå§&í²„œê¾¢$SäG-SÛñ¯õçíz‹œ5„Œ[Ê&lšC(Åö²Ø„ôX½ÚËÒ ÖãØ¾öšbàÙc’‹RÔæ»½ D„ˆbxØuß}Î}„SÉäÜs­Ÿ}Vášê E&bÛöú É•`u°ÒÔZmD ~û‹‚Ø©8ˆžÓˆº-=E¡èT¢i´»ÚdÇŸÒº. Ót# ¤© —µË ޷űF9.¹†¿2<ˆ;qþðCüY‚s«Ý£ MõóoÑE×Ò¤SóWzű1"IÉàÔ|²Ö†Œ€2£Êï wLjýïã¨< ]'©ºAó»y47³ÃØæ›n"€-FppÓÎb´Rêä¦èâ0Xñüó¶}¤ØÔÍéë‡jïú'f¤¤ª miµÅ8~ýXǵó˜²ÑQ¥â§¾üj2í»Úã³ÃGÚÅÐ.K'ÿª*%æ†ö>÷œâÑ’öøùIDRbb¢¢pXo±ñœsÂW¯V,Z”®“vé+•OœØúÚµè“&,=DN&ÏÉ =µZEtÖ^Bd®Ã[oaðSן¬ –ED»B’”²r’² Z$/1–Ñ}A´ãK:Q¨º·4Ž<8¼åsÎVi]œWXt°²”TËÂÑõÇjJX¾ðä¤{uÔ|qF Õxs”šcv‘îå3RãÖ%ú'ƒ º²ŠÁ‹KŒÄÑ}Í(Ÿ8›ØØØeA&.üî<ƒ§_óW×ýÇyº'…vWÈþ–¾Ïˆ­ÕØÎñë9È=hùˆD@"p6`D³J^r6éEËÞºu+Ÿ½K‘‡D@" Hùùù’—ô˜œÍ}||BCCCä!H$…€ä%g“^Ȳ%‰€D@" ÐF@òÙ$‰€D@" 0$/1”–rH$‰€D@" y‰ì‰€D@"  ’—JKH9$‰€D@" ¼Dö‰€D@" H ÉK ¥%¤‰€D@" H^"û€D@" H$†‚€ä%†ÒR‰€D@" H$/‘}@" H$CA@òCi )‡D@" H$’—È> H$‰€¡ y‰¡´„”C" H$ÉKdH$‰€DÀP¼ÄPZ¢[rïÝ»wOo111”Ή••Uod)ó¼ìÞ½›Ê:t(::še˜@XZZº»»Óç97L!õ¥Ú¹sgVVVII‰µµµÀyà4‡‹‹ MãììÜš¦ß5})==½ªªŠ9ß@ú’£¢¢‚Ö—¼¤[|ÀPÓ~Ì­§yÉè TÌÞÞÞÍÍí43”r\]]éT‡NMM¥GõJ/í]H :BŸ÷÷÷Gÿ úUfl"j~~>7ƒswa1üj"!u ¤iúKÓt·! !=ØæååÕÕÕÑ‘èZ†Ð7D—®©©‘¼ÄPxFw倗ôV熗¤¥¥!'êdGOåœq‘œœøÙ[åÊ|$¢·ÀKRRRèQ¢ç¨Iœt¥â¢ö@ûv%sxIpp0}ÞÏÏ šG´;|×…ìJY½•F @ÁKªÚØjU¡áà„8 ùõñ`$‚2r.ê¢v!ªy…×£“ž©Î™½Õô}‘Ø ^"¤UAÊEµÛô…úyJ^Ò]`péû”—ˆ‰ÌÓÓÓÛÛÛÇÇGLgœC_x•é¢^93]Y–bhèó:½ˆy'óòòòõõíŠj!Œ¡×ë¨ÃK(B¼2"žèó}D‰z\}^"$ã”`©‚\BßDFF&$$888ðobb"'=£¯Ôç%BqŠ:rÐv}Ñ%NY/í‚'#¯Â^¨ß§Ìÿ 'Ðæ%Ô¼ˆ!FG\\=G°–3 žä%Ç3º+PŸòÌï¼M–––fkŽââbæa\眃Waq¨/4LvâŠx¥¯«iÄy tx 3ÑK¹¹¹¼œ‰UTT$ÞÃD÷ Û¦KJµ —"¶¦E¡¸¨>rš¥/AÞÑËÊÊ’¤ÍÉÉý‘¸Ë¿ÌãBTaVäP»·_$æ9Å»¦H ~ž~ÓëóŠÃYª™™™[PP€s ´‹?y£à.HbÇ:xð '<‹ÀHÅ]!¡¨ÀòS(]µ‚B~íê;r ÃK„ ùiÜÍÕÕÕÔQ4A.š@»S ™Õ™J¸µ« NJ:pi?¥=¿qîmz&=D&V»%i×À •‘‘AüŸà»ª EU^B„[“žO/¢;Q;êË‹Q ¦wá ?U£]¯Lõ’—t—\ú>â%ÂR„}‡)•—0*j>‹[[ÛäääÂÂBf:º/sœ0Óƒ¹H·ŽˆˆS?9˜P`9’šœ¾fê9èÛKèB˜èN(Åððpz3ÝItæz†˜ÜqýЩ¸Hƒ‘ÐßêëëQ½<ÎtOJîBk˜ôÉát¨‰/¡ôÐÐPŠCÊ‚‚sP½"Îë#6†°°°¤¤$ eîF`î ù© öïßÅãdÅz»¨ ¨ NŸšèóc¸µ¶¶’?¼ `9¡j€ JB»>‡™Ùˆ–…”ÔÖÖ¢2A˜Àdr ¦Œ\êE U†3´L·ø)ê(4ùð“  7ž~¥ô»´6/F~Rš†9?¢9­IÓp…ö¢?ÐÇD]„Àôr¦¾$S¯Ð…ÈŠKp2f9~r‘–„}ûöÑî¢á855…ÁK(‘)NDÀ€6‰DJ7 Ÿp !é®ôò§cˆüéELž2еí%¢»‚ƒº¢q…ù ¬0™^K[¢ósWðo:}ž+t9¦z•Ìu·¦’—Ïè®@}ÇKÄKØÑ£G~⥊qÅ*Ó÷S:ä%"J€—H¡×érÌìèHz &2¦uô:S«ÃK´É™~þ:`ª’h‹ÔÉפï*¥/¹/9Ù\ÔÅ9§+ó’þ4u²‰K=}¬-p'Â÷J—8L/Á„CG}Ig’×}ú :ïK=Mˆ!÷¡7’Ñ9pæ‰ð®Ó<ÈÓ%6IáI…£œf†òñAŽ\„N…Õû6=ªWziïBŠH¼ó‰8nÌâE¹w‹è£ÜxmK…³ J9‹ÙЦ¡l¸ÌúQÓœEÐzV4Øâ…Á&Ì=ˤwŸS‡ë‘ßíë+8ûàùÃËÛ+ñ­b™'„‰ôJž2“A‹]ˆƒè"üëô(ÃÄ ±®DÄ[¦úR!ªˆ€áÖ@ªÔQ¬Lî_MÓ_º*§èKD„ˆkò IÄ’+ÉKÎ>Éè¼öâA±mƒ<$§‰‰ÅqšùôéãbŠ~×ç ÒØ~'v·š²Ÿ6M·êxÖ«ƒÔ ú’Jò’PƒxzË[…ÎÁ+ 8ôour³°Øä‘”n=(K:D€ŽÄäBˆ¾Áö(nlŒÆ+¤>¶ˆÊº^(ãýHìn ê%,ùý«iºUGI,ì%"Œ*ŒMòƒ =^ÂZ8•ˆpRSS]W]W_]ßP[«}½ós±DÏÐɶëYÉ”:èEb¿QtŒv'!$ôyqn€Bê÷%„OÖ¯ ^2 Ñ*/é/MÓÛléKN A~uê~œðCyDðqЫêjkŠ «ÌÜæÚl Í:ØPÏE5Aç':¼„çjª«êëjøk¨«Ñd¯)E9SþÚ m/úø$'ü<öTeu•’§•²Uó¯­©ˆgµ…VsOUW·‹"~ ñ8Q•–0jíj卿¯A¬Zƒ¬Úó2œˆœÎSjq]„w°%Óç%j/EßÀD78»°tÈK .Å)EÌÔgWHýÒµí%ª„Ø¥™1à5@™»‹¡>/Q;Œvç!z‰ZSwQkÑv\?iDÎ9ÔÇhàÓ]ùËiüjŸ¯æ»º…¤:ˆê¯jª¯ij¨mj¨[(²¡¶Q¹Rÿ‚ա¹AùÓXYªHÖLšºš#-õA±YÛœãèàG[êƒS¿žïöãR÷þ´½Ôc‹clC}M}m5Y‘?é5j › +¹‘yÛá†õ6Qî!ém‡¸_UQ]µÉ>nÔR‘‹Ý—Z† ¾ihnTÄ#+ç±FåqåŠò“1S¯ùYüdØ8cSÀO+ÇyÙ.¾?^‰Š?ØT›^0b‘+:׈MÉ7µ‹^g±×3-‰Ë^m¾|WX\Z>™<Þdí•ÔÜT·Ù!v§[<ìzanéÂᚎ0¦û£ÃráõuÕ[c÷E’¬¢¬¼ÂÖ7iÍÞsû˜ôœ"HŒ ;ÓͽÂ3`K ñj¨q JÛ°*„Ťä‘gYY…_òê=f¢ J˳òŠoþdÛ—¸À˜ìæú~ÿbÚ[œN>:öz ¯³¨¶Üxã7¾ýö[a;éJÏì# ÉV›— ìYä‚Þúî»ïÄH¼úê«¡)h2Ñæ%TQaQâÛ¿lüð믿²»‰0ôt}³>/á=žÖyþùçábÏø%K–üùçŸÔš½û¾ÿþ{^å/¼ðBìÿâ#8·ß~;¯ì£G&+vO§Ë¡/Eãöwpz|m^"úÒu×]Ç×Ä· Î?ÿ|qH_âdÍš5“&Mâüa„|¨ˆccãk®¹lŲ‰ 6|ôÑGQ;ª­[K^Ò&`X^‚ý¬¶º6(6esèæ}™&‹~0÷Ÿ‡ ³÷ü8iÃìʲ&l§œ¤ôyÉËÐýþʰù¥ÏãÓ©G6î‹2wˆµõÏ\c½Ç#áPsíC#v™ì‹²p_g eIÎ.ž¿5˜“ín‰ß,tÃÚaë•ôì8ë]n ðHÌ÷‹ÝרDá©ÅÙP“–ÿýbÞcZçH~ÉÊÝá[]’mý36îÚï›’ž_úÃ2/»€ÌÍNq8} _ÏuùÃØÏ>0µ°´|æ¦ÀÔœBÈ>HhM5™D$åîòLÙå‘bl•W\¾`{ÈÚ}qvé¦ö1ØH\‚SlCþí®‰ë­#‹Ëʱ˴µÖÏØm:Ô\×Ú\ëjf½Ï/ÕÖ?kôr¸‘c@êôMAûü2v{&––!Õ=_î°pM Ï%ÏSÛ­19`ëð(^HÉúõëÙléÒ¥˜ÜϺÊ×ç%?üðƒä7Þx#û( Óç%¼ÂŠo챃-šƒm Pìnõm}?ŽÐšPlBâÓ6+W®Ä¸ÅEøFë²Ë.C›¢ù>Ë=÷ÜP Êä€Á<óÌ3ìÒÆõðþ@käÈÔ\{ßrË-ðZ0¤ ]zé¥Ú¼Î¥“+€?vìXl$b5ïìÙ³7mÚ$BÈoºé&˜1ÇÔ©SùÌ2öJéÔ’—Éè4‚—àOÎÉ)ßäiµ'Þ´°1}KÀܸìদ†÷_7Êì#gß膺¦Sö ]^r¤qÕžˆOÿr™a¸Ö:‚Ø‹¶#?¯ô·Ê{ÕÞèas\'oðm¬¯~ów»’rzssRFáË<½cra3mGY×stètÇÒò Gÿ”‰ë|HÀE¿¨,Ì!uuÕ˜1è©ü›’÷ÂKœR³Š¾˜ë<Í,xÅž¨á³gšâA·Êgê¦`ÿ˜,É–í s ‚*µdæϳŽM˃7@æéøü ÃÀ†1ĺ9X‡½Ä34 9`k³Ìc‘eØúýq—¼iÚPSí™õë_²MÉ-=ÚÊ;ÁÑû¿Þ KÃÀÓ­ñÖ­y¹¿'Öá%¼KáæGU`fÇêþÀ<÷ÜsÂ3}}^ÂÊ*/¹ùæ›Qug<éã£ÏK0¹‹o²óæo¿ý6 y c 2A5y¼dÕªUÓ§O§Ö„Œ`¡±.¿ürô /¹ãŽ;¸ù믿 %¿ÿþ;Òs¾xñâQ¯ }^rë­·ÂKÀžÿ÷¿ÿ]›—`™šî€m£­­é×5Þ¸E¢“óü¢3Ó²Š00 f]@å;f…—†—àa«ªg89{À7y±e¤¤¹¡Ž ¸ñ¢´ó’Ôüï—(¼z³ùy¥7ü ,>Û?*+;¿{ ᱡñ9 w„(a%mÍ3Íøò¡ùf¢qg˜ú§dk‚·èPS]kS]@L6Fl0xsfm ŠÍFæ°øœøô¼ ܰmluŒ›n꟞•’/BXŽ´Ôa/¡\L/m‡êqB-ÛŠÿˆr½#2x þ”œQ›={pH\¼ä–O·RAÝHÛ^™'J&úöÔoó|ÞeΜ9C˜™™1»Ýêêó^ûFŽ)ùµ×^‹kÀ ú¼ïŸøFf¾-2aÂôJüúg·-ôý€:ë„ÅÛQYó,‚HŸ–Od.kd|#3'¬õÉÈ-òŽÈœbì›ÅE„ÉÎ+yë÷õuUû¼©†—ÀÔÅÛCò‹Êˆë?ÚR7a­¯s`*ñ.‡Ö[ºÄcÔ‰HÌÍÈ)þ|–cUe+†ü¢³âÒ ¦™øQŒDÔ1·tkÈÔÔß§ÂèÇ—ˆ›ôL¾Õ]|žþ좧ÃK˜|yÕ1bÍaÅÁ]wÝ—êî¬Ú§¨ŠÌuâ^E‹ƒ ³ù²eˈLD¯œò=ä Èy:EèÇ—Ðyt]±bÅã?N Zjèñ­(HT }é?ÿùŸ‘ƒsX[[ãÛ:••J„¤à»Áª$¾êL¬ X¡wÏn÷;|zëY}{ 1­| êÁCÈ:Ñ$Œ>t5fÌLV|O úÎW…±—`šzûí·ùåOOOó8þààà `’ö’¨õ~ÿ¼¤±¾1>-}Œõsb›ìöôç«ï}qÜõc½÷ö¤Û?š~ϧÓïùç›çN÷û¡Ö#Õ•Õ'î rBßÖY' '@UÇç(KW”àÐÆi¦Ðfìß,p[bRRZΨê'ë_×z³ †°ÜŽG[¼"³~Xâ1|®KPLVÛ¡†°¸‡€TrÓøY¢³1@XÌB¶Y¹ÅNq°îbðHL/€XŒXäF´ ÎÄÈEîGØ,Ž,C°bwø¯k|à(‡[ücsF-õüb®‹w8†Zì4û½“H?f¹çâ¡To«S, >Ÿå59Ü\G Œç«y.“7úÁ601lëk÷û$Ç¥æã—Q„lkÞá–0z™ç°ÙN)EXS\Ó¾œçòÝ"w¿˜ì#­ ñ¶6äO{;ß±|º·æˆ”/¡jšõ†Êª Þìù6 κÊ׿%jp*@„Ç{Ì`U—/v…o¾ù±úé'<8ÈÚý·Géóñ¾þæ›o>ü¾ûîÃ.‚Cöä“O~òÉ'¬k––çÀ?>øàΩ>ô¯ ]N¼ñ£59D,N‡¨WW›—@@æ½÷ÞCAìèKX›öìÙC¯ã' knÁàùÉã—ˆO`N‹p‘“gŸ}ê‰ñÞ]œ¥½d ð͆u³Ö-¿ò©ÞõÚ“·=÷صÜ}ñmW^uÏ­Wßsó…WÿãÉWŸKLhlTúG']Yo_µÊ–æ:–´ˆ^…ß F޶£X4CSj•¥³ïüa‡ý@\¶4âñiæï`c0“@8DÑü<ØTÇ­Z‡CÞ¡¡·ðUž=z¨ØXöÖÖ‹ÝMNp¸DYï’’¾¥Q)‚ãP‹’¿? ¬BüœC™Á[xeÇÕi7uð”²6øX°9S\ûS ÊSBf¥FšŠ´‹ÑvPÚ+³ÃÀËDŸ—ˆ:‚S¯Y†°ý—/≹•Cl¨j€MÓá¾jê\Öß=8𓎪ÕÉÔŸ?Tf).ŠÖÞašU´,× °eϼHÚ¼D1ÊEMÀ€å\8k8Âj©­ ÆËivEÉKú=/ÁÎLW`©ÃÁ†ƒ­ ‡59|ðèÑ>•ÖÆß‘Cm‡[Û:‚ T ÚNÅô¢õ}ÍVþÔCäÀ¿âó9Œú†ºªŸ–{6ÕÑ_•ë"¥8פÑüÔ\ÑÊäxJ5½Î]‘ÿ±ggu,ý±¬õÊ¥óxû~´+C•_Ef-h´2i¯Ñ±ôBfC»[`Š-¹˜ Å÷qt𦓯RqО¸Ô¦Hu Ï“%Vi‡ ))u0Ô°b\kw3õŠšƒš g#Hò’~ÏK0r’«xëk1œhýÕ)ç¸.Ôí´;éÇâE|§ëÝ]1Ÿ´5‹}Ûä!ÐG€·+Õk˜øˆE]#†#?Cë:n Õ;f8²õ¢$b¾þÕ4½Xý3“]Hô¥3S\×K‘ßíëÇì„ÆÃž&ŽN>™­¦éüDX°»˜X-´[éeâA…݉N¥ÝK °úÝíóg½ à áã8ë’ô©=˜ŽúTžš98`_##qôc=(E×ÿžp× ©NJŒoª§Ç™È%Ú¨ß6LX0<{‰ð¦úR { A¯Z€„;IDATØ^¢ºØúWÓô—.¤íäöCëÿÒ^ÒMll,ß `ùœö‘•™‘›•©wY'•îO¾}…W,89ERy["p*XœI^ÅèTÛ£Ø<”å£ôù¬¬,ÎOU'C¹¨â³®úcßPD¿Â†îb^@™%&&ˆËI%m^Îð}f¾àŠÌ|Öä»ï¾ããvgÛÓlV}^Âû·……û£ó5ÌhP¾ ,¾Û‡jüì³Ïx_G•ж£)ù€Ëà1, ãÖ‡~Hz¾‚+biÏnÇ;Mpzñqm^B_(…X¤Æ!–花 íãûÀ'N·ø>Ÿ€á1ùb3)ÉŠÁ"âB8àÇôÃî¢-yÉá% 'ÍÌu²ˆØ¼?Ël¾ÏˆÝ¡«©ÛäíŸýj<%5©óÂ)ÇaG¼Äw›CØÁê‚„¤ÔW'Ú´5Ï4ñ¶tŠK1ÛºzwPq~6ú~™e€X"Ö‹¹æ¾A‘I3L¼ÝüãB£’?žaÑb§cø#ßívô‰‰MLÙé™°qbZÀÊ€)Â7,ñ«yNõyœ‡G§LÛèã“ •Y³+(:>eÄ瘄TWÿØø¤4ǘ¥n‹¶ù‡F%A#à:f¶!û=£w8„Á×f»CØÏ+Ü«òãS§›x‡E'6Ó!$2©ª4ï©1{œüb`*Þ!ñ³L}|BãIóí|ç€È¤œì(Ù>!ñ_+’01í|9×É'4!(":2~¥{t|ò뽸=ŠˆM®*É]±3à›yN‘±Éí¾ž^œ*DVú~ñÖ… Y²d ¼DX}OÙ-û ^‚㆙”oà¡Õ>7Ýt“Xrv…ìÜ^"V.¼øâ‹öööðYWT/o®Àkhbw«)õý8Ô”š°°0>Å)Ád2þüI“&Q}¾wÿÀntÅWp‹º³ àÞ{ïåʸqãÖ­[·jÕ*>³üÔSOñÍÈíÛ·ÃáðDôk|ºf'‰õyÉ-·ÜÂ:0d¨bvb ð1œ,_¾–N“×{-°ðÏÏÉ~÷ý„eT–ä„'@¼‚âfmòƒ@´5¿?Õž¥¢»"fšy·Ôb±÷‰Æ€ øDÃ`N–8¼Ä¹¡2?/7ñõ\çÕ»·Û‡O\ë¹|G vˆ©&Þ­ƒ¡5lGŸØó6ÚïvŽ|}â¾€ˆDÄÀdâšðÍ|çÆÊ#ÿ—ÆÛ˜Ø›Û†.· ¤^d¾t{öž½n‘$ ÿ8Êm­í’-ª·&‘~”O‡¼ÿßéåÕ–×ú³îÄÑ·—èð|"ýˆ—àÊؼ„qÏ€~ñq`m^‚¹H›— /¹í¶Û˜ß]]]1€aCâÖØK>ýôS>òÇ'å°„õwêÖ+³AWx „¬ˆ Ñá%ûöíƒðÁH¶mÛ†s–O oÞ¼Sé± Ìš5 »Küe’—ô{^ÂðSb:Òr·»9Mwývÿ¨èô@Q«¹[Æ}°äöáëÿ=nù$XKÞ©^û:ä%c—»áÁ«hk*¹ÈeáVÿ>Ñö†X¹F¢é‡L±;ÒPÔTU“4b¡‹{@ìl3_~¶µ•¿7õ@JjÚN§È¿Ì¼ñžàâÁ³³h«'¸lT^òõ|…—äçfbØøz®“™]¾›u{ƒö¹ã.ɇÁlÃʲÖÎÁO¨À·¨ÃuEIÉi¸ZZj àmmuŸLw‹IÚã‰U£íhYT|ÊÏËݱŽÀKÈɹbD¼b¾[à¼Û%ÂÖ+z†©wl| ¦}^òìØ½Î{Ý¢°ï >T±Ëàçls_SÛòâÜUP¢¶– W¦ˆ•I‡¼„W.%|ý—sw½Î}޾gÍš5ª‡©–G÷— ˜}ôQÞMõNNN?üðö€þ®t;´—ðMì%D6PSÞÚq+L:U¼ÐsÖ{á…ŠpyM¿îºë¸%õ`FÂJ§n:tèP®@näÐÕç%*ÁíÀÍ„_ŒîŒ‡ ÌNB¿`133Ã2Y»víÿýßÿÁö (ŒñÈÈH¸#c§gÎDÉK/ÉËÉŒIži?u^äK÷?=bÙó»7•”}ðǣ̻ÿ³%½2æßë,¶ž"ÆP‡—Ô”æ`±yh[cqrjÚ<ôñ¾ˆÅôÞxRæšûðŽ®(Ê}ög뙦>S6xM^ï‰ÚNHJ›¾Ñçõž¸QPÿEÙf6¡èïšò<âaÃcSæmöýy¹*ñ§¹YžÁ ïN±kª"L/319mñ6ÿÙ›}Zø-Øâ‘”˜œ ÏX¼=€GßBR|bˆð ®BI&­õ$Á4cïïº`k„šü¸Ø¶9ç‹9ޏ>øÓÎ?4±¡²`¹eÀ„Uî»]# m™·Åoþ¿~³Í}“R±$A°ÜâàXMU…¸R1‡F3k‹Íßâë Âm4ßÂÒOK§pXÔÒC>2¾¤CÆ ÏK„{û‚ øæm^¤zšèð”Îò/¿ü%‡7ç¹çžƒúè£Ï?ÿ:BpN^õY^ù /‚ä?þˆŽ466ÆÚíÃÌ)à>|8ÿ!K߆Âà9‡‹x{{Ü#øb„”¼d ð’üœ¼€ˆ¨,?ú#ðÁqûºìöW'ÞöéO¾òÓõïL¼õí_oºû þ˜=¹´¤´[~œ|œ,a a1É"2uN¤'û½¢v¹DØyEA# ¯NØçà½×5fovHT’•kÄN§ˆà¨$GƦ–AnD”¦Š³†ˆT8„Øz$1%ÍÅ?–dÈÆ]˜„[”•KŽ\'ìÀ¹Û9b—s„Wp¼²[I–B œ|cˆP)-Ì&îÄÖ# 2´Ë)‚¸Ì8ƒ¡h·€8Jg£,SœÕ@°Œ»¥9È@$ó IP"]4;©À<4’(8T$lkòmRJú~¯hrpñ‹…¸ }Câ±ÐdËõ8Í=ÚKpK3gñfß³©Ìq?¢ÃKHŒ„P“72buèõBO?Cõ80'Xa&&&»víÂ†Š† ”~m Ðç%4 ëqxGÇY€û€ŸTœE74ñ°ð ®Ð¯ú²eË@KÓyÝ+W‰â®èý¢ÓïH•)öUHq°‚0(W 묤#^„ÄÜrww­ ±ZÁÖÊÊJ°±u²Mµ’— ^žd…ù+L6Ýùüÿyû£G_ï¡ç_¾÷‰§|òù‡ÿûì­÷=<ô³a ‰§ÔºûªiâR5;ª)',F3ã±¼V³Xa Ïþ¼·²4O¹¢¹ËRç'¤×tSåŠêìÐ,»=a@‘Ïñ»Çž¥e³5eu®¦8͹2l”•ií9 ’F-K”.V2ÃEøÉãböQÌ3TGS´’Fó”H#6 á¹µK¢I/r>^/x’³DÉ©ŽïšÒ+“ÄÊädq¯µe™Î¾jb^†‹ Ì8)1@í®¿ ˜.3ç†)v·zw‡û—ˆ¦Aáñ¯P¨Fq*FÝ9WqmÇEáÕw9 ¶e»Q¯$Öß¿DíK%¬n`«t:˜ÀP%vš93C…TDâz„”¼d ð1•7ÔÔ6ÔÔ5ÔÕ5Õ745ˆ¿Æ¦†¦šªjíÝEwÑ?T^’œœ,zFç&ôô¢mXNØ ÿTÊûƒºG?݇^L¦ÛLB—èïCoÈ2wÌÎ÷¡×®©N­;o»Qw!í0½ÊK8ÑNÐ Œ}=:$/é÷¼„úô'ŽÔ4òI‘¦óCû»}â£k¤àÓ€åÙiºß <Õ“òþ @@|Œ K 0ØïöAÁûãwû›8ñݾ® ÕþØÝè?¼¬3A÷¯O*ö;¨E_b­µát$1uãLë‹•MTä!H$‰€Dàì" yÉÙÅ¿‡¥7à¬Ñ;›x—Ò¿ÞùimmEŽ<ÛݲdúA‚« éTÛ£LlOÉ¿+dG¼‘5œøÈ{ v¤~Ú4ý®9ÀYô%C“‘¤½¤‡´à¬?Fvr£®¦º±®¶²²BÿV'WXÍO¥FD­stëY™X" ƒ€èEð–³VÓ0ñA0±Ê‘ ^ VH}èFác•¦a{úR©MCõ£¦9ýŠŸá¤0ú’áÌùbê/ÉÒ^rÖ9FO£÷øQYÙXWžé_]U[SS}ÂÝNˆŠLvbU:óµzt=+5eeeUuuUS}mS}M]m5Yu’Éi–¥Ÿ3¥©ŠÌµ;á§¶Àµ5Õ¦Éí„£+€hËЕô&èEðȮڴ;•!ÔÁħ@¦·úü¨ª‹…LÜú]Z§ŸŸaú¨šƒ FiþÕî?dí‹:ó•ά2`ðé-ØŽ‹ÉDä±êÏÎ1ﮨb꼤'„À@žÑæ%tŽƒuñI…ûb-cwX{Eiiîœ h÷}^¢É°¶­µž¿£­õ届ŽhA%Ĩ¾¶:*9/>-?+¯¤j¢]ÅUt³¬Ko¨¯¡t˜AEeeKSí¡ƒõœ²E½¸kÓfJœs)·°´ ¨L'Ci¨«VphQþ89Ô\'rëœi5ÔÕð×õVèî6ØôÚ¼=ªÍÙí Œ¾9ë°è󮨃Qu ;l_m^¢ª1#AaZ†)v·új‡¼D´œLŒbþE¡ŠŠc–ã Ô™Yü亸¢ö7±F¬[ àÄ¢Ãkóm UœÜ|'OÑÅ«¬6æÀ®vE"j{Ð%/1vÑs1T^Bó×0Ñ—ÔÚ…8X»—ï˜f;7:&¿¥Y®]W:¼Dé^­ aéëm"Íì¢ù·­íPyy%ÊXä§Nˆ\Qþ47ĉ8WÔSízëˆñk¼Æ¯öÚé¸Y!Ç(tAM ˆÎ2;cj½fo„R–ÈP¤?V˜ZV;Ã`¨h—xL*Å¥æ§d â™é˜r¨Y™²j«ƒbs¼Â3HŽ9GK¤ÊæúGÿßÈL®k—·ˆMÉ7¶Üá·Ë-ÁxÔ„Ãj¢-¡€EÍJ%¦ç'¤çkèQ—Z¡+-Õ/ÒtÈK=üì‚%ÏÙ…E‡— z=""‚òÿýw¶d0Lj¢ÃKÀ“dÆ ìpÊŽXÔÂ0ÅîV¿Õç%ª¾äk8P[:Ú”}÷ÙãuåÊ•ìY"%ۢϙ3géÒ¥œóÎÍ ‹/fËWÎ…mŒs¨ÉÙíxÝ‚¢OëðºΞ=›s1õ RÂO¶¤an1„ùI[€?[ÄrÑÒÒR°Àg±ÑÍ$øb·ª yIÏ <)x‰p1474†ÄfÙ%Û;ZmM^V̧d‚ky1m·è¼sèð’–æ:× ´¥;CÍíc^bùÛX2ˆêm;܈ɡ¹¡¶íHƒæz ÆÍ ß²om¬¯!ïo/ü²¬µÔ>Ôp°¡æhK)ÛÚB6øW$ÆöÐÒT7~­Ï 3ÿ­N±Æ¶Q+­"Ú7àÒ$à¯çJ#?BÏ5EiRì7 7'&FICbø Rñ ¦ˆÃ÷ÇÆf“???þËéÒ·M‘¤´Œwèûùn/ÿlSVQŽ×æX-˜Oð7)³Y‹2–Ž$MéG›Ù‰IηpŒ´ÖçÇ¥&¶Q{ÜZ›ë1¢(ù+’°=ÈûYûS¹Ý-q‡[2å’CwÇg·³¡%Öç%T_XæÙÄúý÷ßç¼g¯S½XS^‚bƒ”ð}TæYTÝ{ï½'dîÅ{%+^¤|uè·ß~C°;…gÛÓ¬©/¡!¨&¾è¢‹Þ~ûmÖŸó¦îììÌŽòÔš¯äp 6›ä„æã£qèNd˜7o*Ý)˜Ê]wÝÅ—ÿ 4ƒj0vÒÚ¼D0pƒ”€!H²?W¸®¼Ý<ȶ¹Œ¶óç._ÃaA/ŸÂáÛà|7ÇÓÓS¬çyø1̆/é°÷.ý°»¯’—»è¹ÇxI%< 3³Ü&ÜË6{«mŽéïvµjò‹ \µÙ©­My98å8Ôæ%åtÐà 3Íw¸'i´,l );¯¸°¤üÇ%¼ý·jX°-Ä;"38.g£mÔÇÓž½Ý<|¶óÅo˜<6rwzN¤ä¡ïv]7Ôâ‘»l¼’fYG¥Øû'æðè÷»©óÐiö—¼iöà7;}Â3à(šø…%çjÊj¹õ“­<ž”]tå{æûŸé¤õ>­µ 9«÷„·Øíoÿ3›½…¯”A>Ç­ö¾ôMS£gÖ–”!ó¢¡;\âïûÆá?œæxÙ;›4e~{ò¨¤œï»“ífǘ9[‚o.(ä›mF/¬¿ê=ó§ÇìE†øô|¾ðgb‹qè ­oÒ…o˜\óþæ)Æ~”EÐ ²ðK6;+§©A šÉ+,½~è–KÞ4µÜžD;ß”¿½erõÍ¿®ñÍ+-ú§½Ûì½)ö¹¸±NpæÄmàëðº3”˜õ^}õU¾¸F‚³®;µy ºœ×h¶ß1b„W_}5l [D›—]òì³Ï†‡‡s‚ý}€¥‡WÕSyCîBú¼Dô¾‰Ã×p Ø?Ä{9µÆ(2räHL&—^z©°š°ëÉÝwßÍGƒúé'²bsêý÷ßÏž`Ü/ñýŸÞj;}^òüCì’çwžÊK8Y½z5,DŒŽ±cÇò•>N„+í‰'žàœðÙ?V‰rÂVô€Zéî0—¼¤ç„À@ž¼•YYQç±)býl“™®Ÿy%Ù á7o6&=µª±ñÔ“”޽ŸË^Ϥ•Va0 k¯Dœ¨ê¼Â²/ç¹45Ô´m˜¹)È;<=5»ÐèEcÜèþ»Âöù¥QnIeÕÏ+¼ Ë8ñWÅ^”˜;nµOFAÙÃßí ŠQ:ýèåž1Yœ”×ÔO7 HÎ,œ»%Ð7^rÐ-8mЉ_M}Ý)Îs·EX{'e敜÷ªqI‰bi´t‰3³[´+ÂÔÁ”Ãè¥ü;~÷ë÷k.1³ ‰§,Å$óêÄýÅ¥e¿®õ).-dzÝ9nñöÇ›^VžâHÌ©øßoʃ掱¸r²¿žç"ò±öLœ·5*†ãfGâ:›ˆºššÚŰùÎö$ ÑÚ}1ÛâÂr†ÏuO)Ö #M;=’,=Rø=Èí%ÌMhJÞ±xÙâkòäÉ,%ë··¦c‘>/aªå{¼¢Kðí1©õ ^òÚk¯ùùÁžÛ0œ°Møã%¢±ð²…††~òÉ'‚—`Ó¼$!!aôèÑ4Öe—]†Eì„ /¡íHÀ×n90™|øá‡;vìÀÕÅ‹>JWRªv|‰ð㈕ÃpÜ·Þz‹Ÿ‚(pÂG£¹ÜÂv/Ù½{7ç°¾¡óâ‹/2¢•xüx¼, ‡\a"œã"CØ¡ÊK8çàCÖXGD ,ŸQda)áñ;wŠH ná,í%ýžÁÀKÿwEýNoç).Öx‡ãF9þØðÍKïú|ÍÃc–ŽMM/n8Uü‘/AÅÆ¥Ô(!u˜é¡8tǰíM›‡ÏqB[jiøq™§Wxzh|ÎØ•^¨væ/TòbËÐ̼b !ž¡é„›:X÷èð’£þÑYã×úF¦,ß–_„÷¤ù/ó 5{#3rŠBâs£Ãk­#m£‘P„ žC‡—ˆ¹ K‰Ï¢E‹xåeÎâEíìÒ¡€Aøqx4@ÃC‡~ ÈÌwQ½øqκ-ê4[VŸ—ˆWvºÐçŸ.Þé bÀ!È9~Øïë矾h;îºë®ãDølmmׯ_Áˆ»Ã† à³Ðú4î§kó%H±¹9,,ì믿&  Äò.œbqqL³Š‡!ÜŽÈVN`Џ¡†"¬WÑ?œðg JÚKbƒè ÕëëÒò&îýyqÒs“Ÿøpþ=›,OÏŽwòÍ»ø’žúöî›¶´4·T'Ê'9tx &ç ´E;B§`̆}‘Ä66Õ/µŠ0Û½Å!öµ ¶,i ‹Ï™°V‰‡…A/VòH4ݵÃ-ž²Z›êžùÒဘ¬ß7úG§°Ö¦ ¨ôpK[XúÚ½$N0wˆÙæ‡\³6†%ådJ ì˜å!IöŰþe·{¡ iù‰éoÿa·W“ÿZ눸̂ øÜe»Â6ÙÇlqŒý}½/4bºYQ/ðþ|£²‘‡@Z®¿1i¿²Be…C@JaqyV^11¶Õµ5Ëv‡Ø»é@ ‚ípÆ?Ú²foø>¯$ * ·‡ 1¿p‹ ø¢I0ÌìõL4ÞYK^Êþ0Õkm¢¶:ÅíöH\º+4(6›¸œMöÑ;]ã7;ÄïŽÆæ,Øbë“\ZÆò“ADMôãK€Løþ=<<þüóOçYw‘hóÎyáC»ÿòË/„õ¡óx/Wœ¤=ZëØ§ZJ'îåAÜ+ŽdFm˜™™BìÎi" _Â;º««ë¨Q£þýïc¡ÖîîîhGe‚&–ŠÐ|ðþ¥³ñ¾-$Æ9ÒÌœ9“ M3±—ôwêvš«®LÕ#˜ð‚!«„ Ó¯¸ÿÀÚÄ耲X Œ„ÄÒߢ££ÿ 9øÎ”à%4ÍAWäâ–-[¸(í%ƒˆ‘ˆªÂKê2órÇlþêw¼;ÿ¡'FßtÓ>þÁ]ÿ|ûŠGÞ¿ê·þqÛ3­3_Ýzðp·x‰² ¥µÞ3,Ýx_j^Â+ A¥•Uð — ´ˆ¤¼‚â2Œ„¾b$Àx€wƒÐîîÒ xDz:¤ª’WXšC„Glj>½_]ߌåÇ„zIks± „‘’¹‘3&Bp ¬³Žd 1¡¦qiùïM9°Ý-iÓþhr;r¨‹X&3 v‘ƺxRNA)cA¬òŒÈdMËÁzÃ`”ü/D™„ÇçÀ ,+v‡C¼pÐhì.‡×ïS¢O޶6ä”P4¼ÂAVbíqjV!bˆ%N”B˜‰X¬ä‘AèqYyY™îÞêj)/¯8ÒÚà•¹Ë5ž[ƒ™—7¢° £Xm(O· ¼½2kg¢ÃK†W½æe<¯‰†¹àV0Jß?ËRÌÍÍ©ÅðPèóˆKiЈÔ›ØñV]'Lè«ð#ÀÂMÄfÖèZîò½Cúìö½^ïÌ=ËPÇ^¤¬¬y oÕªU€†/ŒA!XK`` ³è_jMÍóZ+†3i–-[ÆÂ% )éù“~œ~Ïc„‡Jm=œ'-þkæêEÓ–ÍŸ<Æ/Ó&ýö×ÔÉMýeò¯ W.ÎÊÉ®¯;Å:ò“ì«VÇ.&(i€Ø•D ×h­Ç aÔ<¬L*½‹Ö'=þ%Wã· %Ïi’¡Ä«áb73rS‹ýÖÐë$h×^µ¬ Vb84›˜5Pk’}"3¿Y€«åÈÍr‘RJÒ€×F”¨f"!V|I2Ê媢’’+ }áqM!q9“Öûþ²Æ‡¸Ĭ'˜WSwJuá_Ü[\S?ÉaH†Ê»õ±ŸxÄÖpí24ãdDÆ*®c/Q'MAM v_5ÄS·ŠB“õl®ïë§ô÷U£D”ÓÁgÝ Õ+Õï0¾j¢NÙ¢±+(‡ºÄFM F:Oéìºf˜t³Wpën&:ñ%üT!݉+ Ç ƒZÝW+â S{8‹yR4̯g¶FÉKú=/!Ô‹V¤+àU(+©*/«®(gmNµúWQVY]…¾¯ÝÉ/Q¿sª´gá>Œ%¿°$0:£î’Þ=Ȱ¦ª2-»ÈÊ=!4.[T³Y¤iÖaÖÖÕÖ*ÿžðÇ5M8Ä©:¥à%ˇ!Ô£ÓJŸä ‹Žf+ yôâ;¥t­^È«²P째bšƒÜ÷“Q/c¿ŸHÝ=1©WlšîUÒR‹¾„mÃÐú’ØE~·¯³)ºD@" H’—ôË%„]ÙFIûà‚Þ5$üd­°isBpõ©)$'G@t!ü8t*z”aBÅzZ"´èó,1åÜ0…Ô—J,ÆÓß_îœÔQìÓÕ¿š¦5=»ˆ¾DŽáÌùHÂ!b‰$/é—¼$&&&MëHMU~¤ó_jzFZZ*ÿuù`:q À Û6wù¹S$$+õè­†[j"$~:=Ê0f¡3 }žõBà~q 6lE7¬+éÅ¡jPu§Ž,±¡iXŹAÉ6„} Ž+fiC¨š‰bOÉKú%/af¦Tí#+#; :Æ%48)93Kç^§?é Ä€'Ìw"mFíGw2kOËã9Ù™eE¹¥…9ù¹Ùüìä8ͲôsV2Ü-0®@¡&ÇYŽVW—(eåQ”u"+RI’.OÒÑ!Úò€F^Ž2q#xYQNM¹R‘ŠâÜì,‘É Yû©TG{d*ç'Ö«ý® XÈ™ù«,̓ jç|,·è PYeðuJÔúõ¬§ÏK¨-$€·| +`<»uÔç%ˆÍ·ú‚!yJ^"`D» 3ï¾XæÏ:°§ß¬ú¼DŒtÈ 8Ñ.Ð2±®OÞÑåDƒ·‘†+t9îòg"?ù—G´uðé‹Ú¯sÐæ%aÀKA¸´û·”<5KAùI0–ÅxAŠFM@WWº‹ä%ý˜‘èðš?;+#)>{¨K¡[™å\—yö.QeEy]ìºö’ŒŒòâÜÍv¡¿­ñœºÁ{Ò–ÚB&Îì$›˜•ÉZUàjnvf~®æ\£Ü+Jr§mô^½+p…ŸGTIA6WIœ«¡ ü+“I~^–¥cÄ”õ^S½]í~¤¾(MCMòr•4¨º·RV6ÍÍ›¢‡Ÿ¹”.¤Rä!O•‹\PD·Ê‹r·Ù‡M^ïùÇz¯U;IÇSä&2܉¹HA¹9J>\Ùj¸˜bõQë%$'Qq~vBrÚäõ^3M½çmö¥Ùæ¾È¥Š-pÐŒUE$‘¥`–Þá^Uš+¸×€ûì3v}e+R4%k”øŒÀðáÃAå ƒñ÷÷g‹ØqãÆ Œ“4l]Ê"”þŽO·Àì$±/d4 è!HÂáÔAÊ->üâ‹/بž­ý¡ÂŒbSSS:Þ|@ë@DèŠß}÷;ý³-›hÄîB-yÉâ%™yÙù^áñöiû v¯‹œ–T¼ß;,6xç=YÕá%e…9[ìÂnõßí±Ã1ÜÂ>l–™7ª4.1 Œ¢M ˜¹V”tt|jHTRq~NLBŠXBXtÚ½(?;:.åß?ì)ÊSHMÓ¼îäfÅ$¤E$•åDÅ¥„'†F'‘[EqÞOKÝæoñÛëié>~•[Ce>Z<0<1 ,119) ~Ÿ˜FIÉi…yYyÙñ‰©‰¾¡ Å ×HIMç©àÈDØÏLSŸå;"b’a9¯þj³Å.t¯[ä ËÀµVA¤IIKŠJäYÄ(-R¬©ééT*,:N‘HA0¡¼œÌ¸$¥^¡QI‚ Ä&¦’Æ7$!19ÕÊ%béÿ»l´!…çRAŒM…xegò,W@‰²|c†üiÁKIM£î’šèð¦'4_ób/H¾Ù‹.áƒõ\ì­éµgùhóÎÑs”[¹#$_oØÝX{&LןÒá%hYt-Œ„6Ùò•½8Ep†¡‰Ýõ ’R‡—PtäòåËï¸ãŽW^yÂF„ |ûí·ì’Îþ¤ ÀX/»Áòy96PÿùçŸi»‰'²Q=˜ðÁ9ÞãiSgggº_ƒÓ-$;O¬ÍKèí@‡ã;8`È…øƒpñ”nïÞ½?þøã¦M›Ø¥Öqß³g_&â }ïq¢Pã4W؇ž-ÿ•·W-ocW$—¼d€ðÅl•—iåbeº;cÍr¯_©›mðî…æÛÊŠÊ»2uxIMiÞ„Õ{Ý¢ØÍ¹­¹¤í`‰wH|jZú襮ù¹™U%¹s·ø:ùÆF$}1Ûq†‰Ï,3߸ÄTŒc–ºþ²ÊÃÖ3ª±2š‰Ï?¿Ú¹È"`ŸG "â’ÿØà5~¥;v…ä”´ß×xŽYæ6~•ÇvÇðₜßÖyø„Æã i;Z~Õû[(ÔÒ)bôR7ÒLßèMæÁQIÃf;Î1ó³ÌuéŽXü`Ö&_ü¸ÄÅt_pSUÁ¬M>¿®öøc½§µ{Ô¨%®ïÿi7u£w[cñ‹¿ØÀ“«òýb§lðÂÔáOJòŸ¼Î³Gd\ò‡Óíÿ2ó^ø„&L^ëùÓr·oæ9ã{ ‰Nšj¬ÔkÜ XZkmá[“÷oØôãb×ð褦ª|ÿˆ„%Û $  Æ,uûi™ÛÄÕŽ>1…¹Y;`Z¤ŸiæÓXU0ÝÄûßßï^¸Õ/(2Ò3x :ƒOÊñ¡y&)z&ê„7].vežê»4:¼ÍÇ—Ùù8ª˜ønŸa*xm^Â$Ž'þ‰'žðòâ“–ÊêЄÃ÷woŽ>/Åòõ8Tæ»ï¾ /ÁüƧX`Ô:66–÷{,"_|1.^ëé3wÞy'×y³g' z°ðk>ûGz 'Ò•#†•/œk®¹R+œ_çwWQÀ”È'‡øzx2F+++ø_Ìã…U±=)ùéââòå—_¢VºËì%/ ¼>š‘cçl²Ê9Çâgë—÷„®£n_­û÷ÏÆc£#3 óOmLÓá%hqô눅.¼ÙðçÿM²e÷©¨¸”Ïÿr(ÌÍ&ŸÈ¯h¿°Ä§Ú‹ ï ªú€««ÊÎ΂ ÀŠ ³žúio[S1là—•nð’¯æ9¹Ä5TäCPÈÒS\œ³ÐÂ/26mù¡­­ö˹ΰ Ì#:ÇH³vo°{4VÊÂLƒ-dUÐN§8ÄZ«`b5Zë ï¶£íPÙ¸•îpì(Õ%9‹¶ú[ìÅut´¾è…_lÚXvXž1¢qÕµ)ŠHü}wrZúËãmÂc’[ëŠ^°/&=£ípާÜììMûC¶9EP/‚Tþ4öª-Ï}ä{+k·ÈÂ|<Ö™D±¸ÆÎÛâ—;Ÿ†Fßå»}¼r¡HúŽst%g^‚!©à%b§Ño¼‘Aa€†}^òâ‹//º„¯4;ý=Àx ­‰º‚8¢öÞ{ï=H ßÊA)òBÏG[à°+®¸‚ë0˜øøø»îº‹Îq¹çž{ÀXøhÎSO=uï½÷b2«™ºÒIv}^rË-·$%%!xòq`iÀŠA½ k ›yòF™ŒidÊ”)BB ¡2˜U""".¼ðÂ^x/‰w®¼«8K^ÒïyI¼f=NnvNpdÚB‡åNiÛ¨RR~DmcmrVÔÛ‹¯±é•µVûórŠEx‰°—ÀKpðŽÎg /¹üòËÑšð]–¦ßzë­4"Oa5±±±—<úè£ÁÁÁ9ý\Ò›Ó¡½ä¦›nÂL†0ŒK.¹ 1x@s±‚à„Å^;:ü8øn8yþùçÕAéŽ+¤Çô)ì'Tò’þÏKâ㉪HOÍÙà`1Ù}Èä¯8ïµúröËC—ÜóéÊû¾øëCÿèüSÅéð’üœ,øT¢%ø«*Í{üÇÝ5eùŸýåÀOÜ.ßÌw²óŒ†—Œ\âÚXIœ]úÚÝÎþ|G·º­¡òA€'ö†ÿ`…ÍÃÙ7†,Dà4i¨(ÀÇAĆ’¸¹uŽvÿ}§Æ^RÿÒxnBKmGØR¥~ƒ7Ä+0/ÒÁšBÂQ×Yõ²~O0Õ¥¹mÍ¥·~¶ ^2a•‡W46 È <ÉÂ.4?'›ø’g¶nk*jk)i­-B~¿°øÑK\«ÊYˆX›2i‘%_Ìq¢"¨S"BÚš°ÓÔ?ô;Á[c鮈ÚTÂjwÏ—–ÍUJh!‡b/ ˆcî‹1Ið’—~±>R_ˆ½äp}qjjºÂÏ`NŠá§ÎèÅm‡JýC?ýKá%ÂT2 ©‰>/¡¦bgq ðL÷ &®w_^õy Ñ ŸÅ®»î:Ô›áÛKXû Â&0€êèÑ£ÑÄÏ^BÓÃ9ð¾ÿþû¨Fx _NB—Æ$Hùª«®âµÖ‚fÅÃ-žÂŒ´fÍÔ$wѵèWâšy×?ë´¸w;sÏrÓ·—Ü~ûí ^0íüã`™v€]¼x1Q;EÀŸPŒ‹êˆæî«¯¾JW$0 Ix!Át‡ï œôãô{žÑÝ `®ÌÏÉ Œˆ›°ï‡¥ÉÏLrøï«Ó®ž»égÿ(×w&þóÃ9÷ _ðÀ¾¼uƲe%E%ݲ— ÚxGc~ VcÊωk<xdz¹Ñ&ø·už³Íý^Ÿdëàㇽ¤¶<?Ž‹,Îþ~]僈N2yîkÂ;XóÛ:¯ ÈDâ0â“R¹ŽÑ‚`CP–íÀö€‹ÄÙ/6ƒßgÄ|g'ÿØíöá”KüÇØå®8Œ%Ldîf_žZ´|Rˆ™eæÃB›Éë¼×À‡2eƒ·=!ùÊ aâQ  „ŒÀKÞüͪà5ÁXëcº/ä÷u^,újŽó²ñIi#¹à[!~ÖÂ.ì·5¿¯õœgîÇO‚jAiq­Üˆ½ä±­pE ^‚ÏÈ#0Ÿ‘b/ÑØZl=£…ØÄ”˜Û†âä"üsœ .Å%Bnq]Í6óE~ÍòŸžM)ý”þzÞÀÜÝÝ Ýë­·,,,Ð+Ý ˆëõ ëðx_o'R½Å+5A0L©ÊÂ-;tâ^ѯÄ~,1„ö ØÐÀªØAÜ+šEøÚk¯A8ø­‰O:BKQw^åéQÐJBª‹äpÌq‘b™1«jýÑG‘xÚ´i†9tæ[Ag=¨Ò—DGIˆ V÷Í7ßÀt‰Î— ð2LÐ> ‚N† )ÍchdÎСCI@T õÝæÒ^Ò]`p镞‘Ÿ0Ö|Äû+ïý`Ñ£/þzïÝï_þð{7ÿëýkÿóá ¼{å½/\±jý²’Âîñ%»0'(2ÉÎ;ÚÁ'†8Ö†JV¼(Ëh÷¹GâR!¯#öb2ð}ˆ¥°,o±õˆÆ¯Á:¥?feú‡++u“S ,e»¶ŒØø¡Î1! ï±¸Àf h÷ˆØdrkùƒU`•ÁøšçVEqŽwpÂÇ3ì)ÂDn0ÂWQí¤a! ¶Ëp=Y“ f–ü‰£oLa^N`d¢f#å t±PW$ÆÑ7–õ>\I žáLö>Ñ6n‘h$~â ‚Q/¬A¬ü-R˜JbnnûÞ-”EÈ ‹Œƃÿ"#«ˆ!•WP,ŠØ·G?¿‹œˆïãУ´ºËPªÎ{3ó©ˆB‹CÑ`„Ôïˆ-¾ƒRQå2²ØÝêÑDö@&tšF­c'µî‡Q·ð÷©S=§Móœ>ÝCëŸü¹üúk¬‹ ÌàѹÑBǪ‘‘ÁãQNN.&?¦§§ÃuŽ[D´Ç€ÆR’]X˜–”çæºi“×Ì™ü…š›Ç¹»§%$dæä(†U€®XPN™æôôÏa,¥–H$ÉKºÈ 1Ùq^’ž^xð Ó·ß.42ËŒVjþ8Y¤ù›ndä1cFNY™ê¡r¼OŸ,P%33·´Ô}îÜùFF+4¥À90œtÈK¸˜[V–f;dȶ{ïÝxÁK4b¬32²¸ë.ëW^I‹ÃprÒ¢´ÓÉÅi¹ÃÚŒç Ìh–‘H$ýÉK ‘ptQ¦ì%ååá;v8ŽãøÓOîýeöñgqë­Ž£F9¿Ĉ(;;Ü(49„ §¼<¿®®°©)¿¾>·²R\oJÅSSX˜WYYÐР$¨«Ë-/çL#%mm7Bw6­62ʯª*9zTÐ [ –2Ùñï¯ÑÐ#“+®°9ÒyÂÛÏ?7¾ðÂyFF±(Ùæå)’ÔÔ67‹²ò**xP5¥(Òææb b=; øË«®ægæ–cá´J‚ÒÒ|‘ ¡ÉÉAñ1‰ø’ (‹š’ @S_%A'¨þ?°e $‰@?E@ò’.rCLv<îUh_¨@Q·²­më-·¬×'¬^~™®)T5ú[ñ­§'%…oßî4nÜ®wßuøî»ÀµkSbbrÙ …¤Ä$†„®Yc÷ÕW»ß{ÏeôèM›Rbc +±6lë¿ÿMÎðþµ2Äòÿ‹÷òÊ)*:NM4Ö‰ÂÖV—1c0«l022¿úêÈ}û XP 1‘VVþö·KKFRHHØÖ­îü±ç½÷¬† q5 a’BCI,xƒBz23£íí='MÚóÁV￸dIŒ½}zjªBM23©rFVV´ûøñTgßðáA«W'úû+A-šP–ÔØØÇo¾±zï=‡‘#ƒ7lHðóS¢mw‘‡D@"  ’—"áè¢L'¬>¶5[ÖÖfqÓM‚—ìzñÅ´ÄDa?àŽTòŽ4¾ì2áâÁìaü÷¿[ÜpC¬³3wá.Ä‚l½óNãK/Åγf™Ædû¿ÿ66®Òü4Åþ¡¡&KŒ¦Á30r¨¼D±pÅ’“crñÅÈ`|þùÞÓ§c¥Pb]!=ìN[Sja‘àë Mñœ5‹Ì…$‹ŒÖj„ÙrÛm0øÌ#%.ÎñË/Í®¾š¬H@2ÅZsË-Ä©(f¢"“Ík¯™^{­*-’[ÜygàêÕ”H&Ôwû­·R_„§:ÈLq»_z)-9Y5ƒŒR‰€D@" PÌÜrÿ’.ÒƒK¦»¯š£HOWxÉ7 ^²ó…ÒâãE vˆ/1½ðB¸ÈÆK.qþñGŸyóv>ò)Qê6/¿œWS“ž°ëñÇIÀ³¶ï¾ë»`×Ô©ûÞ}wï /9°t©ÍÛoà %$€p¸M˜©íÊQ"K*+#öìÁRŸñå—Çyx`´Pƒ<vGÉΆ£xüñ‡Åí·c/ñ™=Ûí×_¡SdKé¶o¿­¬**.\¾ÜôÒKq™^pÇ´i¾óæ9µûé§CLMñìàbóÊ+ÈÃ#Žß}ç¿t©í[o‰v>õTrDÔ‡ZˆêX>ø ß¢E^Ó§ï{ï=ÛwÞi½•¼DNƒ‰€DÀ¼ÄàØF×êp¿×xIB‚ÂKÒÓs«ª"öî%þT±£¼ñF][[c[[ˆ±1A©\19÷ÜÌôôX__l‚vDîÙSÝÖFL Áéèï¼¼‚æf¿µkÕøÌ0m`ÑÞ-‚ ²ÿì3ÅøAVW\‘˜­Ù/_ôüã& L8P”òrŠ(mk«okóøõWH’Bh.½4! _ŒÍ{ïQ-®¿¾¼­¿¢Ã‡aÂAƒ„f×_Ï]L -mmÔ(''‡r¹brÞyQû÷§DGc&A ®ÀÃj5Q Å¢Óù"gC¥R‰€D@"0x¼¤ë4ÀàRv—¤¥¡þ­žxµÚ1×Èhö1ï j›Ÿ1NNØ2¶ß{/ö t9„`ëw`‡Ú°!» rC؇÷’%*/ION&è¤=`öØ QxIk«ówß©¼$QŸ—N@„GNѸî'â‹¡DâQ*ÿÿøG¼¯o^U’^SA$ƾ7ßôž1ƒ•ÆYDæÖÖºýü3·„SiŽæoÆDupÙø®]KP­Í‹/ò,ɰš˜]r‰Ãðá«W‹Õ@‚% žÑ.k*H ÉK Žmt] îò’ж6ÁPÒ,Ö Z¾Ü÷¯¿|Ä߬YncÇ«‘S\°l™)Ëy.¾Xèr–á8|8ÔMǼD«§+~œŠ l¢ ÅãìŒÿ踚]àpÁr0áXÜ|³×´iVÿý¯òˆ†—$x{ÃKXi¼ï­·†8„G…»œ>¡¸,¶ùòKÅ'¥a-a›6ùΜ©VÓK¬›&¢;;è‘¶‚ÜP!2{žy&),Lw7ïRB‰€D@"0м¤ë4ÀàRv——9bÿÉ'¨vÌ ÛÿûߢÖVÅGÓÒ¢ü:Ĺ²¶Eãg!V4`Å °leë‘sÎA£óN“¢–¯Å‹ab0®uáŒ:R”@MÀ)&Å#sî¹î“&±X,ÂèÂ9™Çûød¤¥™ßx#lƒ¿àõëñ¸Ž«„Ê ^âã£D¥ää ŠûÉkÆ Œ%&ûwÉyï+¯ -tÊøÜs…¡vuŠÛÚ`QŠ0› uëXìcùðÃÏ;©(ÑùrŒ.}€ËúI$~†€ä%Ç6º.P÷x ñ%åå˜0N(¾üÃ{æL1Ä”ÐgY'¶e a¤ û?ÿœ…µ ÂJ;†¨K`Šòš?_ðl8hˆ¥%Fä„·bpKËþ>‚)‘+—_df&7p–ìr=rïÞÔ„ËK\¹Vqà£T^ÂZßÌü|èn…•—µµYÞ?ò·û¹çØm–d7]=#ŒË?°òHñˤ§“sÄ®]äb±ýàƒd }à€ù•WR¤ÊgîÜö]LúÙ˜•âJ$Œ€ä%]§—²3^róÍh_þv±GĽ¢°ñœTTìyþy¡˜×_xáî—_¶ýðC›¡CY¶ƒw#ÞÕ5Îߟ( ‹ûï·~÷]»áÃ-À-ëçžãñœŠŠ°;6jÈÉîgŸÝþê«ì_¢ZNܡӻ®í|ì1á:ÙpÉ%6ï¼cóñÇVo¼Á¢@â== .±¸åü±ã_ÿ²2Äüª«ÄvpØK”hÙ¼<ôòøÎçžÛ÷ᇾþšµ9Jë¹ç²PH‰¥ÍÎvýùg“‹.¢:ä³ëùç•ê|ðÁ®W_]uÎ9l#ú˜ßzëž·ßÞ?l˜ÕK/Ÿs¼ ~ïí­„˜Èø’<¿ÉºI$ýÉK Žmt] Nx ª]ìö±å‘GR££ áX"a­¬ÕsÏ™þíoØNØz¥¾ù¦›,þõ/ ) –O>Iô ê_ì7OèëÞ7ßÄ³Ãæi™¹¹©‰‰®'n¹áÂv -ðæhóÆ?¹ˆ3Ëz7\t‘~ãÅïzúi¶Ìgn”0 v¤…÷ ªå£n¾ê*2;¦Ä¹ºâÇñY°`Ç£nºòJb\Èaã¹çî~ê)Ï?ÿÄ4¢|0?Oàºu¸x6]}5Ï"3cD±xàH;;Ì3ÖC‡nýç?×s½$Ø|íµÖo¾É¶rÊ2"¹¯Zÿ›²¤Ä‰ÀG@ò’®ÓƒKÙ1/”—ã” 43 41 ·±A7+›ª©»¶k¾ë›A@hÈæÍ&&¸T°y¤DD( d²³!.‰~~VV<Îf¬ÜbØ,H‰8²³ùïîlalfµw/ p:øzŸ Að¡ÌLö‰´µÅzbaãàûQf›5|@N‚LMƒLL’ÂÃc;xÓ¦ Í›ÙvÚ‘ž––ïæ¼y3òðmB’‰½O„8 ;),ÄñÄb"‚=ñ­`áÀƒ#¬í}SœiVĈ4ü¡×ÑÓÊ^gª¦×|ÝFû–ˆ‡mWä<γ$àA¶{¤GÿÐH"8Eˆ=òI/6Ukÿë’Ù?Md•Ÿ\l²…7Qy\•Ç5”¢ýqQ™ää&§°P©²ZŠf5²rKÍAÜÒXJ:–¹ÿ a)±D@" PH^Òu`p);æ%¢ÝIu°ÐåzL¢ý¢ð÷èç ÍltžíÄêÐQYíù‹§´ŸÕϧ#añÒÿ\°Î¸Ô®Ž> ’” ¨iLVF" @H^bpl£ë”— I‡J]‡°¨:^jg'·…tÈo:4œ¨òtà:Qå<æi:¸îrbšŽ v•õ™“vh˪H$†€ä%]§—Rå%ZYžJ$‰€D #PZZj$ƒS¼R Nظqceee®<$‰€D@"0Pà3gÕÕÕ’—ôK´`Á‚¨¨(ÿyH$‰€D`@ €R‹ŽŽ–¼¤_ò''§ðððyH$‰€D`!&yI¿ä%Rh‰€D@"  H$/Í*+%H$~‰€ä%ý²Ù¤Ð‰€D@" H^2 ›UVJ" H$ýÉKúe³I¡%‰€D@"0 ¼d@6«¬”D@" Hú%’—ôËf“BK$‰€D`@" yÉ€lVY)‰€D@" ôK$/é—Í&…–H$‰À€D@ò’Ù¬²R‰€D@" è—H^Ò/›M -H$‰€ä%²Ye¥$‰€D@"Ð/¼¤_6›Z" H$ÉKd³ÊJI$‰€D _" yI¿l6)´D@" H$’— Èf••’H$‰@¿D@ò’~ÙlRh‰€D@"  H$/Í*+%H$~‰€ä%ý²Ù´…nhhÈÎÎ>xðàY¯É‘#GŠ4‡*Immm^^^cccd;|øhë¡ÃGíÁ³]y¤¨¢¡ód›““ÓÔÔ$’>|8??¿¸¸¸+™ŸÝ4uuut‰úúú³+†,]" ôÉKzš=R^^þÃ?<ðÀIIIˆU\Ù°Ã5ÅÚ'Ã%,·¹åдªªêÏ?ÿ¼òÊ+kjj(º´´ô©§žúüóÏj›;‡æîóÍØâ¬ÈÙ•#"¹t‡{jU}ï𭪺朒ڶ¶ã,gºy°¾ Í-ɹ•⺷·÷#<2eÊñ““çŸþ?þàÜ#"¯o†[xžcp€WÕZÈCGŽ$dU9Ò1ÍÚ옴Û3-6³¼+Èœ2Ý‹/¾8bĈS¦” $‰€¡! y‰¡µH÷äá…~òäÉà±²š¦E–‘Û\R6;%®Ü³Þ6®¶¡µ{Ù^ê£hÝ£Gï¼óÎ’’rÊÊÊzúé§[ZZ°5ÛÅO5 Ú씼Ã-e¶EXWÊñ+\g_Q{j•ß•Ü<# –YEi§ì"4l³­]<ê²eË–_~ùE<õÊ+¯„„„ÔÔTikÛn_ÜK½þÚfb_VÕnSéD’ÖÃGÿ4í€ ñȘ•>Û\S,\’¡JöAÙ]©NçiZ[[ÿõ¯~V2‰€D@"p†¼ä ÞËÅÁK¦NA¾^QSÍBÔš[R²xgd\f'¼§:ǹ®±î²Ã-õùq6\üô/——ÆÛrÒzèÈð9n6>é¯N´ãçð¹®#—xá—áÜ54Çè¹µW Ù4Ý\É|µulyuÓMm1>ðåŸëzþ«ûaOf¡b_á0zbÅïš½:q?ç Å$4I)%§¸îÚ6_øê†Ñ˽ùùäO6×¾¿ùÜ—Ö‰üœœÆ/Î_{íµøøxqÎq°õð6×dŸ˜õÊøµ¾½f|ï;¼"Û/~<ÓéòwLžZMšUÖ1ç½²þ¶Ï¶nÉî¨^ÐI@\^'»„¡Ó"SKK*—îŽBNlHŠTÁÙŸÍrÙä?¿ÆÉ#RJa]³,Â2 ‰¡QÉKN=xd ‰€DÀ ¼Ä ›¥ËBió’ŠÚæ¼Òö%eU ·GTÔ6Mߟ¥˜4‚‹ßýÓ¡¶±å‡¥Þüt ÏG£&ÃSJÿÜÄ•ÿü°‡mý3×ÚÄqbæ˜h㫼‚¿6ÉBU²·öM‡—øD·û)°7  =5NœÒÊv^B®¾½:²Ñ..4±Ä%L1!@5 @”´‚jçМ¿ÌC¹xÕû›D½áɹU‘ieKvE­Üã®Ø!8ÞøÍ.«°&=¿*³Û;Q-ÝSEnß/ñâ:´ Z†WÛ Êû°–¾÷ŒÌG~m\ïûÊRüŒË,·òN7sL‚:ÀKF¯ôQ“uf/ij59àÙ.›©C‚iù5˜šüãŠÈŠLrJê2 ªŸÓ¸Ì¸òÕÅ.¥sü±1Ð÷˜3¨¸²§UXJéj›˜°äjcó‰QìL Í­ Ù?,óJͯ¶òΘ¹94£ †4DáÔh\?yeu€ùâ/ûDl¯ä%úPË+‰@¿@@ò’~ÑL'^2cÆ ‚ H‘QX½Ð2‚ ´5nŽi[aW@ýV‰gäÛÅžX)F/Wô®GD‚$ÂSK…½ä韔°ýYl•ˆÍΉû4ö’±«|÷($ ‹×qL,+öĨzT)´ æš÷ÍÓ•€qüûßÿVy 1â"‚©ñ%ü„1ð±bo Ô«Ã ó\flÝì”d鑺bO4×#ÒJ©ËÁ–Ö…–‘° žµÜa˜ýýÏÝ^i)¹U<Ë#\|e¢mfQ-l†ÄH‹¥‡j§J”P<~­˜ÿ†ýJûÁŠBrvy¤Á0öú¦cøÛa™ ÞV<èææ6aÂqN]22ŽûJê[ͼŽQ4¿ØB3‡$ŠÞî–²Ó#•|“Kñ4qED®à®Zacéž’˜Ó¾ÞG•mÜj?‚^iµùÛ#°”àÆÂîB&¸Õ?$±¤¤ªëˬ¦˜”7à˜3µO¤Ö”EuJ«áp4±Z9'$$ȸWay"ô#$/éGÕ¨ð’ï¾ûnÞ¼yl¶Áí”ÜjÞÚ±1 çÄk4 oš&–Åèÿ€x%þ”°Ð”üj, å5M©¥\± TÜ:¹%uIÙŠâLË«Î.RœÍ­s·†¯²Ž%ÏÒê&¬/ÅZ; 2!4ÍŠÇ„=TÒÒÒ.¼ðBVó“õ8÷Þ{oPPPEyiBvµN *KwÜ"ò Hë]@Xàu‚÷ìòL㜜á\?tø0^'Q¸4‹Õ="T–`–%[8'ùÅ)vÌB‹vF.²Œ"©„ µMYk÷Ų CÑM}•WZ}#놔S“®¬¬üý÷ß¿þúkqõ8ëÖ­ o>I„ö&(^QùMX«°ZaF"ÐUšš­Ý'ÐÖ9p½8ˆë‰Ù•ă9…Š`¯š·-œ–Í)nwÓÄC¼ XÙš+<¸xW$õU~¬Y³†dý‚䉀D@"`àH^bà t ñØAkåÊ•_~ù%åÌ×-¸`{„cH{ÑläellüÆoˆ½ÈØÅ„Å,3gÎÔËè]!ã‹ÑÍkmbçl Ç Ò»™GFF,5ÙZXXŒ;výúõ½[J_äæçç7fÌØj_d.ó”H$}Š€ä%} ï™ÈK ûj¶ 9Ó¼Ä#¢Ý’AÙ¬+ÆR"Œ%â`¿W6HU·LíuùRs«Oq ÍÁ¢Ð뙳M-†u³Z6¡.eeíAĽ^\/fADr¹ßk/B*³’HÎ’—œ1¨eA‰€D@" œÉKd‘H$‰€DÀP¼ÄPZBÊ!H$‰€ä%²H$‰€D@"`(H^b(-!åH$‰€D@òÙ$‰€D@" 0$/1”–rH$‰€D@" y‰ì‰€D@"  ’—JKH9$‰€D@" ¼Dö‰€D@" H ÉK ¥%¤‰€D@" H^"û€D@" H$†‚€ä%†ÒR‰€D@" H$/‘}@" H$CA@òCi‰nÉqøðáCòH$‰À€C@ò’nñCIìáá-‰€D@"  bcc%/1ªÑ-9¶nÝZTT”žžž!‰€D@"  PjÅÅÅ’—t‹Jâ}ûö9r¤¦¦¦V‰€D@"  Ôв’— Õè–ÖÖÖ---•òH$‰ÀB µµUò’nñCI¬ò’ªc‡N·¬ª¬Toõщ(±=óNGE×8!ÏŽê¦Ô«—ªÖ‰È]øX]M/ÓI$‰ÀÉ`N%ŠWòC¡Ý’C‡—´óƒêê*ñWU_8Nú`¨%*'‚(¨¥ëœtY%+!¼ó8ÎT4ÙŠz~ÕÚËêPæ. ¬Öº‹éû d–‰€D` ! yI·˜€a%Öæ%BIW×××65‰¿šææê†E‹÷’iA§ß·—XWWSW×N#jkkU´OL‡jt<Š4¢Ö44T×֪镂jj¨K õ"ÿÆFNºša§”œ›µ ÜØX­Vª“á~Œ”€€¸·¬8iŠ‘u‘H$ÝB@òâÝ’F‡—4=·sgà’%þ úÏŸ·eK~LŒb{¨©Ž]/Ï1«ƒþuÁ ´Ñ«N¸TQQ×Ò’åíí5kVÝÁƒð†Â„„ E‹üæÏG€ eËBW®ä$`áBßÙ³öï¯?t¨²¢BÍ¡ƒ 5L§þÈ©S³ýüj Ѥ¯&ª©‰ºDûΙCΙ^^…ÉÉÚ†“vó‰ ú5Õ\×»\ÙØÖæ>u*"'¸…¬X°x1?½ç̉۶­® C_ÊrsCׯO€šôЧ[X&–H$ ÉKºÅ +ñ ¼¤¢âH[Ûö‡^lddþÐC¦÷Ücy×]ûž>ÙÖ¥®8>°¦444µµ¡ŒkZ«?1r†8ª¿Ñúu­­¤ohkãÁvŠP_Ï•ÚæfL¤ç3g’‘'‡ÛÚòCC·>ðÀÆ;îØü¯­9ï¼EFFÿùÙÝwßt“ǤI-mmhz%ãG«êêÚUxMZ ÙVj°ÇE,^Ì Ep—²b·l±þï·ßr‹É=÷˜ÿóŸ6Ï<ãþí·ÅÙÙpd&Ïfj!ª)Ì8µµõ‡‹²¨]»?‹µ´ˆ‰‹­mm˯¼rÓÝw›ßÿú«¯^jddróÍ›î»oíM7¹ NJÒ“³‚@}}»ÀÕÕÈÉE·ææº#GŠÖ\{mà† ‡4b`}é#Õ›zdu$‰@‡H^bXT£[Òèó’ÝO™‡ÌŸ_”’’îî¾ýæ›ý§LAž’´4r#‡só²ÂÂÒ‚‚TGÇÐyó&O.-,¤ò„EA#¨Kð_%íÝ[’—WS_O‰0˜Üˆ¥,ssTOccAddQrry~~èªUÆW^™¶YNNA\ENhhÀï¿'ìÚ¤WÜd—ÿo¿Å˜šb³iÅíØ±á’Kì?ú(KÕ¤IyÑÑ’šÈÙV" ôÉKºÅ +±>/ÙùŸÿl»õV¤<¨yww5j÷ÓOÓÆ¼÷‡/_nõÈ#kŒŒ6m¿ýö33Òdz{£S>þxÏãsÝô‚ H† ¼¨È{òd‹›o^gddvñÅÛz(;0 3=X^\Œú?JÑß|³PcGQ(Q[œÃñóÏ7]v˜^x!+ö›úzŸßßrÓMë¹xþùæ7ÞóØvýõ«e»ÑÈõïöõ×.Æ)ƉC‡à1Ên£ÆÆú£G}&N4»äJGªg‚š@›\GŽÜtõÕfþ÷¿o¾õÖl__{O˜°ùúë)‹ôX_2ýý±ÄRå˜Ý»×_uU~D„°² ›ãС×\ƒ0&ç·ÿ7 sTÍoòä]÷ßOe7ž{î¶Ûo÷:´\#0ª¸­[!4ÒdÒã)I>( r$/1,ªÑ-iôy‰Õÿ»ùŠ+ò3ÜÜ"V¯¶¼çžÈU«0u¤:8Ø<ýt‚MMffUVVâž=»þùÏ’ŒŒÜ   W^é6n¥(66hÞ<Ó¿ÿ½²¼ýÔ⪫pv ïƒþüÓoâD#£ð Š££×üýïñ(‘‡5´¶òxÄŠN_~éøÍ7‚UEÊ\##(Bap0¦‚ø-[°µà­ ¢"béÒÙFFœÀH¦Ä¢VThóÅWkþìñÅàÙ³ÿ=lþ|Û§ŸÆhgÄâÆ·ÞqGrVT€‚s[Ët#£¨U«ÈÓš~õe—EíÜy/Ѩ}Îôñ9ðæ›;î¸cãEX³á⋉½Í 3¹ôÒ}Ï=£tDEHÉön[° pòäÐÙ³?ükJaJ &2Óæ%Ôº¼¤Ää‚ ¼ú*"&†Æî•WÈœ·ßqÇ–k®IÚ³‡4Â(…_Éì®»BÖ¯W0Ô8§$)éñ|$”H$’—Õè–4Æ— 5á"IûöÞEÙã}ØýÖ[¸°CÌÐüÍÔüKhgY\ÜšK/M°·¯gñKUTíîðÎ;;_xÁuÊô®âm©®†+üWXº´(<¿® t0Ö´2$ƒlIɪ™v{Ɖ¼¤®¹9ËË žD΢\þ 2jž*ÍÍ Y¼Øöõ×áCÖÏ>‹ÿˆè]x A0dŽ3¥¤ `÷#„.^Œ3¨}a£–­÷.LJÚuß}† aí #~ÇŠÈŠB6ì"3gî}æ®8}ò ¨"Þ–¿Ž 0ËÈh¢%ØöD^ÂãDÉ €"½³\]¡‘kÖxçp°¸å%æ&%Åô¶Û‚V¯V¢‰Yý¤AAÎ,‰€D@"Ð3$/é0¬ÄÆ—l½ñF–Æ@G¢7n4»è¢,??Ôø’%NC‡B/´¬,ÇUì%vvbIK¦¯/áÄ„͘½ÀRŒ\O9p€¸L ¹~~ /±°@yãá±¥èxŠP–ù°cŠÆ-¢ØK¾üENq(ò²’b5b֬ѯª¾¾¼¬ 2ÄQ_]mòÿ²hçÓà% r ‚…,\H˜–bÂ9rD1–45Á<ÖA­x„ĉç(?2RÙ¸¥¶VdK@+n¦Ü¨¨°¥K±è€ÁFp)m{ ù×¶¶Z=ú(á±ÚéAOYòSY ¶üÄ[ä4dHuAÁÆ[nñ_¼4 O]Úø¤gƒU>%H’—Õè–4¬~ä<&(ÈJÖÄ:äûÛo;ÿùÏœˆˆÒ¬¬}/½´ë¡‡f ×ñª8úi†··Õþcõä“?üàþý÷vo¼u„U»ÉXÞy§ë×_»Kˆ.þšV ¥¥!ÀÞ§žrûñG¢b†ß|å•y±±b0¼$ÂÂbõ%—°ˆI‰®=xLˆÒ=ðöÛÀ‚À£úJÈÎþ×_wúà·±cÉŸXÝÀ)SꛚìÞ{ê­ÃС Ì ˜=d%‰@ï# yI·˜€a%Öá%°ß~‹7D! ìMÒЀ[Äõ«¯`”¯¾ C¢²… Ù<ùäzöù׿XlŒu¤º©)ÕÞÞêùç·ßy§ßï¿'ÙÚš<ú(¼„õ8ÞcÇîzê© ·ßîðé§D™Àlˆ\Ájâ;nÜŽÿþ×ä®»ìÞ}sKYq±÷Êz¥ƒcíí·¿ðBžÆ³µbý¦&Ï‘#-îºËôŸÿ´óM`apÄÚµv/½¤`øÈ#Ñ6(+‡£äùÃ`Å’" ’¼¤÷'*™£D@"0h¼Ä°¨F·¤Ñ݇ž}]5±j†²Y{}={oô@˜ª°(»†À<4­Y>>øq’ÝÝq—°É•8Њ ³².—;H̃‡+kLDæš dÕýS•P–5lBßÔ$Ô¼“"öe?¶*d…˜P ¥ ÖVe¯Íž"Ê.m!Vÿ¶´ˆôÊ~órQÙwD#R!ƒžë<%"L•dšÍ鹋´UeeäО˜½ä5²Á9ÄΰA2ET ÷ªc{7„_öÑ|‘G9ÑTM¡\šmåÙt®¾^žÀ^Ͷ. ,šÝÕ” ,I)  ì‘¯1À š DVT" ô2’—t‹ Vbýïö)– u=ˆÐ¸‚¦ÛU*i°dº»/=眛†C‡&¡~LG¨VÔ/‰©jññ%~Bë›;í )WëºrQSª¡E‡à+í)Õ½Y5)…¢ˆö”Z¶‘§"¼º©<òpQ|LGÈvìûy¢¦í<éØ6üÇÐ*®½\MeUÚÃWµn¯ƒ®íXÉÅ8½:‰Où¬D@" è1L¡Ú¼DåÄ\¨=éõ¸ˆþò ä%g„;ôe!*/ÑèüÊÃÍÍö‘.ùÖ>5–Ó,M6ª­>Îú®_êð ÂvÂQsÌf£C5H }¥±±‡¢HŒ1Su “··ÐŸœ‹ü9a0ìyD$à„DMÅ•q"F¸¸¥RU’3Ãáú®dΉ@?E@‡—h^2kD¤ÿ¶´´ j"yI_R†3’·à%èmúqSC]xLþþ8GçBkë,“M1sWnñ9Úz&:´6/Aª¾xñâeË–ÁuŒ¡¶¶9aÔq…»Ä7YYYýú믄§ÀB¸xÓM7sÎ9Xð{ì±¢¢"†%O‰CÍŠÌW¬XAA¹¹¹ûÛßþüóO†îÑ£G¿úê«à›åR eqÞÐÐ@þüäD”®J"²ùKjÒO§u)¶D _# ÃK˜²˜ §OŸ.æææLƒƒ„šH^rF¸C_ÒÎK*+±‹Õ8FÙfZÚæn^è=šbýíÜÂZ6õµºÕæ%Œ(À°aÃÞ}÷]Aàfff0 ‹ŒŒ ÞÒÓÓ¹ÅÁx#ÁÌ™3Ÿxâ‰M›6q~É%—À0fyyy¿üò 'AAAëÖ­[²dÉþýû¹K­_|ñÅ·ß~;"""++ë…^2dˆˆûì³Ïà%‡¶³³ƒqdffrÝÄÄ$..nùòå111þþþk×®MMMFš ¬ZµŠÒqñJjÒ¯'w)¼D Ÿ" ÃK˜Á˜3™ÍÄLx饗òúÔ×3¹! 'yI_R†3’·êÇ©«© ŠI5µØ—µqIà3¿¹”?gï˜ß6Ì­*kª«U\$}×ç´y‰0„|üñǯ¿þú”)ScáÂ…¨À¤I“Ö¯_±xï½÷`0 &OžüÈ#@à#GŽ455Ý·oF???‡C\HO_~ùe`` ìáÉ'Ÿ„Žxxx$$$ÌŸ?ÿÃ?høðáØ`à%”Ë#\tg̘1Ó¦Mà‚mæ?þ²ÁŸcÍš5Èð×_q¥Oê»&9K$ý}^²}ûö/¾øB¨‘ë®»®¤¤Dò’3¢Te!§€à%¸+òò*7yìÙo’WŸlæ73:;°©©þ½%×Úô‘‹_lS6À>T¸Ú¼DœC86nÜÈ ¾Œ °Ù³gcáøöÛo!p… &ÀH€ÏÅÆÆG ç0{S§N7nì4žžž¾¾¾˜^¸2wîÜÛo¿]d‹ýcÆ œÄÆÆ’'fžÚ¶mØÛÛsÝÍÍmâĉsæÌÁËÃO|C¡¡¡˜F)ÚÕÕòôé§Ÿb×ÁF é™1cÆ|×!å _¤×gv)¹D ÿ" y‰ÚvÒ^rÚ¼àlg/!€³¾ºÁ%$ô£×üR^]ÔrHÙålÝÞYC–ÜúùºG§Ï)-!„¢M&úñ%({ì‚— :ãN !X8à%ðƒ-[¶C)H³uëÖ±cÇrQ(..&*Elª·øßÿþŸ€Ö`áHIJJ æÍ›' $ðŒ(<Åùµ×^‹Íƒ"¼¼¼¾þúkJܽ{÷Í7ßÌ­k®¹Ip ýôÓO˜Xðþ'ùÀKx/Á„0ŽŽŽ¤>¤oýwÖ”’K$}‰€>/aú¶^Ž«¯¾š)NÚKζ¾•åw xIC]mFvñLÛÙs"^™`ûô¨¯ûEx´<üÁäÇ?˜ÿÏÏ–ÜÿÚ¸§,÷»l>ØwW‡—À*víÚ5~üxaÒÀG!ìcõêÕ¼0ÐÜ4?þ8  ?þø#Öø !"™¥¥%&Ü+ÉÉÉä)ÁÂIHHìp˜Gdd$¼{ <ƒ|pÇ\tÑE$ ,Ì!8tœ¹Â-ø£:;;—mXX.Ø`…yöÙgñøà6‚ñ¬\¹’”}‡R_Nk2o‰€D # ÃK°ó~ÅdÅ4¸wïÞG}”º ’è7i/éšò7àTð’¦úƘÔÔÑ{?\šöä ßg¾ÚxïÇ=<ÕxØÐiwŸ÷À—óx`ÈEÎûóPëaeÉlߌ\ýuÂÄmÁ-¾ùæÀCHÆèÑ£1r@2SµpÛ‰X ‡øý÷߉Q…sàß!Ü•ƒÀ–ÏpâA5j±`Ä¥óy Y!Œ¡Ë˙ʊ†:$ؼy3¦œAÂC„ß >Ú={ö@bÅE<2Áˆ2bÄ„!?ÉIßô™«D@"ÐCô÷/ÁxÌ›“Þ?ü@PïldÝgSxÅî‹Ç$/1`ÆÑ5ÑP¥ÊÚ׺†ñ g]qÑí×]{¹ÑEí»ä‰ÿÝqÏq‰ñÍMÍ}×§õ÷U«rIJ{”='b—±6˜Ø‹â¸È Õ‰Ez±šv¢^[’ˆÅý\'ÏŠ‹ä™ð¬x„‚Db±O‰x„+â)ÎE![ßAÔXæ) ôy‰˜BÅ$6xH ­)yI×”¿§ûÐ×TUu.#¤„ÆÖÞbµwÏå>ô½‹§ÌM" TÈ}èÕæ–¼Ä€G×DÃ1AsÒåüüèSR‚êwûÊÊÊÕl"++HN¦Píïö~†ý:–ün_×(€á¥"6·…!bùŒáÈc˜H$‰@׳h×Óà”@6ë”Ã𔯔¨3D¤ÅY?p…"%!xϺ0R‰€D@"п¡oÌ¢"úm0@Aõa]’—ôWöÅ~,rÑ>ÒÓR3ÓÓt¯ê$êÕŸñññ ˆñ½Þ{5c™™D@" ø°©»+1‹2Ÿ'%% ü Ÿ¼†‰‰‰Ü$æWò’þÊKèͬ­Õ>ò²³B£’½‚bsX›¥s³¯~²@1–0¨N¿ 6oU®ä¦žó®<¢Ÿ¦[%ö¬ù”D@" è´´4¶<`å.»+©iļ4¨@£úT™”’— ^BïÍÉÎŒ‹Ë·‹ñؽ×Å/¥0/÷Ìôi^B¡ì`ÆÑ•ÒIÊÉɉé”ùùù QNN–ƒš?ÏŠôâ_®t^®Z¢š’+"þ=åãƒjŽ••HÎú¼„I‰YQÌ„ƒjR’¼¤¿ÒUnÕ^‚NÏÈH/ÈγõówÊ·q/ß1mïÊô”ÜÜìS(é^r:¼„QÄÕAW‡þ3&IŒ$œà\d?V> Ì— ßxJûqR’ÛŒ®lTϾC˜þx$ €”\ï¤DÁZ0–ªÂ°Üšï ó,ÈbM$éd9œ²Rƒð§Wz‘ÌD"0hÐá%Ì!ÐÐàÛ¥ìÙÅ×¼ ä%„—hHIFQ~žoHÚ$ç"«Ýë²ÌWoó¬,)Uîõ±%P›—Ы0Á©ß¯ájž­Àš Ó0H‹ˆ€ž+0;w²ã*? w‚aüûßÿ¾ûî»ï¼ó·~˜Oç°šåÇ"<›­ÏĈ廀lWÏö¡ùå—|ðA¢¶Ù­™}||ØþU,ºã€g¢ –H†ÄÁ°=Ž'Îù×ÉÉé¾ûî£Äx€md‘»‹HOøSWA\9 ÄO¢ÕDÖÄòCk̲ ‰À@@‡—°i5aì^Íç½øæ(Ÿé<¦\ÉK /ÉÀƒ“˜eá{ Çr®ùT‡ÏÛ·†¤„nØæRQZÜ×ÌD›—ÀƒEÍó!_>¤'˜Á+¯¼Â9Ÿ¤‰ˆˆ@¯“à–[n¹í¶Û^zé%¶2|çw`ÿùÏx- cR4 kúùn0 Ùa'p”«®ºŠÝèYB†„ôçŸ>_†@nH,V“qRâYñ² qÇwÜx㯽öhüüóϤçÓ9˜død1ÌÆCR²÷3ƒë|» ‘Jp‘;v@\®¸â v¬gTxxø%—\¬ÁFÑp&Ö"ñmB\zé¥ìpT’—œÙ\!hóΙúÖ¯_ÏIÅLxå•W2)©ÎîQå“ÕBò’ÂKhàìÌ\ŸÈ¸mÑÛöd­[8Ú.ju›bùÙDÓ?Ó’KsrúÖ›£ÍKÐÇhñI“&ýöÛohw¬Ÿþ9_«ï¯[·ŽÖ@; Pîâ=Á\ÁäË™ÑÑÑ0 (‚­­-×!¤”ð‘?¾6,¬ Ÿ|ò ß$ì+äOVÂg¤òÎ!7|j˜Jp—·àî 7Ü€%3 ¥@ø&_ûÃL‚xP¾x ¡áYŒ¥PÆ?\ w¸ºº¾ð | oháåáÀa Öð,ï4 .œ:u*ö>ëƒØräHŒ$æ£Þj«`ÛxöÙg±U¼þúëX# 2ß}÷nÂTqšÀ3ÈŸJéóÄ##ÎɹEzH‰aÁ†ÁOÒeBįP"Š [A$þ%2—IEÈ”ˆ¤±³³#[,=ä@¡À B<‚w ™ýýý!4$صk÷©×l`OвvAˆ€þþ%ÌK؆y©ã*88^2H M/yÉ@à%èììœ5ÛÌÞøþÓÇ~7däWÿ>ô…÷_{ãã!o~ôÞ o¾úõ¨oÃÂÃòòNºGÙéÏúûª1„PÏ:DÆÀ9ú[Œ.NøÉ!å‹e·¤ ŒH,Ò‹W†(̃+Ø!„ÊçA|%* ˆÍÁSb0¬\çAÎI#öjãà„Ÿ‚Ö›‰źbä%еÄj 2ó8‘1B$~ò”[•ðôQ•9H$ƒ÷{åý‡)…y† pð¼êH^Òïy‰ØW“¬ŒìÔäÌôÔìô4ÂM²33²2Ò³ùKOËäV^n^Ÿvk}{‰Ðý‚à«çžœ2þS:ˆ™K-®»ê§?e]I0HæSYM‰€Dàôèp¿W©ïôKé9tÀKÚ?+,ÿ'H$‰€Dà¬"ðÿ­ 4ëMX3pIEND®B`‚maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/resources/images/xref.PNG000066400000000000000000001454701330756104600324500ustar00rootroot00000000000000‰PNG  IHDRéî­KygAMA± üaÊïIDATx^ìxTG†S7Úþu¨ÐÒÒZZh‘âVŠ»»»»»»»»kp‡œà‚»ßÿ½™p»]64Ab|óì³½;;w佡óí93g¼¼”D@D@D@D z°”D@D@D@D :‘XÑ¡«ê£ˆ€ˆ€ˆ€XÒ.ú#ˆN¤]¢ÓÓR_E@D@D@¤]ô7 " " "H»D§§¥¾Š€ˆ€ˆ€H»èo@D@D@D :v‰NOK}vÑ߀ˆ€ˆ€ˆ@t" íž–Ó×;wîܾ};Zv]‡#àA»\¾l9c nEääxæÌ™ž={Ž7îá†óï¾ —p¦‹/†óް¿p႟Ÿ_XK«œˆ€ˆ€Ä ´ËæÍV¿~­³®^}ÀnÚ´iùòåwîœÇîÞºu‹o—,YBhÅT2}útzâããÃG*<~ü¸¿¿?×¾¾¾+!¿\¹rsçÎ¥-S€æ,X0yòd§oôdÒ¤IŒˆ±£-‚‚‚ªU«6~üø‰'òÑcµ³gÏ>œ-Zdê\¶lÙÕ«WW®\9vìX*$“o!%:i*a,lݺµS'HW­ZõêÊc¯”)" " Q™€írâ„…ÞxæëÚµì9sü›o¾™&Mš¢E‹¦M›ÖÌî;vìèÕ«W‹-²eËvþüy”ùòåëØ±ã_|Afú×^{™ûÙgŸm×®9—.]0`À˜1c>ÿüóÍ›7ã%©Q£FâĉK—.MN¥J•˜Ý³fÍÚ´iÓ ”-[ã[@#GŽ,Y²dÍš5éOçÎ)@á*UªÔ«W–.]Ú¬Y³)R MêÔ©S°`ÁæÍ›ß;lº©V­Z•/_žoÑ"C† A=ôíÛ·zõê7n$“átíÚµOŸ> jذa¯¿þzÕªUK•*åÈ·šiëçŸ¦Ê §®]»V¨P¡¿ÿþ›Î/^œY… ®]»6]mÒ¤ 9ÔCúœ.]:œ©Féˆðé6ˆ>B]ïòüóÖ•+>êýñÇGÍüm„F—üùó31óF‚ &pá¯>ýôS¬#(r(“;wnc¨@ßT¬X½B~… °ÓpÁìŽâ[ÈÎ;¹@4$Ožü­·ÞÚ°aƒ[1EäÌ™û V¡C‡bb¡@œ8qÈGÖÐ%VÔ©S£ExÇdl?÷¦xñâݸqÃØ60&¡ÉþüóOTQ¬X±°‚ICY²dÉ“'c\¼x19ܲmÛ6É}8ÒÜÖ­[.©R¥¢2Ø«®ÓÇXF.àÃÀ±¾pmú@C¦G6«’’ˆ€ˆ€Äl¡j—W^y¨?õÔSLíØ 00­â‘Á¦‚ÃeÍš54ÉZ ´ËóÏ?o,½{÷æ³_ýú믑õëד“#G&rüGäתU+00‹öíÛc,1S>Z„ ã¦!“)ß­ÓXnþúë/D™þQ0H–O>ùÄ£æ\¹rá÷éß¿?]ŬB¦Ñ.7oÞ¤ZÇáEÎgŸ}fîµgÏLJ8ƒpñàî1ö_ѓƣ®ÈA$áñ1·˜{ÑdÆEåôówÞá,I’$áûabÒîÝ»1̘k´М¯0Ìà<2é-:k–ó­.D@D@D ¦ð ]–/·*W¶×»¤Nm­]û€úé§ß}÷ÝŒ3b–`vG7 R¦LY¤HšDO0ý“?~üÌ™3—)S†¦+øŒ²gÏnL2uëÖ}õÕW1Eðñ…^Ø»w/Šá7Þ Zcw¡s\dÊ” ‰S¹re#\n&\-É’%Ã(’4iRÜO|›>}zj@µðŽG©D‰}ôË„ñs±âÄhT ÅŠsjË! 1\Nt-…•…ä³<ÅôW#úÏ’rpKQžV°è˜zÐIÃÅãTËGD r ßJ+A‚ßÿ=u⥢̉'¾úê+4Ĩ;“s#&ä1ÃäÍ›÷÷ßÍ3õ€P·‰€ˆ€ˆ@”$àA»`¤`.Æý‚± (è{M½ÌÙÜl–h0N`“À[Äò³Höèѣ̾Ló8;p‘`E0+6˜ƒ‘;|˵±©e±+Põ›™c …±Ü+\L»ÔL£˜%°go =á#ÍQ¢ŠU#4AhQ‚Ûˆ2ׯ_§iWC²†»h Ë [Hndq ƒ–î®X±‚j1–8Ô¨“åÆÎB†@Ž)o’‘JkƒE"]ÅDµØij¦ãZ¸p!M NB±Ü˜è!–ò˜n+‰€ˆ€ˆ@Œ'ªÏèaFŽ)ÅÔûÁ°àãaªr»—Ý7¦æ#F<Âj#«*3ü†½ 0w5lØ0ìw©¤ˆ€ˆ€ÄîÚeÒ$«jU‹i±AûU¥ ˆ3X DD@D@D Úp×.lÄaǪ́QÖÈ‘ö‹E7oFûAj" " " 1†ÀcñÅ:ˆˆ€ˆ€ˆ@T#àA»Èž…º¡˜jýWD@D@D@ž,îÚ…ED’«^Ý"~ì´iO VD@D@D êð ].´öì±ØrûÑGQ¿ÿꡈ€ˆ€ˆÀ“EÀ]»Ç.±ÓW_qHá“ÅB£ˆú<¬w9rÄ" ýªUQ¿óꡈ€ˆ€ˆÀGÀ]»@õ_D@D@D FÐz—õ85ˆñºá?+yøÆ +[¶ì7B« ±’9sæÍ›7ó°<È{X]·nÝŠ+ÂRReD@D@D " xöñ~Ê+eÊ7vìØ{öì)Z´hH3wÿÃTj.“$IÂûÊ•+MK&u2{öl>þöÛo|ìܹ3ï\Ÿ¦I“ÆØ]FŒátxÈ!÷¶²ÿþï¾ûÎ)c„S§Nm2HN¼xñÌÇÆŸ8q‚‹Ÿ~ú)Ož<ˆžøñã3oooSà•W^A[lÚ´éã?æãÖ­[!`×1×Å‹§Î%Jpm˜|øá‡ä,Z´hÒ¤Iýõ—)6}úôЛaBâ¡|óÍ7¦<¦#rvíÚå kJ(Q¢D&'V¬Xæ®Ë—/çË—/A‚rü/CwŠ€ˆ€ˆÀÙ°Ü*騑y×êÜù¡êf2~çwðòPK²dɦM›–1cF¦[~úþùçóæÍ£í>}úT«VÍÌ©H‡—_~™ tIòäÉ™>Q}ô•Ù½{wÞ±»¼ôÒK7nüÏž½ÿþû¦ :¥ÂÅÌ™3{ö쉚9~ü¸iqÇŽ)R¤0ÅN:…cåôéÓæ#×÷±d˜2(TŽÓ /¾ø¢óqÖ¬Y-[¶œ:u*ù¦9<;Ù²e«Q£FÚ´i+T¨€Uƒ|äËüùókÖ¬‰î¡Lýúõýüü¶oßÞ®];]E$™:‘€cƌႻ¨Ùiå—#G 5kÖìþXíB·üñG:0~üx2/\¸PµjÕzõêáüjݺu›6m¨ù8qâD· q«¡u®^½zÿ†ô­ˆ€ˆ€<>îڻñc!ͽûîCµ‹V@©˜µ)¿üò º!qâÄÿûßÿ.\øý÷ß/]º¥²víZG»,Xðù矧p™2e˜Ý¹8tè†Þ~Œ7Ž/_¾<00ð»¡BOX2Ì—6lÀtÁêÇ ¹sçši;«@L±-[¶ *̬|ýúõ¬Y³îÞ½›ëcÇŽ™†Èôññq4ô¼wïÞNFÝ­[7ç#ßbÁ #0á TXt‚tÀÏ}Ü*ræÌ‰‚~÷S¦E‹fÎ&1Ñ~ûí·Øð:¡<îÓ?Ì3æ[ì.,PeQÎ#.˜}iú÷ßç+jF%`‰ašÇ’ñ÷ßqÃÜŒ ËY4h€ýƒLãÇ1‚†JP )S¦Do±.K™h‹ìÙ³Óg;vìHýX/ C:`YÁè‚,À׃˜›3gí‚0â.l3£3è-ˆ¤@»}ƒšÁàtôèQº1eÊÂ^Â-ýúõCŠá“ „QW™mÛ¶……D>nÄC–ž¼yó¢á MÈÁ½E&½¥éºuë’ƒ ¦R¥JZ `–÷ÒD–,Y .|îܹÿËÐ" " "ðp<øŒ˜yYYQ°àCU\¬X1&9fAÞYáQ²dI옼>ÌôüÃ? TP!LäÎîæ{fGæu¶Ï˜ [H¡àäôC¾'&o×¥µÎ·,Å@`ìq´ _á·b™ IÄWXDp²°Æ–5"( ì:èS¹rå2dÈ`ªºrå ºÊÈ“ÃÌRÁÂ5«d ¥J•b tfÙ²edfÊ”‰õ4 –³˜[¢ PÈnÇNÃGÔ¢e¸E…™dî"Ÿ®ÁDš1cý$™V0‡À„ÞâB‚ð¢9_Á-]ºt¸F©ÐC#nLBˆðA\cC⺠†@=ä#ä‰`Ó2·€%W®\4g>"¿ð¾…w+–Ó]ˆ€ˆ€ˆÀ#!ày½Ë#©úþ•têÔ ÇPÅŠÑâQ%̵h”&Mš<ª:U!€bsœGb"" " ‘Eà_Ú…e ,ØH”ÈJžÜ~%Mj¿ßwUÉv³ ®Ì8kÌNŸG•°Ž`·ÀТõ¤ ©ê(EÀÝîÂrŽùóCb\¸Ð⥳£ÔSgD@D@Dà 'i>£'œ»†/" " "ð`¤]Œ›îˆ¡j"­V&±ÉTÅï°T¢2" " "ðÈ xÐ.Ä!¨.ûdþùÁ›c¿ÑçÌ:\¶³¥™6Ù’¸ t,[…‘ „0a×®³)—Y–ÍÃì6!±+˜hi„$!–š ¡F´zܨQ#ÖùzÜ#MÚ]µj­˜ÞˆÅœ•ÈÙfÿ0u²˜—½ôÁDocy/=t¢¡°š84ìÐ&kˆñ]€I0B‡sˆ‡K瑹‹Ê&| R²-1çëëKÓŒˆÞä 8h—[è!ë—"hbÝ"iè©QE‡Ù®Lå|䯨wÜHádOÌ0ÙM¶3ñ]\ý9O?ý4ïУiª%¾ Ãøg75×0á¯Èa'9ÑiË(EžÛÝ9‹€ëæÍ››­ãDæ%$ w™ýGT|ze Cg @Cÿu6lÓU‚â¸uRE@D@D ŒøàÌt—©—‚Â}òÉ'&6ÑíÈ!l?°.C\r Ç„švAßÖ‰!KÔNâ^ŽéaK6Ä\áÈ$® p†cö#w(G"qÎDÏó˜&ȸ/¾ø‚G@ë„ì#‘é?f•/¿ü’Ø<ÜN…„ $† öøˆB"~kµ@ 8/££ÏDå!`ñ{3ÈÖwê4mV‡±›'Nds;­¸žÆ¿TCÀ]»0w׫gGÔe–gö ŽÂú€‰åL‡ì‚æ~æcLÌjÌß?˜™>Ÿzê)”!ÔÌ6Çë˜_öX87Àh…û'd„)€MÅ„%†0nÌÓDÈEýƒ ÃH"êM&b,ŠÀtŽÿ(´†ãæê-BN!†œÂ¨"bØpJv3ÀáÇ# ™¯P䓉1ƒ¦MìZD jÍDT_ @aê$ˆ.¸Ë„Ç5 G$"øÌ–÷IŽvÁìÁ1Iˆ Ø‚» ¥Ho‘t8N7Gmð‘ÎÑØµr,+(T†ÉÑKÄă3ψ{†T…¿ú꫆ ‘°xލ€æ”+%xîÚ…/ׯ3y[~~ÖG=@…!·à•àW8ÊÃ8 ˜ö˜±g12“Ñ6S63§b±0{5çáa!„sd4“.9F…Ü?NNÓŒ(('|L*ÌI=¨(Œ%\P–S ÷QtûFÔö ˜LòbŠ ‡ks ÆÆÃµYb$Ää哉•‹Ï”ƒåü \6Ä´ÅËc‚ô“H†1®ÑCñˆwƒ b§¦òñRas2Ž0s&"cyÂh„ÐA1`žÁ/c2é<™nþ#G»à½2¡ŠñŽ™Þê—ˆUè C ë^-ÈpÍâ‰o©ŸxÁ€bì•+W¦$Þ+L/HR,@˜… ÍÉ´…aMrWêÕ«—1€)‰€ˆ€ˆÀðà32µTªdqóÝÀôá®™Õø$HÀ4ÌD…vaó%“gâG ŸãqvàXáà§?ß"ÐøÈaÇ/ÃÙËÔfz@è9v|Fg„–žyæós3õc™@L`nAˆ b°0cÝÁtÀœƒ#ƒo͉Ó$Åpq¯q$a¤–ñÈp ùœ…„Ñ‚ˆþf5 "ƒ ™à9;‰¸„0 1LœAx…#eD™dd Ú&˜jàƒlBêq‚Œ8¤ ƒALp#J‹Î°þ†± ä>ûì3€p 4¸CŽq±!ír¶C)º.ÖÁ‚”4ˆÕÂdô†žç3 \Xrdƈ̢iœ\æ. âN¢Ã< ?¬S$î/&%ĆQctAîp ¤ç0Ç'‘ƒ¨£ùVID@D@€@¨Ú…U­ì:sæê´oÁÚk†™˜•8†˜øùáΙ̸føýÍdovèàÁá´Á·L“Ì‘&‡Û™eùAïºè„zð_„—Ú˜G™×?r±a´ \ؘþé ì%œ|ıAä`•!‡å·ø¹œÎÐFáœV퇱ã¦$uRc1Þ%zEý(3çàkŽ;À½… “mQåDaîEv˜š¹¦¹Ë¸M¢?X)Œ†ÄH©™ÆŸE 0ÁšE2§>ÑŠ±Qƒ³$½=ןqÓÐ=ÇÙ„òµé÷ÒCšà#e+¤ŒC&q;M`%2)}ã±Òa®ÉçIÑ1W§£#Ç–icÒСC u!" " á%ªv oEá*ÏÜJÀÅ€ÁÝ®{ï_˜©—õ%,ÅpÎ2|„•«ª‡'àx޾*Õ " "ðdø—vÁ¦P €½D×õõÀ¦—'¨F-" " "ðX DŽÝå±I•‹€ˆ€ˆ€Ä`Ò.1øájh" " " xÐ.lß™3Çb¯ÉøñÖìEaý& 3ï«þpR'[¬ÿ3ò «}õ¤al…²,Ju‹‚ÿ{YÓÊT6{{Œ½Æv²ËGXPÌzØÐ"õQ?kiÙãà бˆhÅÖ(‹Ù7Ä’^¢ß/KŽÂ ÿÁú£»D@D@žL´KóæVªTV¾|û…]¶Ý„:€X DIa? ›i÷'¶¢°#†U´Hä…ÙkC¾S5³,3±³ù™4f“ {dLDyv&Ócv #‰B›­QlEv¢Î»nÃAúP ˆx§3Ά&vÙ0µwÄìý¡-⯰ņmÛfw[¢ÿt•òìC~ï½÷XqL# ØìCýf[5eØÅÃæ†±°ã‰ÄWÌî¦ÿH¶/™X5è'zÅ`¹€’é'U±y‡2FÇãF*¤Ù±™†`ËŽgc”Óç‘#G-†½Ü cSwâĉùЇB‡Í~+S’vi…w³‡ ‚,£Z³-œvÙ€M%DÏ#ä ˆ]NN)COHÀçX(ä‹S'»Á XÌö%†Ï#v}Êdr×êÑðýý©´ˆ€ˆ@Ì%àA»4kFd[‹³t|||ÜF#l Ï È‡J„É'„P#¦ïÄ!–+_q-1½^…˜³DUÁ<@J%I’$D¾gÛ3åÉἃ‡ë`׎… vb2 }K .ðJ .OB,âÔÎ̲&0ßšÉ̵Äü%´ cÍôì–ÐX èB¼8TŽQÄÓ#>ÕÐ…»˜ª37è3ý_ý„ 1Á£¨„ˆv„¯åWÌë„B¡NjCd˜Ð´°B4…à~`‹2B„òh!F¸‘p)è'Âó34G9}FÓ°?œæ<#újb±@†Ž™S“xFDsášþ›£ Qyhšt|DÆq€ÅOœ¯Œƒ mñÜÍ–o%¸?Ú…°.̉ݻsx1K Ó3ÁИ)1c0É¡cˆÇôÉTýá‡ò-móÎŒnæT”„‰vO¤]îÖœÀ¼H7æœ&Í…#AL>·c†A"ecݾWÄ87R60ÜCXqxL¦<׸·0‡8´„¥ÇÔfÀ sŽZ4Ar‘€¼c/!°¯c BBåÏÜH¦ë ŽX€^Ì`y¦ü˜z$ 6N,>gºܵ ‡àœa &ÚmÆŒörÝKÄ·Å„@í˜:¸F”à8ˆ;69Ø3ÐÆûƒ‰ÛçÒ :€Òc 0~~Ⓝ‰ÂY¼Âïx~ëcºÀ1áñ„g§·ŽvA”àŠÂ–Ài…Ì£LÃTÈŠ JáÞ̬ÌâH •190‘Ó=¦p+Dß7†1Ç3±ô„,ÁÞ@·ì`FG¢1X£pè D/ÔÀ£ˆ ˜jp¡`à@ë8S¸…wÒ?ÇÐ 6˜p°î@G V 3(!cRÂCDÔ£¥pláŠÂÅ —ØELøZÔ •»ù„ÚàFs ç"-…ÁÑHb*äšQ›Xï‚°£?Æ›†ÃâECt9e"çRk:šãE‚QC̱‘ÜEaÎoø´KIt$ƒ2ñÑp˜å…ÂÖ=Ø¿5Ý%" O>#fg³ä%x2zÀ„`Ù3(³5+g¹ÆÀÀÏ}fz\ Ì…dò«)À”FŽi†oYÞÁ$j~è3ç±:„{™é~`@0ûÞªs5N MpO 6°‹ÐubÕÀ¸Â$Í‚f},x¬X£ƒÍÀ4„‰!ÐI„Éaá‚Æ,ÂEÐU¾¥Bæi£¢p?µjÕ c s ¦ nA”àbáÓ<ƒ¥ÿ fV{ ¤Èç.”„¹ £ Àœ¿AÍA?1lkGQa"¢Bº„ÌBmGµh ³ÞÃ×u»< Ž}6 —‚‰:i×95šE¸,ÐÁ³æœÀÙIàFnÁ„ÄpÄ ä,”†­Ó+sŠ‹x^t-b†ƒé…[x”Oœ:iˆÎ ZÈ9òHÂÅàRøO´ËÞóðp$±ÜÁ´Eáá+tj`"4ÕËRÔ' oQÔFꡈ€D)îÚ…ƒù°ßeölû…?áîÚ(ÕmuFD@D@Dà %ð/íBÀŽøegn©R!¯lùøX›7[›6Ù¯õëu£þJD@D@D@¢g…†º"" " "ðŸ"B»œöñ¹tèÐvED@D@D@Dà? ¸k¨SÇJœØúýw{´ŸßÖðNx{¯-Tè¼KEG'O>>w®ëm늻ÁÁJ" " " "ð_ܵËÂ…VÖ¬–··uõªU£Æ#ˆM·¡zõ--Z¸vcÞ?º~\[¸ð‘3þ«Ÿú^D@D@D@l÷ó!bØvô0iOϞ늹uù²©d᯿vðòéå5ãË/o^ºt5 `z„½½¼†{y-þã‡iH÷Š€ˆ€ˆ€TKºYD@D@Dà‰!ªv‰ÇZ³æÁ1ܾ~}Kݺ»:w¾}ã†S˱ٳ¹¾âï™­Ø–uãÂ…‹û÷sqrÙ²[ #óà°u§ˆ€ˆ€àͺMD@D@D@B!ð¸â»¹,s|xTþ¥]88ºn]ëÅ­7ß´_ÿûŸõöÛÖùóª-Õ#" " " KÀÝî‚Rá(éÀÀ×ñãÛ€îGHàqùŒaU•ˆ€ˆ€ˆ€8¢¥v!0 ¡íîܹS$;̯s:ƒ’ˆ€ˆ€ˆÀ=úhÞwß™¯.>L@a§'ßCO\=q‚Wh};·cÇŽ{¡v% ÀéÆí[·.ìÙséàAF@¡E*¡þ›/Ò1§XÀôé‹Ó§íååj­¡üù;(æ±]âÚ"E†xy õò2ªÈ êú™3WƒW9ÁÓÔÏ9š¥Gù× ºD@D@Dà¸k—­[­ªU­aì•+­%¬Aƒ¨ÖPn"®î”øñ§½öÚ=qo) “ßz‹ü]íÛïîÒ…‹õ%JìhÝzCÅŠ;Ûµcþ& ÇŠ¿ÿ>pÍn<2iÖˆÓ¾¾f²¼71w’yÆÇí‚#‡Ñ†²eñì‰â ™˜/_ÞѼ9jÀ¹}|ð]$Îò1ó`BàÂ,9>{öÂt阌fÎ X¸™rvÏÿ©Swwê43cFSSû¤I͵«ʵÏÆŒÙÖ¢…“ƒ’@²ð¹ƒ‹êôÚµ\{'JrŒv(+‹÷Nœè?vìŠ|ù¶vëæTµ*gΓK—òñæ… +³g?>oÞ–† YCýfaÍÄçŸçýØœ9¨sצ† 1#™ëËÇŽM|å•ÀeË kƒŒÈ-mo×nêG-Nž|ú{ï—ôæ}û-x6שÃŪ¼y/íÛÇ ‰ªl7oÞ¹~=Æ®‘¾“rD@D@¢wíâçg•-kᯘ:ÕÊšÕ=:B»<ûë¯1Éà…Ù\³& ûµi3ó³Ï¸À?‚@aÊ<:cÆŽ–-±Il©_ßY„1÷»ïvuë¶©fM–zìî±¹sÿù'ÿÁƒ)pzÍšeiÓ2ñ1¯ æ‡uE‹RæÐðác_yÅÔ€giúô;ZµÚÚ¸±90Ò5aàAšÌýí·5%J3 ß6mYúôœ•íS¾ü¾\G§N¥ÛG&LØ×¯ŸÇŽzë­Ó+W2iµ¶tiDRÀ´iG&Nëå…7‡[v´h1ýÓOéêÒ4i°î,üõ×s~~,a •¯Ê‘ƒ¦Ñ‚4=ñ­·v´iÃÂaîBöÍùê+îÂýIDkëXŒP9Ë3gÞÙ¡ÃÅ={ƽöš‚G¦L÷ÔS˜|Ћf™Ñ¼~ðkÙÔ¸Ïøˆ›iUíÚssçÆð¡jLD@D@\xØg„é¥I«F «W¯ˆF…=fC¹rH– Á¶–ýà1áˆi–blmØðì–-;;vÜZ¯Þö¦M}Ê•»|èéß•ÀÀ •+#>Bë.“. ƒjY jÊ`‰Áÿ‚H œ?Ÿ5ª;š5c†¦•.ž‘³7n©UËøƒÜëj Àê“mÍša"2š å±àÀMU«ÒO­Y³­qãm òî‹ÎSÚÖ¼ùÖ p íîÖ ÷†%´Õ2@8ܸx‘k¿öíO­]ËÀé jƒj&¿ò 9èóÑÒ$d=ÙT£×vOîÜ9:}:$ãÖ2fʰœÈxж·n}hÜ8.LAkÖì4ÝÆÇ +6”)sdòd„£©ÕH‡'MÚÛ¿¿ã­‹è¿µ'" " –-ã»<ÉncÙ²]½¼†{ya y„X¸ÓÑËkâ3Ϙ-`7Ξ?~?/¯wýq°-U%" " CÀ]»`ïÀô@p—eËì×¼yΞâ‡iE÷Š€ˆ€ˆ€ˆÀ£!ð/íÂrR~ÌgÈ`åÉcåÎm¿Ò¥³B‰™òhšW-" " " ".ò… — ‹€ˆ€ˆ€D2¨¢]IÉ$Ô¼ˆ€ˆ€ˆ@t àA»…•­FD¥ ÞÅòè“ÛÞ©šxnNhÚGßžjˆAܵËÙ³vp—jÕ,"Ô.loU~ÄisõênL—=½¸U'" " " ¸k—5k,BªúúZÄÁ'd|ÇŽrÐþ·äÏ?9{hqêÔDH3UÂdM±b²Õ%" " "s ¸k—õë­’%íƒIÍšYíÛ?Ê¡sˆ4!C–gÊÄꞟèsÄO#*ÿ£lFu‰€ˆ€ˆ€Ä\ֻ̚eqHNòäÄ­³‚O?|diIš4ÔupèPèá‚t8{€C«•D@D@D@D lܵ ÖÛ·CnEi9¶j¨ÔÎví8öÏ`”D@D@D@D ,ܵ˞=VŠÖÓO[ÏÓˆ¶-((¬½cúôVÑ¢VÁ‚ö…Ë(ÃZƒÊ‰€ˆ€ˆ€xÐ.ØQéx™Uºì”ŽÛÚ±ÃÚ¸ÑʘÑb~$©OŸ>Ï>ûìJÁ78:tÈ××—µA7¹$ôÇ·Hð˜cÇŽ 0€jÇ÷Àõx¼1 ÀŠßZ±"LµrNv… öú¡Úµ­.]¬B…ì³Â’V¯¶,KA•'‚@¨v——^²˜nIÇ'N‹,Y¬‰ÿ›K®\¹¨÷é§ŸÆŽ?~ü   Ä‰“söìYÓÞ´iÓfΜùÔSO¥I“†SîFy9sæ »ÝÝ;(Q"SÞiràÀ!=öòZ¶lÙ½]9~üøW_}å”1fÍšEÎTÖ!§7š/¿ü²É)R¤ˆë-ׯ_óÍ7MÎ{ï½·ÍWžZ$kVÛŽrì˜ý5Ýüé'ûý»ïìuBÅu™2ö{þüÿÜ_³æ?§D "ŸzÊZ´È.ƒ¦1‘ל9ÖéÓÿ|lÛö¿É«„ˆ€ˆ€Äx¡j—çž Ñ.»wÿK»°}:, Y/^¼ùóçþùç:uB ¼øâ‹ëÖ­ žã½V¯^3ˆ‹AƒÕ¨Qƒ‹ÓÌÒ–uòäIWíBÎäÉ“í²iÓ&®›qÌ’e/^|=g/Ý“ÈGm\ –]Ï_/8™¶í‚–9räÒ¥Kɬ^½:*Š |U5Êž=;å‡ òöÛowéÒ¥B… ;w¾p÷ØH·Öê×·ªW·š6 q­]k½óŽ]_ù$¼leˆÈç^¾êÐ!ä› LŽÖ‰öEß¾ÖüùVΜÖöív1¾0!,ÈUFD@D@ž¡j—^?«D>û,ä:sfküø0q¡ÞÔ©SoÞ¼ùÃ?ÄŽ²k×.röµ7X»lÙ²eîܹøŒ/^\¥Jr.^¼ÈW—.]âº/³÷Ýd -æÓŽ;¸®ÓŲfÏžxoWÊ”)óÆo`}á«-Z˜ ,àÆyÁ‡(‘^yåì=Æú‚®º}û6=dMÌ·ß~ûå—_RàÔ©SåË—gM’$I*V¬xôèÑ{bCV£FVâÄL‚[³ðµ™ãŸú÷·5$ 0ŽIÆ©îwíò‰‘mÝjMŸnÍk¿€“ÎÏÏ¢›Ø`R¥²Œ] ûM÷îöq£$" " O8Ú'áé˜V›7g ŠmTH™ÒêÝÛž˜‹³6m ±^x!vìØ•*Uúù矗/_ŽÎÀm„a£ÿþ4Y§N¢E‹rÁû7ß|“,Y²}ûöuíÚµAfŽ9¸Þ¶mÛ¢E‹¸&§gÏžxˆp9%NƒÆ@âqíí¤I“ÐèÖÓä΃:)Q¢•ðÎ5– S- ‰L¼E&L@Í”*UŠòx©Þĉ%†[þþûï{µËµk¶e%aB[j`/ÁsDš6Íâ(tW•*ö5‰Ê1Z „@æŸZwΟ·sÐ=|‹ÖéÕË^7ÃâŸråìÕ0Où÷ß–±+±J§pa 7.ª-[Â_…D@D@D ð ]||lÏ«+J—Q*ìˆ)UÊ*Y2d6ýO'Nœ Þï¿ÿ~Ô¨QÓ±*§àªZµ*F´K­ZµøEÂ> k×®>|¸téÒÕªUCµ J–,¹jÕ*|7”ìÞ½;V±cÇR oñò 3ðF…vˆ#ò_¢„ò,UÁ‹T¯^=\?¼+VŒ†È§zÒ±cÇ=z°^¡S¿~}L,çÎã[¬D¦é¶mÛŽ[:sÆÖ(µjQ¿mnaÉKp‹„È$1 #Ê_XiÓÚè‚Û´8ŒA-[Zþþ!9Å‹[•*ÙËbaŒí “LùòöGga1Qvh ÕÈsQÕgô0hX‹ÃóƘ1cÌÒ“'!¡Z†ýg è W¡,ó}xhŒ" " "ðXüK»Ü¾m›>ùÄŠ×ó‹ÍÒ¹sÿwDòê?Ñ‘#GX¥ûX:y•²Ò÷ÙÇÿ Q¼xÖ‡ZŸnq½o¾±8ó"6Mh0ÛOå¬üE)‰€ˆ€ˆÀ“LÀÝîÂÚRU°ÃÅã‹…¥„{yˆx+1õ;öšÙÍ›ÿ…hÛ6ÛÄR!Ã,…qÍ iØóy.,?zÂáÇ„? AD@Dàá<ŸÑÃuIw‹€ˆ€ˆ€ˆ@¨BÕ.X¢Kb“ótõ¦ ædÊä7¼7ºµÀíYC˜»¬‚" " " xÐ.Db;uÊŠË>PÚ$¶º°›†˜p‘r¬´#MÜ6™ì2`\¿½w Ò½9DsáF·óB{Â?ýô“!E,`BÞÕ$8np‹n²‰® ¸å°µêµ×^£ÂÉDØ4çV 5¸õÖ­’øg¨!‰€ˆ€ˆ@˜ xÐ.ljN’ÄŽï¢T“f̰?²eÚÉ sýUÕ¾l&*.ap©ˆ81ì—&îËùóç9œÈdšs–,YBä:>²Ýš]Ùœ9@ø–«W¯²§š]ÐT2|øp2‰CV³ÛlänÒ¤ 9ü?~<‚Xº{̆jòË•+G…\´nÝ]B…ìÇ&ð!õÈdS7½"sôèÑDá£'ȘìׯŸÙzMؘ|ùò¥2bÄ:Ã&, ÐavfQɦnNH Ô/#¥‡”\±b7’+ü0G;=Ô“ÐÍ" " "e„ê3rÎ32]%š?³|pðÛˆKeË–ÅÈaB0©Š—¨tÈ‘X±bÄ…¹ÿ»ï¾ã[´s<=CÐðñ¯¿þâ’ìxââwÞ!,~MÄ^Bá½ûî»X\øª]»vœeMBÞa\á<û /gΜ ƒÏ¢D¬*†[2fÌøÖ[o!,ÈŒ'Îo¿ý–6mZ‚ã!•8Zòý÷ß'f ýD…ܸqƒh1œ éZ?Åh1S¦L?üðqn/ˆÔX–,Yèçis]¥NN†J˜0ah'+EÜ#QK" " "ÙBÕ.Ï? ãŸÞ¨žø®9Ðóßÿ°¼XD0{ Žb"ÞrÊ#ZÄt€wÆgdB·±æˆ,Çiäp0$s?¸iˆ8Ç·c Á.Â:tð÷÷'þ/âíB¼ÝûŒ aa’ŸŸò‚> >©ÇÉdŸ—`w½{÷¦6Ž, ‡s(Q0¦BšÃZãzÜ™´È½ ­iÓ¦éÓ§'‡£"Là`>îÝ»ÑCÌ_u Cà¾íæˆ#%x‚ xÐ.F <ý´…£ÃÙ‘‹e¡bÅÓy" S;6 %œ=ÄäÍô•…³*W®Œ1g kŒvA`Aá+´‹98)oÞ¼¼ÿòË/)R¤à%D|^.(O1Ö¬Ÿ‘v±ÐW—3\eнÃDOà$"ÿ’»ÈåË—9üÈ”,P ï¶A6!b¸æ4JŽ5àÂñˆcˆxÁôÍÇÇbzÂ;‡±ß ›ˆá‹ßÊA@Ž··7µ1d>ÒŠ9òIID@D@žp´ –¦øøñ1TXœL"‡#‘“'·òå³C˜DXb S8š [¶l¬öà4¢×_}ذah„H† |Çš˜T©R!;ZµjÅìÎz -8w°²pp4‡>~üñÇÐHŸqßàÖ9xð ç |ñÅ,‚Á¹ÃJx£IÔ€2’Âc‚ÅÈ 6 a B,X»Œ1”h#êÁc–ªpÚ@žR-1W'™@¨ë]žd(»ˆ€ˆ€ˆ@”%ð/íÂêÖl°ã>/N; ˆ²ÃQÇD@D@D@b8Ù]bøÖðD@D@D †v‰aTÃNÀƒv1çüŒ²AGÛhzô`SŒ½h7ì‰]?DÂe±mØoQI¸?ÚeËkð`{ÉË•+ö½ìö͘o»ƒÇOB›dÍš•Èoá¸GEE@D@D@Dà¾X™5ëÍ«WMvÐêÕý¼¶7k S“" " " K Tíòâ‹ÖíÛv_x7kd5²ìFp:±x±÷/¿üÓè;G§N=¿k×¾¾}/ìÞmò×àÍ·5mÚ)c Rˆ¹ÛgD:,.¸²g·ví² ¶úô‰PçvìXš6í•€€mU‰€ˆ€ˆ€Da´ ’%M+mZ+^7rô‹/l÷úÙ³þ“'Ÿññ98iÒ•'Ì-óç›3çÜöíw‚ÏË&ŠÌ‰%KŽÍ{˜ñ§]ݺÍûé§s;wrУÉ9»eKÀŒ'—-óØ.‚Ö®E¬.\x™,ƒÓÜxñ.ìÙshäÈwZâ`¦£Ó§Ÿ\±âf(ûµÎïØ19V¬ÃãÇÓmSÉÕ',86oÞ•ãÇùxóÂ…#S¦Ð“£³f9ßõí·;»v=»m[hOèÆÙ³‡FâFÿ™3Cª=y’®2åtðY€µ¿<ùäêÕ!•ܹsbéR:¹gˆGþz " "…„ê3âØf³ŸˆªVµŠµåKåÊÿšÈÄζm9½hò{ï­+ZôÖÝ#\;ã[¹rÀ”)®9LÀž~ziêÔ“¾ù&píZ¾âÐéYqâ`«X”4éi__rÎøú®üûoŸ’%»Ÿtíôé%éÒÍùé§½}ú È9¹téÌO>Y–.Ýüï¿ßŠ-g{‹“Þ[£F§7l0˜øâ‹ëK–äµ4sf>[°`a²d‹“%›ñᇇƌñÈpK½zÓ?þxM—¢Àeÿµ ,H˜p^üøtœ…éÒyÿü³O¹rÞ9r˜P6ÓãÆ]™+—ÿرë¼vê”OéÒëŠñ©Xqf’$”A±!eVfË6/^¼ù?ýDά¯¿^òçŸ+òæÝÀ¡áÁiGÛ¶sãÇgȳ>ûŒÇ‘õÄÕ®ˆ€ˆ€¸¸ßYŒæ#Ž ÌnÅŠV²dv°ÝÀÀHÈ G˜1v¶isžÝ“˜’WfÏŽÄõ›ÀE‹VåÉs娱+GŽ`_± ¯¼²½yó];n®S»È©Õ«7V©²·W/Žx\±“–uéðan¹~ê”Só7'!eÐ ò,;êÖ=2y²ó^'ûhëK—N,Zä!Ã7V)²"gν½{¯+U ;ŠÇJÖ)0mšù ‹'7ÍþòK¿öí‘D~mÚ¹¼X1¿Ö­w¶o`ÀSl_ÿþHºû<˜õÅ‹ïîÑÃÀÃ;¶ŸMÕ«ïëÓÿU‘ã1ã®v´n}lölû¹¯^=ÿ·ß6תe÷¶Hçô¨H~üj^D@Dà‰'êz—§Ÿ¶ðr˜pü/ÚïµkGþzærã¯á=´³Vå̉+„’œ8mfåǯ6QÜ Þá0}úŠ,Y¸¸rô¨ÿ„ —ó-_~G“&äLzáÉ÷üöíÞ¿ý†Íãð˜1¼“3ãý÷o]¿~ãâE|FþãÆÝû—Cå«såÂ0k† ÌŒ÷̦M\Œóò¢Ú‹¬/Q=?2aBP('Gbê@7ì0àÜ–-Œbg§Næˆl†ƒnÛѼùÕ#Gð7¡cfÅŽmº±©F}ýú^·ãñOzqòäK–Ðîå#GvµoóÊ•Íuëî vN{ï=Þ·Ö«‡ÆÂ´¾T©Õyó’späÈMÕªÑmò©öâÞ½Oü?ˆ¬“'­B…,Ö¡û1¢t:4zôÚÂ…qÓ`DAC >–e̸8eÊ5… ™85À2XfeL(‰m_?sæÌ† Èìs¿ûŽ|[]»¶¯wo$æŠçΑƒŸh]¡B>eË®+Q•àžÕ9snªZw‹HP!~íÚ±Àeò«¯î ^ç|hìØuÅŠáúY[´hhKkO,\¸&~|FŠlÉâëëSª”}K¡B,ÇÙP¦Ìê|ÿ%)°™lÚdŒOÜ‹ˆ¤ÕÕãÇYlFGŸ•ÈèŒ=4­S¥¢ò¼ú&" OÅwyÒž¸Æ+" " Ñ›À¿´ ?È °wGßçõÉ'V°YAID@D@D@"€ì.‘]MŠ€ˆ€ˆ€<0i—F§E@D@D@"@Xµ “9+€WðR×ÈO,85«n•D@D@D@ž(´ {‹´7þ'„.;oØ5ݹ³Õ¡ƒuäH”àsxÜ8ö6G‰®¨" " " HÀƒváìš~ýìåºNÀý!C¬ôé­¹s­‘##?®.{Œ·7iB`þ­ „v®PTS" " " JÀƒv!gŸýG»ÿw,BÑ:‡ôEhÿÝXà¼y#ž{n^Ò¤{{ö$Ðm$öDM‹€ˆ€ˆ€D<ûgdÎb$áE∛ŋ­üù­•+#¾“ÿjɲ¹Y³åÙ²™Ó•D@D@D@ž(¡j—X±B8pªÑÂ…!ט^B9ü8â –˜°ÄHØþˆkU-‰€ˆ€ˆ€D ´ ëZÐ(¬w‰ÇZ¶Ìö}ñ…/žõÍ7öÒûöEŽ«" " " O$Ú…%º¶ƒÃèÀ–¼°óˆ—’ˆ€ˆ€ˆ€D.w홋¬ÕåýÒ%ûýÂû#ï\óÂĵâªDî3Së" " "ð$p×.“&YU«Z Z ¸¿È¬YÓêÕ+%ý$?Q]D@D@b6wí²e‹5mšÊeÎ÷™3fØûŒ´19fÿMht" " "• „õL€¨<õMD@D@DàÉ! íòä8|ø¥Ð7>ñõÝPºôúâÅ7V«vùСëñs现b(œéøüùWÌM'-⬙<¹bÅ–Zµ¶°ì(¦]:­+Vl]áÂÙ«æ)ùµjådû»³C‡,Oºuíډŋ¯;ž›¬ U«N¯_®[TXD@D ªð ]Ƴ>úÈŽïÂÙÑ&±Õ¨^=«ysËÛÛ:}:ò‡pÁÏϯuë;·o{ìÊÙÍ›WeÏ~Ú×÷ÎÍ›Û5Úݵk„õøj`બYÃÛÜÖºu¯š»èóÜD‰VdËÆõX//¦çðÖéår`ð`NÊ<µzõõPþ\Fðçu7\ºteŽ—Ãȧ_»v—öï×xýÚ·ß×·o¸nQa¨FÀƒv¹uËî$ç9g h*U–ènjÞ¼‡—×p//æ?´Â½@WfÏ~fóæ¿ýF™aÏ>{hĈÉï¼3÷·ßf~ÿýœŸv~©ÏþòK Lxûíc,K¶¬Ù™2Íúñǹqât½;­žXº”&yymïÕË;A‚^^½¼6–/OMxÜ)¾¦H‘^^^£½¼ö `:¶·oßQÁ]=µj 2ñ™g¨jVüø¦óÞÞ=½¼{y­ÈœÙÜâ<95p1ùÕWMΙ f¼ÿþÊä̹¡D‰þÏØ¨Šå+ÔÒ‚Ÿ~¢B;wîÌøè#>®Ì™3´?ÜÃ'ò8Æ>õÔ‘)S(?÷×_áÃyß‚àõ”Ö—,I[#½¼vwéÂ÷XP6V®¼àÇûyy\²ÄÜ%Ú³bÇ>½nÇJ67oÞ×Ë‹AùOj pFÜ&<õÔž=øx|Μ‰Ï=7ÆË«ÍÝz|î\å–U¹sß`»¿§¸x1eÀÛúî]À&=ÿ<”–eÏN(ç#ãÆ„C¿úÊTpûêUžÅP/¯¥©Ra0SxÜÂtžÑàÁÖSOY ZiÓZáü¡ûèûÏd¿"C†UÙ²Ý$Í=‰ÙÅ·bÅ%)ReO”e-øáÞæÍ›òþû7ÏŸ_‘5ëñ ìœY³ 0mÚú%ŽLœHΡáÃ)|ñÐ!ŸbÅøHadGàÂ…›«WçØjrþú+ïLZ¼omÜx÷]àÚ…c³fm®VÍÉ9:s&åNœxpÌTÔÍ3g%Mº­I“›/"en{I®­EÞM§Ö¬YS @à’%Ÿ}viêÔd߸xÑüx:¹¿¾"eÀûª9ÎïÙstÚ4Ÿ2eÖ)²$MšË–!qÙ䯆Y|k:dÎĪF»Ç5ŠÛ÷õì¹8bÄl‚.£6lX•7¯Ñsk ¸ròä}<&±%üáõÜ„ ··oOš†÷ÇþyÚ]–!ÃÆªU‘D÷ÖvÂÛÛ¯ysÇövùða$ѳ$U*F7%Q"ßàñbÖ2·_9~Ü}|F;8jÔá±c™ÿŽsš%”M›öõî´ÚÒ°á-[Öþ~ý6OŠfÉ Z! ¸äüDXØsäÀôíèÔ©sâÆ=6w®_›6¬&¹äï_ìâÁƒ«óçg*Å’AßüGF¸çÞ¿™mã>#O×®;pþYÖ¶–-}Ê–=6s&3îõ‹™˜÷rjݺ­õë™:q†tcÁÐá vhÌôÖ½ÕŽ¿kœ° ³*x€ëŠAÝçïvâ‹/ÚoßæP*.x^fùËŠ,Y3?ùÄܸÃcÆ8Ðy(nò€v{o3Ѳ|«T¡]l-ûFôpèÕ©+ †Â›‡èN»ºw_,Ly‚­SK3e:2y²)|íÄ Þ‘,Œ ÓÝ‚D‰P·®\9¹páþ–¤N½ª`A =zmþüè¼Ã£Fíë×)sŸë+GBÀƒvaù£¯¯½ÞeÂËÈ üzíZûé+I»«’M›n žƒV¯6S#iG³f¨–;²ú•98hùò•Y³âW:4z4ó%fÜ Ë2fÄ…qdÖ,Êß¾y7 ‹6Ð ›ªUcòƸX|ºoøð‹ûöÍûáÆ€;w6U¯¾§{÷-[2ßSÏÊüùŒ‰)åøâÅË3f<2}:zèì–-;Û·Gm˜î1ݮΗowŸ>¾*ðqMž<Û‚×çn¬QÃÌ£8z°= ØVåÊ…]7Êñyó0±,Ë’…ßús¾ÿžõ"Ør7?p¾`—rƒ{ûúõ9_}弈xaÒ¤œàŽV­X3„2˜ýõ×8S&½ðÂ…Ý»K»~:¬-ZcÃÖF0SÑßÊ•OñøïIо'Ÿ’%q÷`nÙT«Ö†ŠNŸ®Ðž1.&{Dؾ>}P0<š­ÁJùkuîÜÆN­_o“1Âã¦;o¬[ßVà¢Eܲ§W/dë)[)¾â¯¿v´n¿é¬ŸßÈ×^3= ˜3gMÙ²¬B*!nîíÞ¶V­¶·nõåäÊ•S^tr[³fü©`Ÿ \°Àû—_¼T0wî¬`ÕKëØrŽÍ›|D̹íÛ×_¶ê¸KÀƒva.`©h©RÖï¿[fâ—mÛ¶¶Ï(ØßÕÓ²´i·Ô©Ãº ÓQV0à.Áÿâ[©.“ɺ“¿ÿ¾,}zÄF…Õyò¬Î›we–,³X/\àÖ¥Kkòå[š6-_±…kLg||¤IsýÂü#g7n¼ÄÍ+WVå̉|q¾ZU¤ÈâäɦKG3׋ÿü›Ðå»‹ì ²mÛÕeËrqaÏžM5j,úýw–Â0ý£rÈÄÀƒ‘fa²dkòç_ñ÷ßX§HqûÖ­%Y³žÛ¶9í‚¥¯¼ÿ“̽½B™m(SfÑ`¢Xøûï>Á"éÊ‘#*UZ”<95À{ÚèâáÃ>U«ΟïS¼ø¥0~,I—Î;iRJhOEKÿúˬSÙ3hÐâôé×äÍ»8U*xÞçeiÊ”ÛÙ·Ævª¥K@Ø?hzzfÈKÓ§§]¶Y…¶Ú—U&¾uëúuéâXP0‰yÿñaWû÷ßôm~¢D×\Eš4ieÁ‚÷Ù´­E‹EÉ’ÍK”“é ºG"L,‡]š!Ã’?ÿ\þ÷ß7îªD½]$ ßFõꟈ€Ä10¾ kø¹ìì:Þ?lóÍÑI“°¯ÄˆG¦Aˆ€ˆ€ˆÀMà_Ú…MÇìÉÁ¶»x|±z¤vmË“¹=ŠBijÃ*NÖ `ø~×èEûªn‰€ˆ€ˆ€„€»ÝOþ¸x|±ÁbáBKëÃVED@D@D@ è3z,œT©ˆ€ˆ€ˆ@Ô í5žƒz!" " "61G»­XÁÆæ+á<à&l”TJD@D@D ªð ]ؽKð\⻘¸µ¾Èµóº»+ÒÀò[¶§Î—¨$N'ˆ…ê[®±="­[jXD@D@D BxÐ.«W[5jØbåúu» gÎüK—u.‚!B:xO#›õÝwDÙÖ´)qNÍ÷„G#²ê•£G#§OjUD@D@D ¢„ê3"n»s£é תT 1ÆDT÷<´³¿OŸIqâp°"¡ÙMÄU±Ozûm'Šn$öMM‹€ˆ€ˆ€hÙ2Nr¢Ïm¬VÃ¥ÿûN•ˆþ½ˆw+W¶¶m éGëp–_T‹JwéàÁ}t# Jªˆz~jGD@D@ž4´ ®"¢þ_½jqþ«ÛÈõ:Š`ºxbùò(ÒuCD@D@D ¸kv>l$…Î#6î°Ò…ì>tÈÎŒ‚"&H© ¨@à_ÚåΫiSëóÏ­ <¿¾úÊÊŸß:}:*ô\}x Äœ¸ºOâÓÓ˜E@D@DàÉ#Víró¦Å+ª¥Û÷¸¯È¹uë–[? Å{ýúuÞÃÕÿðºÆ¨Þ´|Oûájö¿ 3Æ›ô0€ðßµ?ήÆ\‡÷¡<ÎÞ©nèAÀƒv¹pÁ^ÚÒ¹sÈÌ,Éfénݬ.]¬ ¬7¢ÐÀºwïÞ¶mÛ«¬+¾›V®\Ù¹sg2÷s®ÁÝtâĉ¡C‡úûû‡½ëÄå:Ôš??ìwXµkÛ·tíjñ0À^–Ä‚è{S``à„ <Þ~îܹ~ýúuëÖmúôé#FŒ0e¨FŽ–.ݧÌ·x…a¨î K¨î¦1cÆ´lÙrÇŽdÔ«WoàÀçÏŸCÿ]dÑ¢E[Ø §$" "ðð¼Gº_?;¾‹‘¬Ïe™ ³s† ÖÊ•DeݺuãÆ;yòäŠ+–.]J«¼Ïš5kïÞ½ëׯç+~¸WªT‰œ>}zòäÉAÁ±h(\µjU2™&ͤNNóæÍ‹+¶iÓ&§ëãÇ>|8ú 4AÄ›*••)“uîœ}ÓìÙÖ† öšeÈ._¶eÍç',YRë·ßZíÚYo¿muè`•/o»v­5dˆÕ§OH%ÇàÁ’Ã××¾kút+kVkâDkêÔQe‚§ÃA—*UŠá 4¨U«VY¹Ù®dzíÚµÑS§N5Æ †%ÆÛ§O???r|}}GU™]ïÁéÀsæÌá}ìØ±ïî0G äðáÃÞÞÞ÷ê€K—.µk×®zõêÆ 3⃴jÕªŒ=š»LÎâÅ‹L™Õ ±ØW?©pá´²páB>öïߟG“Ÿ5S–•:uê?ÿü“ jCYöíÛ÷Ô©Sûì³Ìʇbyóæe:,R¤ˆ‘/XY^ýu&r®q¯0µ#q~ùå~š›®W«V-EŠÌë¥K—®S§ŽÇñ Ørç¶Z¶´ ²¿Gºýô“U¼¸U½ºÕºµC ßxñlR¸°µfCã'NXiÓ†Ô7gŽ-bˆéÇ«H;sÊã´iVãÆó,ÒYƒFdFîÙó_½ˆ?þîÝ»=v ÉR°`Á2eÊ*TÈLðØ™Å@zõêu#Ø,Æ55T©R¥~ýúkPÁ’‚ÿýwSçÆ!#GÈ€—–/_U„BU JÜZGâäÉ“çÇD%¬ 0zˆ†¦L™‚lâ¡\¸pÉ[ô Âñ•W^¡LïÞ½cÅŠÅ;ÊéÚµkTBç?üðC¾âš¦›6mÚ¦M›‰'¹–(Q¢¿ÿþ!R®\¹œ9s2Æ.]ºtíÚ•Š™­}ûö±`ÝáFúàñ[eŠ€ˆ€Ä$¡®wyþùóŒð´Äo¦?ÞÊ–ŸÚ7ü$I’¤I“†_Þô²bÅŠÌO\Ô­[—™• &`Ì\,[¶ SÁK/½dæif}&NæT§£ÈŠ1;š®1TpÁ¡ýXß³Çb¢G[8seìØ(Û‚òÜsv%Ç[3ZV£F¶‡È$ÎÜNš4äš[_|aaYH—Î($LV©SÛA ã} žâÝ=q_~ù%vŽÐ@O›6  ‚ùB4Y³fÍŽ=êxް‚¼ÿþû¼#eŒ%Ƽ3pSçÙ³gkÕªÕºuknùæ›oøöã?&“e4;vD4xlÚ‘æ[ì+hÄL™2%H€J°‘ð\Ò¥K—,Y2$Jˆ2Û·oÿî»ï¸0+“(ƒvÁlöÃ?,v!mxz„Ù D”ÕGP‘ªˆ#q¨LÀÃZ]+{v+kÖºíím%Nl¿%ÎíYžüßÓ•+W–-[Føœ‡¯J5ˆ€ˆ€ˆ@p×.«VY3Ú¡\Æ·R¦´;³w¯}&Ñu·l±¿BÇ(9P2d8ÊÞñ9r nÂ…«S§NÛ¶msn™:u*O¨OŸ>äüùçŸcX,ý(½*UªÔˆ#EeªCD@D@"”@¨{¤‡ ³• ‰çÕ5)K{ÿQôJ«W¯¤—W·nÝâÅ‹ÇG  $à"{öì™2eâ"cÆŒ¼—-[–Ñ]¿~ýí·ß6waö ç‡~à:qâį¼òÊSO=åH•*ÕÒ¥K=iß¾½Óîz¶oYÖâÅ‹_xá“Ù³gOrFŽ锡û÷ïÿüóÏMN¾|ù(pîܹرc7hÐààÁƒµkמ;w.™Î-41yòd>¾÷Þ{*ThÞ¼ùk¯½F† š2Ÿ|òÉÆ=vÏÛÛ»L™2´è|‹ á–V­ZE¯ç«ÞŠ€ˆ€Ah¿à„jÔ¨eùòåDÛËœ9óÕ«WóäɃˆA‘´nݺI“&«W¯žN»»éÀÉ’%Ã@2pà@´ 깃d™3gΰaÃ&¬Y³&]úõ×_¹(W®ÜŠ+èü’%K(“-[6TšÇF1ZM&ЧsçÎnc/R¤*!4 ˜LŒ0š Q²dI´ ªÂÒÄ·x…øk§Ãû¤I“¸Øµkíš/ùýõ²ÑC‹óçÏïØ±#¦#J¢~X¹‚G‰e1È£uëÖÑyna‰ §Ý£vóv"000z=_õVD@DàI#à®]6o¶]E Z]»Z¿ýfÓà£T©˜ ­nݬbÅ, D£tóæM&ûX±bµhтٽ?ºÌ²Š-š&Mš®]»2xd n——_~9gΜˆƒäÉ“S›Ä?þˆI *‡é ®"†4KOœT @yóæ…¤nݺ7F[`û¡Ì¸qã°‹Ðò…:0tèÐ~ýúQŒ’ƒºÂ|BÓ˜Lüüü°Ð €Îœ9ƒÑ…ÂX€Ú¶m‹ÑˆJ° }ûí·T…¸;v,¶¥víÚa¶Aoq/vºÚ¥K—Í¡<0Ýsµ»àiz饗p±E£ç«®Š€ˆ€<ܵ˹sÖ€VÕªVùò–ãZ»Ö*SÆ~¹x3¢«Û·oO›65+5jÔ˜8qâ­[·L¿kÕª…“ˆ©½oß¾ˆ(`„`ò6&Ö¾°ÐdÇŽ|Ä*ƒŽA4T«VÍuä8k.\ GË–-‹/@Ë—/£'ðË”/_·9È$HÅŠé‰S¢Ò¥K£¨ÈAëÐîÞ½{·lÙBŒQ„u-T‚}ÉR¹re‚}eúô騱µkײ2ÿvš*Uª°¢Å£YW•`BÛ9í>ýôÓ®îªèñ€ÕK'€‡õ.O„^½z± …™sKxÇ~èÐ!n$û–ÃÛôÔGlá3+ˆ$‹Ëà ս" " Fà_Ú…Uº8.>üÐúòKÏ/¾äÌi…²‚"Âúü(Âð€KèÔ©S¬üàâÎ;᪻֔ðÞ®&Ga:ÌJáQVèFÀÝîÂê‹øùy~á?9pÀºëx‰ncUE@D@D@¢?ùŒ¢ÿ3ÔD@D@DàI"àY»°S:*œ¹ˆG†ô$=UD@D@Dà?xÐ.„>‰Ëzá…ø.TÀñÑýúY˜}lçöxîåªU«(§ˆ#ú+p¸kâѱGš´k—õþû!Åfδž~Ú*]ÚŠøÅ¹sç&dœ˜ˆ€ˆ€ˆ€ž}Fƒ-^Ü Žï’Ö­³ˆYñbDs#ö¡Y"ºUµ'" " "U xÐ.˜^.Ó§ÿ«ËmÔ(ÁÌž=û7ßWID@D@D@îµ»°áÂaÑÒGh]'‘S±¢uìXD3#Ž-áí#ºUµ'" " "U ¸Û]ð(`åÎmŸj”'OH¯—/·’$±8ê‡ÖÁDX"t}úôéïsPs„õD ‰€ˆ€ˆ€DîÚ…-É„Í=xÐŽAçœÒÃ2—ýû-Îä!?"÷N>|xÔ¨Q#~•My8ꆈ€ˆ€ˆÀ=¢tlºhk_`" " " ›À¿´ ÁþqyyÝïõÉ'¶FID@D@D@"…@”¶»D 5*" " "• H»Då§£¾‰€ˆ€ˆ€¸ð ]|}­þý­^½¬óçíÒ8’–-³ºvµ#¾8«wRD@D@D@"…€»v ´7¶Š± ¶ 8aeÈ`U®lýù§¥èü‘òÔ¨ˆ€ˆ€ˆ€CÀ]»œ>míÛgÛ®•/Ÿ}Áù‹ë×Û%KZC†ˆ€ˆ€ˆ€D&Ïë]jÕ²x:õOÏš7·Z·¶”VH$àA»tè`uìøO—®^µZ¶´Ú´‰ÄNªi!à®]V¯¶~þÙ>2š“ÿ÷?»ÐîÝv¸ê¦Jeuî,p" " " "™ܵËåËÖ”)¶•¥Y3kéR»g¬waí ¯V­¬íÛ#³¯j[D@D@D@ßE" " " щ€»vY·Î:Ô7Î;ÖýEæðáÖܹzctb©¾Š€ˆ€ˆ€<~ÿÒ.wîX&X+Zuêx~U©buëfé\çÇÿ\Ô‚ˆ€ˆ€ˆ€gòé/CD@D@D :ˆNÚåÖµkÑ ­ú*" " "ðxÐ.AAöŽè3þi u,‚Ù¼ù1´æ*7U«´r¥Sü´¯ïõ3gœ·oݺtðà•cÇÂ\Ÿ Š€ˆ€ˆ€DKîÚåÐ!{½K¥JVñâöÒÒÑ£V‚VýúVÖ‚‘3È[7nLzñE§mTËÖÆoº¬»¹qþü6"Ò(‰€ˆ€ˆ€ÄtîÚ…“¢°ÏŽæÆçž³GÏ9k×Ú,à¬èºƒ½¼.ìÜižÅŽ–-GyyñòéåuíäIrfʼn3åõ×yy-ËÓ™Æ'" " O4Ïë]Ξµcé: G¦LÖk¯Y>>‘ QâÚê™g|ôÑÊlÙn]¿nòƒV¯áåµ£E‹H蜚ˆX´ §Fÿö›uófHGnß¶8Òˆ„O†ã#8.Zäýë¯ÿ4zçÎÑiÓÎïÞ½¿oß œVœÖ*ÄûÑéÓO‘’ˆ€ˆ€ˆ@Ì%à®]ví²²g·£¼þ?_>{ܬw!gÇ …зo„’8·}ûÒ´iµ7B¡«1ˆÚܵ˾}VùòÖX¿üb+f÷ÉmÛZß}gU¨`똈L;Ú´auË,?J" " " "L êÆw¹}óæþAƒ®Ÿ>­'%" " " wíÂqE¬yíÔÉó‹õ.#FXœ5­$" " " ‘BÀ]»,^luîl¯kéÓÇýEf×®öRvM+‰€ˆ€ˆ€ˆ@¤p×.¬-a‡ñ]<¾ÌWJ" " " "Y¢îz—È"¢vE@D@D@¢2i—¨ütÂ×·uEŠ\s9ã)|7LjÒgÖ¯ßTµjŒŠ!" "*Ú……ºD²åuøð?·q’9íÚE”KÓ¤ Zµ*´ÞloÚt´—×X//ÞLœ–NŸõõÝ\§Î " ?ÒD'×—(aª¼|äÈ̸q×–*õH[ø§²k§Oß¹ûéÊÑ£[48çç÷m]?ujh0Ɖ|౪›.Ìýê«ð¶B…a¿…s†yyíéÑã?oaošë ÿYþÞ7/]Z•3çsçÂuïÒté\ í^άûôÓáªY…E@D@î%à®]|}CŽ`ô÷·Þx#¤>ÇæÎ=,à8CûÈäÉÔéÄÂ9·uëÂĉw¶m{™œ€@% ùçm†’N­[wpĈ“K–ܾ~ýZPÐù;p’Ôž=ÔÚ-þ“'úé ~~ÎIRD ˜5 ¼æépûÑ©Sã)ò©öì¶m—ˆ&DÇΟ?±té±™3wl?‹{Óñ9s¶5hprÙ²cóçJ·._æ##:OÅàÄÇÃãÇŸ¿+×,8îíͳ;0dÏîÔS¦\>z”xÍG&Mº·¡Àyóf}öÙÁáÃ!`¾½pŒá,Xp%0W¦O硾{Òúík×f÷±ˆ.îßon¹uõê‰%KfÌ8|gþf¼÷^h$•/" "Fž}Fö9Ò#GÚ•›®J[¸˜ó¥=©…0¶õhŠ1szÑä÷Þ[_¬³Â½•®.P`W§N>¥Jm©[—#oߺÅoâ O?©fR¼xëÖq˶† gÅŽ½$EŠEüqzÃrÖ—*5÷ûïWçÎm*ÜÙ½ûÄ/¾àbmÉ’« ¦!&-Ú]‘1ã²L™|Ê•»}åÊì„ gÿøãæš5™nÉSòN”hÁ/¿øÂ.81c^üøô ÄDKÎá1c¦½ûî’?ÿ¤Ø½&"fòýC†LÿàƒõÅ‹óãž‘[vuíŠÂîsÅŠÓú‰‹SkÖÄÁ^ >œ’td„io½…‰ÌÄ‹2f\øë¯ “$Y”:µÇ®2/Ïœ™®êàÈ‘hĽ=z ÷òB4l(S沫Îå~Nl˜ùí·»;u2º*ÐÛ{a¢DKS§žññÇXJPx³¿ùfÅ_-LŸ~ï!æ>ªõ ;š6=µz5ýºu›;ö–5Æ~ñ†{ìÛÎöíg}ú)}[“/Ä(³¥Ij^’2åø·Þº,Mˆ´,}zoγN»:vä´NŒ^Ê•[‘'9Gn÷)QbE–,Ë3fÜR«Ö½mù”.=ëóÏWçËw=؇ðZž%‹÷/¿Ìýæ›Í5j3û·ßx¦kÖœ%‹¹ =#nÜ•¹r'À¨oÞÜÚ¨Ñì/¿5†ŽßÚÕ¾=ÇV¬-Xpoÿþ<}T¦ˆ€ˆ@Ø xÐ.{öXx9Æ ©$(ÈJ—Ϊ\ÙJžÜ¾¸k¶{¸$ó÷¡Q£P0×Nº·j ›ëÕcÞ¼±»oßyÄfB]´hUž<—øÊ÷M3âÄ1Ó< ±"kÖ•ÿ½§wofzÛzqëÖŠ|ùxÛš41‘´¶P!ìLN­¦N]]®Üžž=7W¯î±©[7oÎù·˜Á V››4é–fÍö÷é³ {Wñ0ºíwGÙƒ’ihkiŽ˜‘Ö(%*A}toZ]°`ÀݧÀŸŠ_ëÖó$ØÝµ«mÀëÕ‹ò‹K”À–Æ_Î'¤ tª:¿kפ_ÄkI¦_»v\l­_ß|»ð·ßø»º?O}+" "ðŸܵˑ#VéÒ¶Å… ·Aûv¬øœ#Mb–Œôõ.Ø!Œ'‚wg /öÏ1ø€6ÖªuxìXûzĈ9rØc v7`óç—7, ñ?þ\°aUŽ'—.Eñ0ñß¹y“sªù™¾oذùÉ“3SR5°2¸œ/¼ï8Ã<0ð„zæÇãôñ)S†ÉlÊôɯùÿm„ÆÞÑa¸!×’SbbGðdÌœ7݅(¼ooÑbJܸH(ÃaÞ/¿_¸Ðø¿&2¹À˜ÂÉÁ®ƒãñ„Ïkw°¸7™j±`j:¶h×KÓ§÷;‡KhV%Óª=0x0Î)Fu1é]Å¡ƒ‰…áãrZ’:µß]U1;Nœ »va¥ÀtríÚCS¦Pþ/l< i8¹&|ðF)ôÆ'4&–uÁ«ˆŽ›ªWg¼<”‹ûöMûøcç)ÏþöÛÓ7òÑœC~~Û¶U¹s#:/<ˆé%47ßü„ O,[†ì£$cʽýúq;¦;j›jׯ5†³E2õÿ3 1‰¡nm'Tðʪ uë0æqå[¶,¢uÅ`Ǿý6 íOEù" " a$à®]˜Ç9‚‡Q®\Ö]£¸]?È9‹1C+ôÅalññcâ\š1#‹6˜QLKûúôY–1ãâ?ÿäg7žævŒ›ªU[W´èºâÅYƒ3ˆb¬~X•+WÈ]wîP`eÖ¬ªU[–5+Ë5°‹àøX”4)>4•l¬^§À__nÁºãq© Õ²ÚdÄ s9Ó6+oÈœ'N q-ks­Z8¨„9˜ÝÓöäW_Å0C»üú7¦¦y ú–/ÏšžE™32„j×)â8ñÊœ9Ql¦ŒIȸuÅŠ¡EÌGš@B¡-¨Çã3@î`5Y[¸ð‘©S &"ÔҺ…ñ£¡B{lXƒð¿øµicÖ»1‚F7”.½:oÞ3›6­Ìž}Mþüøz0k9r.Á?šÆútïäÉ7Vª„ggkƒF{¹%Fº4gN@ÑñË û¶5jDW×.¼±Z5DÆòL™Ö—,97~|(«LX@3ç›oè.³I¯¿Î’îƒæÀ¯´6þëÁ½½7¡kWçÉCͬAæ[¼ZpÃñ„­ù²2wn{tåËÃ_ž¹ýâÞ½¾•*­ÊžÝ¸ç®=Ëx)F%»ºtA°bwáo~.Ë—Ïè]%‡!à®]0L°°aófkÓ&ëîÚ »~Îà#Ë"Cñ>tõj@Ó?=d,Ì Tâº*åÒþýÎB]j6gŒ÷9Û’®RÌt!…ûƒ1R¹ñ%…–迱E‘0œà’£·Pâ#Ö zE»ôÓµ]ºaú†Q©Á©ÄYQëÖØîÄÉV®œ‰ÿ޾™EµôœtqÏp”³h!¨é \Ûš6ÅþΦ]íÚÝÇ’D ®§hq/ ÙùsïØÙÍ›é-ï®dtðwrøëâÊ`s²!;†­ˆÇĪdþˆÿÜUˆ€’bœ«pøðá={ö„·6PC˜»;ˆExkPy;wíÂqE]T¹²Uª”5`@H=LF,s)TÈ^sð`Ø+ì%‹++V¬3.zjþüù%K–|ÿý÷çá⺛.\¸0hÐ ÿ‡éÐ?þاOŸûÔ°}ûö/¾øÂ­À!CÖ­[Æv,X>}úš5kƉ§oß¾<›°ÜÈðï/ªÂR‰)sãÆM›6™ëÀÀÀ'N„åÞ±cÇÖ®]›’åʕ۹sgXîRx0îÚ…DÛ·Û‹Ø+VH³fÙëLаMFÕªUC—Lž<ù¯¿þJ“& MçÎû믿îÙ³gùòåŸ{î¹ýû÷cŸ`̲¯¼ò 6ÊܺukË–-/¼ðÂ$VOÆ9sæäcÆŒ1œ8Œ^}õUn|ë­·Æç\×®]Ÿyæ™>úytñâÅ,Y²RÜhÊ£3PHä´ç€Êà‚ÒË‹ù›Ýºu£ÿÔÐûnˆbÌèS¬J•*—ÙÓõïÄ@vïÞMÃ}úO?ýÄEÑ¢EÿøãÓjøôÓO—>™ó¡.\H—.©6^¼x¦N B&§{÷îN+—.]úꫯ8`rêÖ­Û¹sg°{ì†2E@D@Dàá ¸kS#…ßü§O‡Ô?|¸ý‘W… ¨‡o4¬5dÈþásá=Ož<ü¬ç‚éÍš5\lܸ‘ÀÂ… _~ùå%ÁAêÐ4ˆœ5N3ãǧÌĉM%›7oÎÒ'eÊ”÷ö¹€6‚ çûï¿Ç“B™×^{­©sÂÓÝ{víÚõÞ{ïu‚šAR 9p¾ðÑ8Þ|óÍR˜°‚EUýúõ%J„‡…n,XÐTë1}ûí·h¾ÂƒóñÇsC*iÒ¤è3˜µÄW¿ÿþ;¨ äpBS Æ Ëš5+£p¶lÙV¯^MÉ6mÚL™2…lEÜË PMš41]š‚ s=xm6άøñ㛯~ûí7ǬÅpÞyçg@nÖ¬™é¼’ˆ€ˆ€<´ËæÍ¿´£ñرö±Ò$~çßýñÿ8:ã^g’$IZ´hA.½,]ºtPP5bE% ipOC4Fã9xð Úe¦9× 81ÑRÌÉyê©§ŒvA0Cß;’½{÷¦M›–['N¼uëV£B0íÔ©S‡ ³¼kõ$K–̱ˆ`éáÚHg óz¥J•ÈAÐ }p<]½zõÊ•+tsNh1u˜éÿÈ‘#Ô™)S&äB™2eŒoSè—_~©€–´Xœ4¹p‹™K»n5#J:¿þú+Ö|LTØYØÓ,ë‡~p|C#GŽlÕª•¹Å㘔øˆGŒž œx(©S§‘)†¸ùàƒœæh¨eË–Ò.¡=Yå‹€ˆ€<<wí‚Ë"OkáB+(ˆ92¤þQ£¬¢Eí uY²Xsæ<|£a­WýC‹ð^µjU´ ~œâÅ‹ãHB7ð“_áõ`ÊĄ݅ٳXM˜†™_™•™\qßP¬GfNÅRR£F d³>3ô½½Á28`æÎ›7/nÌ$”ùä“OÐ+X;ÈD àÖA”P!^¡Ž;RKí¢¨pîÐC ÅPTt˜¶(€,ÀSƒbîСC]W»ö:cÇŽ½oß>2±!!8OŒDÎ&ÆÅ p!;ÈBõêÕ5>Gy¸VˆNÂ&Äí´˜#GFÍrZ„TÿþýQ0è<3@??? -ÔodÞ4(Ñ[4N"Eý`°aP¬zÆŒdš NÈ»j,7Ò.aýW9ðp×.»vÙ‡EstÑgŸYœ&m¿öså²ð tê„+$ü<èL–¸ŠÐ Lù¦üD¬®ÀyE„™û›o¾Á Á"–q  ÕSˆ#àA»~–€m)R„tâäI‹h‰Y ØÛ§ïP¸.²­7âSK" " " Q›€»vA¸°5zÅ ‹Ðn Ú}g×ÈûïÛ[£ R—6-a?"t@D¢cãq„6©ÆD@D@D@¢0P}F;H ×D|µœ9‰k¡£áÀâýGh“jLD@D@D ð ]ØÍ–"7áÂJ”°ú÷Сœ>}š3‰8¡­ª1(LÀ]»°ÿ™ .Á‡YË—ÿÓqÌ-%KZ[·FèPˆ…Ï)Юç?GhójLD@D@D êp×.[¶XiÒXeÊX;˜8ñ?ý>Ý"pü•+=Ž×!à}D·ªöD@D@D@¢*wíÂÙÆ'ZmÚØê¼½ÿéu@€ÅùÒy˜‘i{÷îÝœ¢Ué©_" " " M ÄwY¿~}DSQ{" " " Q•À¿´ g!תe=óŒõ꫞_/¼`‡~9q"ªŽFýˆéÜí.—.YAAÖéÓž_§NYçÎÙ^”D@D@D@D RDŸQ¤pQ£" " " Q“€íÂYŒ„¡ó÷ÿ§ÃD|9xÐ~q#Ó¥K—N:u'ê”è’¿¿@@ÀñãÇ:tæÌ™ãáÂn ºœB«äòåËç0¬…3±•ý"k¼CI×®]£ó·oßc­W®\9|ø0C>qâ<š0ÞÞb,LÂ{ãýËCãüùó¶NÕ&" "àJÀ]»pLtÛ¶ÖgŸYl-Yb—dî ² Ǽû®U»¶ú$EÁzœ5Ñ7\NÄ®Zµê«¯¾ºsçN3†[,ü åÂmNI·|ê7Jˆn`n Ô½]Epð„Þ~ûíW^yåÿû_úôé‰×ÇítÞµn$ǹù~Ó¦MÎ@.ÅŠûðà ô—7oÞ¥K—ò•)ìÚ4Í´iÓ `ºHëp-C+®ÜLÉ¡C‡6lØ0´AÍŸ?ŸžÏ;×)­>Î…ÓJ³fÍò[o½õÜsÏqѸqcSŒñº6ÍG’3ä}ûö;vÌmD÷vÉõ–o¿ý–‡N¨+SÒ`t{¦|tµ÷y‚T²víÚÌ™3ßû÷å‹€ˆ€„—€»váô¢Q£ìJ6n´>ÿܾسNJÛüŸÝâÿÉÓ¦…·‰È,ϬÃÜÙªU«É“'3+Ï›7ÞøùùuêÔi„ C† á#Ɔ\¹r‚ ø'‹H6u™¹îСØ1c°̘1£]»v¼>¼oß¾LêL±\tíÚuôèÑÔà6H~Í6¬}ûö4ѤI“íÛ·SÙ1räHr Ä\Þ«W¯Ž;Ž?ž¾µiÓ¦_¿~{÷îu«çäÉ“#FŒ :øjÖ¬Y”;v,Ò“Íl[·¬]»v5Š~öìÙsÒ¤Iä4hЀáŒ7ޱó±OŸ>•+WÆf³xñâdÉ’aYášÆÔ´dÉ.®ÛÓºwïNÇŽ=júP¦L™„ öèу¶øÈ¾bÅŠÁƒ3.:SŒ{©“šC{Ì{öìÉ!ýç,X@Wé3jéàÁƒ\£™x7O‡!Ð1__ß‚ "GÖ¬YÃ>y3ÀbŒ¡ ™< еnÝšÈùä“Oh¼tÒcO¸‘çsž) âÂU»lÛ¶Í`œ={¶©dæÌ™½{÷æF‚ mÄ9-Z´èJéýû÷§I“æÀ¿Ï,åïÍ…¡R¾ˆ€ˆ@ x^ï‚p)VÌ2?•‰ìòý÷v¸— ¬,YlM½s<ƒüþûïK–,É,Nçÿýw~ÓçË—ÏLðX)0H<ÿüóÄÁcâ¡@Š)(€†IèÓO?%sÑ¢E~÷Ýw+Þ±c“'OŽ*â·»cTpÈ`êÈ;7eP¿ýöÛ_|ÁWôäé§Ÿ¦ròÿøã7Þxƒ ô “.±cÇÆ…á‘-“eµjÕÌW-[¶Œ/¿ì%JDUätîÜ™*ùüóÏ#9¨¥÷Þ{IwΜ9|dÒe®­W¯ïÌ÷XPI“&E+pÞÂ3ÏB”+WtöìÙ_~ùõØ>øÀ±¬€ô¯¿þ2Õ"b$H@g~øá2é©R¥âÇÏu¬X±Œlr&Ë–-óØF÷Î;ïÀ$Ož<Ù³g71ylj†¨BÅ‚‘LZAq€K:5d Äã&‡ÃAù« ÿâFEä¹~K÷hô>”ô•ˆ€ˆ@Ø xÐ.kÖØÂÅ9‘Ù&+ø—|tJ‚_|±xñâtÚÌR/¼ðBÖ¬Y™¨øÕn¦: -8)ÌNâ×6R† &×ï¾ûÎ&ì"EŠpA1  æ:Ëb&Æ\q/~¾—¥Ìý\P iÓ¦¨f5fPÌÄ­!ŸL:C+Ó ]Jš8q"JÂ|‰`B‚ ¹øÏ|O‹B°êÔ©cºÄêke¸9˜8c¦1¢` Àê@43p Kh#s£i©¹óæ›o"D007k •†7*´ž“ÏQš µA?ùˆ€«T©Ø„0íp¨ÂÃ*ÊX€Ì·YPÊÁ éÓ¥KTÈ”DrI‡ÂCvcsò˜Dê‰á[–-[– ä‚9p«™N _¦I>²–“™ibÖÁ`‰1w‘ðñË× ó¢Ç8tܳ•°L•J̉‰åã?¦ZæN&cÓ¤CÅŠ1iÜ2¢P¡BfmGªT©¦NÊÏtÈäŠÑˆÝØPZH.hã˜d˜D™ÝS¦Li´‚1ÁÌþ@rñnæi¾âò5jÔ0=A !20«PÖ#¤¦œ>Ãùå,4Aœa@ ­óèì%Lù,¸Á„C1ã¹{5=D\c•“0ö8êó>Z_‰€ˆ€„…€»vÁÄP° •!ƒ•,™m}!ñ•¹&yr+iR‹ ÷îºÆ°Tùe˜bùüÍ7ß$Nœ˜ßÐfÂcùŽ~²ó;Ûø˜óJ”(A¦±[0MÖªU ÿÓ'«1˜´~ýõWrþüóO `{xÿý÷ h¦O~ˆ»­`eU >)\EÌô,gAI°À J 8 ÌJ\ Lüúwæé{‘Ñ7æø¯¿þÚ,Â`Ò¥E¾Œä`@á@Á+3‹:Ã\N&ͱb†ÙgÓ'ýwÌ*@Àù…“ïS8w¥K—Ž@0¶ c?@*a¢Qfw*ÁÓ„ú&S»é*j€ašÄn ø¬³ùñÇ‘MôÝÆŠZdF T}3{ˆ`KWéŒÑs$4 b /؎ײ,Ä£3Cæñ-#ňÂGê7OL\KôßH ¬YΪháÂ…)€¼Ã†ÄШŸJP'Àça¡]X×B+$È£¡ÜLüð¼ÌÒ(d†“˱<¹š§Ì‚hW×òˆ2ŽüꈀÄ|F¨öxòº»ÛÆFwö¬ýŠz›ˆÿû!ðû›_óL±Li®ÖT…ë[¦j× ˜’,Å`r%ñïTb~úÓ$v ì f¿ ×÷n]6·˜ú©Šk³o–éÂfr%Q€’üR¿wµ¯30DM3#:Ë2¸¾Q©“|¾u­–L꤫Æ3b6ÎÐtÝ#cnG~ aj 9Û’Moô„hËØ?œ²DåçñIËMÐIš3jÀX¡Œ‰›ÐË/¿Œ4Á”å:dZ¡ÃŽ"ä^3d³› ÍGg‹ 9®"’¦]ûiž”©ÁæšLÚ¢6ó·AC$ç™Rƒabú=Óô}vn³4 ÛŒ+ \„XÂþû/U%D@D@ÂFÀƒv Û*%! aŒ ƒúañÐÖ­[v lé m·y´£ì&‚£]ÿÕaˆúþ¥]ø-‚_Å÷y}÷‹U£þ¸ÔC˜I@v—˜ù\5*ˆ©¤]bê“Õ¸D@D@D fð ]–/·7ŠÝìÁ‘DÓñZ´(B—벘®ë1cæCШD@D@D@ÂLÀ]»Ù•mÂ5kÚ¯|ùìjˆÏÔ W³fµ||Â\÷Cdk.û`ÙÍûÐ5©BÀ]»°m6øH«~}Ëì{å„#s°‰hu&DèÈóçÏo‚)‰€ˆ€ˆ€ˆ<¯wAµà3 ŽúAÔ/ë短wÞ± û,ˆPnD{饗"´I5&" " "… xÐ.Y½zÙ]Ö’Î#˜˜o78ÞzÄ%"©J?âÚSK" " " Q›€»vY±Ââ?–åV­jGH¸U{íK§Nœ®lÑ£áøCbêGt«jOD@D@D ªp×.‘ç¤(D¬øúÚ½f þ#N¼ >q9B“ŸŸÑâ9'B[Uc" " " Q˜ÀÄwqu1 >ºå<Ö¡qŽsˆÏcmH•‹€ˆ€ˆ€DîÚãJÖÀž_¬ƒÁsõjtú)" " "Ó¸kÂбV·m[«M÷™M›ZƒsoL£ ñˆ€ˆ€ˆ€D: º<)õSD@D@DÀ&àY»œ=kñrM'OZAAz €žˆ€ˆ€ˆ€ÜKÀC\Ý-¬Œ­”)í G¤ ¬Ò¥­té¬Ô©­ÚµíPuJ" " " "Yܵ §±ä…˜.lôñÇv¯öì±bǶnܰcÓeÎѱé"‹‹Úˆš<ûŒ²g·Ãÿ»ËîÝVœ8!Ï’Åš4)jD½x"¸k—;wB†}ó¦õÞ{Ò.OÄ)" " ш€»vÁU4uªµu«µ~½}8iï^Ûîrú´ÅrÝL™l’’ˆ€ˆ€ˆ€DwíÂÊ\ÂÿçÈa»¸h‘Ý«‹­*U¬¿ÿ¶þúË>€¥0J" " " "Y<¯wáT£ë×ÿÕ¥K—,^J" " " "¹ܵ +s—,±V¯¶_œ)m^+WÚ׬±cܸÑÞs¤$" " " ‘BÀ]»°¨jU«aC«A÷™5kZi„IID@D@D@"…€»vaMîáÃQ^Žq‘éïoFèQÒ‘EŠ€ˆ€ˆ€DY:Ï(Ê>uLD@D@DÀh£]ÎíØqvóf=C'œ€í2y²•(‘• }’‘“X«;nœ},@¤¤;7nL{ï½Ëx³î¦Íµk_عÓùxëÒ¥½}úœ^»6Rº§FE@D@D@"Œ€»vÙ°Á*_ÞÚ¾Ý>àçŸCº1fŒ}D@á‘¶ÃÈüøÅ)R˜ÞܸtɯKŸ²eƒØœÐ4‡§M[ž6íÍË—ïܾaìÔˆ€ˆ€ˆ@Äðì3b§tÓ¦¶Xqš¦Y³ÈÙa´·_¿¹qã:=ÙÚºu_/¯1O=5;vìçΑ?ûë¯{{yMxá… •*ݺ|9â!ªE#àY»ÌžmU¬hUªôO7È©S'ÂÓÝ8{v46—trùòÍ›o­SçæÝ½Ú{zôØÕ¾ý¡CoE–O+—'ž€»v9tÈòö¡ò¿ÿýƒ‡ðtíÛG4­ëçÎmªVmÿ€® _9~üæ•+ø‰írÚLJWOœ¸Æo%MÀ]»œ=k5onf”2¥5lXÈÐ §ûÍ7Ö_X™3[;vDC£G¯-Zô6GZ+‰€ˆ€ˆ€ˆ@0>£ãÇ­9s¬™3ÿ!DœºéÓíÕ»3fØJGLºcYÛ7>‰nR»¢p|—;w®Ÿ>}çFID@D@D@BüK»Üºe*do‡¾Ïë³Ï¬€áÈ!…í.‘D­Š€ˆ€ˆ€DiÒ.Qúñ¨s" " " nžíBÈÝ »wß8^" " " Ñš€íBݾ}­îÝ­à µ‹`–,±:u²¦Nµ¢ÎÔlÎVòzDdÞ¼]}úìíÝ{O÷îÎ×N:»’¦Mw´isçÖ­[×®Íûî»u… ¯Êž}cõê|ÅéÊ—ßT³&Còñâ ûíêÉ“'–,YS°àeÿ£S¦ìîÒ…šÇ¹†(þ7ŸR¥ÈX”$ ï3g/8pþüÝ]»î8p[ýúd¢‡üZ·Þ۳璔)©Ùܽè?f~òÉÁƒC£|=(hqΜ+jÖ¼ÿcðN’$pñâÇõ¨T¯ˆ€ˆ€<ž×»øúZ5jئ'qc›6VT8/ˆ‰|I–,³ãÆ=:mšG §V®œ'ÎÜÜÙ¶-‚ƒ2˜@ŽÏŸìÀÒ`K™Ý»WdÊtaÿ~ÄǪ\¹ ´¯W¯­õêݾ14,øø¤37Î`;¸eííÕkcåÊ,—¹¸oß¼ï¿ß×·/b⸷7 iC… ÇæÏç«é|`l$Þ œÞ¸Õ‚vÁ#3;yrcÚÕ¡ƒ±ÇxLØ´§KL/|‹‡ 5öý÷'¾þúœ/¾èÜ“ímÛðòBc]صËq“Íøà:šÃÓ§ûß=ßawçÎsâÇŸûÝwp[œ=»Ó4ÐÉ¥KÃß•ªÇEÀ]»Ü¸a™õLúqâØLÊ-ZXmÛ>®„·ÞkAA}ùÐ!ÇâVƒO™2Ç,˜þÑGgY¹s7>|çÝ™ŽL˜°¾xq[Óܼ‰É$håJ ÞÛ¿¿);$X1¬+YòÄâŬíÝXµ*J…œSëÖùV®ìTˆ¦ÙR»¶ù8õí·y?2i&.XgCD`.®qúÒî¶m‡|úé}†¹¡lÙs~~¦×{æl¦+GŽœöøp2ö¥€tØŒ? Z½ÚÜIÜX÷£ì´2éÊÑ£¨1ûåë{ön[ä/H˜PÚå~ õˆ€ˆ@Ô#à®]vî´]E8Œ˜…‰SGbÕ%güù§½b7Š'ÇÄgŸõŸ0~vñòbqnà’%Lü§HaÖ`ñþõW,(+TX“??9~mڬΛwoXPP䰚ķ|ùÅÉ’õòÂfsbéÒ5yò ‡ÆÕ8¾`Áêܹwvì¸4]:t 9{z÷žýå—›kÕÂÖ²µQ#$Ôš¼y1êðšöÑG¡qÃE…e}°T¢ ëv×+F…û¨-N–ÚŒ|î¹€)Svuî¼"[6ô“©gÚ›oniØpiš4«e±‹o‹ýÞ}÷3ô´µ~}ünf]Ž’ˆ€ˆ€D|Fû÷ÛÅ‘)¬wéÐÁ>DŸ‘Ë/ö(:@²øµm‹° h¶#a5Á ¶#Jà¢EÖíÛ|Å:ÖÆ­)\xm±bf$þ“&!;p$™,°õkÙòÔêÕ'—,9åãsh̘]:±e{óæhSæÌ† [ê×g‘ŠùÈZ`¾=<~<>#ÞYù‹þ`­Ìæzõ®‡¾{È·Jªõk׎Ȧž€Y³4›ëÖÅÄ& |dTBÍøŒèØQX®ëœ¤}ïÃ8¿c‡ÿèÑÆeæ1Q`m8ž¢èƒT·D@D@D áŽïÎb£¦‘ɱby'Jtiöä¥ëçÎm®S'´ZOXD@D :p×.k×Ú›‰ÆŒñü6Ì>b:ôóÑiä꫈€ˆ€ˆ@t$ð/í‚MeâD‹©õêy~å¥Gë‰4UDLJ«>‹€ˆ€ˆ@ $nŸQ d !‰€ˆ€ˆ€D1J»°kš-6Ѿz*" " "n´KPEÔ76E;‰]2,‚Ù´)ܵ?¾NoØ`"ñ;‰ýD;;t RÜãkT5‹€ˆ€ˆ€D:wíÂÁ>Dv©TÉ"x[—.v÷8Ìç§Ÿ,ÂÓ eþüHï°ÝkgÎlmÜØu‡0am·5jD(ý(Ñ?uBD@D@Dà±p×./ZæÌŽŒ~ï=û‚¸ºë×ÛuêØ!^"=éd”—›œGxy]ã ÈàtlÖ,6<ß&*°’ˆ€ˆ€ˆ@Œ&ày½K¶lv,]ÇÊ‚ É”ÉzíµC#ˆ}ÒÐ'Ÿp â-sxê*(hØsÏEn¯Ôºˆ€ˆ€ˆ@Äp×.è'|Ë;ïØ} ­YCÂA­[GL¯BoåΣӧŸß½{¿~©hÊqVâv:§$" " "ðp×.ûöY;Ûku'O¶0"±Þ…ƒ‡·nµ ´úõ‹rH|«Vå$Å(×-uHD@D@Dàñðà3"x.ªå·ß,Öí’0Ãp˜Ñ?Ø xÑ1Q*±Õhþ?\;y2JõJx|¢w|vJ™4éñÑQÍ" " " Q€»vḢfÍ샣=¾Z¶´°Ê(„JT{Šêˆ€ˆ€<9ܵ˒%ARX×âñÕ½»}໦•D@D@D@D R¸kv±ÕèÖ­û½"¥£jTD@D@D@ ½×»èŠ€ˆ€ˆ€I’$>>>NæâÅ‹øá‡eË–=Ú§Û«W/Zß³gSíÙ³g³fÍš'OžU«V=Ú¶Üj{çw–.]Þ&öîÝÛ»woîºtéÒ´iÓ6oÞÞT^D@D@"€»vY»Ö*TÈ>vqÞ<+aÂîíßoU­j}ýµÅz—K(’“'O^½zõôéÓ§8 Ò>¦à|PPЕ+W˜zOŸ0nÜ8@1ò¯ÇÔ»qãÆÂ… Éä+ÓUôx¿…',8ݾ}›œÀÀ@*¡¶{G@[£ÚsçÎqaêá:cj8sæŒùÖ9¹š¦©mÅŠ´ÞÏS$œí۷ׯ_ÅÀpnÞ LÔCm¦ÔÀG ÐCZ!QU·nÝ(pÙet±bÅþúë/s  .^¼Hª29ÇŽ£ÿô>»Ž®yóæ9rä ‡ÂåË—7:FID@D@¢Ï>£Ã‡í˜.yóš™Þ¾®^Ý>̨U«ˆ]Ó¦MéÜ—_~™4iR.˜†™°¹ÀªQ±bE.°¬`óàAÀ{úôéMç>üꫯN:•k$BñâÅÍ ‡j 4hЀ|ðÁK/½”¸{÷$¾}å•W&MšÄ¦4ÁúõëŸzê©?þ˜œ7¢-ræÌiª]·n©YÀ]h2GŽéV+ ÂW¯½ö–!cóhÖ¬9ôö­·ÞBlÑÛ‚ >÷Üs|$Á‚H.^|ñEº:hÐ §N2«W¯NrÊ–-'NœxñâÅŠk̘1äÐU dÈá»ï¾s5ÏéÔ°hÑ¢ *0‡W)‰€ˆ€ˆ@ô!àY»°™¨pa«fM{UW´¨…6Àmqƒûûï¿cÇŽM{ô2[¶lXVžþù† úùù½üòË›6mÚ²e _¡ üýýŸyææc ïÞ½ 1eʧ£Ë—/§^“ÃuÏž=¹À2Q«V­{ÇCÍŸ~ú)w¡*V®\I¸q㢢¸øüóÏiÚÜÒºukTŶmÛœji´K—.µ eU¸´°$9-RröìÙ'N¬[·néÒ¥± tèÐW‹±c§¡$Ý6ŠÄ5Á킇L:9sfÞ1¥J•Š,LÿûßÿPK4Gͮ͹2iÒ¤ÉѨm0âþ¸Ô’ˆ€ˆ@t%à®]˜Ëœ¥o¾iŠ©ÿë]P3ž&úÇ8òäÉ“ÿúë¯Fm`nÁÂŽ;v`œ`õ†É™0a®]»Ð.«W¯¦0nl®«[ŒÉÛÛÛLê\3Ù>üÞà‚I—.]Ñ¢EæÛo¿ýö³Ï>ãk ‚ÆdÒtÌ!~8¸“cÇŽE|˜.Ý[-ZBŸ±¯Ð%s F H¨%„=ǨãëëËp0#̓»…Ñ«=⌠Ví0d.ú÷ïŸ?~ºG[|œ;w®ñþìܹÓh|a«¸À®síÒ¸qã#GŽ<Æç§ªE@D@Dà1p×.„×oÒÄÊŸßÊ™ó_«[Xp’"…õãC/B©2mÚ´?ýô“QÌÜ,(Á/ƒã&K–,¸EXð‘7o^¾Â…”:uj¼-3gÎä:wîÜÏ>ûl¦L™ *„4?~<~б€wÆŒ4Õ¢E ì(ø’H¡-àÍ•+·à2]ãFôP™2eŒ.Á„}…JèM›•¹ˆ‰üeè V܆…ˆ±P3 ã ßÖ«W¯dÉ’T‹; 7ž)H·i—þïãp©`iÂx (€¡…:§OŸNý}úô1£GÆ …”É—/¦©!C†p Ú mW¥Jî‚›Ó WŸÑœ9sj×®z‹¸Ç©–D@D@DàQðà3ÂŽÀj âçº&\E³fY#FXw׃>ŠÆï[VŒØ?êÔ©c¬$ŒÆ 5jÔ¬Y³˜ìGŒ1yòdœ#ÌÙ¬A9~ü8ß’ø–Iû–˜µk×’ƒk†õ.˜4L=hšZ° Q0ð8¨“[ŒA…ÅÂÜ‹•µ4pà@³ÕiE+mY(ƒÉÄm¬©‡NÒyŠ!/L&²ÐU\TH"ª¥BÖç # ëZÐ:ûY2mYäs;«XP6Œ·]b½ ‹~@anávž+pܶ;•*Uʘaè?²©S§Ný)ªxÔ<¯wyÔ­³Ë5árB‘Ö%D’³Rç‰A¥Š€ˆ€ÄÿÒ.l".[–E÷{á6:~<"F~=8aÌÀÕíEÛ6@„qv€³ èœmØ®#sÝ(îìCWÇE@D@žDQ×îò$> YD@D@Dà¿H»ü!}/" " "•xÐ.çÎY7Z6üÓMœ6ëׇ¼î®1¸A°8âSK" " " Q›€»v!î<Ás ªÂÁ‘iíÄž£§Ÿ¶’$±ó‘5™ˆžbÂÓ)‰€ˆ€ˆ€ˆܵ ÁÏfÎä@‹ƒ ãÇAD0ý2e8Ð'ˆÁ…°³‘аšˆ’<¯w™;×Ê;äLºM|×,Y8È>Òèž·qXÄÈçØ ´<Æ6Tµˆ€ˆ€ˆ@´"àY»°À…ƒÃʇ$⢂5cF;B]„%öúrR´K„WC" " "õ ¸k—­[­úõ­]»ˆßjýðƒÝNN™’è®ÄµÒ¤ùgLÄŒ¨kóçϘ¶ÔŠˆ€ˆ€ˆ@Ô'àÁî2j”}t+sÍÃH–.]ìµ/¼8„çÎaø9Õ(B›Tc" " " Q˜@4ˆïÒ¶mÛ( P]ˆPîÚåêU‹Å.—.Ù¯ B^Ätqr¸PÈ"à~žQõêöaF/¾èùE”—dÉ"t«QdqQ»" " " Q“@4ðEMpꕈ€ˆ€ˆ@¤v‰ìjTD@D@Dà xÐ.sç¯\yC™2>'N\ujݱã|Íš›Ê•óÙ»÷Â6Óo+Q¢DÕªUkÕªU¦L™Ö­[çA“¿¿Ÿ>}îs÷ܹsK•*Õ©S§ÐÊ,_¾¼U«V§OŸ~Ð.X«V­Z°`Á­[·¸Ý(" " ƒ€»vñ÷¿ÜºõŽîÝwuê´ûï¿W˜&¸Ô²å޾}÷ ´ÿر+£¯Î›7o2‘Ož<™w7Øðm«ææÔ©Sg̘±pá“'O’søðáiӦ͜9Ó‰%³eË–I“&ññÔ©S †½{÷"8 €kr†^¯^½Ù³gûúúÞ¾}›œ¯¿þº}ûöŸ}öYïÞ½ëׯ?}úô 6ܹsgΜ9TEj0qö6nܸuëV¾âzܸq”4u:©]»v… öÈÄÏÏoÙ²e¯¿þzêÔ©C™Ë—/£3¦L™²dÉçÊdÉ’…VLÇB1^ù Ÿœ;vÀ„d˜Ü›@”/_¾3gθ~µÿ~:`Æ«$" " ‘BÀ]»\ºt“ר±‡ \[½ú&Ó§‘#½ûî”%ÖoÝz.Rzù0.]º´hÑ¢Lí-Z´˜Çé–U²dI¬ˆ•òåËW«Vm×®]5jÔ;Z-RþdÕ¨ˆ€ˆÀNÀƒÏ(0ðê°a†?è ágöŠA¬Þ=t(úEÕÅ­ƒÅyqôèQ–°``“D Œ•ÀBrºuëæ*/={ödÖGܰœÅ@Ö—¸ÚcvîÜÉÊt€Š%·´eÞb\aI ¢Åã.Fމz`m fŠuìØ‘jYX³hÑ"§¼QÕ‰è)±,³·Ó=¤E+¸¨ëaÆQ9b YC&cÄQ…4áºÿþÜBŸM­«W¯æ#wÑÊßÛýÉ‘#zËùŠá„¶‚ø ÿW¤á‹€ˆ€D$wírëÖÛ·C<7oÞ¾qÃ~‘éô‰Ìˆìß“ÙÆ’råÊEîØÍJ^×]H¸Šä-ŠÜ‡¢ÖE@D@ à¦]îÌŸœUº]ºìöøjÛÖoäȃW®h©¦þxD@D@D@"‡€»vY¼øª¥oß}_Ý»ïž0Á_Ú%rž•Z¸Çî"$" " " "¥ xX«K‰%ëMžè$„ŸåJÌ‘Ç5B[„õõq5©zE@D@D@¢6wí‚L©[×úãë矉`f÷%Ï>keÉbeÊd}ò‰µxqÄ ˆHhìõ%ž}Ä5©–D@D@D@¢6wírô¨µp¡Ýe­½õ–}Á6ƒ… "mZB˜Dè€ ,ÈÖÜmR‰€ˆ€ˆ€Daž}FÙ³³ÉòöþWÇ›5³ªU³"ø\a¶ ›S{”D@D@D@D÷ÆwáA› G¿÷Þ?ˆˆPÏÁÆC‡F44Žq-p~DwE퉀ˆ€ˆ€DîÚ% €“-ÃΟo¹œ*hg•*ÑkuáÃyË&ľ’ˆ€ˆ€ˆ€x°»°“ˆàòE‹ZyòX«VýƒhÍ ×§Øñ#ç$s”1'&>Æ6Tµˆ€ˆ€ˆ@´"ày½ n£^×âÚþýû9…'´“£guVD@D@DàÑp×.Û¶Y³fÙ[x-X`{ŽÌ‹k–îâ½Ásýú£i[µˆ€ˆ€ˆ€ˆ@x ¸k—I“¬ªU­† ­ Ü_dÖ¬iõêÅÁÅámEåE@D@D@DàÑp×.è’  ;¨®Çñvϳîüsªô£é„j0ð¼Þ%Œ7«˜ˆ€ˆ€ˆ€D0ÚeË«E «yóz²v­í-âµ~}X»wöìÙÞlXRGJÀ]»ìÞm•)cµooÕ¯oåÎm7uð õÙgöQÆYéÒÙ¡_Â’Ð.Y³fÆ=J" " " "ðè¸kT÷ÈkÊëÏ?C´K¼xÖÎÖöíV¶lîܧ'³fÍ*[¶ì£ëªj{Î0H:t°&´ßI,ÝM”ÈÖ1É“[9rXûö…•š··w¡B…Ο?ÖTND@D@D@þ‹€»Ý¥²kWÈMæi??+v윿ÿÇ9Ò‹-*Z´è96&)‰€ˆ€ˆ€ˆÀ#"à®]Nž´ƒ»àJŸÞªWÏnäøqë‡8WÈ>% kVÛsÆ4f̘bÅŠ…±°Š‰€ˆ€ˆ€ˆ@XxØg´c‡}òâÈ‘!1è8PÚÇÇ1Â~mÝ–:í2¿ýöÛ¡C‡ÂzƒÊ‰€ˆ€ˆ€ˆ@<®ø.ׯ_߯ùJ" " " "ðH üK»0·m[ÛCIJÜdÉÜ_d²€·dIëÌ™GÚU&" " " a&ànw9vÌv ±#š%ºn/2±¤ìß%Ž˜óUPD@D@D Fx\>£Iƒˆ2¤]¢Ì£PGD@D@D@Â@@Ú% TDD@D@D Êv‰2Bi—0@R(C@Ú%Ê< uDD@D@D ¤]ÂIED@D@D@¢ i—(ó(Ô0p×.GݰaÃ&%ˆ2Ö¯_ðàÁ›7o¢mþ¥]nß¾=yòäöíÛ:t’ˆ€ˆ€ˆ€D }úô™8qâ¹sçܵKì4*"" " " ‘I@ë]"“¾Ú/i—ðSyÈ$ í™ôÕ¶ˆ€ˆ€ˆ@x H»„—˜Ê‹€ˆ€ˆ€D&i—Ȥ¯¶E@D@D@ÂK@Ú%¼ÄT^D@D@D 2 H»D&}µ-" " "^Ò.á%¦òјÀ72gÎòG÷?_ýõ˜1cjÔ¨á:0¾ŒÆã C×/]ºD„Ê0 S‘-[¶PnݺuÕ«W?pà@˜î ŽŒIÉÚµkwìØ1Œ·<¾b.\Ø·o_XêÿðÃW¯^í”ìСCîܹÃr#e¼¼ÜGzëÖ-/¯Ç_ c *&"üO)8‰…}åŠ=kÒª¢W¦ÀÕ«W™Ëé6·›ÎÐ×?~œvßR0ÏŸ?Ï-®} :tˆÚœªÈ¡6 ']ºt|åt˜(äUªT£“Éã ˜)@?áãöòêœ#Ç?º‡ü)xy¹xÑ~FÁC8¿{÷…“'í>\¸pãÖ­z.]ºyõªýøÎž½Î¸ùhÊŸ:e—ä®Ã‡/;…]aêZb$i—ùX5¨ÿ&àh¦æ­´iÓV¬Xñ¯¿þš1c7ÇŽÛLo˜dr§¢E‹ºÎXÌÊiÒ¤©_¿~êÔ©[·nMIÓdãÆ©„ârPälܸ1W®\Y²diÙ²eÞ¼yɹxñb§N²eËÆÇµk×:}]´hQ:uÌG¾2s*ÝûóÏ?¹˜={vþüùóäÉS°`Arºté’)S&*/S¦ ÊÃu̘@räÈA%… ž5k_aa>žíN/^œ!¿òÊ+LºLöØŠ)Bé3³5ÂeðàÁ%K–¤!ÒøñãË–-›={v !Bå… ¢rnY±bÅš5k€Y¡B"v3‘;vŒ2åÊ•ã.úfÔhÅÜeºôþûïóN´qò v“Þ}÷]çšáœc0kÕªUÓ¦Mù ÉHs2d¨\¹²i®R¥JäYPÿرc dÌ9<88ÐCrx|øpg¨Tˆ~2úû Ó*6¦m£o°j|ÿý÷ –)–\0OÏ›7ë† –/_ž‹ªU«ñ4wîÜÏ>û Y@&Ó6j‰1ý/X°€zõñÇsñÖ[oñÎIiÜHë!Š+Æ]ô 5ƒR¡$ˆÚ(†¬1Ì;=Ϙ1#¢ÁØ™¦M›–4iRg,Ü‚ÒÚ¶möÅãà«jÕªÑ.¨œÑÑJÊ”)Ó§OÏ0é#å«^½z5oÞÈ@ã+l!XY^|ñEÓ¥c¯BâÔ«WaÎG¸1v£SiÛ¶mMà`¶A_¾öÚk®Úeذaß|ó wa_áiR ^¼x¦5Àޗר+‚Š]Gf•R¥||}Ïĉ3;ÊĉþÙ³¯D¬òUíÚ›[´ØQ¥ÊÆ1clÙwåʭĉz{Ö¯¿iÀ€ýÁýÙU¿þf.’&]œ7WoϘPº´ÏåË!šÉiQ"# H»ÄÈǪAý7G»`ià—16îÁä`&0ó-³1 ¬ZµÊü¾w²ã?þ0ù‘8qbóCׯœ9s:wî̯ðnݺµhÑ©aŠÑ:­ƒ•ÜʌþÅ_Ìœ9Ó©–)Ó Ê1ñ¿ÿý· ¢ …Ÿhܸq&<,ˆ!fDÓÉ­[·¢¨\½HäÓÔ ‚‰‚]bæ1n&Ô_~ù…¹Ùh‘n;þ©çž{ŽLÌBFP‰³-ÂDŽô5jG fŒþ0æo¯ 2¸+_¾|Ží¯ð¶`Ÿà.83:cY1÷öíÛ—æÑâÅ‹ùH éiÓ¦ ÍGìCˆ3pZá¡ ¼Ða4÷óÏ?›2ˆ†¬Y³"#a2wa¡ÏP2”Ä3òöö¦:Cy‚ C_!1¤Q'ÖÔmQlóf[+°¾à®rzÈóeÔæ#^6šX¶l™ùÛà)`¾ru<±´…üT©–lÚtzîÜc¨œK}4í2f̡͛Ï"PúôÙ›8ñ‚®]ýV­ Ê›×v0uë¶»X±u{÷^øê«™þþ—W® :~üª—×hîúùç…¦éåËOV®¼Ññ%9ÝÓ…ÄHÒ.1ò±jPÿMÀÑ.LÛLŸ¬wáÖO¸jf_,+µjÕÂ7TªT)gö¢$Ú`šAñ`9ÀØ€·‚_êÆX‚èAÁ _˜5µOÇG}ÄÓ*S;S2Öæ6WU„4agÂÆ•Ã/x®™JÍ¢ 4טø–©”zPØ9°ðÎ4ìŒsΔºuë2“˜YYÃÁ m´ fzÎìkV˜R!*ÄY²óÉ'ŸIÆZÀ0¸Y‚쀕c 'ŒµaFôÞ{ïñn´ ‹ZPTôÜu“:ú€^¡“¸‹å®”7Ú¥k×®S§NEÁ ±è¨3€ËiåÊ•Žvá‘Qžž`\á ²vÇ`dŒŒ”‡™ ‡)€zCcªBòX1_M™2¥}ûötÛÑ.Ã1פI,g< \Ex‘€ì<ý)R¸jzŽÇÊTËSC³r–]²d &cs>#®G:T¤ÈÚñãýûöµW¿ÿþ @¨–2e64h°uÈyó®jÓÆ–G2,çýùç'^¿~{Ë–sŸ|2«k×ÝõëoiÖl{ýú[ù*Aï#Gl¿~(iWÔºŽÙ¤]böóÕèB%àª]úõëg¶º ]ð/páêQÂS`~y;*„ü(Ç"bj7s§¹ ³ŠYÂäÊ,Èò×å,•@â0ÕáÁºÀ/r†qî˜Ä<ÊäÍTÊ,ÎÇ7Þxƒ_ùüúÇN€†0‹aÍâ Sž ›z˜ ]÷I!¡J”(a¤ºÁÁÌè¦NR‚ » ߢT_˜8raòäÉf˜LüŽvAŠ¡i0ØÐ¨1ÕíbTˆcwÁ>„Èpêä+³lÈ ™ÆÓd ÚÅ8¼qØœŒˆtvgÑ ªÈÑ.ÀôÂ; ƒJ„ Íò ´ &Ækt -òD Šu aá˜ÊP'õÔðV­|Í·O=5, du—.»òçgÝ1ë{›¥0Ÿ>ëða[¤b¶)^|Ý… ZïâÊ[×1–€´KŒ}´Øý ߉ɛǸ-¸FÁá,ŒÀƒ!„u*ø;pú8ubcÀÖ‚G#V¬XÓ§Owòß|óMftfMŒFÐXIŠÅ…ªÌšVß²À]Âï{·~ò•³ùµñÿvÎ¥( £a±wé¦ if ÙCÚì +°µ°²La#XØÄF¦±°,lD°q‚X†$à‰7<%M`‚cÎ&“çû¹ï™/÷gBC ªÐ1Ýn·( îÊqƒGš0!?ôSÌ"M…ç„›Xâ#ˆD:G*Š€{!½ƒ£È%%Êd¢‚:a‚b T%(áÉàµ%xMÈo -¸yh´#2RÁ6wn¼2œÃ*’Zb3‡Áx88c^dºbvº5€G=Q–eäá¢ZRQI¼%²Ã±Ô%¬"ˆ ü+„¢?*„9ó<'ß?Z“s¯×C`ÅS^v°¤Ÿ8˜ û‰4á*c•ÔŽ¼#,Ø‚+µ“NϽÝFËÝÝ[dÝrŒFQÿ\ež_‡÷§§/Óéz‰Á`6JÇññÓááÕÙÙzìxüøþ¾Ò¾ÏÏ“Éël¶®íßX×øgÔ.ÿì u;D€Ü â[ㆪˆƒg .l¸oh;ʬ~ D îšÜ]¤é æAH5YŠv…Í‘HË™×|¾üzÐÎêšF*‰B¾¤OLú+ÕCqM·Ô!ùÈ@.HˆY,–LÛ>) ¨]vèð=%@̈Ž­›ÇcAYP»Ýæ?-U£lµ‡H†ít:xV6öNL‡\–e$¬Ó2LâÔÏ #,ï÷o²ìâààò—^­ÖùÉÉwTSXi§*P»T€æ H@€j# v© ½ K@€$P€Ú¥4‡H@€$PµKmè]X€$ Ô. 9D€$ Ú¨]jCï€$  T °Ö.¾I@€$ ¦ø°L¼2%(Z¸IEND®B`‚maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/site/site.xml000066400000000000000000000035401330756104600273340ustar00rootroot00000000000000 maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/000077500000000000000000000000001330756104600256575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/java/000077500000000000000000000000001330756104600266005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/java/org/000077500000000000000000000000001330756104600273675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/java/org/apache/000077500000000000000000000000001330756104600306105ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600317165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/000077500000000000000000000000001330756104600333775ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600351445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/java/org/apache/maven/pluginsreport/000077500000000000000000000000001330756104600364575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefireSurefire1183Test.java000066400000000000000000000111751330756104600422700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/* * 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. */ package org.apache.maven.plugins.surefire.report; import org.apache.maven.doxia.site.decoration.DecorationModel; import org.apache.maven.doxia.siterenderer.Renderer; import org.apache.maven.doxia.siterenderer.RendererException; import org.apache.maven.doxia.siterenderer.SiteRenderingContext; import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink; import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.shared.utils.WriterFactory; import org.apache.maven.shared.utils.io.FileUtils; import org.apache.maven.shared.utils.io.IOUtil; import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.io.Writer; import java.net.URL; import java.net.URLDecoder; import java.util.Locale; /** * Prevent fom NPE if failure type and message is null however detail presents. */ public class Surefire1183Test extends AbstractMojoTestCase { private Renderer renderer; @Override protected void setUp() throws Exception { super.setUp(); renderer = (Renderer) lookup( Renderer.ROLE ); } private File getTestBaseDir() throws UnsupportedEncodingException { URL resource = getClass().getResource( "/surefire-1183" ); // URLDecoder.decode necessary for JDK 1.5+, where spaces are escaped to %20 return new File( URLDecoder.decode ( resource.getPath(), "UTF-8" ) ).getAbsoluteFile(); } /** * Renderer the sink from the report mojo. * * @param mojo not null * @param outputHtml not null * @throws RendererException if any * @throws IOException if any */ private void renderer( SurefireReportMojo mojo, File outputHtml ) throws RendererException, IOException { Writer writer = null; SiteRenderingContext context = new SiteRenderingContext(); context.setDecoration( new DecorationModel() ); context.setTemplateName( "org/apache/maven/doxia/siterenderer/resources/default-site.vm" ); context.setLocale( Locale.ENGLISH ); try { outputHtml.getParentFile().mkdirs(); writer = WriterFactory.newXmlWriter ( outputHtml ); renderer.generateDocument( writer, (SiteRendererSink ) mojo.getSink(), context ); } finally { IOUtil.close ( writer ); } } public void testCustomTitleAndDescriptionReport() throws Exception { File testPom = new File( getTestBaseDir(), "plugin-config.xml" ); SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom ); File outputDir = (File) getVariableValueFromObject( mojo, "outputDirectory" ); String outputName = (String) getVariableValueFromObject( mojo, "outputName" ); File reportsDir = (File) getVariableValueFromObject( mojo, "reportsDirectory" ); String title = (String) getVariableValueFromObject( mojo, "title" ); String description = (String) getVariableValueFromObject( mojo, "description" ); assertEquals( new File( getBasedir() + "/target/site/surefire-1183" ), outputDir ); assertEquals( new File( getBasedir() + "/src/test/resources/surefire-1183/acceptancetest-reports" ) .getAbsolutePath(), reportsDir.getAbsolutePath() ); assertEquals( "acceptance-test-report", outputName ); assertEquals( "Acceptance Test", title ); assertEquals( "Acceptance Test Description", description ); mojo.execute(); File report = new File( getBasedir(), "target/site/acceptance-test-report.html" ); renderer( mojo, report ); assertTrue( report.exists() ); String htmlContent = FileUtils.fileRead ( report ); assertTrue( htmlContent.contains ( "

Acceptance Test

" ) ); } } Surefire597Test.java000066400000000000000000000120731330756104600422160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import org.apache.maven.doxia.module.xhtml.XhtmlSink; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger; import org.junit.Test; import java.io.File; import java.io.StringWriter; import static java.util.Collections.singletonList; import static java.util.Locale.ENGLISH; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.CoreMatchers.containsString; import static org.apache.maven.plugins.surefire.report.Utils.toSystemNewLine; /** * Prevent fom NPE if failure type and message is null however detail presents. */ public class Surefire597Test { @Test public void corruptedTestCaseFailureWithMissingErrorTypeAndMessage() throws Exception { File basedir = new File( "." ).getCanonicalFile(); File report = new File( basedir, "target/test-classes/surefire-597" ); ConsoleLogger log = new NullConsoleLogger(); SurefireReportGenerator gen = new SurefireReportGenerator( singletonList( report ), ENGLISH, true, null, log ); StringWriter writer = new StringWriter(); gen.doGenerateReport( new SurefireReportMojo().getBundle( ENGLISH ), new XhtmlSink( writer ) {} ); String xml = writer.toString(); assertThat( xml, containsString( toSystemNewLine( "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "" + "" + "
TestsErrorsFailuresSkippedSuccess RateTime
11000%0
" ) ) ); assertThat( xml, containsString( toSystemNewLine( "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "
PackageTestsErrorsFailuresSkippedSuccess RateTime
surefire11000%0
" ) ) ); assertThat( xml, containsString( toSystemNewLine( "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "
ClassTestsErrorsFailuresSkippedSuccess RateTime
\"\"MyTest11000%0
" ) ) ); assertThat( xml, containsString( toSystemNewLine( "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "
\"\"test
java.lang.RuntimeException: java.lang.IndexOutOfBoundsException: msg
\n" + "
surefire.MyTest:13
" ) ) ); } } SurefireReportMojoTest.java000066400000000000000000001046761330756104600440050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.io.Writer; import java.net.URL; import java.net.URLDecoder; import java.util.Locale; import org.apache.maven.doxia.site.decoration.DecorationModel; import org.apache.maven.doxia.siterenderer.Renderer; import org.apache.maven.doxia.siterenderer.RendererException; import org.apache.maven.doxia.siterenderer.SiteRenderingContext; import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink; import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.apache.maven.shared.utils.WriterFactory; import org.apache.maven.shared.utils.io.FileUtils; import org.apache.maven.shared.utils.io.IOUtil; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.CoreMatchers.containsString; import static org.apache.maven.plugins.surefire.report.Utils.toSystemNewLine; /** * @author Allan Ramirez */ public class SurefireReportMojoTest extends AbstractMojoTestCase { private Renderer renderer; @Override protected void setUp() throws Exception { super.setUp(); renderer = (Renderer) lookup( Renderer.ROLE ); } public void testBasicSurefireReport() throws Exception { File testPom = new File( getUnitBaseDir(), "basic-surefire-report-test/plugin-config.xml" ); SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom ); assertNotNull( mojo ); File outputDir = (File) getVariableValueFromObject( mojo, "outputDirectory" ); boolean showSuccess = (Boolean) getVariableValueFromObject( mojo, "showSuccess" ); File reportsDir = (File) getVariableValueFromObject( mojo, "reportsDirectory" ); String outputName = (String) getVariableValueFromObject( mojo, "outputName" ); File xrefLocation = (File) getVariableValueFromObject( mojo, "xrefLocation" ); boolean linkXRef = (Boolean) getVariableValueFromObject( mojo, "linkXRef" ); assertEquals( new File( getBasedir() + "/target/site/unit/basic-surefire-report-test" ), outputDir ); assertTrue( showSuccess ); assertEquals( new File( getBasedir() + "/src/test/resources/unit/basic-surefire-report-test/surefire-reports" ).getAbsolutePath(), reportsDir.getAbsolutePath() ); assertEquals( "surefire-report", outputName ); assertEquals( new File( getBasedir() + "/target/site/unit/basic-surefire-report-test/xref-test" ).getAbsolutePath(), xrefLocation.getAbsolutePath() ); assertTrue( linkXRef ); mojo.execute(); File report = new File( getBasedir(), "target/site/unit/basic-surefire-report-test/surefire-report.html" ); renderer( mojo, report ); assertTrue( report.exists() ); String htmlContent = FileUtils.fileRead( report ); int idx = htmlContent.indexOf( "images/icon_success_sml.gif" ); assertTrue( idx >= 0 ); } private File getUnitBaseDir() throws UnsupportedEncodingException { URL resource = getClass().getResource( "/unit" ); // URLDecoder.decode necessary for JDK 1.5+, where spaces are escaped to %20 return new File( URLDecoder.decode( resource.getPath(), "UTF-8" ) ).getAbsoluteFile(); } public void testBasicSurefireReportIfShowSuccessIsFalse() throws Exception { File testPom = new File( getUnitBaseDir(), "basic-surefire-report-success-false/plugin-config.xml" ); SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom ); assertNotNull( mojo ); boolean showSuccess = (Boolean) getVariableValueFromObject( mojo, "showSuccess" ); assertFalse( showSuccess ); mojo.execute(); File report = new File( getBasedir(), "target/site/unit/basic-surefire-report-success-false/surefire-report.html" ); renderer( mojo, report ); assertTrue( report.exists() ); String htmlContent = FileUtils.fileRead( report ); int idx = htmlContent.indexOf( "images/icon_success_sml.gif" ); assertTrue( idx < 0 ); } public void testBasicSurefireReportIfLinkXrefIsFalse() throws Exception { File testPom = new File( getUnitBaseDir(), "basic-surefire-report-linkxref-false/plugin-config.xml" ); SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom ); assertNotNull( mojo ); boolean linkXRef = (Boolean) getVariableValueFromObject( mojo, "linkXRef" ); assertFalse( linkXRef ); mojo.execute(); File report = new File( getBasedir(), "target/site/unit/basic-surefire-report-success-false/surefire-report.html" ); renderer( mojo, report ); assertTrue( report.exists() ); String htmlContent = FileUtils.fileRead( report ); int idx = htmlContent.indexOf( "./xref-test/com/shape/CircleTest.html#44" ); assertTrue( idx == -1 ); } public void testBasicSurefireReportIfReportingIsNull() throws Exception { File testPom = new File( getUnitBaseDir(), "basic-surefire-report-reporting-null/plugin-config.xml" ); SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom ); assertNotNull( mojo ); mojo.execute(); File report = new File( getBasedir(), "target/site/unit/basic-surefire-report-reporting-null/surefire-report.html" ); renderer( mojo, report ); assertTrue( report.exists() ); String htmlContent = FileUtils.fileRead( report ); int idx = htmlContent.indexOf( "./xref-test/com/shape/CircleTest.html#44" ); assertTrue( idx < 0 ); } public void testBasicSurefireReport_AnchorTestCases() throws Exception { File testPom = new File( getUnitBaseDir(), "basic-surefire-report-anchor-test-cases/plugin-config.xml" ); SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom ); assertNotNull( mojo ); mojo.execute(); File report = new File( getBasedir(), "target/site/unit/basic-surefire-report-anchor-test-cases/surefire-report.html" ); renderer( mojo, report ); assertTrue( report.exists() ); String htmlContent = FileUtils.fileRead( report ); int idx = htmlContent.indexOf( "testX" ); assertTrue( idx > 0 ); idx = htmlContent.indexOf( "" + "testRadius" ); assertTrue( idx > 0 ); } public void testSurefireReportSingleError() throws Exception { File testPom = new File( getUnitBaseDir(), "surefire-report-single-error/plugin-config.xml" ); SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom ); assertNotNull( mojo ); mojo.execute(); File report = new File( getBasedir(), "target/site/unit/surefire-report-single-error/surefire-report.html" ); renderer( mojo, report ); assertTrue( report.exists() ); String htmlContent = FileUtils.fileRead( report ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "surefire\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "" + "" + "\"\"" + "" + "\n" + "MyTest\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( ">surefire.MyTest:13" ) ); assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest.html#13" ) ); assertThat( htmlContent, containsString( toSystemNewLine( "
"
        + "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n"
        + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:24)\n"
        + "\tat surefire.MyTest.newRethrownDelegate(MyTest.java:17)\n"
        + "\tat surefire.MyTest.test(MyTest.java:13)\n"
        + "\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n"
        + "\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\n"
        + "\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n"
        + "\tat java.lang.reflect.Method.invoke(Method.java:606)\n"
        + "\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\n"
        + "\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\n"
        + "\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\n"
        + "\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\n"
        + "\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n"
        + "\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n"
        + "\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n"
        + "\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n"
        + "\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n"
        + "\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n"
        + "\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n"
        + "\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n"
        + "\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n"
        + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:272)\n"
        + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:167)\n"
        + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:147)\n"
        + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:130)\n"
        + "\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:211)\n"
        + "\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:163)\n"
        + "\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:105)\n"
        + "\tCaused by: java.lang.IndexOutOfBoundsException\n"
        + "\tat surefire.MyTest.failure(MyTest.java:33)\n" + "\tat surefire.MyTest.access$100(MyTest.java:9)\n"
        + "\tat surefire.MyTest$Nested.run(MyTest.java:38)\n"
        + "\tat surefire.MyTest.delegate(MyTest.java:29)\n"
        + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:22)" + "
" ) ) ); } public void testSurefireReportNestedClassTrimStackTrace() throws Exception { File testPom = new File( getUnitBaseDir(), "surefire-report-nestedClass-trimStackTrace/plugin-config.xml" ); SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom ); assertNotNull( mojo ); mojo.execute(); File report = new File( getBasedir(), "target/site/unit/surefire-report-nestedClass-trimStackTrace/surefire-report.html" ); renderer( mojo, report ); assertTrue( report.exists() ); String htmlContent = FileUtils.fileRead( report ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "surefire\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "" + "" + "\"\"" + "" + "\n" + "MyTest\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( ">surefire.MyTest:13" ) ); assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest.html#13" ) ); assertThat( htmlContent, containsString( toSystemNewLine( "
"
        + "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n"
        + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:24)\n"
        + "\tat surefire.MyTest.newRethrownDelegate(MyTest.java:17)\n"
        + "\tat surefire.MyTest.test(MyTest.java:13)\n"
        + "\tCaused by: java.lang.IndexOutOfBoundsException\n"
        + "\tat surefire.MyTest.failure(MyTest.java:33)\n"
        + "\tat surefire.MyTest.access$100(MyTest.java:9)\n"
        + "\tat surefire.MyTest$Nested.run(MyTest.java:38)\n"
        + "\tat surefire.MyTest.delegate(MyTest.java:29)\n"
        + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:22)"
        + "
" ) ) ); } public void testSurefireReportNestedClass() throws Exception { File testPom = new File( getUnitBaseDir(), "surefire-report-nestedClass/plugin-config.xml" ); SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom ); assertNotNull( mojo ); mojo.execute(); File report = new File( getBasedir(), "target/site/unit/surefire-report-nestedClass/surefire-report.html" ); renderer( mojo, report ); assertTrue( report.exists() ); String htmlContent = FileUtils.fileRead( report ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "surefire\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "" + "" + "\"\"" + "" + "\n" + "MyTest\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( ">surefire.MyTest:13" ) ); assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest.html#13" ) ); assertThat( htmlContent, containsString( toSystemNewLine( "
"
        + "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n"
        + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:24)\n"
        + "\tat surefire.MyTest.newRethrownDelegate(MyTest.java:17)\n"
        + "\tat surefire.MyTest.test(MyTest.java:13)\n"
        + "\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n"
        + "\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\n"
        + "\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n"
        + "\tat java.lang.reflect.Method.invoke(Method.java:606)\n"
        + "\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\n"
        + "\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\n"
        + "\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\n"
        + "\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\n"
        + "\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n"
        + "\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n"
        + "\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n"
        + "\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n"
        + "\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n"
        + "\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n"
        + "\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n"
        + "\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n"
        + "\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n"
        + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:272)\n"
        + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:167)\n"
        + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:147)\n"
        + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:130)\n"
        + "\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:211)\n"
        + "\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:163)\n"
        + "\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:105)\n"
        + "\tCaused by: java.lang.IndexOutOfBoundsException\n"
        + "\tat surefire.MyTest.failure(MyTest.java:33)\n"
        + "\tat surefire.MyTest.access$100(MyTest.java:9)\n"
        + "\tat surefire.MyTest$Nested.run(MyTest.java:38)\n"
        + "\tat surefire.MyTest.delegate(MyTest.java:29)\n"
        + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:22)"
        + "
" ) ) ); } public void testSurefireReportEnclosedTrimStackTrace() throws Exception { File testPom = new File( getUnitBaseDir(), "surefire-report-enclosed-trimStackTrace/plugin-config.xml" ); SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom ); assertNotNull( mojo ); mojo.execute(); File report = new File( getBasedir(), "target/site/unit/surefire-report-enclosed-trimStackTrace/surefire-report.html" ); renderer( mojo, report ); assertTrue( report.exists() ); String htmlContent = FileUtils.fileRead( report ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "surefire\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "" + "" + "\"\"" + "" + "\n" + "MyTest$A\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( ">surefire.MyTest$A:45" ) ); assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest$A.html#45" ) ); assertThat( htmlContent, containsString( toSystemNewLine( "
"
        + "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n"
        + "\tat surefire.MyTest.failure(MyTest.java:33)\n"
        + "\tat surefire.MyTest.access$100(MyTest.java:9)\n"
        + "\tat surefire.MyTest$Nested.run(MyTest.java:38)\n"
        + "\tat surefire.MyTest.delegate(MyTest.java:29)\n"
        + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:22)\n"
        + "\tat surefire.MyTest.newRethrownDelegate(MyTest.java:17)\n"
        + "\tat surefire.MyTest.access$200(MyTest.java:9)\n"
        + "\tat surefire.MyTest$A.t(MyTest.java:45)"
        + "
" ) ) ); } public void testSurefireReportEnclosed() throws Exception { File testPom = new File( getUnitBaseDir(), "surefire-report-enclosed/plugin-config.xml" ); SurefireReportMojo mojo = (SurefireReportMojo) lookupMojo( "report", testPom ); assertNotNull( mojo ); mojo.execute(); File report = new File( getBasedir(), "target/site/unit/surefire-report-enclosed/surefire-report.html" ); renderer( mojo, report ); assertTrue( report.exists() ); String htmlContent = FileUtils.fileRead( report ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "surefire\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( toSystemNewLine( "\n" + "" + "" + "\"\"" + "" + "\n" + "MyTest$A\n" + "1\n" + "1\n" + "0\n" + "0\n" + "0%\n" + "0" ) ) ); assertThat( htmlContent, containsString( ">surefire.MyTest$A:45" ) ); assertThat( htmlContent, containsString( "./xref-test/surefire/MyTest$A.html#45" ) ); assertThat( htmlContent, containsString( toSystemNewLine( "
" + "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n"
                + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:24)\n"
                + "\tat surefire.MyTest.newRethrownDelegate(MyTest.java:17)\n"
                + "\tat surefire.MyTest.access$200(MyTest.java:9)\n" + "\tat surefire.MyTest$A.t(MyTest.java:45)\n"
                + "\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n"
                + "\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\n"
                + "\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n"
                + "\tat java.lang.reflect.Method.invoke(Method.java:606)\n"
                + "\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\n"
                + "\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\n"
                + "\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\n"
                + "\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\n"
                + "\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n"
                + "\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n"
                + "\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n"
                + "\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n"
                + "\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n"
                + "\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n"
                + "\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n"
                + "\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n"
                + "\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n"
                + "\tat org.junit.runners.Suite.runChild(Suite.java:128)\n"
                + "\tat org.junit.runners.Suite.runChild(Suite.java:27)\n"
                + "\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n"
                + "\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n"
                + "\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n"
                + "\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n"
                + "\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n"
                + "\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n"
                + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:272)\n"
                + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:167)\n"
                + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:147)\n"
                + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:130)\n"
                + "\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:211)\n"
                + "\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:163)\n"
                + "\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:105)\n"
                + "\tCaused by: java.lang.IndexOutOfBoundsException\n"
                + "\tat surefire.MyTest.failure(MyTest.java:33)\n" + "\tat surefire.MyTest.access$100(MyTest.java:9)\n"
                + "\tat surefire.MyTest$Nested.run(MyTest.java:38)\n"
                + "\tat surefire.MyTest.delegate(MyTest.java:29)\n"
                + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:22)" + "
" ) ) ); } /** * Renderer the sink from the report mojo. * * @param mojo not null * @param outputHtml not null * @throws RendererException if any * @throws IOException if any */ private void renderer( SurefireReportMojo mojo, File outputHtml ) throws RendererException, IOException { Writer writer = null; SiteRenderingContext context = new SiteRenderingContext(); context.setDecoration( new DecorationModel() ); context.setTemplateName( "org/apache/maven/doxia/siterenderer/resources/default-site.vm" ); context.setLocale( Locale.ENGLISH ); try { outputHtml.getParentFile().mkdirs(); writer = WriterFactory.newXmlWriter( outputHtml ); renderer.generateDocument( writer, (SiteRendererSink) mojo.getSink(), context ); } finally { IOUtil.close( writer ); } } } Utils.java000066400000000000000000000026711330756104600404300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ public final class Utils { private Utils() { throw new IllegalStateException( "no instantiable constructor" ); } public static String toSystemNewLine( String s ) { String newLine = System.getProperty( "line.separator" ); StringBuilder b = new StringBuilder( s ); for ( int i = 0; i < b.length(); i++ ) { if ( b.charAt( i ) == '\n' ) { b.deleteCharAt( i ) .insert( i, newLine ); i += newLine.length() - 1; } } return b.toString(); } } stubs/000077500000000000000000000000001330756104600376175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/reportSurefireRepMavenProjectStub.java000066400000000000000000000033421330756104600460730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/stubspackage org.apache.maven.plugins.surefire.report.stubs; /* * 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. */ import java.util.List; import org.apache.maven.model.Model; import org.apache.maven.model.ReportPlugin; import org.apache.maven.model.Reporting; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; /** * @author Allan Ramirez */ public class SurefireRepMavenProjectStub extends MavenProjectStub { /** * {@inheritDoc} */ @Override public List getReportPlugins() { Reporting reporting = new Reporting(); ReportPlugin reportPlugin = new ReportPlugin(); reportPlugin.setGroupId( "org.apache.maven.plugins" ); reportPlugin.setArtifactId( "maven-jxr-plugin" ); reportPlugin.setVersion( "2.0-SNAPSHOT" ); reporting.addPlugin( reportPlugin ); Model model = new Model(); model.setReporting( reporting ); return reporting.getPlugins(); } } SurefireRepMavenProjectStub2.java000066400000000000000000000023561330756104600461610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/stubspackage org.apache.maven.plugins.surefire.report.stubs; /* * 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. */ import java.util.ArrayList; import java.util.List; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; /** * @author Allan Ramirez */ public class SurefireRepMavenProjectStub2 extends MavenProjectStub { /** * {@inheritDoc} */ @Override public List getReportPlugins() { return new ArrayList(); } } maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/000077500000000000000000000000001330756104600276715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/surefire-1183/000077500000000000000000000000001330756104600321075ustar00rootroot00000000000000acceptancetest-reports/000077500000000000000000000000001330756104600365125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/surefire-1183TEST-com.shape.CircleTest.xml000066400000000000000000000322021330756104600437250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/surefire-1183/acceptancetest-reports junit.framework.AssertionFailedError: expected:<20> but was:<10> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:282) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:201) at junit.framework.Assert.assertEquals(Assert.java:207) at com.shape.CircleTest.testRadius(CircleTest.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [OUT] : Getting the diameter [ERR] : Getting the Circumference java.lang.ArithmeticException: / by zero at com.shape.CircleTest.testProperties(CircleTest.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [OUT] : Getting the diameter [ERR] : Getting the Circumference plugin-config.xml000066400000000000000000000032111330756104600353100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/surefire-1183 maven-surefire-report-plugin Acceptance Test Acceptance Test Description acceptance-test-report ${basedir}/target/site/surefire-1183 ${basedir}/src/test/resources/surefire-1183/acceptancetest-reports maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/surefire-597/000077500000000000000000000000001330756104600320375ustar00rootroot00000000000000TEST-surefire.MyTest.xml000066400000000000000000000057251330756104600363400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/surefire-597 java.lang.RuntimeException: java.lang.IndexOutOfBoundsException: msg at surefire.MyTest.rethrownDelegate(MyTest.java:24) at surefire.MyTest.newRethrownDelegate(MyTest.java:17) at surefire.MyTest.test(MyTest.java:13) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:272) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:167) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:147) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:130) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:211) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:163) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:105) Caused by: java.lang.IndexOutOfBoundsException at surefire.MyTest.failure(MyTest.java:33) at surefire.MyTest.access$100(MyTest.java:9) at surefire.MyTest$Nested.run(MyTest.java:38) at surefire.MyTest.delegate(MyTest.java:29) at surefire.MyTest.rethrownDelegate(MyTest.java:22) ... 26 more maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/000077500000000000000000000000001330756104600306505ustar00rootroot00000000000000basic-surefire-report-anchor-test-cases/000077500000000000000000000000001330756104600403265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unitplugin-config.xml000066400000000000000000000031361330756104600436140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-anchor-test-cases maven-surefire-report-plugin ${basedir}/target/site/unit/basic-surefire-report-anchor-test-cases true ${basedir}/src/test/resources/unit/basic-surefire-report-anchor-test-cases/surefire-reports surefire-report ${basedir}/target/site/unit/basic-surefire-report-anchor-test-cases/xref-test surefire-reports/000077500000000000000000000000001330756104600436465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-anchor-test-casesTEST-com.shape.CircleTest.xml000066400000000000000000000322021330756104600510610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-anchor-test-cases/surefire-reports junit.framework.AssertionFailedError: expected:<20> but was:<10> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:282) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:201) at junit.framework.Assert.assertEquals(Assert.java:207) at com.shape.CircleTest.testRadius(CircleTest.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [OUT] : Getting the diameter [ERR] : Getting the Circumference java.lang.ArithmeticException: / by zero at com.shape.CircleTest.testProperties(CircleTest.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [OUT] : Getting the diameter [ERR] : Getting the Circumference basic-surefire-report-linkxref-false/000077500000000000000000000000001330756104600377155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unitplugin-config.xml000066400000000000000000000031721330756104600432030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-linkxref-false maven-surefire-report-plugin ${basedir}/target/site/unit/basic-surefire-report-linkxref-false true ${basedir}/src/test/resources/unit/basic-surefire-report-linkxref-false/surefire-reports surefire-report ${basedir}/target/site/unit/basic-surefire-report-linkxref-false/xref-test false surefire-reports/000077500000000000000000000000001330756104600432355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-linkxref-falseTEST-com.shape.CircleTest.xml000066400000000000000000000322021330756104600504500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-linkxref-false/surefire-reports junit.framework.AssertionFailedError: expected:<20> but was:<10> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:282) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:201) at junit.framework.Assert.assertEquals(Assert.java:207) at com.shape.CircleTest.testRadius(CircleTest.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [OUT] : Getting the diameter [ERR] : Getting the Circumference java.lang.ArithmeticException: / by zero at com.shape.CircleTest.testProperties(CircleTest.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [OUT] : Getting the diameter [ERR] : Getting the Circumference basic-surefire-report-reporting-null/000077500000000000000000000000001330756104600377645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unitplugin-config.xml000066400000000000000000000031601330756104600432470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-reporting-null maven-surefire-report-plugin ${basedir}/target/site/unit/basic-surefire-report-reporting-null true ${basedir}/src/test/resources/unit/basic-surefire-report-reporting-null/surefire-reports surefire-report ${basedir}/target/site/unit/basic-surefire-report-test/xref-test true surefire-reports/000077500000000000000000000000001330756104600433045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-reporting-nullTEST-com.shape.CircleTest.xml000066400000000000000000000322021330756104600505170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-reporting-null/surefire-reports junit.framework.AssertionFailedError: expected:<20> but was:<10> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:282) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:201) at junit.framework.Assert.assertEquals(Assert.java:207) at com.shape.CircleTest.testRadius(CircleTest.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [OUT] : Getting the diameter [ERR] : Getting the Circumference java.lang.ArithmeticException: / by zero at com.shape.CircleTest.testProperties(CircleTest.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [OUT] : Getting the diameter [ERR] : Getting the Circumference basic-surefire-report-success-false/000077500000000000000000000000001330756104600375435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unitplugin-config.xml000066400000000000000000000031671330756104600430350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-success-false maven-surefire-report-plugin ${basedir}/target/site/unit/basic-surefire-report-success-false false ${basedir}/src/test/resources/unit/basic-surefire-report-success-false/surefire-reports surefire-report ${basedir}/target/site/unit/basic-surefire-report-success-false/xref-test true surefire-reports/000077500000000000000000000000001330756104600430635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-success-falseTEST-com.shape.CircleTest.xml000066400000000000000000000322021330756104600502760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-success-false/surefire-reports junit.framework.AssertionFailedError: expected:<20> but was:<10> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:282) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:201) at junit.framework.Assert.assertEquals(Assert.java:207) at com.shape.CircleTest.testRadius(CircleTest.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [OUT] : Getting the diameter [ERR] : Getting the Circumference java.lang.ArithmeticException: / by zero at com.shape.CircleTest.testProperties(CircleTest.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [OUT] : Getting the diameter [ERR] : Getting the Circumference basic-surefire-report-test/000077500000000000000000000000001330756104600357625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unitplugin-config.xml000066400000000000000000000031331330756104600412450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-test maven-surefire-report-plugin ${basedir}/target/site/unit/basic-surefire-report-test true ${basedir}/src/test/resources/unit/basic-surefire-report-test/surefire-reports surefire-report ${basedir}/target/site/unit/basic-surefire-report-test/xref-test true surefire-reports/000077500000000000000000000000001330756104600413025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-testTEST-com.shape.CircleTest.xml000066400000000000000000000322021330756104600465150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/basic-surefire-report-test/surefire-reports junit.framework.AssertionFailedError: expected:<20> but was:<10> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:282) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:201) at junit.framework.Assert.assertEquals(Assert.java:207) at com.shape.CircleTest.testRadius(CircleTest.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [OUT] : Getting the diameter [ERR] : Getting the Circumference java.lang.ArithmeticException: / by zero at com.shape.CircleTest.testProperties(CircleTest.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [OUT] : Getting the diameter [ERR] : Getting the Circumference surefire-report-enclosed-trimStackTrace/000077500000000000000000000000001330756104600404365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unitplugin-config.xml000066400000000000000000000032021330756104600437160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-enclosed-trimStackTrace maven-surefire-report-plugin ${basedir}/target/site/unit/surefire-report-enclosed-trimStackTrace true ${basedir}/src/test/resources/unit/surefire-report-enclosed-trimStackTrace/surefire-reports surefire-report ${basedir}/target/site/unit/surefire-report-enclosed-trimStackTrace/xref-test true surefire-reports/000077500000000000000000000000001330756104600437565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-enclosed-trimStackTraceTEST-surefire.MyTest-enclosed-trimStackTrace.xml000066400000000000000000000015451330756104600550420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-enclosed-trimStackTrace/surefire-reports java.lang.RuntimeException: java.lang.IndexOutOfBoundsException at surefire.MyTest.failure(MyTest.java:33) at surefire.MyTest.access$100(MyTest.java:9) at surefire.MyTest$Nested.run(MyTest.java:38) at surefire.MyTest.delegate(MyTest.java:29) at surefire.MyTest.rethrownDelegate(MyTest.java:22) at surefire.MyTest.newRethrownDelegate(MyTest.java:17) at surefire.MyTest.access$200(MyTest.java:9) at surefire.MyTest$A.t(MyTest.java:45) surefire-report-enclosed/000077500000000000000000000000001330756104600355205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unitplugin-config.xml000066400000000000000000000031251330756104600410040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-enclosed maven-surefire-report-plugin ${basedir}/target/site/unit/surefire-report-enclosed true ${basedir}/src/test/resources/unit/surefire-report-enclosed/surefire-reports surefire-report ${basedir}/target/site/unit/surefire-report-enclosed/xref-test true surefire-reports/000077500000000000000000000000001330756104600410405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-enclosedTEST-surefire.MyTest-enclosed.xml000066400000000000000000000064701330756104600472100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-enclosed/surefire-reports java.lang.RuntimeException: java.lang.IndexOutOfBoundsException at surefire.MyTest.rethrownDelegate(MyTest.java:24) at surefire.MyTest.newRethrownDelegate(MyTest.java:17) at surefire.MyTest.access$200(MyTest.java:9) at surefire.MyTest$A.t(MyTest.java:45) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:272) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:167) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:147) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:130) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:211) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:163) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:105) Caused by: java.lang.IndexOutOfBoundsException at surefire.MyTest.failure(MyTest.java:33) at surefire.MyTest.access$100(MyTest.java:9) at surefire.MyTest$Nested.run(MyTest.java:38) at surefire.MyTest.delegate(MyTest.java:29) at surefire.MyTest.rethrownDelegate(MyTest.java:22) surefire-report-nestedClass-trimStackTrace/000077500000000000000000000000001330756104600411125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unitplugin-config.xml000066400000000000000000000032131330756104600443740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-nestedClass-trimStackTrace maven-surefire-report-plugin ${basedir}/target/site/unit/surefire-report-nestedClass-trimStackTrace true ${basedir}/src/test/resources/unit/surefire-report-nestedClass-trimStackTrace/surefire-reports surefire-report ${basedir}/target/site/unit/surefire-report-nestedClass-trimStackTrace/xref-test true surefire-reports/000077500000000000000000000000001330756104600444325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-nestedClass-trimStackTraceTEST-surefire.MyTest-nestedClass-trimStackTrace.xml000066400000000000000000000016361330756104600561730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-nestedClass-trimStackTrace/surefire-reports java.lang.RuntimeException: java.lang.IndexOutOfBoundsException at surefire.MyTest.rethrownDelegate(MyTest.java:24) at surefire.MyTest.newRethrownDelegate(MyTest.java:17) at surefire.MyTest.test(MyTest.java:13) Caused by: java.lang.IndexOutOfBoundsException at surefire.MyTest.failure(MyTest.java:33) at surefire.MyTest.access$100(MyTest.java:9) at surefire.MyTest$Nested.run(MyTest.java:38) at surefire.MyTest.delegate(MyTest.java:29) at surefire.MyTest.rethrownDelegate(MyTest.java:22) surefire-report-nestedClass/000077500000000000000000000000001330756104600361745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unitplugin-config.xml000066400000000000000000000031361330756104600414620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-nestedClass maven-surefire-report-plugin ${basedir}/target/site/unit/surefire-report-nestedClass true ${basedir}/src/test/resources/unit/surefire-report-nestedClass/surefire-reports surefire-report ${basedir}/target/site/unit/surefire-report-nestedClass/xref-test true surefire-reports/000077500000000000000000000000001330756104600415145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-nestedClassTEST-surefire.MyTest-nestedClass.xml000066400000000000000000000054221330756104600503340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-nestedClass/surefire-reports java.lang.RuntimeException: java.lang.IndexOutOfBoundsException at surefire.MyTest.rethrownDelegate(MyTest.java:24) at surefire.MyTest.newRethrownDelegate(MyTest.java:17) at surefire.MyTest.test(MyTest.java:13) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:272) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:167) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:147) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:130) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:211) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:163) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:105) Caused by: java.lang.IndexOutOfBoundsException at surefire.MyTest.failure(MyTest.java:33) at surefire.MyTest.access$100(MyTest.java:9) at surefire.MyTest$Nested.run(MyTest.java:38) at surefire.MyTest.delegate(MyTest.java:29) at surefire.MyTest.rethrownDelegate(MyTest.java:22) surefire-report-single-error/000077500000000000000000000000001330756104600363345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unitplugin-config.xml000066400000000000000000000031411330756104600416160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-single-error maven-surefire-report-plugin ${basedir}/target/site/unit/surefire-report-single-error true ${basedir}/src/test/resources/unit/surefire-report-single-error/surefire-reports surefire-report ${basedir}/target/site/unit/surefire-report-single-error/xref-test true surefire-reports/000077500000000000000000000000001330756104600416545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-single-errorTEST-surefire.MyTest.xml000066400000000000000000000054121330756104600462250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/maven-surefire-report-plugin/src/test/resources/unit/surefire-report-single-error/surefire-reports java.lang.RuntimeException: java.lang.IndexOutOfBoundsException at surefire.MyTest.rethrownDelegate(MyTest.java:24) at surefire.MyTest.newRethrownDelegate(MyTest.java:17) at surefire.MyTest.test(MyTest.java:13) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:272) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:167) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:147) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:130) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:211) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:163) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:105) Caused by: java.lang.IndexOutOfBoundsException at surefire.MyTest.failure(MyTest.java:33) at surefire.MyTest.access$100(MyTest.java:9) at surefire.MyTest$Nested.run(MyTest.java:38) at surefire.MyTest.delegate(MyTest.java:29) at surefire.MyTest.rethrownDelegate(MyTest.java:22) maven-surefire-surefire-2.22.0/pom.xml000066400000000000000000000653031330756104600177000ustar00rootroot00000000000000 4.0.0 maven-parent org.apache.maven 31 ../pom/maven/pom.xml org.apache.maven.surefire surefire 2.22.0 pom Apache Maven Surefire Surefire is a test framework project. This is the aggregator POM in Apache Maven Surefire project. https://maven.apache.org/surefire/ 2004 Jesse Kuhnert Marvin Froeder marvin@marvinformatics.com surefire-logger-api surefire-api surefire-shadefire surefire-booter surefire-grouper surefire-providers maven-surefire-common surefire-report-parser maven-surefire-plugin maven-failsafe-plugin maven-surefire-report-plugin surefire-setup-integration-tests surefire-its ${maven.surefire.scm.devConnection} ${maven.surefire.scm.devConnection} https://github.com/apache/maven-surefire/tree/${project.scm.tag} surefire-2.22.0_vote-1 jira https://issues.apache.org/jira/browse/SUREFIRE Jenkins https://builds.apache.org/job/maven-box/job/maven-surefire apache.website scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/components/${maven.site.path} 2.2.1 3.5 3.5 2.5 0.9 2.0.0-beta.5 scm:git:https://gitbox.apache.org/repos/asf/maven-surefire.git surefire-archives/surefire-LATEST ${java.home}/.. 6 1.${javaVersion} 1.${javaVersion} -server -XX:+UseG1GC -Xms128m -Xmx144m -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:SoftRefLRUPolicyMSPerMB=50 -Djava.awt.headless=true org.apache.maven.surefire surefire-api ${project.version} org.apache.commons commons-lang3 ${commonsLang3Version} commons-io commons-io ${commonsIoVersion} org.apache.maven.surefire surefire-booter ${project.version} org.apache.maven.surefire surefire-logger-api ${project.version} org.apache.maven.surefire surefire-grouper ${project.version} org.apache.maven.surefire maven-surefire-common ${project.version} org.apache.maven.reporting maven-reporting-api 3.0 org.apache.maven maven-core ${mavenVersion} org.apache.maven.wagon wagon-file org.apache.maven.wagon wagon-webdav org.apache.maven.wagon wagon-http-lightweight org.apache.maven.wagon wagon-ssh org.apache.maven.wagon wagon-ssh-external org.apache.maven.doxia doxia-sink-api commons-cli commons-cli org.codehaus.plexus plexus-interactivity-api org.apache.maven maven-plugin-api ${mavenVersion} org.apache.maven.plugin-tools maven-plugin-annotations ${mavenPluginPluginVersion} compile org.apache.maven maven-artifact ${mavenVersion} org.apache.maven maven-plugin-descriptor ${mavenVersion} org.apache.maven maven-project ${mavenVersion} org.apache.maven maven-model ${mavenVersion} org.apache.maven maven-toolchain ${mavenVersion} org.apache.maven maven-settings ${mavenVersion} org.apache.maven.shared maven-shared-utils ${mavenSharedUtilsVersion} com.google.code.findbugs jsr305 org.apache.maven.shared maven-common-artifact-filters 1.3 org.apache.maven.shared maven-plugin-testing-harness org.fusesource.jansi jansi 1.13 org.apache.maven.shared maven-verifier 1.6 org.codehaus.plexus plexus-java 0.9.8 org.mockito mockito-core 2.13.0 org.hamcrest hamcrest-core org.powermock powermock-core ${powermockVersion} test org.powermock powermock-module-junit4 ${powermockVersion} test org.powermock powermock-api-mockito2 ${powermockVersion} test junit junit 4.12 org.hamcrest hamcrest-library 1.3 org.easytesting fest-assert 1.4 org.assertj assertj-core 3.9.1 com.google.code.findbugs jsr305 2.0.3 junit junit test org.hamcrest hamcrest-core org.hamcrest hamcrest-library test org.easytesting fest-assert test org.codehaus.mojo build-helper-maven-plugin 1.12 org.apache.maven.plugins maven-compiler-plugin 3.6.1 compile-generated process-sources compile org/apache/maven/shared/utils/logging/*.java HelpMojo.java **/HelpMojo.java org/apache/maven/plugin/failsafe/xmlsummary/*.java -Xdoclint:none default-compile compile compile org/apache/maven/shared/utils/logging/*.java HelpMojo.java **/HelpMojo.java org/apache/maven/plugin/failsafe/xmlsummary/*.java -Xdoclint:all true -Xdoclint:all org.codehaus.mojo animal-sniffer-maven-plugin 1.16 signature-check check org.codehaus.mojo.signature java16 1.1 org.codehaus.plexus:plexus-java org.ow2.asm:asm org.objectweb.asm.* org.codehaus.plexus.languages.java.jpms.* maven-surefire-plugin 2.12.4 false ${jvm.args.tests} ${jacoco.agent} false false ${jdk.home}/bin/java maven-release-plugin true clean install false maven-shade-plugin 3.1.0 maven-plugin-plugin ${mavenPluginPluginVersion} true maven-invoker-plugin 3.0.1 org.jacoco jacoco-maven-plugin 0.8.1 org.apache.maven.plugins maven-site-plugin 3.7.1 maven-deploy-plugin 2.8.2 org.jacoco jacoco-maven-plugin jacoco-agent prepare-agent jacoco.agent true true false false **/failsafe/* **/failsafe/**/* **/surefire/* **/surefire/**/* org.apache.maven.plugins maven-enforcer-plugin 3.0.0-M1 enforce-java enforce [1.8, 1.9) enforce-maven enforce [3.1.0,) enforce-bytecode-version enforce ${maven.compiler.target} org.codehaus.plexus:plexus-java org.ow2.asm:asm org.junit.platform:junit-platform-commons true org.codehaus.mojo animal-sniffer-maven-plugin org.apache.rat apache-rat-plugin 0.12 rat-check check Jenkinsfile README.md .gitignore .git/**/* **/.idea **/.svn/**/* **/*.iml **/*.ipr **/*.iws **/*.versionsBackup **/dependency-reduced-pom.xml .repository/** src/test/resources/**/* src/test/resources/**/*.css **/*.jj src/main/resources/META-INF/services/org.apache.maven.surefire.providerapi.SurefireProvider DEPENDENCIES .m2/** .m2 .travis.yml maven-deploy-plugin true org.apache.maven.plugins maven-project-info-reports-plugin false ${maven.surefire.scm.devConnection} ${maven.surefire.scm.devConnection} index summary dependency-info modules license project-team scm issue-tracking mailing-list dependency-management dependencies dependency-convergence cim plugin-management plugins distribution-management org.apache.maven.plugins maven-surefire-report-plugin 2.12.4 reporting org.apache.maven.plugins maven-site-plugin org.apache.maven.plugins maven-changes-plugin 2.11 Type,Priority,Key,Summary,Resolution true Fixed type DESC,Priority DESC,Key 1000 true m2e target m2e.version ${m2BuildDirectory} org.maven.ide.eclipse lifecycle-mapping 0.10.0 customizable org.apache.maven.plugins:maven-resources-plugin:: maven-surefire-surefire-2.22.0/src/000077500000000000000000000000001330756104600171435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/src/site/000077500000000000000000000000001330756104600201075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/src/site/resources/000077500000000000000000000000001330756104600221215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/src/site/resources/download.cgi000066400000000000000000000016641330756104600244230ustar00rootroot00000000000000#!/bin/sh # # 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. # # Just call the standard mirrors.cgi script. It will use download.html # as the input template. exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $*maven-surefire-surefire-2.22.0/src/site/site.xml000066400000000000000000000046541330756104600216060ustar00rootroot00000000000000 ${project.name} http://maven.apache.org/images/apache-maven-project.png http://maven.apache.org/ http://maven.apache.org/images/maventxt_logo_200.gif org.apache.maven.skins maven-fluido-skin 1.7 true true ${project.url} apache/maven-surefire right gray

Apache ${project.name}, ${project.name}, Apache, the Apache feather logo, and the Apache ${project.name} project logos are trademarks of The Apache Software Foundation.

]]>
maven-surefire-surefire-2.22.0/src/site/xdoc/000077500000000000000000000000001330756104600210445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/src/site/xdoc/download.xml.vm000066400000000000000000000113661330756104600240250ustar00rootroot00000000000000 Download ${project.name} Source

${project.name} ${project.version} is distributed in source format. Use a source archive if you intend to build ${project.name} yourself. Otherwise, simply use the ready-made binary artifacts from central repository.

You will be prompted for a mirror - if the file is not found on yours, please be patient, as it may take 24 hours to reach all mirrors.

In order to guard against corrupted downloads/installations, it is highly recommended to verify the signature of the release bundles against the public KEYS used by the Apache Maven developers.

${project.name} is distributed under the Apache License, version 2.0.

We strongly encourage our users to configure a Maven repository mirror closer to their location, please read How to Use Mirrors for Repositories.

[if-any logo] logo [end] The currently selected mirror is [preferred]. If you encounter a problem with this mirror, please select another mirror. If all mirrors are failing, there are backup mirrors (at the end of the mirrors list) that should be available.

Other mirrors:

You may also consult the complete list of mirrors.

This is the current stable version of ${project.name}.

Link Checksum Signature
${project.name} ${project.version} (Source zip) maven/surefire/${project.artifactId}-${project.version}-source-release.zip maven/surefire/${project.artifactId}-${project.version}-source-release.zip.sha1 maven/surefire/${project.artifactId}-${project.version}-source-release.zip.asc

Older non-recommended releases can be found on our archive site.

maven-surefire-surefire-2.22.0/surefire-api/000077500000000000000000000000001330756104600207475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/pom.xml000066400000000000000000000065151330756104600222730ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire 2.22.0 surefire-api SureFire API API used in Surefire and Failsafe MOJO, Booter, Common and test framework providers. org.apache.maven.surefire surefire-logger-api org.apache.maven.shared maven-shared-utils com.google.code.findbugs jsr305 provided maven-surefire-plugin **/JUnit4SuiteTest.java org.apache.maven.surefire surefire-shadefire 2.12.4 org.apache.maven.plugins maven-shade-plugin package shade true org.apache.maven.shared:maven-shared-utils org.apache.maven.shared org.apache.maven.surefire.shade.org.apache.maven.shared maven-surefire-surefire-2.22.0/surefire-api/src/000077500000000000000000000000001330756104600215365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/000077500000000000000000000000001330756104600224625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/000077500000000000000000000000001330756104600234035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/000077500000000000000000000000001330756104600241725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/000077500000000000000000000000001330756104600254135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600265215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/plugin/000077500000000000000000000000001330756104600300175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/plugin/surefire/000077500000000000000000000000001330756104600316435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/plugin/surefire/runorder/000077500000000000000000000000001330756104600335035ustar00rootroot00000000000000PrioritizedTest.java000066400000000000000000000025341330756104600374370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/plugin/surefire/runorderpackage org.apache.maven.plugin.surefire.runorder; /* * 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. */ /** * @author Kristian Rosenvold */ public class PrioritizedTest { private final Class clazz; private final Priority priority; public PrioritizedTest( Class clazz, Priority pri ) { this.clazz = clazz; this.priority = pri; } public int getPriority() { return priority.getPriority(); } public int getTotalRuntime() { return priority.getTotalRuntime(); } public Class getClazz() { return clazz; } } Priority.java000066400000000000000000000041421330756104600361110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/plugin/surefire/runorderpackage org.apache.maven.plugin.surefire.runorder; /* * 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. */ /** * @author Kristian Rosenvold */ public class Priority { private final String className; int priority; int totalRuntime = 0; int minSuccessRate = Integer.MAX_VALUE; public Priority( String className ) { this.className = className; } /** * Returns a priority that applies to a new testclass (that has never been run/recorded) * * @param className The class name * @return A priority */ public static Priority newTestClassPriority( String className ) { Priority priority1 = new Priority( className ); priority1.setPriority( 0 ); priority1.minSuccessRate = 0; return priority1; } public void addItem( RunEntryStatistics itemStat ) { totalRuntime += itemStat.getRunTime(); minSuccessRate = Math.min( minSuccessRate, itemStat.getSuccessfulBuilds() ); } public int getTotalRuntime() { return totalRuntime; } public int getMinSuccessRate() { return minSuccessRate; } public String getClassName() { return className; } public int getPriority() { return priority; } public void setPriority( int priority ) { this.priority = priority; } } RunEntryStatistics.java000066400000000000000000000054631330756104600401400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/plugin/surefire/runorderpackage org.apache.maven.plugin.surefire.runorder; /* * 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. */ import java.util.StringTokenizer; import org.apache.maven.surefire.report.ReportEntry; /** * @author Kristian Rosenvold */ public class RunEntryStatistics { private final int runTime; private final int successfulBuilds; private final String testName; private RunEntryStatistics( int runTime, int successfulBuilds, String testName ) { this.runTime = runTime; this.successfulBuilds = successfulBuilds; this.testName = testName; } public static RunEntryStatistics fromReportEntry( ReportEntry previous ) { final Integer elapsed = previous.getElapsed(); return new RunEntryStatistics( elapsed != null ? elapsed : 0, 0, previous.getName() ); } public static RunEntryStatistics fromValues( int runTime, int successfulBuilds, Class clazz, String testName ) { return new RunEntryStatistics( runTime, successfulBuilds, testName + "(" + clazz.getName() + ")" ); } public RunEntryStatistics nextGeneration( int runTime ) { return new RunEntryStatistics( runTime, this.successfulBuilds + 1, this.testName ); } public RunEntryStatistics nextGenerationFailure( int runTime ) { return new RunEntryStatistics( runTime, 0, this.testName ); } public String getTestName() { return testName; } public int getRunTime() { return runTime; } public int getSuccessfulBuilds() { return successfulBuilds; } public static RunEntryStatistics fromString( String line ) { StringTokenizer tok = new StringTokenizer( line, "," ); int successfulBuilds = Integer.parseInt( tok.nextToken() ); int runTime = Integer.parseInt( tok.nextToken() ); String className = tok.nextToken(); return new RunEntryStatistics( runTime, successfulBuilds, className ); } @Override public String toString() { return successfulBuilds + "," + runTime + "," + testName; } } RunEntryStatisticsMap.java000066400000000000000000000226771330756104600406040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/plugin/surefire/runorderpackage org.apache.maven.plugin.surefire.runorder; /* * 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. */ import org.apache.maven.surefire.report.ReportEntry; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; import java.io.Reader; import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Matcher; import java.util.regex.Pattern; import static java.util.Collections.sort; import static org.apache.maven.plugin.surefire.runorder.RunEntryStatistics.fromReportEntry; import static org.apache.maven.plugin.surefire.runorder.RunEntryStatistics.fromString; /** * @author Kristian Rosenvold */ public final class RunEntryStatisticsMap { private final Map runEntryStatistics; public RunEntryStatisticsMap( Map runEntryStatistics ) { this.runEntryStatistics = new ConcurrentHashMap( runEntryStatistics ); } public RunEntryStatisticsMap() { runEntryStatistics = new ConcurrentHashMap(); } public static RunEntryStatisticsMap fromFile( File file ) { if ( file.exists() ) { try { return fromReader( new FileReader( file ) ); } catch ( FileNotFoundException e ) { throw new RuntimeException( e ); } catch ( IOException e ) { throw new RuntimeException( e ); } } else { return new RunEntryStatisticsMap(); } } static RunEntryStatisticsMap fromReader( Reader fileReader ) throws IOException { Map result = new HashMap(); BufferedReader bufferedReader = new BufferedReader( fileReader ); String line = bufferedReader.readLine(); while ( line != null ) { if ( !line.startsWith( "#" ) ) { final RunEntryStatistics stats = fromString( line ); result.put( stats.getTestName(), stats ); } line = bufferedReader.readLine(); } return new RunEntryStatisticsMap( result ); } public void serialize( File file ) throws FileNotFoundException { FileOutputStream fos = new FileOutputStream( file ); PrintWriter printWriter = new PrintWriter( fos ); try { List items = new ArrayList( runEntryStatistics.values() ); sort( items, new RunCountComparator() ); for ( RunEntryStatistics item : items ) { printWriter.println( item.toString() ); } printWriter.flush(); } finally { printWriter.close(); } } public RunEntryStatistics findOrCreate( ReportEntry reportEntry ) { final RunEntryStatistics item = runEntryStatistics.get( reportEntry.getName() ); return item != null ? item : fromReportEntry( reportEntry ); } public RunEntryStatistics createNextGeneration( ReportEntry reportEntry ) { final RunEntryStatistics newItem = findOrCreate( reportEntry ); final Integer elapsed = reportEntry.getElapsed(); return newItem.nextGeneration( elapsed != null ? elapsed : 0 ); } public RunEntryStatistics createNextGenerationFailure( ReportEntry reportEntry ) { final RunEntryStatistics newItem = findOrCreate( reportEntry ); final Integer elapsed = reportEntry.getElapsed(); return newItem.nextGenerationFailure( elapsed != null ? elapsed : 0 ); } public void add( RunEntryStatistics item ) { runEntryStatistics.put( item.getTestName(), item ); } static final class RunCountComparator implements Comparator { @Override public int compare( RunEntryStatistics o, RunEntryStatistics o1 ) { int runtime = o.getSuccessfulBuilds() - o1.getSuccessfulBuilds(); return runtime == 0 ? o.getRunTime() - o1.getRunTime() : runtime; } } public List> getPrioritizedTestsClassRunTime( List> testsToRun, int threadCount ) { List prioritizedTests = getPrioritizedTests( testsToRun, new TestRuntimeComparator() ); ThreadedExecutionScheduler threadedExecutionScheduler = new ThreadedExecutionScheduler( threadCount ); for ( Object prioritizedTest1 : prioritizedTests ) { threadedExecutionScheduler.addTest( (PrioritizedTest) prioritizedTest1 ); } return threadedExecutionScheduler.getResult(); } public List> getPrioritizedTestsByFailureFirst( List> testsToRun ) { List prioritizedTests = getPrioritizedTests( testsToRun, new LeastFailureComparator() ); return transformToClasses( prioritizedTests ); } private List getPrioritizedTests( List> testsToRun, Comparator priorityComparator ) { Map classPriorities = getPriorities( priorityComparator ); List tests = new ArrayList(); for ( Class clazz : testsToRun ) { Priority pri = (Priority) classPriorities.get( clazz.getName() ); if ( pri == null ) { pri = Priority.newTestClassPriority( clazz.getName() ); } PrioritizedTest prioritizedTest = new PrioritizedTest( clazz, pri ); tests.add( prioritizedTest ); } sort( tests, new PrioritizedTestComparator() ); return tests; } private List> transformToClasses( List tests ) { List> result = new ArrayList>(); for ( PrioritizedTest test : tests ) { result.add( test.getClazz() ); } return result; } private Map getPriorities( Comparator priorityComparator ) { Map priorities = new HashMap(); for ( Object o : runEntryStatistics.keySet() ) { String testNames = (String) o; String clazzName = extractClassName( testNames ); Priority priority = priorities.get( clazzName ); if ( priority == null ) { priority = new Priority( clazzName ); priorities.put( clazzName, priority ); } RunEntryStatistics itemStat = runEntryStatistics.get( testNames ); priority.addItem( itemStat ); } List items = new ArrayList( priorities.values() ); sort( items, priorityComparator ); Map result = new HashMap(); int i = 0; for ( Priority pri : items ) { pri.setPriority( i++ ); result.put( pri.getClassName(), pri ); } return result; } static final class PrioritizedTestComparator implements Comparator { @Override public int compare( PrioritizedTest o, PrioritizedTest o1 ) { return o.getPriority() - o1.getPriority(); } } static final class TestRuntimeComparator implements Comparator { @Override public int compare( Priority o, Priority o1 ) { return o1.getTotalRuntime() - o.getTotalRuntime(); } } static final class LeastFailureComparator implements Comparator { @Override public int compare( Priority o, Priority o1 ) { return o.getMinSuccessRate() - o1.getMinSuccessRate(); } } private static final Pattern PARENS = Pattern.compile( "^" + "[^\\(\\)]+" //non-parens + "\\((" // then an open-paren (start matching a group) + "[^\\\\(\\\\)]+" //non-parens + ")\\)" + "$" ); // then a close-paren (end group match) String extractClassName( String displayName ) { Matcher m = PARENS.matcher( displayName ); return m.find() ? m.group( 1 ) : displayName; } } ThreadedExecutionScheduler.java000066400000000000000000000051011330756104600415270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/plugin/surefire/runorderpackage org.apache.maven.plugin.surefire.runorder; /* * 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. */ import java.util.ArrayList; import java.util.List; /** * @author Kristian Rosenvold */ public class ThreadedExecutionScheduler { private final int numThreads; private final int runTime[]; private final List>[] lists; @SuppressWarnings( "unchecked" ) public ThreadedExecutionScheduler( int numThreads ) { this.numThreads = numThreads; runTime = new int[numThreads]; lists = new List[numThreads]; for ( int i = 0; i < numThreads; i++ ) { lists[i] = new ArrayList>(); } } public void addTest( PrioritizedTest prioritizedTest ) { final int leastBusySlot = findLeastBusySlot(); runTime[leastBusySlot] += prioritizedTest.getTotalRuntime(); //noinspection unchecked lists[leastBusySlot].add( prioritizedTest.getClazz() ); } public List> getResult() { List> result = new ArrayList>(); int index = 0; boolean added; do { added = false; for ( int i = 0; i < numThreads; i++ ) { if ( lists[i].size() > index ) { result.add( lists[i].get( index ) ); added = true; } } index++; } while ( added ); return result; } private int findLeastBusySlot() { int leastBusy = 0; int minRuntime = runTime[0]; for ( int i = 1; i < numThreads; i++ ) { if ( runTime[i] < minRuntime ) { leastBusy = i; minRuntime = runTime[i]; } } return leastBusy; } } maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/000077500000000000000000000000001330756104600303455ustar00rootroot00000000000000NonAbstractClassFilter.java000066400000000000000000000022331330756104600355030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefirepackage org.apache.maven.surefire; /* * 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. */ import java.lang.reflect.Modifier; import org.apache.maven.surefire.util.ScannerFilter; /** * @author Kristian Rosenvold */ public class NonAbstractClassFilter implements ScannerFilter { @Override public boolean accept( Class testClass ) { return !Modifier.isAbstract( testClass.getModifiers() ); } } SpecificTestClassFilter.java000066400000000000000000000051051330756104600356530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefirepackage org.apache.maven.surefire; /* * 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. */ import java.util.Collections; import java.util.HashSet; import java.util.Set; import org.apache.maven.shared.utils.io.SelectorUtils; import org.apache.maven.surefire.util.ScannerFilter; /** * Filter for test class files * */ public class SpecificTestClassFilter implements ScannerFilter { private static final char FS = System.getProperty( "file.separator" ).charAt( 0 ); private static final String JAVA_CLASS_FILE_EXTENSION = ".class"; private Set names; public SpecificTestClassFilter( String[] classNames ) { if ( classNames != null && classNames.length > 0 ) { this.names = new HashSet(); Collections.addAll( names, classNames ); } } @Override public boolean accept( Class testClass ) { // If the tests enumeration is empty, allow anything. boolean result = true; if ( names != null && !names.isEmpty() ) { String className = testClass.getName().replace( '.', FS ) + JAVA_CLASS_FILE_EXTENSION; boolean found = false; for ( String pattern : names ) { if ( '\\' == FS ) { pattern = pattern.replace( '/', FS ); } // This is the same utility used under the covers in the plexus DirectoryScanner, and // therefore in the surefire DefaultDirectoryScanner implementation. if ( SelectorUtils.matchPath( pattern, className, true ) ) { found = true; break; } } if ( !found ) { result = false; } } return result; } } maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booter/000077500000000000000000000000001330756104600316375ustar00rootroot00000000000000BaseProviderFactory.java000066400000000000000000000167141330756104600363510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.surefire.cli.CommandLineOption; import org.apache.maven.surefire.providerapi.ProviderParameters; import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.report.DefaultDirectConsoleReporter; import org.apache.maven.surefire.report.ReporterConfiguration; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.testset.DirectoryScannerParameters; import org.apache.maven.surefire.testset.RunOrderParameters; import org.apache.maven.surefire.testset.TestArtifactInfo; import org.apache.maven.surefire.testset.TestRequest; import org.apache.maven.surefire.util.DefaultDirectoryScanner; import org.apache.maven.surefire.util.DefaultRunOrderCalculator; import org.apache.maven.surefire.util.DefaultScanResult; import org.apache.maven.surefire.util.DirectoryScanner; import org.apache.maven.surefire.util.RunOrderCalculator; import org.apache.maven.surefire.util.ScanResult; import java.io.PrintStream; import java.util.Collections; import java.util.List; import java.util.Map; import static java.util.Collections.emptyList; /** * @author Kristian Rosenvold */ public class BaseProviderFactory implements DirectoryScannerParametersAware, ReporterConfigurationAware, SurefireClassLoadersAware, TestRequestAware, ProviderPropertiesAware, ProviderParameters, TestArtifactInfoAware, RunOrderParametersAware, MainCliOptionsAware, FailFastAware, ShutdownAware { private static final int ROOT_CHANNEL = 0; private final ReporterFactory reporterFactory; private final boolean insideFork; private List mainCliOptions = emptyList(); private Map providerProperties; private DirectoryScannerParameters directoryScannerParameters; private ReporterConfiguration reporterConfiguration; private RunOrderParameters runOrderParameters; private ClassLoader testClassLoader; private TestRequest testRequest; private TestArtifactInfo testArtifactInfo; private int skipAfterFailureCount; private Shutdown shutdown; private Integer systemExitTimeout; public BaseProviderFactory( ReporterFactory reporterFactory, boolean insideFork ) { this.reporterFactory = reporterFactory; this.insideFork = insideFork; } @Override @Deprecated public DirectoryScanner getDirectoryScanner() { return directoryScannerParameters == null ? null : new DefaultDirectoryScanner( directoryScannerParameters.getTestClassesDirectory(), directoryScannerParameters.getIncludes(), directoryScannerParameters.getExcludes(), directoryScannerParameters.getSpecificTests() ); } @Override public ScanResult getScanResult() { return DefaultScanResult.from( providerProperties ); } private int getThreadCount() { final String threadcount = providerProperties.get( ProviderParameterNames.THREADCOUNT_PROP ); return threadcount == null ? 1 : Math.max( Integer.parseInt( threadcount ), 1 ); } @Override public RunOrderCalculator getRunOrderCalculator() { return directoryScannerParameters == null ? null : new DefaultRunOrderCalculator( runOrderParameters, getThreadCount() ); } @Override public ReporterFactory getReporterFactory() { return reporterFactory; } @Override public void setDirectoryScannerParameters( DirectoryScannerParameters directoryScannerParameters ) { this.directoryScannerParameters = directoryScannerParameters; } @Override public void setReporterConfiguration( ReporterConfiguration reporterConfiguration ) { this.reporterConfiguration = reporterConfiguration; } @Override public void setClassLoaders( ClassLoader testClassLoader ) { this.testClassLoader = testClassLoader; } @Override public ConsoleStream getConsoleLogger() { boolean trim = reporterConfiguration.isTrimStackTrace(); PrintStream out = reporterConfiguration.getOriginalSystemOut(); return insideFork ? new ForkingRunListener( out, ROOT_CHANNEL, trim ) : new DefaultDirectConsoleReporter( out ); } @Override public void setTestRequest( TestRequest testRequest ) { this.testRequest = testRequest; } @Override public DirectoryScannerParameters getDirectoryScannerParameters() { return directoryScannerParameters; } @Override public ReporterConfiguration getReporterConfiguration() { return reporterConfiguration; } @Override public TestRequest getTestRequest() { return testRequest; } @Override public ClassLoader getTestClassLoader() { return testClassLoader; } @Override public void setProviderProperties( Map providerProperties ) { this.providerProperties = providerProperties; } @Override public Map getProviderProperties() { return providerProperties; } @Override public TestArtifactInfo getTestArtifactInfo() { return testArtifactInfo; } @Override public void setTestArtifactInfo( TestArtifactInfo testArtifactInfo ) { this.testArtifactInfo = testArtifactInfo; } @Override public void setRunOrderParameters( RunOrderParameters runOrderParameters ) { this.runOrderParameters = runOrderParameters; } @Override public List getMainCliOptions() { return mainCliOptions; } @Override public void setMainCliOptions( List mainCliOptions ) { this.mainCliOptions = mainCliOptions == null ? Collections.emptyList() : mainCliOptions; } @Override public int getSkipAfterFailureCount() { return skipAfterFailureCount; } @Override public void setSkipAfterFailureCount( int skipAfterFailureCount ) { this.skipAfterFailureCount = skipAfterFailureCount; } @Override public boolean isInsideFork() { return insideFork; } @Override public Shutdown getShutdown() { return shutdown; } @Override public void setShutdown( Shutdown shutdown ) { this.shutdown = shutdown; } @Override public Integer getSystemExitTimeout() { return systemExitTimeout; } public void setSystemExitTimeout( Integer systemExitTimeout ) { this.systemExitTimeout = systemExitTimeout; } } BiProperty.java000066400000000000000000000024431330756104600345250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ /** * Internal generic wrapper. * * @author Tibor Digana (tibor17) * @since 2.19 * @param first property * @param second property */ final class BiProperty { private final P1 p1; private final P2 p2; BiProperty( P1 p1, P2 p2 ) { this.p1 = p1; this.p2 = p2; } P1 getP1() { return p1; } P2 getP2() { return p2; } } Command.java000066400000000000000000000072311330756104600340040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import static org.apache.maven.surefire.util.internal.ObjectUtils.requireNonNull; import static org.apache.maven.surefire.util.internal.StringUtils.isBlank; import static org.apache.maven.surefire.booter.MasterProcessCommand.RUN_CLASS; import static org.apache.maven.surefire.booter.MasterProcessCommand.SHUTDOWN; import static org.apache.maven.surefire.booter.Shutdown.DEFAULT; /** * Encapsulates data and command sent from master to forked process. * * @author Tibor Digana (tibor17) * @since 2.19 */ public final class Command { public static final Command TEST_SET_FINISHED = new Command( MasterProcessCommand.TEST_SET_FINISHED ); public static final Command SKIP_SINCE_NEXT_TEST = new Command( MasterProcessCommand.SKIP_SINCE_NEXT_TEST ); public static final Command NOOP = new Command( MasterProcessCommand.NOOP ); public static final Command BYE_ACK = new Command( MasterProcessCommand.BYE_ACK ); private final MasterProcessCommand command; private final String data; public Command( MasterProcessCommand command, String data ) { this.command = requireNonNull( command ); this.data = data; } public static Command toShutdown( Shutdown shutdownType ) { return new Command( SHUTDOWN, shutdownType.name() ); } public static Command toRunClass( String runClass ) { return new Command( RUN_CLASS, runClass ); } public Command( MasterProcessCommand command ) { this( command, null ); } public MasterProcessCommand getCommandType() { return command; } public String getData() { return data; } /** * @return {@link Shutdown} or {@link Shutdown#DEFAULT} if {@link #getData()} is null or blank string * @throws IllegalArgumentException if string data {@link #getData()} is not applicable to enum {@link Shutdown} */ public Shutdown toShutdownData() { if ( !isType( SHUTDOWN ) ) { throw new IllegalStateException( "expected MasterProcessCommand.SHUTDOWN" ); } return isBlank( data ) ? DEFAULT : Shutdown.valueOf( data ); } public boolean isType( MasterProcessCommand command ) { return command == this.command; } @Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } Command arg = (Command) o; return command == arg.command && ( data == null ? arg.data == null : data.equals( arg.data ) ); } @Override public int hashCode() { int result = command.hashCode(); result = 31 * result + ( data != null ? data.hashCode() : 0 ); return result; } } CommandListener.java000066400000000000000000000017061330756104600355130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ /** * Command listener interface. */ public interface CommandListener { void update( Command command ); } CommandReader.java000066400000000000000000000416511330756104600351330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger; import org.apache.maven.surefire.testset.TestSetFailedException; import java.io.DataInputStream; import java.io.EOFException; import java.io.IOException; import java.io.PrintStream; import java.util.Iterator; import java.util.NoSuchElementException; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Semaphore; import java.util.concurrent.atomic.AtomicReference; import static java.lang.Thread.State.NEW; import static java.lang.Thread.State.RUNNABLE; import static java.lang.Thread.State.TERMINATED; import static java.lang.StrictMath.max; import static org.apache.maven.surefire.booter.Command.toShutdown; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_NEXT_TEST; import static org.apache.maven.surefire.booter.MasterProcessCommand.BYE_ACK; import static org.apache.maven.surefire.booter.MasterProcessCommand.NOOP; import static org.apache.maven.surefire.booter.MasterProcessCommand.RUN_CLASS; import static org.apache.maven.surefire.booter.MasterProcessCommand.SHUTDOWN; import static org.apache.maven.surefire.booter.MasterProcessCommand.SKIP_SINCE_NEXT_TEST; import static org.apache.maven.surefire.booter.MasterProcessCommand.TEST_SET_FINISHED; import static org.apache.maven.surefire.booter.MasterProcessCommand.decode; import static org.apache.maven.surefire.util.internal.DaemonThreadFactory.newDaemonThread; import static org.apache.maven.surefire.util.internal.StringUtils.encodeStringForForkCommunication; import static org.apache.maven.surefire.util.internal.StringUtils.isBlank; import static org.apache.maven.surefire.util.internal.StringUtils.isNotBlank; import static org.apache.maven.surefire.util.internal.ObjectUtils.requireNonNull; /** * Reader of commands coming from plugin(master) process. * * @author Tibor Digana (tibor17) * @since 2.19 */ public final class CommandReader { private static final String LAST_TEST_SYMBOL = ""; private static final CommandReader READER = new CommandReader(); private final Queue> listeners = new ConcurrentLinkedQueue>(); private final Thread commandThread = newDaemonThread( new CommandRunnable(), "surefire-forkedjvm-command-thread" ); private final AtomicReference state = new AtomicReference( NEW ); private final CountDownLatch startMonitor = new CountDownLatch( 1 ); private final Semaphore nextCommandNotifier = new Semaphore( 0 ); private final CopyOnWriteArrayList testClasses = new CopyOnWriteArrayList(); private volatile Shutdown shutdown; private int iteratedCount; private volatile ConsoleLogger logger = new NullConsoleLogger(); private CommandReader() { } public static CommandReader getReader() { final CommandReader reader = READER; if ( reader.state.compareAndSet( NEW, RUNNABLE ) ) { reader.commandThread.start(); } return reader; } public CommandReader setShutdown( Shutdown shutdown ) { this.shutdown = shutdown; return this; } public CommandReader setLogger( ConsoleLogger logger ) { this.logger = requireNonNull( logger, "null logger" ); return this; } public boolean awaitStarted() throws TestSetFailedException { if ( state.get() == RUNNABLE ) { try { startMonitor.await(); return true; } catch ( InterruptedException e ) { DumpErrorSingleton.getSingleton().dumpException( e ); throw new TestSetFailedException( e.getLocalizedMessage() ); } } else { return false; } } /** * @param listener listener called with Any {@link MasterProcessCommand command type} */ public void addListener( CommandListener listener ) { listeners.add( new BiProperty( null, listener ) ); } public void addTestListener( CommandListener listener ) { addListener( RUN_CLASS, listener ); } public void addTestsFinishedListener( CommandListener listener ) { addListener( TEST_SET_FINISHED, listener ); } public void addSkipNextTestsListener( CommandListener listener ) { addListener( SKIP_SINCE_NEXT_TEST, listener ); } public void addShutdownListener( CommandListener listener ) { addListener( SHUTDOWN, listener ); } public void addNoopListener( CommandListener listener ) { addListener( NOOP, listener ); } public void addByeAckListener( CommandListener listener ) { addListener( BYE_ACK, listener ); } private void addListener( MasterProcessCommand cmd, CommandListener listener ) { listeners.add( new BiProperty( cmd, listener ) ); } public void removeListener( CommandListener listener ) { for ( Iterator> it = listeners.iterator(); it.hasNext(); ) { BiProperty listenerWrapper = it.next(); if ( listener == listenerWrapper.getP2() ) { it.remove(); } } } /** * @return test classes which have been retrieved by {@link CommandReader#getIterableClasses(PrintStream)}. */ Iterator iterated() { return testClasses.subList( 0, iteratedCount ).iterator(); } /** * The iterator can be used only in one Thread. * Two simultaneous instances are not allowed for sake of only one {@link #nextCommandNotifier}. * * @param originalOutStream original stream in current JVM process * @return Iterator with test classes lazily loaded as commands from the main process */ Iterable getIterableClasses( PrintStream originalOutStream ) { return new ClassesIterable( originalOutStream ); } public void stop() { if ( state.compareAndSet( NEW, TERMINATED ) || state.compareAndSet( RUNNABLE, TERMINATED ) ) { makeQueueFull(); listeners.clear(); commandThread.interrupt(); } } private boolean isStopped() { return state.get() == TERMINATED; } /** * @return {@code true} if {@link #LAST_TEST_SYMBOL} found at the last index in {@link #testClasses}. */ private boolean isQueueFull() { // The problem with COWAL is that such collection doe not have operation getLast, however it has get(int) // and we need both atomic. // // Both lines can be Java Concurrent, but the last operation is atomic with optimized search. // Searching index of LAST_TEST_SYMBOL in the only last few (concurrently) inserted strings. // The insert operation is concurrent with this method. // Prerequisite: The strings are added but never removed and the method insertToQueue() does not // allow adding a string after LAST_TEST_SYMBOL. int searchFrom = max( 0, testClasses.size() - 1 ); return testClasses.indexOf( LAST_TEST_SYMBOL, searchFrom ) != -1; } private void makeQueueFull() { testClasses.addIfAbsent( LAST_TEST_SYMBOL ); } private boolean insertToQueue( String test ) { return isNotBlank( test ) && !isQueueFull() && testClasses.add( test ); } private final class ClassesIterable implements Iterable { private final PrintStream originalOutStream; ClassesIterable( PrintStream originalOutStream ) { this.originalOutStream = originalOutStream; } @Override public Iterator iterator() { return new ClassesIterator( originalOutStream ); } } private final class ClassesIterator implements Iterator { private final PrintStream originalOutStream; private String clazz; private int nextQueueIndex; private ClassesIterator( PrintStream originalOutStream ) { this.originalOutStream = originalOutStream; } @Override public boolean hasNext() { popUnread(); return isNotBlank( clazz ); } @Override public String next() { popUnread(); try { if ( isBlank( clazz ) ) { throw new NoSuchElementException( CommandReader.this.isStopped() ? "stream was stopped" : "" ); } else { return clazz; } } finally { clazz = null; } } @Override public void remove() { throw new UnsupportedOperationException(); } private void popUnread() { if ( shouldFinish() ) { clazz = null; return; } if ( isBlank( clazz ) ) { requestNextTest(); CommandReader.this.awaitNextTest(); if ( shouldFinish() ) { clazz = null; return; } clazz = CommandReader.this.testClasses.get( nextQueueIndex++ ); CommandReader.this.iteratedCount = nextQueueIndex; } if ( CommandReader.this.isStopped() ) { clazz = null; } } private void requestNextTest() { byte[] encoded = encodeStringForForkCommunication( ( (char) BOOTERCODE_NEXT_TEST ) + ",0,want more!\n" ); synchronized ( originalOutStream ) { originalOutStream.write( encoded, 0, encoded.length ); originalOutStream.flush(); } } private boolean shouldFinish() { boolean wasLastTestRead = isEndSymbolAt( nextQueueIndex ); return CommandReader.this.isStopped() || wasLastTestRead; } private boolean isEndSymbolAt( int index ) { return CommandReader.this.isQueueFull() && 1 + index == CommandReader.this.testClasses.size(); } } private void awaitNextTest() { nextCommandNotifier.acquireUninterruptibly(); } private void wakeupIterator() { nextCommandNotifier.release(); } private final class CommandRunnable implements Runnable { @Override public void run() { CommandReader.this.startMonitor.countDown(); DataInputStream stdIn = new DataInputStream( System.in ); boolean isTestSetFinished = false; try { while ( CommandReader.this.state.get() == RUNNABLE ) { Command command = decode( stdIn ); if ( command == null ) { String errorMessage = "[SUREFIRE] std/in stream corrupted: first sequence not recognized"; DumpErrorSingleton.getSingleton().dumpStreamText( errorMessage ); logger.error( errorMessage ); break; } else { switch ( command.getCommandType() ) { case RUN_CLASS: String test = command.getData(); boolean inserted = CommandReader.this.insertToQueue( test ); if ( inserted ) { CommandReader.this.wakeupIterator(); insertToListeners( command ); } break; case TEST_SET_FINISHED: CommandReader.this.makeQueueFull(); isTestSetFinished = true; CommandReader.this.wakeupIterator(); insertToListeners( command ); break; case SHUTDOWN: CommandReader.this.makeQueueFull(); CommandReader.this.wakeupIterator(); insertToListeners( command ); break; default: insertToListeners( command ); break; } } } } catch ( EOFException e ) { CommandReader.this.state.set( TERMINATED ); if ( !isTestSetFinished ) { String msg = "TestSet has not finished before stream error has appeared >> " + "initializing exit by non-null configuration: " + CommandReader.this.shutdown; DumpErrorSingleton.getSingleton().dumpStreamException( e, msg ); exitByConfiguration(); // does not go to finally for non-default config: Shutdown.EXIT or Shutdown.KILL } } catch ( IOException e ) { CommandReader.this.state.set( TERMINATED ); // If #stop() method is called, reader thread is interrupted and cause is InterruptedException. if ( !( e.getCause() instanceof InterruptedException ) ) { String msg = "[SUREFIRE] std/in stream corrupted"; DumpErrorSingleton.getSingleton().dumpStreamException( e, msg ); logger.error( msg, e ); } } finally { // ensure fail-safe iterator as well as safe to finish in for-each loop using ClassesIterator if ( !isTestSetFinished ) { CommandReader.this.makeQueueFull(); } CommandReader.this.wakeupIterator(); } } private void insertToListeners( Command cmd ) { MasterProcessCommand expectedCommandType = cmd.getCommandType(); for ( BiProperty listenerWrapper : CommandReader.this.listeners ) { MasterProcessCommand commandType = listenerWrapper.getP1(); CommandListener listener = listenerWrapper.getP2(); if ( commandType == null || commandType == expectedCommandType ) { listener.update( cmd ); } } } private void exitByConfiguration() { Shutdown shutdown = CommandReader.this.shutdown; // won't read inconsistent changes through the stack if ( shutdown != null ) { CommandReader.this.makeQueueFull(); CommandReader.this.wakeupIterator(); insertToListeners( toShutdown( shutdown ) ); if ( shutdown.isExit() ) { System.exit( 1 ); } else if ( shutdown.isKill() ) { Runtime.getRuntime().halt( 1 ); } // else is default: other than Shutdown.DEFAULT should not happen; otherwise you missed enum case } } } } DirectoryScannerParametersAware.java000066400000000000000000000021071330756104600407050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.surefire.testset.DirectoryScannerParameters; /** * @author Kristian Rosenvold */ interface DirectoryScannerParametersAware { void setDirectoryScannerParameters( DirectoryScannerParameters directoryScanner ); } DumpErrorSingleton.java000066400000000000000000000062221330756104600362270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.surefire.report.ReporterConfiguration; import org.apache.maven.surefire.util.internal.DumpFileUtils; import java.io.File; import static org.apache.maven.surefire.util.internal.DumpFileUtils.newDumpFile; /** * Dumps lost commands and caused exceptions in forked JVM.
* Fail-safe. * * @author Tibor Digana (tibor17) * @since 2.20 */ public final class DumpErrorSingleton { public static final String DUMP_FILE_EXT = ".dump"; public static final String DUMPSTREAM_FILE_EXT = ".dumpstream"; private static final DumpErrorSingleton SINGLETON = new DumpErrorSingleton(); private File dumpFile; private File dumpStreamFile; private DumpErrorSingleton() { } public static DumpErrorSingleton getSingleton() { return SINGLETON; } public synchronized void init( String dumpFileName, ReporterConfiguration configuration ) { dumpFile = createDumpFile( dumpFileName, configuration ); dumpStreamFile = createDumpStreamFile( dumpFileName, configuration ); } public synchronized void dumpException( Throwable t, String msg ) { DumpFileUtils.dumpException( t, msg == null ? "null" : msg, dumpFile ); } public synchronized void dumpException( Throwable t ) { DumpFileUtils.dumpException( t, dumpFile ); } public synchronized void dumpText( String msg ) { DumpFileUtils.dumpText( msg == null ? "null" : msg, dumpFile ); } public synchronized void dumpStreamException( Throwable t, String msg ) { DumpFileUtils.dumpException( t, msg == null ? "null" : msg, dumpStreamFile ); } public synchronized void dumpStreamException( Throwable t ) { DumpFileUtils.dumpException( t, dumpStreamFile ); } public synchronized void dumpStreamText( String msg ) { DumpFileUtils.dumpText( msg == null ? "null" : msg, dumpStreamFile ); } private File createDumpFile( String dumpFileName, ReporterConfiguration configuration ) { return newDumpFile( dumpFileName + DUMP_FILE_EXT, configuration ); } private File createDumpStreamFile( String dumpFileName, ReporterConfiguration configuration ) { return newDumpFile( dumpFileName + DUMPSTREAM_FILE_EXT, configuration ); } } FailFastAware.java000066400000000000000000000021431330756104600350740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ /** * See the plugin configuration parameter {@code skipAfterFailureCount}. * * @author Tibor Digana (tibor17) * @since 2.19 */ interface FailFastAware { void setSkipAfterFailureCount( int skipAfterFailureCount ); } ForkingReporterFactory.java000066400000000000000000000037041330756104600371010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.io.PrintStream; import java.util.concurrent.atomic.AtomicInteger; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.suite.RunResult; /** * Creates ForkingReporters, which are typically one instance per TestSet or thread. * This factory is only used inside forks. * * @author Kristian Rosenvold */ public class ForkingReporterFactory implements ReporterFactory { private final boolean isTrimstackTrace; private final PrintStream originalSystemOut; private final AtomicInteger testSetChannelId = new AtomicInteger( 1 ); public ForkingReporterFactory( boolean trimstackTrace, PrintStream originalSystemOut ) { isTrimstackTrace = trimstackTrace; this.originalSystemOut = originalSystemOut; } @Override public RunListener createReporter() { return new ForkingRunListener( originalSystemOut, testSetChannelId.getAndIncrement(), isTrimstackTrace ); } @Override public RunResult close() { return new RunResult( 17, 17, 17, 17 ); } } ForkingRunListener.java000066400000000000000000000333571330756104600362300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.log.api.ConsoleLoggerUtils; import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.SafeThrowable; import org.apache.maven.surefire.report.SimpleReportEntry; import org.apache.maven.surefire.report.StackTraceWriter; import org.apache.maven.surefire.report.TestSetReportEntry; import org.apache.maven.surefire.util.internal.StringUtils.EncodedArray; import java.io.PrintStream; import java.util.Map.Entry; import static java.lang.Integer.toHexString; import static java.nio.charset.Charset.defaultCharset; import static org.apache.maven.surefire.util.internal.ObjectUtils.systemProps; import static org.apache.maven.surefire.util.internal.ObjectUtils.useNonNull; import static org.apache.maven.surefire.util.internal.StringUtils.encodeStringForForkCommunication; import static org.apache.maven.surefire.util.internal.StringUtils.escapeBytesToPrintable; import static org.apache.maven.surefire.util.internal.StringUtils.escapeToPrintable; /** * Encodes the full output of the test run to the stdout stream. *
* This class and the ForkClient contain the full definition of the * "wire-level" protocol used by the forked process. The protocol * is *not* part of any public api and may change without further * notice. *
* This class is threadsafe. *
* The synchronization in the underlying PrintStream (target instance) * is used to preserve thread safety of the output stream. To perform * multiple writes/prints for a single request, they must * synchronize on "target" variable in this class. * * @author Kristian Rosenvold */ public class ForkingRunListener implements RunListener, ConsoleLogger, ConsoleOutputReceiver, ConsoleStream { public static final byte BOOTERCODE_TESTSET_STARTING = (byte) '1'; public static final byte BOOTERCODE_TESTSET_COMPLETED = (byte) '2'; public static final byte BOOTERCODE_STDOUT = (byte) '3'; public static final byte BOOTERCODE_STDERR = (byte) '4'; public static final byte BOOTERCODE_TEST_STARTING = (byte) '5'; public static final byte BOOTERCODE_TEST_SUCCEEDED = (byte) '6'; public static final byte BOOTERCODE_TEST_ERROR = (byte) '7'; public static final byte BOOTERCODE_TEST_FAILED = (byte) '8'; public static final byte BOOTERCODE_TEST_SKIPPED = (byte) '9'; public static final byte BOOTERCODE_TEST_ASSUMPTIONFAILURE = (byte) 'G'; /** * INFO logger * @see ConsoleLogger#info(String) */ public static final byte BOOTERCODE_CONSOLE = (byte) 'H'; public static final byte BOOTERCODE_SYSPROPS = (byte) 'I'; public static final byte BOOTERCODE_NEXT_TEST = (byte) 'N'; public static final byte BOOTERCODE_STOP_ON_NEXT_TEST = (byte) 'S'; /** * ERROR logger * @see ConsoleLogger#error(String) */ public static final byte BOOTERCODE_ERROR = (byte) 'X'; public static final byte BOOTERCODE_BYE = (byte) 'Z'; /** * DEBUG logger * @see ConsoleLogger#debug(String) */ public static final byte BOOTERCODE_DEBUG = (byte) 'D'; /** * WARNING logger * @see ConsoleLogger#warning(String) */ public static final byte BOOTERCODE_WARNING = (byte) 'W'; private final PrintStream target; private final int testSetChannelId; private final boolean trimStackTraces; private final byte[] stdOutHeader; private final byte[] stdErrHeader; public ForkingRunListener( PrintStream target, int testSetChannelId, boolean trimStackTraces ) { this.target = target; this.testSetChannelId = testSetChannelId; this.trimStackTraces = trimStackTraces; stdOutHeader = createHeader( BOOTERCODE_STDOUT, testSetChannelId ); stdErrHeader = createHeader( BOOTERCODE_STDERR, testSetChannelId ); sendProps(); } @Override public void testSetStarting( TestSetReportEntry report ) { encodeAndWriteToTarget( toString( BOOTERCODE_TESTSET_STARTING, report, testSetChannelId ) ); } @Override public void testSetCompleted( TestSetReportEntry report ) { encodeAndWriteToTarget( toString( BOOTERCODE_TESTSET_COMPLETED, report, testSetChannelId ) ); } @Override public void testStarting( ReportEntry report ) { encodeAndWriteToTarget( toString( BOOTERCODE_TEST_STARTING, report, testSetChannelId ) ); } @Override public void testSucceeded( ReportEntry report ) { encodeAndWriteToTarget( toString( BOOTERCODE_TEST_SUCCEEDED, report, testSetChannelId ) ); } @Override public void testAssumptionFailure( ReportEntry report ) { encodeAndWriteToTarget( toString( BOOTERCODE_TEST_ASSUMPTIONFAILURE, report, testSetChannelId ) ); } @Override public void testError( ReportEntry report ) { encodeAndWriteToTarget( toString( BOOTERCODE_TEST_ERROR, report, testSetChannelId ) ); } @Override public void testFailed( ReportEntry report ) { encodeAndWriteToTarget( toString( BOOTERCODE_TEST_FAILED, report, testSetChannelId ) ); } @Override public void testSkipped( ReportEntry report ) { encodeAndWriteToTarget( toString( BOOTERCODE_TEST_SKIPPED, report, testSetChannelId ) ); } @Override public void testExecutionSkippedByUser() { encodeAndWriteToTarget( toString( BOOTERCODE_STOP_ON_NEXT_TEST, new SimpleReportEntry(), testSetChannelId ) ); } private void sendProps() { for ( Entry entry : systemProps().entrySet() ) { String value = entry.getValue(); encodeAndWriteToTarget( toPropertyString( entry.getKey(), useNonNull( value, "null" ) ) ); } } @Override public void writeTestOutput( byte[] buf, int off, int len, boolean stdout ) { EncodedArray encodedArray = escapeBytesToPrintable( stdout ? stdOutHeader : stdErrHeader, buf, off, len ); synchronized ( target ) // See notes about synchronization/thread safety in class javadoc { target.write( encodedArray.getArray(), 0, encodedArray.getSize() ); target.flush(); if ( target.checkError() ) { // We MUST NOT throw any exception from this method; otherwise we are in loop and CPU goes up: // ForkingRunListener -> Exception -> JUnit Notifier and RunListener -> ForkingRunListener -> Exception DumpErrorSingleton.getSingleton() .dumpStreamText( "Unexpected IOException with stream: " + new String( buf, off, len ) ); } } } public static byte[] createHeader( byte booterCode, int testSetChannel ) { return encodeStringForForkCommunication( String.valueOf( (char) booterCode ) + ',' + Integer.toString( testSetChannel, 16 ) + ',' + defaultCharset().name() + ',' ); } private void log( byte bootCode, String message ) { if ( message != null ) { StringBuilder sb = new StringBuilder( 7 + message.length() * 5 ); append( sb, bootCode ); comma( sb ); append( sb, toHexString( testSetChannelId ) ); comma( sb ); escapeToPrintable( sb, message ); sb.append( '\n' ); encodeAndWriteToTarget( sb.toString() ); } } @Override public boolean isDebugEnabled() { return true; } @Override public void debug( String message ) { log( BOOTERCODE_DEBUG, message ); } @Override public boolean isInfoEnabled() { return true; } @Override public void info( String message ) { log( BOOTERCODE_CONSOLE, message ); } @Override public boolean isWarnEnabled() { return true; } @Override public void warning( String message ) { log( BOOTERCODE_WARNING, message ); } @Override public boolean isErrorEnabled() { return true; } @Override public void error( String message ) { log( BOOTERCODE_ERROR, message ); } @Override public void error( String message, Throwable t ) { error( ConsoleLoggerUtils.toString( message, t ) ); } @Override public void error( Throwable t ) { error( null, t ); } private void encodeAndWriteToTarget( String string ) { byte[] encodeBytes = encodeStringForForkCommunication( string ); synchronized ( target ) // See notes about synchronization/thread safety in class javadoc { target.write( encodeBytes, 0, encodeBytes.length ); target.flush(); if ( target.checkError() ) { // We MUST NOT throw any exception from this method; otherwise we are in loop and CPU goes up: // ForkingRunListener -> Exception -> JUnit Notifier and RunListener -> ForkingRunListener -> Exception DumpErrorSingleton.getSingleton().dumpStreamText( "Unexpected IOException: " + string ); } } } private String toPropertyString( String key, String value ) { StringBuilder stringBuilder = new StringBuilder(); append( stringBuilder, BOOTERCODE_SYSPROPS ); comma( stringBuilder ); append( stringBuilder, toHexString( testSetChannelId ) ); comma( stringBuilder ); escapeToPrintable( stringBuilder, key ); comma( stringBuilder ); escapeToPrintable( stringBuilder, value ); stringBuilder.append( "\n" ); return stringBuilder.toString(); } private String toString( byte operationCode, ReportEntry reportEntry, int testSetChannelId ) { StringBuilder stringBuilder = new StringBuilder(); append( stringBuilder, operationCode ); comma( stringBuilder ); append( stringBuilder, toHexString( testSetChannelId ) ); comma( stringBuilder ); nullableEncoding( stringBuilder, reportEntry.getSourceName() ); comma( stringBuilder ); nullableEncoding( stringBuilder, reportEntry.getName() ); comma( stringBuilder ); nullableEncoding( stringBuilder, reportEntry.getGroup() ); comma( stringBuilder ); nullableEncoding( stringBuilder, reportEntry.getMessage() ); comma( stringBuilder ); nullableEncoding( stringBuilder, reportEntry.getElapsed() ); encode( stringBuilder, reportEntry.getStackTraceWriter() ); stringBuilder.append( "\n" ); return stringBuilder.toString(); } private static void comma( StringBuilder stringBuilder ) { stringBuilder.append( "," ); } private void append( StringBuilder stringBuilder, String message ) { stringBuilder.append( encode( message ) ); } private void append( StringBuilder stringBuilder, byte b ) { stringBuilder.append( (char) b ); } private void nullableEncoding( StringBuilder stringBuilder, Integer source ) { stringBuilder.append( source == null ? "null" : source.toString() ); } private String encode( String source ) { return source; } private static void nullableEncoding( StringBuilder stringBuilder, String source ) { if ( source == null || source.isEmpty() ) { stringBuilder.append( "null" ); } else { escapeToPrintable( stringBuilder, source ); } } private void encode( StringBuilder stringBuilder, StackTraceWriter stackTraceWriter ) { encode( stringBuilder, stackTraceWriter, trimStackTraces ); } public static void encode( StringBuilder stringBuilder, StackTraceWriter stackTraceWriter, boolean trimStackTraces ) { if ( stackTraceWriter != null ) { comma( stringBuilder ); //noinspection ThrowableResultOfMethodCallIgnored final SafeThrowable throwable = stackTraceWriter.getThrowable(); if ( throwable != null ) { String message = throwable.getLocalizedMessage(); nullableEncoding( stringBuilder, message ); } comma( stringBuilder ); nullableEncoding( stringBuilder, stackTraceWriter.smartTrimmedStackTrace() ); comma( stringBuilder ); nullableEncoding( stringBuilder, trimStackTraces ? stackTraceWriter.writeTrimmedTraceToString() : stackTraceWriter.writeTraceToString() ); } } @Override public void println( String message ) { byte[] buf = message.getBytes(); println( buf, 0, buf.length ); } @Override public void println( byte[] buf, int off, int len ) { writeTestOutput( buf, off, len, true ); } } MainCliOptionsAware.java000066400000000000000000000022441330756104600362750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.surefire.cli.CommandLineOption; import java.util.List; /** * CLI options in plugin (main) JVM process. * * @author Tibor Digana (tibor17) * @since 2.19 */ interface MainCliOptionsAware { void setMainCliOptions( List mainCliOptions ); } MasterProcessCommand.java000066400000000000000000000132441330756104600365200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.io.DataInputStream; import java.io.IOException; import static java.lang.String.format; import static org.apache.maven.surefire.util.internal.ObjectUtils.requireNonNull; import static org.apache.maven.surefire.util.internal.StringUtils.ISO_8859_1; import static org.apache.maven.surefire.util.internal.StringUtils.US_ASCII; import static org.apache.maven.surefire.util.internal.StringUtils.encodeStringForForkCommunication; /** * Commands which are sent from plugin to the forked jvm. * Support and methods related to the commands. * * @author Tibor Digana (tibor17) * @since 2.19 */ public enum MasterProcessCommand { RUN_CLASS( 0, String.class ), TEST_SET_FINISHED( 1, Void.class ), SKIP_SINCE_NEXT_TEST( 2, Void.class ), SHUTDOWN( 3, String.class ), /** To tell a forked process that the master process is still alive. Repeated after 10 seconds. */ NOOP( 4, Void.class ), BYE_ACK( 5, Void.class ); private final int id; private final Class dataType; MasterProcessCommand( int id, Class dataType ) { this.id = id; this.dataType = requireNonNull( dataType, "dataType cannot be null" ); } public int getId() { return id; } public Class getDataType() { return dataType; } public boolean hasDataType() { return dataType != Void.class; } @SuppressWarnings( "checkstyle:magicnumber" ) public byte[] encode( String data ) { if ( !hasDataType() ) { throw new IllegalArgumentException( "cannot use data without data type" ); } if ( getDataType() != String.class ) { throw new IllegalArgumentException( "Data type can be only " + String.class ); } final byte[] dataBytes = fromDataType( data ); final int len = dataBytes.length; final byte[] encoded = new byte[8 + len]; final int command = getId(); setCommandAndDataLength( command, len, encoded ); System.arraycopy( dataBytes, 0, encoded, 8, len ); return encoded; } @SuppressWarnings( "checkstyle:magicnumber" ) public byte[] encode() { if ( getDataType() != Void.class ) { throw new IllegalArgumentException( "Data type can be only " + getDataType() ); } byte[] encoded = new byte[8]; int command = getId(); setCommandAndDataLength( command, 0, encoded ); return encoded; } public static Command decode( DataInputStream is ) throws IOException { MasterProcessCommand command = resolve( is.readInt() ); if ( command == null ) { return null; } else { int dataLength = is.readInt(); if ( dataLength > 0 ) { byte[] buffer = new byte[ dataLength ]; is.readFully( buffer ); if ( command.getDataType() == Void.class ) { throw new IOException( format( "Command %s unexpectedly read Void data with length %d.", command, dataLength ) ); } String data = command.toDataTypeAsString( buffer ); return new Command( command, data ); } else { return new Command( command ); } } } String toDataTypeAsString( byte... data ) { switch ( this ) { case RUN_CLASS: return new String( data, ISO_8859_1 ); case SHUTDOWN: return new String( data, US_ASCII ); default: return null; } } byte[] fromDataType( String data ) { switch ( this ) { case RUN_CLASS: return encodeStringForForkCommunication( data ); case SHUTDOWN: return data.getBytes( US_ASCII ); default: return new byte[0]; } } static MasterProcessCommand resolve( int id ) { for ( MasterProcessCommand command : values() ) { if ( id == command.id ) { return command; } } return null; } @SuppressWarnings( "checkstyle:magicnumber" ) static void setCommandAndDataLength( int command, int dataLength, byte... encoded ) { encoded[0] = (byte) ( command >>> 24 ); encoded[1] = (byte) ( command >>> 16 ); encoded[2] = (byte) ( command >>> 8 ); encoded[3] = (byte) command; encoded[4] = (byte) ( dataLength >>> 24 ); encoded[5] = (byte) ( dataLength >>> 16 ); encoded[6] = (byte) ( dataLength >>> 8 ); encoded[7] = (byte) dataLength; } } ProviderParameterNames.java000066400000000000000000000032201330756104600370370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ /** * @author Kristian Rosenvold */ public class ProviderParameterNames { public static final String TESTNG_EXCLUDEDGROUPS_PROP = "excludegroups"; public static final String TESTNG_GROUPS_PROP = "groups"; public static final String THREADCOUNT_PROP = "threadcount"; public static final String PARALLEL_PROP = "parallel"; public static final String THREADCOUNTSUITES_PROP = "threadcountsuites"; public static final String THREADCOUNTCLASSES_PROP = "threadcountclasses"; public static final String THREADCOUNTMETHODS_PROP = "threadcountmethods"; public static final String PARALLEL_TIMEOUT_PROP = "paralleltimeout"; public static final String PARALLEL_TIMEOUTFORCED_PROP = "paralleltimeoutforced"; public static final String PARALLEL_OPTIMIZE_PROP = "paralleloptimization"; } ProviderPropertiesAware.java000066400000000000000000000020031330756104600372450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.util.Map; /** * @author Kristian Rosenvold */ interface ProviderPropertiesAware { void setProviderProperties( Map providerProperties ); } ReporterConfigurationAware.java000066400000000000000000000020671330756104600377420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.surefire.report.ReporterConfiguration; /** * @author Kristian Rosenvold */ interface ReporterConfigurationAware { void setReporterConfiguration( ReporterConfiguration reporterConfiguration ); } RunOrderParametersAware.java000066400000000000000000000020511330756104600371650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.surefire.testset.RunOrderParameters; /** * @author Kristian Rosenvold */ interface RunOrderParametersAware { void setRunOrderParameters( RunOrderParameters runOrderParameters ); } Shutdown.java000066400000000000000000000046301330756104600342410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ /** * Specifies the way how the forked jvm should be terminated after * class AbstractCommandStream is closed and CTRL+C. * * @author Tibor Digana (tibor17) * @since 2.19 */ public enum Shutdown { DEFAULT( "testset" ), EXIT( "exit" ), KILL( "kill" ); private final String param; Shutdown( String param ) { this.param = param; } public String getParam() { return param; } public boolean isKill() { return this == KILL; } public boolean isExit() { return this == EXIT; } public boolean isDefaultShutdown() { return this == DEFAULT; } public static boolean isKnown( String param ) { for ( Shutdown shutdown : values() ) { if ( shutdown.param.equals( param ) ) { return true; } } return false; } public static String listParameters() { StringBuilder values = new StringBuilder(); for ( Shutdown shutdown : values() ) { if ( values.length() != 0 ) { values.append( ", " ); } values.append( shutdown.getParam() ); } return values.toString(); } public static Shutdown parameterOf( String parameter ) { for ( Shutdown shutdown : values() ) { if ( shutdown.param.equals( parameter ) ) { return shutdown; } } return DEFAULT; } } ShutdownAware.java000066400000000000000000000021101330756104600352100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ /** * See the plugin configuration parameter {@code shutdown}. * * @author Tibor Digana (tibor17) * @since 2.19 */ public interface ShutdownAware { void setShutdown( Shutdown shutdown ); } SurefireClassLoadersAware.java000066400000000000000000000017351330756104600374750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ /** * @author Kristian Rosenvold */ interface SurefireClassLoadersAware { void setClassLoaders( ClassLoader testClassLoader ); } SurefireReflector.java000066400000000000000000000413331330756104600360610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.log.api.ConsoleLoggerDecorator; import org.apache.maven.surefire.cli.CommandLineOption; import org.apache.maven.surefire.providerapi.ProviderParameters; import org.apache.maven.surefire.report.ReporterConfiguration; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.DirectoryScannerParameters; import org.apache.maven.surefire.testset.RunOrderParameters; import org.apache.maven.surefire.testset.TestArtifactInfo; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.testset.TestRequest; import org.apache.maven.surefire.util.RunOrder; import org.apache.maven.surefire.util.SurefireReflectionException; import javax.annotation.Nonnull; import java.io.File; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import static java.util.Collections.checkedList; import static org.apache.maven.surefire.util.ReflectionUtils.getConstructor; import static org.apache.maven.surefire.util.ReflectionUtils.getMethod; import static org.apache.maven.surefire.util.ReflectionUtils.instantiateOneArg; import static org.apache.maven.surefire.util.ReflectionUtils.instantiateTwoArgs; import static org.apache.maven.surefire.util.ReflectionUtils.invokeGetter; import static org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray; import static org.apache.maven.surefire.util.ReflectionUtils.invokeSetter; import static org.apache.maven.surefire.util.ReflectionUtils.newInstance; /** * Does reflection based invocation of the surefire methods. *
* This is to avoid complications with linkage issues * * @author Kristian Rosenvold */ public class SurefireReflector { private final ClassLoader surefireClassLoader; private final Class reporterConfiguration; private final Class testRequest; private final Class testArtifactInfo; private final Class testArtifactInfoAware; private final Class directoryScannerParameters; private final Class runOrderParameters; private final Class directoryScannerParametersAware; private final Class testSuiteDefinitionAware; private final Class testClassLoaderAware; private final Class reporterConfigurationAware; private final Class providerPropertiesAware; private final Class runResult; private final Class booterParameters; private final Class reporterFactory; private final Class testListResolver; private final Class mainCliOptions; private final Class commandLineOptionsClass; private final Class shutdownAwareClass; private final Class shutdownClass; @SuppressWarnings( "unchecked" ) public SurefireReflector( ClassLoader surefireClassLoader ) { this.surefireClassLoader = surefireClassLoader; try { reporterConfiguration = surefireClassLoader.loadClass( ReporterConfiguration.class.getName() ); testRequest = surefireClassLoader.loadClass( TestRequest.class.getName() ); testArtifactInfo = surefireClassLoader.loadClass( TestArtifactInfo.class.getName() ); testArtifactInfoAware = surefireClassLoader.loadClass( TestArtifactInfoAware.class.getName() ); directoryScannerParameters = surefireClassLoader.loadClass( DirectoryScannerParameters.class.getName() ); runOrderParameters = surefireClassLoader.loadClass( RunOrderParameters.class.getName() ); directoryScannerParametersAware = surefireClassLoader.loadClass( DirectoryScannerParametersAware.class.getName() ); testSuiteDefinitionAware = surefireClassLoader.loadClass( TestRequestAware.class.getName() ); testClassLoaderAware = surefireClassLoader.loadClass( SurefireClassLoadersAware.class.getName() ); reporterConfigurationAware = surefireClassLoader.loadClass( ReporterConfigurationAware.class.getName() ); providerPropertiesAware = surefireClassLoader.loadClass( ProviderPropertiesAware.class.getName() ); reporterFactory = surefireClassLoader.loadClass( ReporterFactory.class.getName() ); runResult = surefireClassLoader.loadClass( RunResult.class.getName() ); booterParameters = surefireClassLoader.loadClass( ProviderParameters.class.getName() ); testListResolver = surefireClassLoader.loadClass( TestListResolver.class.getName() ); mainCliOptions = surefireClassLoader.loadClass( MainCliOptionsAware.class.getName() ); commandLineOptionsClass = (Class) surefireClassLoader.loadClass( CommandLineOption.class.getName() ); shutdownAwareClass = surefireClassLoader.loadClass( ShutdownAware.class.getName() ); shutdownClass = (Class) surefireClassLoader.loadClass( Shutdown.class.getName() ); } catch ( ClassNotFoundException e ) { throw new SurefireReflectionException( e ); } } public Object convertIfRunResult( Object result ) { if ( result == null || !isRunResult( result ) ) { return result; } int getCompletedCount1 = (Integer) invokeGetter( result, "getCompletedCount" ); int getErrors = (Integer) invokeGetter( result, "getErrors" ); int getSkipped = (Integer) invokeGetter( result, "getSkipped" ); int getFailures = (Integer) invokeGetter( result, "getFailures" ); return new RunResult( getCompletedCount1, getErrors, getFailures, getSkipped ); } class ClassLoaderProxy implements InvocationHandler { private final Object target; /** * @param delegate a target */ ClassLoaderProxy( Object delegate ) { this.target = delegate; } @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { Method delegateMethod = target.getClass().getMethod( method.getName(), method.getParameterTypes() ); return delegateMethod.invoke( target, args ); } } Object createTestRequest( TestRequest suiteDefinition ) { if ( suiteDefinition == null ) { return null; } else { Object resolver = createTestListResolver( suiteDefinition.getTestListResolver() ); Class[] arguments = { List.class, File.class, testListResolver, int.class }; Constructor constructor = getConstructor( testRequest, arguments ); return newInstance( constructor, suiteDefinition.getSuiteXmlFiles(), suiteDefinition.getTestSourceDirectory(), resolver, suiteDefinition.getRerunFailingTestsCount() ); } } Object createTestListResolver( TestListResolver resolver ) { if ( resolver == null ) { return null; } else { Constructor constructor = getConstructor( testListResolver, String.class ); return newInstance( constructor, resolver.getPluginParameterTest() ); } } Object createDirectoryScannerParameters( DirectoryScannerParameters directoryScannerParameters ) { if ( directoryScannerParameters == null ) { return null; } //Can't use the constructor with the RunOrder parameter. Using it causes some integration tests to fail. Class[] arguments = { File.class, List.class, List.class, List.class, boolean.class, String.class }; Constructor constructor = getConstructor( this.directoryScannerParameters, arguments ); return newInstance( constructor, directoryScannerParameters.getTestClassesDirectory(), directoryScannerParameters.getIncludes(), directoryScannerParameters.getExcludes(), directoryScannerParameters.getSpecificTests(), directoryScannerParameters.isFailIfNoTests(), RunOrder.asString( directoryScannerParameters.getRunOrder() ) ); } Object createRunOrderParameters( RunOrderParameters runOrderParameters ) { if ( runOrderParameters == null ) { return null; } //Can't use the constructor with the RunOrder parameter. Using it causes some integration tests to fail. Class[] arguments = { String.class, File.class }; Constructor constructor = getConstructor( this.runOrderParameters, arguments ); File runStatisticsFile = runOrderParameters.getRunStatisticsFile(); return newInstance( constructor, RunOrder.asString( runOrderParameters.getRunOrder() ), runStatisticsFile ); } Object createTestArtifactInfo( TestArtifactInfo testArtifactInfo ) { if ( testArtifactInfo == null ) { return null; } Class[] arguments = { String.class, String.class }; Constructor constructor = getConstructor( this.testArtifactInfo, arguments ); return newInstance( constructor, testArtifactInfo.getVersion(), testArtifactInfo.getClassifier() ); } Object createReporterConfiguration( ReporterConfiguration reporterConfig ) { Constructor constructor = getConstructor( reporterConfiguration, File.class, boolean.class ); return newInstance( constructor, reporterConfig.getReportsDirectory(), reporterConfig.isTrimStackTrace() ); } public Object createBooterConfiguration( ClassLoader surefireClassLoader, Object factoryInstance, boolean insideFork ) { return instantiateTwoArgs( surefireClassLoader, BaseProviderFactory.class.getName(), reporterFactory, factoryInstance, boolean.class, insideFork ); } public Object instantiateProvider( String providerClassName, Object booterParameters ) { return instantiateOneArg( surefireClassLoader, providerClassName, this.booterParameters, booterParameters ); } public void setIfDirScannerAware( Object o, DirectoryScannerParameters dirScannerParams ) { if ( directoryScannerParametersAware.isAssignableFrom( o.getClass() ) ) { setDirectoryScannerParameters( o, dirScannerParams ); } } public void setMainCliOptions( Object o, List options ) { if ( mainCliOptions.isAssignableFrom( o.getClass() ) ) { List newOptions = checkedList( new ArrayList( options.size() ), commandLineOptionsClass ); Collection ordinals = toOrdinals( options ); for ( Enum e : commandLineOptionsClass.getEnumConstants() ) { if ( ordinals.contains( e.ordinal() ) ) { newOptions.add( e ); } } invokeSetter( o, "setMainCliOptions", List.class, newOptions ); } } public void setSkipAfterFailureCount( Object o, int skipAfterFailureCount ) { invokeSetter( o, "setSkipAfterFailureCount", int.class, skipAfterFailureCount ); } public void setShutdown( Object o, Shutdown shutdown ) { if ( shutdownAwareClass.isAssignableFrom( o.getClass() ) ) { for ( Enum e : shutdownClass.getEnumConstants() ) { if ( shutdown.ordinal() == e.ordinal() ) { invokeSetter( o, "setShutdown", shutdownClass, e ); break; } } } } public void setSystemExitTimeout( Object o, Integer systemExitTimeout ) { invokeSetter( o, "setSystemExitTimeout", Integer.class, systemExitTimeout ); } public void setDirectoryScannerParameters( Object o, DirectoryScannerParameters dirScannerParams ) { Object param = createDirectoryScannerParameters( dirScannerParams ); invokeSetter( o, "setDirectoryScannerParameters", directoryScannerParameters, param ); } public void setRunOrderParameters( Object o, RunOrderParameters runOrderParameters ) { Object param = createRunOrderParameters( runOrderParameters ); invokeSetter( o, "setRunOrderParameters", this.runOrderParameters, param ); } public void setTestSuiteDefinitionAware( Object o, TestRequest testSuiteDefinition2 ) { if ( testSuiteDefinitionAware.isAssignableFrom( o.getClass() ) ) { setTestSuiteDefinition( o, testSuiteDefinition2 ); } } void setTestSuiteDefinition( Object o, TestRequest testSuiteDefinition1 ) { Object param = createTestRequest( testSuiteDefinition1 ); invokeSetter( o, "setTestRequest", testRequest, param ); } public void setProviderPropertiesAware( Object o, Map properties ) { if ( providerPropertiesAware.isAssignableFrom( o.getClass() ) ) { setProviderProperties( o, properties ); } } void setProviderProperties( Object o, Map providerProperties ) { invokeSetter( o, "setProviderProperties", Map.class, providerProperties ); } public void setReporterConfigurationAware( Object o, ReporterConfiguration reporterConfiguration1 ) { if ( reporterConfigurationAware.isAssignableFrom( o.getClass() ) ) { setReporterConfiguration( o, reporterConfiguration1 ); } } void setReporterConfiguration( Object o, ReporterConfiguration reporterConfiguration ) { Object param = createReporterConfiguration( reporterConfiguration ); invokeSetter( o, "setReporterConfiguration", this.reporterConfiguration, param ); } public void setTestClassLoaderAware( Object o, ClassLoader testClassLoader ) { if ( testClassLoaderAware.isAssignableFrom( o.getClass() ) ) { setTestClassLoader( o, testClassLoader ); } } void setTestClassLoader( Object o, ClassLoader testClassLoader ) { Method setter = getMethod( o, "setClassLoaders", ClassLoader.class ); invokeMethodWithArray( o, setter, testClassLoader ); } public void setTestArtifactInfoAware( Object o, TestArtifactInfo testArtifactInfo1 ) { if ( testArtifactInfoAware.isAssignableFrom( o.getClass() ) ) { setTestArtifactInfo( o, testArtifactInfo1 ); } } void setTestArtifactInfo( Object o, TestArtifactInfo testArtifactInfo ) { Object param = createTestArtifactInfo( testArtifactInfo ); invokeSetter( o, "setTestArtifactInfo", this.testArtifactInfo, param ); } private boolean isRunResult( Object o ) { return runResult.isAssignableFrom( o.getClass() ); } public Object createConsoleLogger( @Nonnull ConsoleLogger consoleLogger ) { return createConsoleLogger( consoleLogger, surefireClassLoader ); } private static Collection toOrdinals( Collection enums ) { Collection ordinals = new ArrayList( enums.size() ); for ( Enum e : enums ) { ordinals.add( e.ordinal() ); } return ordinals; } public static Object createConsoleLogger( ConsoleLogger consoleLogger, ClassLoader cl ) { try { Class decoratorClass = cl.loadClass( ConsoleLoggerDecorator.class.getName() ); return getConstructor( decoratorClass, Object.class ).newInstance( consoleLogger ); } catch ( Exception e ) { throw new SurefireReflectionException( e ); } } } TestArtifactInfoAware.java000066400000000000000000000020371330756104600366160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.surefire.testset.TestArtifactInfo; /** * @author Kristian Rosenvold */ interface TestArtifactInfoAware { void setTestArtifactInfo( TestArtifactInfo testArtifactInfo ); } TestRequestAware.java000066400000000000000000000020161330756104600356720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.surefire.testset.TestRequest; /** * @author Kristian Rosenvold */ interface TestRequestAware { void setTestRequest( TestRequest testSuiteDefinition ); } maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/cli/000077500000000000000000000000001330756104600311145ustar00rootroot00000000000000CommandLineOption.java000066400000000000000000000037241330756104600352650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/clipackage org.apache.maven.surefire.cli; /* * 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. */ import java.util.ArrayList; import java.util.Collection; import java.util.List; /** * CLI options. * * @author Tibor Digana (tibor17) * @since 2.19 * @see command line options */ public enum CommandLineOption { REACTOR_FAIL_FAST , REACTOR_FAIL_AT_END, REACTOR_FAIL_NEVER, SHOW_ERRORS, LOGGING_LEVEL_WARN, LOGGING_LEVEL_INFO, LOGGING_LEVEL_ERROR, LOGGING_LEVEL_DEBUG; public static List fromStrings( Collection elements ) { List options = new ArrayList( elements.size() ); for ( String element : elements ) { options.add( valueOf( element ) ); } return options; } public static List toStrings( Collection options ) { List elements = new ArrayList( options.size() ); for ( CommandLineOption option : options ) { elements.add( option.name() ); } return elements; } } maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/providerapi/000077500000000000000000000000001330756104600326715ustar00rootroot00000000000000AbstractProvider.java000066400000000000000000000025331330756104600367360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/providerapipackage org.apache.maven.surefire.providerapi; /* * 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. */ /** * A provider base class that all providers should extend to shield themselves from interface changes * * @author Kristian Rosenvold */ public abstract class AbstractProvider implements SurefireProvider { private final Thread creatingThread = Thread.currentThread(); @Override public void cancel() { synchronized ( creatingThread ) { if ( creatingThread.isAlive() ) { creatingThread.interrupt(); } } } } ProviderParameters.java000066400000000000000000000115701330756104600372770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/providerapipackage org.apache.maven.surefire.providerapi; /* * 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. */ import org.apache.maven.surefire.booter.Shutdown; import org.apache.maven.surefire.cli.CommandLineOption; import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.report.ReporterConfiguration; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.testset.DirectoryScannerParameters; import org.apache.maven.surefire.testset.TestArtifactInfo; import org.apache.maven.surefire.testset.TestRequest; import org.apache.maven.surefire.util.DirectoryScanner; import org.apache.maven.surefire.util.RunOrderCalculator; import org.apache.maven.surefire.util.ScanResult; import java.util.List; import java.util.Map; /** * Injected into the providers upon provider construction. Allows the provider to request services and data it needs. *
* NOTE: This class is part of the proposed public api for surefire providers from 2.7 and up. It may * still be subject to changes, even for minor revisions. *
* The api covers this interface and all the types reachable from it. And nothing else. * * @author Kristian Rosenvold */ public interface ProviderParameters { /** * Provides a directory scanner that enforces the includes/excludes parameters that were passed to surefire. * See #getDirectoryScannerParameters for details * * @return The directory scanner * @deprecated Use scanresult instead, as of version 2.12.2. Will be removed in next major version. */ @Deprecated DirectoryScanner getDirectoryScanner(); /** * Provides the result of the directory scan performed in the plugin * * @return The scan result */ ScanResult getScanResult(); /** * Provides a service to calculate run order of tests. Applied after directory scanning. * * @return A RunOrderCalculator */ RunOrderCalculator getRunOrderCalculator(); /** * Provides features for creating reporting objects * * @return A ReporterFactory that allows the creation of one or more ReporterManagers */ ReporterFactory getReporterFactory(); /** * Gets a logger intended for console output. *
* This output is intended for provider-oriented messages that are not attached to a single test-set * and will normally be written to something console-like immediately. * * @return A console stream logger */ ConsoleStream getConsoleLogger(); /** * The raw parameters used in creating the directory scanner * * @return The parameters * @deprecated Use scanresult instead, as of version 2.12.2. Will be removed in next major version. */ @Deprecated DirectoryScannerParameters getDirectoryScannerParameters(); /** * The raw parameters used in creating the ReporterManagerFactory * * @return The reporter configuration */ ReporterConfiguration getReporterConfiguration(); /** * Contains information about requested test suites or individual tests from the command line. * * @return The testRequest */ TestRequest getTestRequest(); /** * The class loader for the tests * * @return the classloader */ ClassLoader getTestClassLoader(); /** * The per-provider specific properties that may come all the way from the plugin's properties setting. * * @return the provider specific properties */ Map getProviderProperties(); /** * Artifact info about the artifact used to autodetect provider * * @return The artifactinfo, or null if autodetect was not used. */ TestArtifactInfo getTestArtifactInfo(); List getMainCliOptions(); /** * @return Defaults to 0. Configured with parameter {@code skipAfterFailureCount} in POM. */ int getSkipAfterFailureCount(); /** * @return {@code true} if test provider appears in forked jvm; Otherwise {@code false} means * in-plugin provider. */ boolean isInsideFork(); Shutdown getShutdown(); Integer getSystemExitTimeout(); } SurefireProvider.java000066400000000000000000000073741330756104600367670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/providerapipackage org.apache.maven.surefire.providerapi; /* * 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. */ import java.lang.reflect.InvocationTargetException; import org.apache.maven.surefire.report.ReporterException; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.TestSetFailedException; /** * Interface to be implemented by all Surefire providers. *
* NOTE: This class is part of the proposed public api for surefire providers for 2.7. It may * still be subject to changes, even for minor revisions. *
* The api covers this interface and all the types reachable from it. And nothing else. *
*
* Called in one of three ways: * Forkmode = never: getSuites is not called, invoke is called with null parameter * Forkmode = once: getSuites is not called, invoke is called with null parameter * Forkmode anything else: getSuites is called, invoke is called on new provider instance for each item in getSuites * response. * * @author Kristian Rosenvold */ public interface SurefireProvider { /** * Determines the number of forks. *
* Called when forkmode is different from "never" or "always", allows the provider to define * how to behave for the fork. * * @return An iterator that will trigger one fork per item */ Iterable> getSuites(); /** * Runs a forked test * * @param forkTestSet An item from the iterator in #getSuites. Will be null for forkmode never or always. * When this is non-null, the forked process will run only that test * and probably not scan the classpath * @return A result of the invocation * @throws org.apache.maven.surefire.report.ReporterException * When reporting fails * @throws org.apache.maven.surefire.testset.TestSetFailedException * When testset fails * @throws InvocationTargetException fails in {@code ProviderFactory} */ @SuppressWarnings( "checkstyle:redundantthrows" ) RunResult invoke( Object forkTestSet ) throws TestSetFailedException, ReporterException, InvocationTargetException; /** * Makes an attempt at cancelling the current run, giving the provider a chance to notify * reporting that the remaining tests have been cancelled due to timeout. *
* If the provider thinks it can terminate properly it is the responsibility of * the invoke method to return a RunResult with a booter code of failure. *
* It is up to the provider to find out how to implement this method properly. * A provider may also choose to not do anything at all in this method, * which means surefire will kill the forked process soon afterwards anyway. *
* Will be called on a different thread than the one calling invoke. */ // Todo: Need to think a lot closer about how/if this works and if there is a use case for it. // Killing a process is slightly non-deterministic // And it void cancel(); } maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/report/000077500000000000000000000000001330756104600316605ustar00rootroot00000000000000CategorizedReportEntry.java000066400000000000000000000073631330756104600371330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import java.util.Collections; import java.util.Map; /** * @author Kristian Rosenvold */ public class CategorizedReportEntry extends SimpleReportEntry implements ReportEntry { private static final String GROUP_PREFIX = " (of "; private static final String GROUP_SUFIX = ")"; private final String group; public CategorizedReportEntry( String source, String name, String group ) { this( source, name, group, null, null ); } public CategorizedReportEntry( String source, String name, String group, StackTraceWriter stackTraceWriter, Integer elapsed ) { super( source, name, stackTraceWriter, elapsed ); this.group = group; } public CategorizedReportEntry( String source, String name, String group, StackTraceWriter stackTraceWriter, Integer elapsed, String message ) { this( source, name, group, stackTraceWriter, elapsed, message, Collections.emptyMap() ); } public CategorizedReportEntry( String source, String name, String group, StackTraceWriter stackTraceWriter, Integer elapsed, String message, Map systemProperties ) { super( source, name, stackTraceWriter, elapsed, message, systemProperties ); this.group = group; } public static TestSetReportEntry reportEntry( String source, String name, String group, StackTraceWriter stackTraceWriter, Integer elapsed, String message, Map systemProperties ) { return group != null ? new CategorizedReportEntry( source, name, group, stackTraceWriter, elapsed, message, systemProperties ) : new SimpleReportEntry( source, name, stackTraceWriter, elapsed, message, systemProperties ); } @Override public String getGroup() { return group; } @Override public String getNameWithGroup() { return isNameWithGroup() ? getName() + GROUP_PREFIX + getGroup() + GROUP_SUFIX : getName(); } @Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } if ( !super.equals( o ) ) { return false; } CategorizedReportEntry that = (CategorizedReportEntry) o; return !( group != null ? !group.equals( that.group ) : that.group != null ); } @Override public int hashCode() { int result = super.hashCode(); result = 31 * result + ( group != null ? group.hashCode() : 0 ); return result; } private boolean isNameWithGroup() { return getGroup() != null && !getGroup().equals( getName() ); } } ConsoleOutputCapture.java000066400000000000000000000061271330756104600366210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; import static java.lang.System.setErr; import static java.lang.System.setOut; import static org.apache.maven.surefire.util.internal.StringUtils.NL; /** * Deals with system.out/err. *
*/ public final class ConsoleOutputCapture { public static void startCapture( ConsoleOutputReceiver target ) { setOut( new ForwardingPrintStream( true, target ) ); setErr( new ForwardingPrintStream( false, target ) ); } private static final class ForwardingPrintStream extends PrintStream { private final boolean isStdout; private final ConsoleOutputReceiver target; ForwardingPrintStream( boolean stdout, ConsoleOutputReceiver target ) { super( new NullOutputStream() ); isStdout = stdout; this.target = target; } @Override public void write( byte[] buf, int off, int len ) { // Note: At this point the supplied "buf" instance is reused, which means // data must be copied out of the buffer target.writeTestOutput( buf, off, len, isStdout ); } @Override public void write( byte[] b ) throws IOException { target.writeTestOutput( b, 0, b.length, isStdout ); } @Override public void write( int b ) { try { write( new byte[] { (byte) b } ); } catch ( IOException e ) { setError(); } } @Override public void println( String s ) { if ( s == null ) { s = "null"; // Shamelessly taken from super.print } final byte[] bytes = ( s + NL ).getBytes(); target.writeTestOutput( bytes, 0, bytes.length, isStdout ); } @Override public void close() { } @Override public void flush() { } } private static final class NullOutputStream extends OutputStream { @Override public void write( int b ) throws IOException { } } } ConsoleOutputReceiver.java000066400000000000000000000025211330756104600367540ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ /** * A receiver of stdout/sterr output from running tests. This receiver knows how to associate * the output with a given testset. */ public interface ConsoleOutputReceiver { /** * Forwards process output from the running test-case into the reporting system * * @param buf the buffer to write * @param off offset * @param len len * @param stdout Indicates if this is stdout */ void writeTestOutput( byte[] buf, int off, int len, boolean stdout ); } ConsoleOutputReceiverForCurrentThread.java000066400000000000000000000026441330756104600421240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ /** * @author Kristian Rosenvold */ public final class ConsoleOutputReceiverForCurrentThread { private static final ThreadLocal CURRENT = new InheritableThreadLocal(); private ConsoleOutputReceiverForCurrentThread() { } public static ConsoleOutputReceiver get() { return CURRENT.get(); } public static void set( ConsoleOutputReceiver consoleOutputReceiver ) { CURRENT.set( consoleOutputReceiver ); } public static void remove() { CURRENT.remove(); } } ConsoleStream.java000066400000000000000000000017731330756104600352320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ /** * Delegates to {@link System#out}. */ public interface ConsoleStream { void println( String message ); void println( byte[] buf, int off, int len ); } DefaultDirectConsoleReporter.java000066400000000000000000000026331330756104600402350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import java.io.PrintStream; /** * @author Kristian Rosenvold */ public final class DefaultDirectConsoleReporter implements ConsoleStream { private final PrintStream systemOut; public DefaultDirectConsoleReporter( PrintStream systemOut ) { this.systemOut = systemOut; } @Override public void println( String message ) { systemOut.println( message ); } @Override public void println( byte[] buf, int off, int len ) { println( new String( buf, off, len ) ); } } LegacyPojoStackTraceWriter.java000066400000000000000000000130131330756104600376400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import org.apache.maven.surefire.util.internal.StringUtils; import java.io.PrintWriter; import java.io.StringWriter; /** * Write the trace out for a POJO test. Java 1.5 compatible. * * @author Brett Porter */ public class LegacyPojoStackTraceWriter implements StackTraceWriter { private static final int MAX_LINE_LENGTH = 77; private final Throwable t; private final String testClass; private final String testMethod; public LegacyPojoStackTraceWriter( String testClass, String testMethod, Throwable t ) { this.testClass = testClass; this.testMethod = testMethod; this.t = t; } @Override public String writeTraceToString() { if ( t != null ) { StringWriter w = new StringWriter(); PrintWriter stackTrace = new PrintWriter( w ); try { t.printStackTrace( stackTrace ); stackTrace.flush(); } finally { stackTrace.close(); } StringBuffer builder = w.getBuffer(); if ( isMultiLineExceptionMessage( t ) ) { // SUREFIRE-986 String exc = t.getClass().getName() + ": "; if ( StringUtils.startsWith( builder, exc ) ) { builder.insert( exc.length(), '\n' ); } } return builder.toString(); } return ""; } @Override public String smartTrimmedStackTrace() { StringBuilder result = new StringBuilder(); result.append( testClass ); result.append( "#" ); result.append( testMethod ); SafeThrowable throwable = getThrowable(); if ( throwable.getTarget() instanceof AssertionError ) { result.append( " " ); result.append( getTruncatedMessage( throwable.getMessage(), MAX_LINE_LENGTH - result.length() ) ); } else { Throwable target = throwable.getTarget(); if ( target != null ) { result.append( " " ); result.append( target.getClass().getSimpleName() ); result.append( getTruncatedMessage( throwable.getMessage(), MAX_LINE_LENGTH - result.length() ) ); } } return result.toString(); } private static boolean isMultiLineExceptionMessage( Throwable t ) { String msg = t.getLocalizedMessage(); if ( msg != null ) { int countNewLines = 0; for ( int i = 0, length = msg.length(); i < length; i++ ) { if ( msg.charAt( i ) == '\n' ) { if ( ++countNewLines == 2 ) { break; } } } return countNewLines > 1 || countNewLines == 1 && !msg.trim().endsWith( "\n" ); } return false; } private static String getTruncatedMessage( String msg, int i ) { if ( i < 0 ) { return ""; } if ( msg == null ) { return ""; } String substring = msg.substring( 0, Math.min( i, msg.length() ) ); if ( i < msg.length() ) { return " " + substring + "..."; } else { return " " + substring; } } @Override public String writeTrimmedTraceToString() { String text = writeTraceToString(); String marker = "at " + testClass + "." + testMethod; String[] lines = StringUtils.split( text, "\n" ); int lastLine = lines.length - 1; int causedByLine = -1; // skip first for ( int i = 1; i < lines.length; i++ ) { String line = lines[i].trim(); if ( line.startsWith( marker ) ) { lastLine = i; } else if ( line.startsWith( "Caused by" ) ) { causedByLine = i; break; } } StringBuilder trace = new StringBuilder(); for ( int i = 0; i <= lastLine; i++ ) { trace.append( lines[i] ); trace.append( "\n" ); } if ( causedByLine != -1 ) { for ( int i = causedByLine; i < lines.length; i++ ) { trace.append( lines[i] ); trace.append( "\n" ); } } return trace.toString(); } @Override public SafeThrowable getThrowable() { return new SafeThrowable( t ); } } ReportEntry.java000066400000000000000000000043161330756104600347450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ /** * Describes a single entry for a test report * */ public interface ReportEntry { /** * The class name of the test * * @return A string with the class name */ String getSourceName(); /** * The name of the test case * * @return A string describing the test case */ String getName(); /** * The group/category of the testcase * * @return A string */ String getGroup(); /** * The group/category of the testcase * * @return A string */ StackTraceWriter getStackTraceWriter(); /** * Gets the runtime for the item. Optional parameter. If the value is not set, it will be determined within * the reporting subsystem. Some providers like to calculate this value themselves, and it gets the * most accurate value. * @return duration of a test in milli seconds */ Integer getElapsed(); /** * A message relating to a non-successful termination. * May be the "message" from an exception or the reason for a test being ignored * * @return A string that explains an anomaly */ String getMessage(); /** * A name of the test case together with the group or category (if any exists). * * @return A string with the test case name and group/category, or just the name. */ String getNameWithGroup(); } ReporterConfiguration.java000066400000000000000000000052521330756104600370020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import java.io.File; import java.io.PrintStream; /** * Bits and pieces of reporting configuration that seem to be necessary on the provider side. *
* Todo: Consider moving these fields elsewhere, this concept does not smell too good * * @author Kristian Rosenvold */ public class ReporterConfiguration { private final File reportsDirectory; private final PrintStream originalSystemOut; /** * A non-null Boolean value */ private final boolean trimStackTrace; public ReporterConfiguration( File reportsDirectory, boolean trimStackTrace ) { this.reportsDirectory = reportsDirectory; this.trimStackTrace = trimStackTrace; /* * While this may seem slightly odd, when this object is constructed no user code has been run * (including classloading), and we can be guaranteed that no-one has modified System.out/System.err. * As soon as we start loading user code, all h*ll breaks loose in this respect. */ this.originalSystemOut = System.out; } /** * The directory where reports will be created, normally ${project.build.directory}/surefire-reports * * @return A file pointing at the specified directory */ public File getReportsDirectory() { return reportsDirectory; } /** * Indicates if reporting should trim the stack traces. * * @return true if stacktraces should be trimmed in reporting */ public boolean isTrimStackTrace() { return trimStackTrace; } /** * The original system out belonging to the (possibly forked) surefire process. * Note that users of Reporter/ReporterFactory should normally not be using this. * * @return A printstream. */ public PrintStream getOriginalSystemOut() { return originalSystemOut; } } ReporterException.java000066400000000000000000000022001330756104600361170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ /** * Exception occurring during report generation. * * @author Brett Porter */ public class ReporterException extends RuntimeException { public ReporterException( String message, Exception nested ) { super( message, nested ); } } ReporterFactory.java000066400000000000000000000024431330756104600356010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import org.apache.maven.surefire.suite.RunResult; /** * Used by the providers to request (per-thread) run listeners. * * @author Kristian Rosenvold */ public interface ReporterFactory { /** * Creates a reporter. * * @return A reporter instance */ RunListener createReporter(); /** * Closes the factory, freeing resources allocated in the factory. * * @return The run result */ RunResult close(); } RunListener.java000066400000000000000000000061671330756104600347300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ /** * Used by providers to report results. * Using this interface integrates the providers together into a common reporting infrastructure. *
* An instance of a reporter is not guaranteed to be thread-safe and concurrent test frameworks * must request an instance of a reporter per-thread from the ReporterFactory. */ public interface RunListener { /** * Indicates the start of a given test-set * * @param report the report entry describing the testset * @throws ReporterException When reporting fails */ void testSetStarting( TestSetReportEntry report ); /** * Indicates end of a given test-set * * @param report the report entry describing the testset * @throws ReporterException When reporting fails */ void testSetCompleted( TestSetReportEntry report ); /** * Event fired when a test is about to start * * @param report The report entry to log for */ void testStarting( ReportEntry report ); /** * Event fired when a test ended successfully * * @param report The report entry to log for */ void testSucceeded( ReportEntry report ); /** * Event fired when a test assumption failure was encountered. * An assumption failure indicates that the test is not relevant * * @param report The report entry to log for */ void testAssumptionFailure( ReportEntry report ); /** * Event fired when a test ended with an error (non anticipated problem) * * @param report The report entry to log for */ void testError( ReportEntry report ); /** * Event fired when a test ended with a failure (anticipated problem) * * @param report The report entry to log for */ void testFailed( ReportEntry report ); /** * Event fired when a test is skipped * * @param report The report entry to log for */ void testSkipped( ReportEntry report ); /** * Event fired skipping an execution of remaining test-set in other fork(s); or does nothing if no forks. * The method is called by {@link org.apache.maven.surefire.providerapi.SurefireProvider}.

* (The event is fired after the Nth test failed to signal skipping the rest of test-set.) */ void testExecutionSkippedByUser(); } SafeThrowable.java000066400000000000000000000031661330756104600352000ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ /** * Guards against misbehaving throwables */ public class SafeThrowable { private final Throwable target; public SafeThrowable( Throwable target ) { this.target = target; } public SafeThrowable( String message ) { this( new Throwable( message ) ); } public String getLocalizedMessage() { try { return target.getLocalizedMessage(); } catch ( Throwable t ) { return t.getLocalizedMessage(); } } public String getMessage() { try { return target.getMessage(); } catch ( Throwable t ) { return t.getMessage(); } } public Throwable getTarget() { return target; } } SimpleReportEntry.java000066400000000000000000000147101330756104600361160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import org.apache.maven.surefire.util.internal.ImmutableMap; import java.util.Collections; import java.util.Map; /** * @author Kristian Rosenvold */ public class SimpleReportEntry implements TestSetReportEntry { private final Map systemProperties; private final String source; private final String name; private final StackTraceWriter stackTraceWriter; private final Integer elapsed; private final String message; public SimpleReportEntry() { this( null, null ); } public SimpleReportEntry( String source, String name ) { this( source, name, null, null ); } public SimpleReportEntry( String source, String name, Map systemProperties ) { this( source, name, null, null, systemProperties ); } private SimpleReportEntry( String source, String name, StackTraceWriter stackTraceWriter ) { this( source, name, stackTraceWriter, null ); } public SimpleReportEntry( String source, String name, Integer elapsed ) { this( source, name, null, elapsed ); } public SimpleReportEntry( String source, String name, String message ) { this( source, name, null, null, message, Collections.emptyMap() ); } protected SimpleReportEntry( String source, String name, StackTraceWriter stackTraceWriter, Integer elapsed, String message, Map systemProperties ) { if ( source == null ) { source = "null"; } if ( name == null ) { name = "null"; } this.source = source; this.name = name; this.stackTraceWriter = stackTraceWriter; this.message = message; this.elapsed = elapsed; this.systemProperties = new ImmutableMap( systemProperties ); } public SimpleReportEntry( String source, String name, StackTraceWriter stackTraceWriter, Integer elapsed ) { this( source, name, stackTraceWriter, elapsed, Collections.emptyMap() ); } public SimpleReportEntry( String source, String name, StackTraceWriter stackTraceWriter, Integer elapsed, Map systemProperties ) { this( source, name, stackTraceWriter, elapsed, safeGetMessage( stackTraceWriter ), systemProperties ); } public static SimpleReportEntry assumption( String source, String name, String message ) { return new SimpleReportEntry( source, name, message ); } public static SimpleReportEntry ignored( String source, String name, String message ) { return new SimpleReportEntry( source, name, message ); } public static SimpleReportEntry withException( String source, String name, StackTraceWriter stackTraceWriter ) { return new SimpleReportEntry( source, name, stackTraceWriter ); } private static String safeGetMessage( StackTraceWriter stackTraceWriter ) { try { SafeThrowable t = stackTraceWriter == null ? null : stackTraceWriter.getThrowable(); return t == null ? null : t.getMessage(); } catch ( Throwable t ) { return t.getMessage(); } } @Override public String getSourceName() { return source; } @Override public String getName() { return name; } @Override public String getGroup() { return null; } @Override public StackTraceWriter getStackTraceWriter() { return stackTraceWriter; } @Override public Integer getElapsed() { return elapsed; } @Override public String toString() { return "ReportEntry{" + "source='" + source + '\'' + ", name='" + name + '\'' + ", stackTraceWriter=" + stackTraceWriter + ", elapsed=" + elapsed + ",message=" + message + '}'; } @Override public String getMessage() { return message; } @Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } SimpleReportEntry that = (SimpleReportEntry) o; return isElapsedTimeEqual( that ) && isNameEqual( that ) && isSourceEqual( that ) && isStackEqual( that ); } @Override public int hashCode() { int result = source != null ? source.hashCode() : 0; result = 31 * result + ( name != null ? name.hashCode() : 0 ); result = 31 * result + ( stackTraceWriter != null ? stackTraceWriter.hashCode() : 0 ); result = 31 * result + ( elapsed != null ? elapsed.hashCode() : 0 ); return result; } @Override public String getNameWithGroup() { return getName(); } @Override public Map getSystemProperties() { return systemProperties; } private boolean isElapsedTimeEqual( SimpleReportEntry en ) { return elapsed != null ? elapsed.equals( en.elapsed ) : en.elapsed == null; } private boolean isNameEqual( SimpleReportEntry en ) { return name != null ? name.equals( en.name ) : en.name == null; } private boolean isSourceEqual( SimpleReportEntry en ) { return source != null ? source.equals( en.source ) : en.source == null; } private boolean isStackEqual( SimpleReportEntry en ) { return stackTraceWriter != null ? stackTraceWriter.equals( en.stackTraceWriter ) : en.stackTraceWriter == null; } } StackTraceWriter.java000066400000000000000000000031271330756104600356700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ /** * Ability to write a stack trace, filtered to omit locations inside Surefire and Maven. * * @author Brett Porter */ public interface StackTraceWriter { /** * Write the throwable to a string, without trimming. * * @return the trace */ String writeTraceToString(); /** * Write the throwable to a string, trimming extra locations. * * @return the trace */ String writeTrimmedTraceToString(); /** * Get the "smart" trimmed (1-2 lines) stacktrace. * * @return the trace */ String smartTrimmedStackTrace(); /** * Retrieve the throwable for this writer. * * @return the throwable */ SafeThrowable getThrowable(); } TestSetReportEntry.java000066400000000000000000000023441330756104600362600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import java.util.Map; /** * Describes test-set when started and finished. * * @author Tibor Digana (tibor17) * @see RunListener#testSetStarting(TestSetReportEntry) * @see RunListener#testSetCompleted(TestSetReportEntry) * @since 2.20.1 */ public interface TestSetReportEntry extends ReportEntry { Map getSystemProperties(); } maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/suite/000077500000000000000000000000001330756104600314765ustar00rootroot00000000000000RunResult.java000066400000000000000000000154021330756104600342270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/suitepackage org.apache.maven.surefire.suite; /* * 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. */ import java.io.ByteArrayOutputStream; import java.io.PrintWriter; /** * Represents a test-run-result; this may be from a single test run or an aggregated result. *
* In the case of timeout==true, the run-counts reflect the state of the test-run at the time * of the timeout. * * @author Kristian Rosenvold */ public class RunResult { private final int completedCount; private final int errors; private final int failures; private final int skipped; private final int flakes; private final String failure; private final boolean timeout; public static final int SUCCESS = 0; private static final int FAILURE = 255; private static final int NO_TESTS = 254; public static RunResult timeout( RunResult accumulatedAtTimeout ) { return errorCode( accumulatedAtTimeout, accumulatedAtTimeout.getFailure(), true ); } public static RunResult failure( RunResult accumulatedAtTimeout, Exception cause ) { return errorCode( accumulatedAtTimeout, getStackTrace( cause ), accumulatedAtTimeout.isTimeout() ); } private static RunResult errorCode( RunResult other, String failure, boolean timeout ) { return new RunResult( other.getCompletedCount(), other.getErrors(), other.getFailures(), other.getSkipped(), failure, timeout ); } public RunResult( int completedCount, int errors, int failures, int skipped ) { this( completedCount, errors, failures, skipped, null, false ); } public RunResult( int completedCount, int errors, int failures, int skipped, int flakes ) { this( completedCount, errors, failures, skipped, flakes, null, false ); } public RunResult( int completedCount, int errors, int failures, int skipped, String failure, boolean timeout ) { this( completedCount, errors, failures, skipped, 0, failure, timeout ); } public RunResult( int completedCount, int errors, int failures, int skipped, int flakes, String failure, boolean timeout ) { this.completedCount = completedCount; this.errors = errors; this.failures = failures; this.skipped = skipped; this.failure = failure; this.timeout = timeout; this.flakes = flakes; } private static String getStackTrace( Exception e ) { if ( e == null ) { return null; } ByteArrayOutputStream out = new ByteArrayOutputStream(); PrintWriter pw = new PrintWriter( out ); try { e.printStackTrace( pw ); pw.flush(); } finally { pw.close(); } return new String( out.toByteArray() ); } public int getCompletedCount() { return completedCount; } public int getErrors() { return errors; } public int getFlakes() { return flakes; } public int getFailures() { return failures; } public int getSkipped() { return skipped; } public Integer getFailsafeCode() // Only used for compatibility reasons. { if ( completedCount == 0 ) { return NO_TESTS; } if ( !isErrorFree() ) { return FAILURE; } return null; } /* Indicates if the tests are error free */ public boolean isErrorFree() { return getFailures() == 0 && getErrors() == 0 && !isFailure(); } public boolean isInternalError() { return getFailures() == 0 && getErrors() == 0 && isFailure(); } /* Indicates test timeout or technical failure */ public boolean isFailureOrTimeout() { return isTimeout() || isFailure(); } public boolean isFailure() { return failure != null; } public String getFailure() { return failure; } public boolean isTimeout() { return timeout; } public RunResult aggregate( RunResult other ) { String failureMessage = getFailure() != null ? getFailure() : other.getFailure(); boolean timeout = isTimeout() || other.isTimeout(); int completed = getCompletedCount() + other.getCompletedCount(); int fail = getFailures() + other.getFailures(); int ign = getSkipped() + other.getSkipped(); int err = getErrors() + other.getErrors(); int flakes = getFlakes() + other.getFlakes(); return new RunResult( completed, err, fail, ign, flakes, failureMessage, timeout ); } public static RunResult noTestsRun() { return new RunResult( 0, 0, 0, 0 ); } @Override @SuppressWarnings( "RedundantIfStatement" ) public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } RunResult runResult = (RunResult) o; if ( completedCount != runResult.completedCount ) { return false; } if ( errors != runResult.errors ) { return false; } if ( failures != runResult.failures ) { return false; } if ( skipped != runResult.skipped ) { return false; } if ( timeout != runResult.timeout ) { return false; } if ( failure != null ? !failure.equals( runResult.failure ) : runResult.failure != null ) { return false; } return true; } @Override public int hashCode() { int result = completedCount; result = 31 * result + errors; result = 31 * result + failures; result = 31 * result + skipped; result = 31 * result + ( failure != null ? failure.hashCode() : 0 ); result = 31 * result + ( timeout ? 1 : 0 ); return result; } } maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/testset/000077500000000000000000000000001330756104600320405ustar00rootroot00000000000000DirectoryScannerParameters.java000066400000000000000000000067731330756104600401430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/testsetpackage org.apache.maven.surefire.testset; /* * 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. */ import java.io.File; import java.util.List; import org.apache.maven.surefire.util.RunOrder; /** * @author Kristian Rosenvold */ public class DirectoryScannerParameters { private final File testClassesDirectory; @Deprecated private final List includes; @Deprecated private final List excludes; @Deprecated private final List specificTests; private final boolean failIfNoTests; private final RunOrder[] runOrder; private DirectoryScannerParameters( File testClassesDirectory, List includes, List excludes, List specificTests, boolean failIfNoTests, RunOrder[] runOrder ) { this.testClassesDirectory = testClassesDirectory; this.includes = includes; this.excludes = excludes; this.specificTests = specificTests; this.failIfNoTests = failIfNoTests; this.runOrder = runOrder; } public DirectoryScannerParameters( File testClassesDirectory, @Deprecated List includes, @Deprecated List excludes, @Deprecated List specificTests, boolean failIfNoTests, String runOrder ) { this( testClassesDirectory, includes, excludes, specificTests, failIfNoTests, runOrder == null ? RunOrder.DEFAULT : RunOrder.valueOfMulti( runOrder ) ); } @Deprecated public List getSpecificTests() { return specificTests; } /** * Returns the directory of the compiled classes, normally ${project.build.testOutputDirectory} * * @return A directory that can be scanned for .class files */ public File getTestClassesDirectory() { return testClassesDirectory; } /** * The includes pattern list, as specified on the plugin includes parameter. * * @return A list of patterns. May contain both source file designators and .class extensions. */ @Deprecated public List getIncludes() { return includes; } /** * The excludes pattern list, as specified on the plugin includes parameter. * * @return A list of patterns. May contain both source file designators and .class extensions. */ @Deprecated public List getExcludes() { return excludes; } /** * Indicates if lack of runable tests should fail the entire build * * @return true if no tests should fail the build */ public boolean isFailIfNoTests() { return failIfNoTests; } public RunOrder[] getRunOrder() { return runOrder; } } GenericTestPattern.java000066400000000000000000000027131330756104600364010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/testsetpackage org.apache.maven.surefire.testset; /* * 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. */ import java.util.Set; /** * Resolves string test patterns in object oriented patterns {@code P}. * * @param

resolved atomic test, object oriented - not necessary to be a string * @param test class, or null if not mandatory * @param test method, or null if not mandatory */ public interface GenericTestPattern extends TestFilter { boolean hasIncludedMethodPatterns(); boolean hasExcludedMethodPatterns(); boolean hasMethodPatterns(); boolean isEmpty(); String getPluginParameterTest(); Set

getIncludedPatterns(); Set

getExcludedPatterns(); } IncludedExcludedPatterns.java000066400000000000000000000017171330756104600375600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/testsetpackage org.apache.maven.surefire.testset; /* * 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. */ final class IncludedExcludedPatterns { boolean hasExcludedMethodPatterns; boolean hasIncludedMethodPatterns; } ResolvedTest.java000066400000000000000000000376521330756104600352640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/testsetpackage org.apache.maven.surefire.testset; /* * 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. */ import org.apache.maven.shared.utils.StringUtils; import org.apache.maven.shared.utils.io.MatchPatterns; import java.util.regex.Pattern; import static java.io.File.separatorChar; import static java.util.regex.Pattern.compile; import static org.apache.maven.shared.utils.StringUtils.isBlank; import static org.apache.maven.shared.utils.io.MatchPatterns.from; import static org.apache.maven.shared.utils.io.SelectorUtils.PATTERN_HANDLER_SUFFIX; import static org.apache.maven.shared.utils.io.SelectorUtils.REGEX_HANDLER_PREFIX; import static org.apache.maven.shared.utils.io.SelectorUtils.matchPath; /** * Single pattern test filter resolved from multi pattern filter -Dtest=MyTest#test,AnotherTest#otherTest. * @deprecated will be renamed to ResolvedTestPattern */ // will be renamed to ResolvedTestPattern @Deprecated public final class ResolvedTest { /** * Type of patterns in ResolvedTest constructor. */ public enum Type { CLASS, METHOD } private static final String CLASS_FILE_EXTENSION = ".class"; private static final String JAVA_FILE_EXTENSION = ".java"; private static final String WILDCARD_PATH_PREFIX = "**/"; private static final String WILDCARD_FILENAME_POSTFIX = ".*"; private final String classPattern; private final String methodPattern; private final boolean isRegexTestClassPattern; private final boolean isRegexTestMethodPattern; private final String description; private final ClassMatcher classMatcher = new ClassMatcher(); private final MethodMatcher methodMatcher = new MethodMatcher(); /** * '*' means zero or more characters
* '?' means one and only one character * The pattern %regex[] prefix and suffix does not appear. The regex pattern is always * unwrapped by the caller. * * @param classPattern test class file pattern * @param methodPattern test method * @param isRegex {@code true} if pattern is regex */ public ResolvedTest( String classPattern, String methodPattern, boolean isRegex ) { classPattern = tryBlank( classPattern ); methodPattern = tryBlank( methodPattern ); description = description( classPattern, methodPattern, isRegex ); if ( isRegex && classPattern != null ) { classPattern = wrapRegex( classPattern ); } if ( isRegex && methodPattern != null ) { methodPattern = wrapRegex( methodPattern ); } this.classPattern = reformatClassPattern( classPattern, isRegex ); this.methodPattern = methodPattern; isRegexTestClassPattern = isRegex; isRegexTestMethodPattern = isRegex; methodMatcher.sanityCheck(); } /** * The regex {@code pattern} is always unwrapped. * * @param type class or method * @param pattern pattern or regex * @param isRegex {@code true} if pattern is regex */ public ResolvedTest( Type type, String pattern, boolean isRegex ) { pattern = tryBlank( pattern ); final boolean isClass = type == Type.CLASS; description = description( isClass ? pattern : null, !isClass ? pattern : null, isRegex ); if ( isRegex && pattern != null ) { pattern = wrapRegex( pattern ); } classPattern = isClass ? reformatClassPattern( pattern, isRegex ) : null; methodPattern = !isClass ? pattern : null; isRegexTestClassPattern = isRegex && isClass; isRegexTestMethodPattern = isRegex && !isClass; methodMatcher.sanityCheck(); } /** * Test class file pattern, e.g. org/**/Cat*.class
, or null if not any * and {@link #hasTestClassPattern()} returns false. * Other examples: org/animals/Cat*, org/animals/Ca?.class, %regex[Cat.class|Dog.*]
*
* '*' means zero or more characters
* '?' means one and only one character * * @return class pattern or regex */ public String getTestClassPattern() { return classPattern; } public boolean hasTestClassPattern() { return classPattern != null; } /** * Test method, e.g. "realTestMethod".
, or null if not any and {@link #hasTestMethodPattern()} returns false. * Other examples: test* or testSomethin? or %regex[testOne|testTwo] or %ant[testOne|testTwo]
*
* '*' means zero or more characters
* '?' means one and only one character * * @return method pattern or regex */ public String getTestMethodPattern() { return methodPattern; } public boolean hasTestMethodPattern() { return methodPattern != null; } public boolean isRegexTestClassPattern() { return isRegexTestClassPattern; } public boolean isRegexTestMethodPattern() { return isRegexTestMethodPattern; } public boolean isEmpty() { return classPattern == null && methodPattern == null; } public boolean matchAsInclusive( String testClassFile, String methodName ) { testClassFile = tryBlank( testClassFile ); methodName = tryBlank( methodName ); return isEmpty() || alwaysInclusiveQuietly( testClassFile ) || match( testClassFile, methodName ); } public boolean matchAsExclusive( String testClassFile, String methodName ) { testClassFile = tryBlank( testClassFile ); methodName = tryBlank( methodName ); return !isEmpty() && canMatchExclusive( testClassFile, methodName ) && match( testClassFile, methodName ); } @Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } ResolvedTest that = (ResolvedTest) o; return ( classPattern == null ? that.classPattern == null : classPattern.equals( that.classPattern ) ) && ( methodPattern == null ? that.methodPattern == null : methodPattern.equals( that.methodPattern ) ); } @Override public int hashCode() { int result = classPattern != null ? classPattern.hashCode() : 0; result = 31 * result + ( methodPattern != null ? methodPattern.hashCode() : 0 ); return result; } @Override public String toString() { return isEmpty() ? "" : description; } private static String description( String clazz, String method, boolean isRegex ) { String description; if ( clazz == null && method == null ) { description = null; } else if ( clazz == null ) { description = "#" + method; } else if ( method == null ) { description = clazz; } else { description = clazz + "#" + method; } return isRegex && description != null ? wrapRegex( description ) : description; } private boolean canMatchExclusive( String testClassFile, String methodName ) { return canMatchExclusiveMethods( testClassFile, methodName ) || canMatchExclusiveClasses( testClassFile, methodName ) || canMatchExclusiveAll( testClassFile, methodName ); } private boolean canMatchExclusiveMethods( String testClassFile, String methodName ) { return testClassFile == null && methodName != null && classPattern == null && methodPattern != null; } private boolean canMatchExclusiveClasses( String testClassFile, String methodName ) { return testClassFile != null && methodName == null && classPattern != null && methodPattern == null; } private boolean canMatchExclusiveAll( String testClassFile, String methodName ) { return testClassFile != null && methodName != null && ( classPattern != null || methodPattern != null ); } /** * Prevents {@link #match(String, String)} from throwing NPE in situations when inclusive returns true. * * @param testClassFile path to class file * @return {@code true} if examined class in null and class pattern exists */ private boolean alwaysInclusiveQuietly( String testClassFile ) { return testClassFile == null && classPattern != null; } private boolean match( String testClassFile, String methodName ) { return matchClass( testClassFile ) && matchMethod( methodName ); } private boolean matchClass( String testClassFile ) { return classPattern == null || classMatcher.matchTestClassFile( testClassFile ); } private boolean matchMethod( String methodName ) { return methodPattern == null || methodName == null || methodMatcher.matchMethodName( methodName ); } private static String tryBlank( String s ) { if ( s == null ) { return null; } else { String trimmed = s.trim(); return StringUtils.isEmpty( trimmed ) ? null : trimmed; } } private static String reformatClassPattern( String s, boolean isRegex ) { if ( s != null && !isRegex ) { String path = convertToPath( s ); path = fromFullyQualifiedClass( path ); if ( path != null && !path.startsWith( WILDCARD_PATH_PREFIX ) ) { path = WILDCARD_PATH_PREFIX + path; } return path; } else { return s; } } private static String convertToPath( String className ) { if ( isBlank( className ) ) { return null; } else { if ( className.endsWith( JAVA_FILE_EXTENSION ) ) { className = className.substring( 0, className.length() - JAVA_FILE_EXTENSION.length() ) + CLASS_FILE_EXTENSION; } return className; } } static String wrapRegex( String unwrapped ) { return REGEX_HANDLER_PREFIX + unwrapped + PATTERN_HANDLER_SUFFIX; } static String fromFullyQualifiedClass( String cls ) { if ( cls.endsWith( CLASS_FILE_EXTENSION ) ) { String className = cls.substring( 0, cls.length() - CLASS_FILE_EXTENSION.length() ); return className.replace( '.', '/' ) + CLASS_FILE_EXTENSION; } else if ( !cls.contains( "/" ) ) { if ( cls.endsWith( WILDCARD_FILENAME_POSTFIX ) ) { String clsName = cls.substring( 0, cls.length() - WILDCARD_FILENAME_POSTFIX.length() ); return clsName.contains( "." ) ? clsName.replace( '.', '/' ) + WILDCARD_FILENAME_POSTFIX : cls; } else { return cls.replace( '.', '/' ); } } else { return cls; } } private final class ClassMatcher { private volatile MatchPatterns cache; boolean matchTestClassFile( String testClassFile ) { return ResolvedTest.this.isRegexTestClassPattern() ? matchClassRegexPatter( testClassFile ) : matchClassPatter( testClassFile ); } private MatchPatterns of( String... sources ) { if ( cache == null ) { try { checkIllegalCharacters( sources ); cache = from( sources ); } catch ( IllegalArgumentException e ) { throwSanityError( e ); } } return cache; } private boolean matchClassPatter( String testClassFile ) { //@todo We have to use File.separator only because the MatchPatterns is using it internally - cannot override. String classPattern = ResolvedTest.this.classPattern; if ( separatorChar != '/' ) { testClassFile = testClassFile.replace( '/', separatorChar ); classPattern = classPattern.replace( '/', separatorChar ); } if ( classPattern.endsWith( WILDCARD_FILENAME_POSTFIX ) || classPattern.endsWith( CLASS_FILE_EXTENSION ) ) { return of( classPattern ).matches( testClassFile, true ); } else { String[] classPatterns = { classPattern + CLASS_FILE_EXTENSION, classPattern }; return of( classPatterns ).matches( testClassFile, true ); } } private boolean matchClassRegexPatter( String testClassFile ) { String realFile = separatorChar == '/' ? testClassFile : testClassFile.replace( '/', separatorChar ); return of( classPattern ).matches( realFile, true ); } } private final class MethodMatcher { private volatile Pattern cache; boolean matchMethodName( String methodName ) { if ( ResolvedTest.this.isRegexTestMethodPattern() ) { fetchCache(); return cache.matcher( methodName ) .matches(); } else { return matchPath( ResolvedTest.this.methodPattern, methodName ); } } void sanityCheck() { if ( ResolvedTest.this.isRegexTestMethodPattern() && ResolvedTest.this.hasTestMethodPattern() ) { try { checkIllegalCharacters( ResolvedTest.this.methodPattern ); fetchCache(); } catch ( IllegalArgumentException e ) { throwSanityError( e ); } } } private void fetchCache() { if ( cache == null ) { int from = REGEX_HANDLER_PREFIX.length(); int to = ResolvedTest.this.methodPattern.length() - PATTERN_HANDLER_SUFFIX.length(); String pattern = ResolvedTest.this.methodPattern.substring( from, to ); cache = compile( pattern ); } } } private static void checkIllegalCharacters( String... expressions ) { for ( String expression : expressions ) { if ( expression.contains( "#" ) ) { throw new IllegalArgumentException( "Extra '#' in regex: " + expression ); } } } private static void throwSanityError( IllegalArgumentException e ) { throw new IllegalArgumentException( "%regex[] usage rule violation, valid regex rules:\n" + " * # - " + "where both regex can be individually evaluated as a regex\n" + " * you may use at most 1 '#' to in one regex filter. " + e.getLocalizedMessage(), e ); } } RunOrderParameters.java000066400000000000000000000034101330756104600364060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/testsetpackage org.apache.maven.surefire.testset; /* * 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. */ import java.io.File; import org.apache.maven.surefire.util.RunOrder; /** * @author Kristian Rosenvold */ public class RunOrderParameters { private final RunOrder[] runOrder; private File runStatisticsFile; public RunOrderParameters( RunOrder[] runOrder, File runStatisticsFile ) { this.runOrder = runOrder; this.runStatisticsFile = runStatisticsFile; } public RunOrderParameters( String runOrder, File runStatisticsFile ) { this.runOrder = runOrder == null ? RunOrder.DEFAULT : RunOrder.valueOfMulti( runOrder ); this.runStatisticsFile = runStatisticsFile; } public static RunOrderParameters alphabetical() { return new RunOrderParameters( new RunOrder[]{ RunOrder.ALPHABETICAL }, null ); } public RunOrder[] getRunOrder() { return runOrder; } public File getRunStatisticsFile() { return runStatisticsFile; } } TestArtifactInfo.java000066400000000000000000000025051330756104600360370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/testsetpackage org.apache.maven.surefire.testset; /* * 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. */ /** * Contains information about the detected test artifact * * @author Kristian Rosenvold */ public class TestArtifactInfo { private final String version; private final String classifier; public TestArtifactInfo( String version, String classifier ) { this.version = version; this.classifier = classifier; } public String getVersion() { return version; } public String getClassifier() { return classifier; } } TestFilter.java000066400000000000000000000021161330756104600347110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/testsetpackage org.apache.maven.surefire.testset; /* * 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. */ /** * Generic interface of test filter. * * @param test class, or null if not mandatory * @param test method, or null if not mandatory */ public interface TestFilter { boolean shouldRun( C testClass, M methodName ); } TestListResolver.java000066400000000000000000000423301330756104600361230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/testsetpackage org.apache.maven.surefire.testset; /* * 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. */ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashSet; import java.util.Set; import static java.util.Collections.unmodifiableSet; import static org.apache.maven.shared.utils.StringUtils.isBlank; import static org.apache.maven.shared.utils.StringUtils.isNotBlank; import static org.apache.maven.shared.utils.StringUtils.split; import static org.apache.maven.shared.utils.io.SelectorUtils.PATTERN_HANDLER_SUFFIX; import static org.apache.maven.shared.utils.io.SelectorUtils.REGEX_HANDLER_PREFIX; import static java.util.Collections.singleton; import static org.apache.maven.surefire.testset.ResolvedTest.Type.CLASS; import static org.apache.maven.surefire.testset.ResolvedTest.Type.METHOD; // TODO In Surefire 3.0 see SUREFIRE-1309 and use normal fully qualified class name regex instead. /** * Resolved multi pattern filter e.g. -Dtest=MyTest#test,!AnotherTest#otherTest into an object model * composed of included and excluded tests.
* The methods {@link #shouldRun(String, String)} are filters easily used in JUnit filter or TestNG. * This class is independent of JUnit and TestNG API.
* It is accessed by Java Reflection API in {@link org.apache.maven.surefire.booter.SurefireReflector} * using specific ClassLoader. */ public class TestListResolver implements GenericTestPattern { private static final String JAVA_CLASS_FILE_EXTENSION = ".class"; private static final TestListResolver WILDCARD = new TestListResolver( "*" + JAVA_CLASS_FILE_EXTENSION ); private static final TestListResolver EMPTY = new TestListResolver( "" ); private final Set includedPatterns; private final Set excludedPatterns; private final boolean hasIncludedMethodPatterns; private final boolean hasExcludedMethodPatterns; public TestListResolver( Collection tests ) { final IncludedExcludedPatterns patterns = new IncludedExcludedPatterns(); final Set includedFilters = new LinkedHashSet( 0 ); final Set excludedFilters = new LinkedHashSet( 0 ); for ( final String csvTests : tests ) { if ( isNotBlank( csvTests ) ) { for ( String request : split( csvTests, "," ) ) { request = request.trim(); if ( !request.isEmpty() && !request.equals( "!" ) ) { resolveTestRequest( request, patterns, includedFilters, excludedFilters ); } } } } this.includedPatterns = unmodifiableSet( includedFilters ); this.excludedPatterns = unmodifiableSet( excludedFilters ); this.hasIncludedMethodPatterns = patterns.hasIncludedMethodPatterns; this.hasExcludedMethodPatterns = patterns.hasExcludedMethodPatterns; } public TestListResolver( String csvTests ) { this( csvTests == null ? Collections.emptySet() : singleton( csvTests ) ); } public TestListResolver( Collection included, Collection excluded ) { this( mergeIncludedAndExcludedTests( included, excluded ) ); } /** * Used only in method filter. */ private TestListResolver( boolean hasIncludedMethodPatterns, boolean hasExcludedMethodPatterns, Set includedPatterns, Set excludedPatterns ) { this.includedPatterns = includedPatterns; this.excludedPatterns = excludedPatterns; this.hasIncludedMethodPatterns = hasIncludedMethodPatterns; this.hasExcludedMethodPatterns = hasExcludedMethodPatterns; } public static TestListResolver newTestListResolver( Set includedPatterns, Set excludedPatterns ) { return new TestListResolver( haveMethodPatterns( includedPatterns ), haveMethodPatterns( excludedPatterns ), includedPatterns, excludedPatterns ); } @Override public boolean hasIncludedMethodPatterns() { return hasIncludedMethodPatterns; } @Override public boolean hasExcludedMethodPatterns() { return hasExcludedMethodPatterns; } @Override public boolean hasMethodPatterns() { return hasIncludedMethodPatterns() || hasExcludedMethodPatterns(); } /** * * @param resolver filter possibly having method patterns * @return {@code resolver} if {@link TestListResolver#hasMethodPatterns() resolver.hasMethodPatterns()} * returns {@code true}; Otherwise wildcard filter {@code *.class} is returned. */ public static TestListResolver optionallyWildcardFilter( TestListResolver resolver ) { return resolver.hasMethodPatterns() ? resolver : WILDCARD; } public static TestListResolver getWildcard() { return WILDCARD; } public static TestListResolver getEmptyTestListResolver() { return EMPTY; } public final boolean isWildcard() { return equals( WILDCARD ); } public TestFilter and( final TestListResolver another ) { return new TestFilter() { @Override public boolean shouldRun( String testClass, String methodName ) { return TestListResolver.this.shouldRun( testClass, methodName ) && another.shouldRun( testClass, methodName ); } }; } public TestFilter or( final TestListResolver another ) { return new TestFilter() { @Override public boolean shouldRun( String testClass, String methodName ) { return TestListResolver.this.shouldRun( testClass, methodName ) || another.shouldRun( testClass, methodName ); } }; } public boolean shouldRun( Class testClass, String methodName ) { return shouldRun( toClassFileName( testClass ), methodName ); } /** * Returns {@code true} if satisfies {@code testClassFile} and {@code methodName} filter. * * @param testClassFile format must be e.g. "my/package/MyTest.class" including class extension; or null * @param methodName real test-method name; or null */ @Override public boolean shouldRun( String testClassFile, String methodName ) { if ( isEmpty() || isBlank( testClassFile ) && isBlank( methodName ) ) { return true; } else { boolean shouldRun = false; if ( getIncludedPatterns().isEmpty() ) { shouldRun = true; } else { for ( ResolvedTest filter : getIncludedPatterns() ) { if ( filter.matchAsInclusive( testClassFile, methodName ) ) { shouldRun = true; break; } } } if ( shouldRun ) { for ( ResolvedTest filter : getExcludedPatterns() ) { if ( filter.matchAsExclusive( testClassFile, methodName ) ) { shouldRun = false; break; } } } return shouldRun; } } @Override public boolean isEmpty() { return equals( EMPTY ); } @Override public String getPluginParameterTest() { String aggregatedTest = aggregatedTest( "", getIncludedPatterns() ); if ( isNotBlank( aggregatedTest ) && !getExcludedPatterns().isEmpty() ) { aggregatedTest += ", "; } aggregatedTest += aggregatedTest( "!", getExcludedPatterns() ); return aggregatedTest.length() == 0 ? "" : aggregatedTest; } @Override public Set getIncludedPatterns() { return includedPatterns; } @Override public Set getExcludedPatterns() { return excludedPatterns; } @Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } TestListResolver that = (TestListResolver) o; return getIncludedPatterns().equals( that.getIncludedPatterns() ) && getExcludedPatterns().equals( that.getExcludedPatterns() ); } @Override public int hashCode() { int result = getIncludedPatterns().hashCode(); result = 31 * result + getExcludedPatterns().hashCode(); return result; } @Override public String toString() { return getPluginParameterTest(); } public static String toClassFileName( Class test ) { return test == null ? null : toClassFileName( test.getName() ); } public static String toClassFileName( String fullyQualifiedTestClass ) { return fullyQualifiedTestClass == null ? null : fullyQualifiedTestClass.replace( '.', '/' ) + JAVA_CLASS_FILE_EXTENSION; } static String removeExclamationMark( String s ) { return !s.isEmpty() && s.charAt( 0 ) == '!' ? s.substring( 1 ) : s; } private static void updatedFilters( boolean isExcluded, ResolvedTest test, IncludedExcludedPatterns patterns, Collection includedFilters, Collection excludedFilters ) { if ( isExcluded ) { excludedFilters.add( test ); patterns.hasExcludedMethodPatterns |= test.hasTestMethodPattern(); } else { includedFilters.add( test ); patterns.hasIncludedMethodPatterns |= test.hasTestMethodPattern(); } } private static String aggregatedTest( String testPrefix, Set tests ) { StringBuilder aggregatedTest = new StringBuilder(); for ( ResolvedTest test : tests ) { String readableTest = test.toString(); if ( !readableTest.isEmpty() ) { if ( aggregatedTest.length() != 0 ) { aggregatedTest.append( ", " ); } aggregatedTest.append( testPrefix ) .append( readableTest ); } } return aggregatedTest.toString(); } private static Collection mergeIncludedAndExcludedTests( Collection included, Collection excluded ) { ArrayList incExc = new ArrayList( included ); incExc.removeAll( Collections.singleton( null ) ); for ( String exc : excluded ) { if ( exc != null ) { exc = exc.trim(); if ( !exc.isEmpty() ) { if ( exc.contains( "!" ) ) { throw new IllegalArgumentException( "Exclamation mark not expected in 'exclusion': " + exc ); } exc = exc.replace( ",", ",!" ); if ( !exc.startsWith( "!" ) ) { exc = "!" + exc; } incExc.add( exc ); } } } return incExc; } static boolean isRegexPrefixedPattern( String pattern ) { int indexOfRegex = pattern.indexOf( REGEX_HANDLER_PREFIX ); int prefixLength = REGEX_HANDLER_PREFIX.length(); if ( indexOfRegex != -1 ) { if ( indexOfRegex != 0 || !pattern.endsWith( PATTERN_HANDLER_SUFFIX ) || !isRegexMinLength( pattern ) || pattern.indexOf( REGEX_HANDLER_PREFIX, prefixLength ) != -1 ) { String msg = "Illegal test|includes|excludes regex '%s'. Expected %%regex[class#method] " + "or !%%regex[class#method] " + "with optional class or #method."; throw new IllegalArgumentException( String.format( msg, pattern ) ); } return true; } else { return false; } } static boolean isRegexMinLength( String pattern ) { //todo bug in maven-shared-utils: '+1' should not appear in the condition //todo cannot reuse code from SelectorUtils.java because method isRegexPrefixedPattern is in private package. return pattern.length() > REGEX_HANDLER_PREFIX.length() + PATTERN_HANDLER_SUFFIX.length() + 1; } static String[] unwrapRegex( String regex ) { regex = regex.trim(); int from = REGEX_HANDLER_PREFIX.length(); int to = regex.length() - PATTERN_HANDLER_SUFFIX.length(); return unwrap( regex.substring( from, to ) ); } static String[] unwrap( final String request ) { final String[] classAndMethod = { "", "" }; final int indexOfHash = request.indexOf( '#' ); if ( indexOfHash == -1 ) { classAndMethod[0] = request.trim(); } else { classAndMethod[0] = request.substring( 0, indexOfHash ).trim(); classAndMethod[1] = request.substring( 1 + indexOfHash ).trim(); } return classAndMethod; } static void nonRegexClassAndMethods( String clazz, String methods, boolean isExcluded, IncludedExcludedPatterns patterns, Collection includedFilters, Collection excludedFilters ) { for ( String method : split( methods, "+" ) ) { method = method.trim(); ResolvedTest test = new ResolvedTest( clazz, method, false ); if ( !test.isEmpty() ) { updatedFilters( isExcluded, test, patterns, includedFilters, excludedFilters ); } } } /** * Requires trimmed {@code request} been not equal to "!". */ static void resolveTestRequest( String request, IncludedExcludedPatterns patterns, Collection includedFilters, Collection excludedFilters ) { final boolean isExcluded = request.startsWith( "!" ); ResolvedTest test = null; request = removeExclamationMark( request ); if ( isRegexPrefixedPattern( request ) ) { final String[] unwrapped = unwrapRegex( request ); final boolean hasClass = !unwrapped[0].isEmpty(); final boolean hasMethod = !unwrapped[1].isEmpty(); if ( hasClass && hasMethod ) { test = new ResolvedTest( unwrapped[0], unwrapped[1], true ); } else if ( hasClass ) { test = new ResolvedTest( CLASS, unwrapped[0], true ); } else if ( hasMethod ) { test = new ResolvedTest( METHOD, unwrapped[1], true ); } } else { final int indexOfMethodSeparator = request.indexOf( '#' ); if ( indexOfMethodSeparator == -1 ) { test = new ResolvedTest( CLASS, request, false ); } else { String clazz = request.substring( 0, indexOfMethodSeparator ); String methods = request.substring( 1 + indexOfMethodSeparator ); nonRegexClassAndMethods( clazz, methods, isExcluded, patterns, includedFilters, excludedFilters ); } } if ( test != null && !test.isEmpty() ) { updatedFilters( isExcluded, test, patterns, includedFilters, excludedFilters ); } } private static boolean haveMethodPatterns( Set patterns ) { for ( ResolvedTest pattern : patterns ) { if ( pattern.hasTestMethodPattern() ) { return true; } } return false; } } TestRequest.java000066400000000000000000000063421330756104600351210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/testsetpackage org.apache.maven.surefire.testset; /* * 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. */ import java.io.File; import java.util.ArrayList; import java.util.List; /** * Information about the requested test. * * @author Kristian Rosenvold */ public class TestRequest { private final List suiteXmlFiles; private final File testSourceDirectory; private final TestListResolver requestedTests; private final int rerunFailingTestsCount; public TestRequest( List suiteXmlFiles, File testSourceDirectory, TestListResolver requestedTests ) { this( createFiles( suiteXmlFiles ), testSourceDirectory, requestedTests, 0 ); } public TestRequest( List suiteXmlFiles, File testSourceDirectory, TestListResolver requestedTests, int rerunFailingTestsCount ) { this.suiteXmlFiles = createFiles( suiteXmlFiles ); this.testSourceDirectory = testSourceDirectory; this.requestedTests = requestedTests; this.rerunFailingTestsCount = rerunFailingTestsCount; } /** * Represents suitexmlfiles that define the test-run request * * @return A list of java.io.File objects. */ public List getSuiteXmlFiles() { return suiteXmlFiles; } /** * Test source directory, normally ${project.build.testSourceDirectory} * * @return A file pointing to test sources */ public File getTestSourceDirectory() { return testSourceDirectory; } /** * A specific test request issued with -Dtest= from the command line. * * @return filter */ public TestListResolver getTestListResolver() { return requestedTests; } /** * How many times to rerun failing tests, issued with -Dsurefire.rerunFailingTestsCount from the command line. * * @return The int parameter to indicate how many times to rerun failing tests */ public int getRerunFailingTestsCount() { return rerunFailingTestsCount; } private static List createFiles( List suiteXmlFiles ) { if ( suiteXmlFiles != null ) { List files = new ArrayList(); Object element; for ( Object suiteXmlFile : suiteXmlFiles ) { element = suiteXmlFile; files.add( element instanceof String ? new File( (String) element ) : (File) element ); } return files; } return null; } } TestSetFailedException.java000066400000000000000000000047151330756104600372120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/testsetpackage org.apache.maven.surefire.testset; /* * 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. */ /** * Exception that indicates a test failed. * * @author Bill Venners */ public class TestSetFailedException extends Exception { /** * Creates {@code TestSetFailedException} with a detail message. * * @param message A detail message for this {@code TestSetFailedException}, or * {@code null}. If {@code null} is passed, the {@link #getMessage} * method will return an empty {@link String string}. */ public TestSetFailedException( String message ) { super( message ); } /** * Creates {@code TestSetFailedException} with the specified detail * message and cause. *
*

Note that the detail message associated with cause is * NOT automatically incorporated in this throwable's detail * message. * * @param message A detail message for this {@code TestSetFailedException}, or {@code null}. * @param cause the cause, which is saved for later retrieval by the {@link #getCause} method. * (A null value is permitted, and indicates that the cause is nonexistent or unknown.) */ public TestSetFailedException( String message, Throwable cause ) { super( message, cause ); } /** * Creates {@code TestSetFailedException} with the specified cause. The mthod {@link #getMessage} method of this * exception object will return {@code cause == null ? "" : cause.toString()}. * * @param cause The cause */ public TestSetFailedException( Throwable cause ) { super( cause == null ? "" : cause.toString(), cause ); } } maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/util/000077500000000000000000000000001330756104600313225ustar00rootroot00000000000000CloseableIterator.java000066400000000000000000000056201330756104600355140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import java.util.Iterator; import java.util.NoSuchElementException; /** * This iterator is marked as stopped if {@link #isClosed()} returns {@code true}. * If the iterator has been closed before calling {@link #hasNext()} then the method returns {@code false}. * If the iterator was closed after {@link #hasNext() hasNext returns true} but before {@link #next()}, the * method {@link #next()} throws {@link java.util.NoSuchElementException}. * The method {@link #remove()} throws {@link IllegalStateException} if the iterator has been closed. * * @param the type of elements returned by this iterator * * @author Tibor Digana (tibor17) * @since 2.19.1 */ public abstract class CloseableIterator implements Iterator { private Boolean finishCurrentIteration; protected abstract boolean isClosed(); protected abstract boolean doHasNext(); protected abstract T doNext(); protected abstract void doRemove(); @Override public boolean hasNext() { popMarker(); return !finishCurrentIteration && doHasNext(); } @Override public T next() { try { if ( popMarker() && finishCurrentIteration ) { throw new NoSuchElementException( "iterator closed" ); } return doNext(); } finally { finishCurrentIteration = null; } } @Override public void remove() { try { if ( popMarker() && finishCurrentIteration ) { throw new IllegalStateException( "iterator closed" ); } doRemove(); } finally { finishCurrentIteration = null; } } /** * @return {@code true} if marker changed from NULL to anything */ private boolean popMarker() { if ( finishCurrentIteration == null ) { finishCurrentIteration = isClosed(); return true; } return false; } } DefaultDirectoryScanner.java000066400000000000000000000115771330756104600367040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import org.apache.maven.surefire.SpecificTestClassFilter; import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; /** * Scans directories looking for tests. * * @author Karl M. Davis * @author Kristian Rosenvold */ @Deprecated public class DefaultDirectoryScanner implements DirectoryScanner { private static final String FS = System.getProperty( "file.separator" ); private static final String[] EMPTY_STRING_ARRAY = new String[0]; private static final String JAVA_SOURCE_FILE_EXTENSION = ".java"; private static final String JAVA_CLASS_FILE_EXTENSION = ".class"; private final File basedir; private final List includes; private final List excludes; private final List specificTests; public DefaultDirectoryScanner( File basedir, List includes, List excludes, List specificTests ) { this.basedir = basedir; this.includes = includes; this.excludes = excludes; this.specificTests = specificTests; } @Override public TestsToRun locateTestClasses( ClassLoader classLoader, ScannerFilter scannerFilter ) { String[] testClassNames = collectTests(); Set> result = new LinkedHashSet>(); String[] specific = specificTests == null ? new String[0] : processIncludesExcludes( specificTests ); SpecificTestClassFilter specificTestFilter = new SpecificTestClassFilter( specific ); for ( String className : testClassNames ) { Class testClass = loadClass( classLoader, className ); if ( !specificTestFilter.accept( testClass ) ) { // FIXME: Log this somehow! continue; } if ( scannerFilter == null || scannerFilter.accept( testClass ) ) { result.add( testClass ); } } return new TestsToRun( result ); } private static Class loadClass( ClassLoader classLoader, String className ) { try { return classLoader.loadClass( className ); } catch ( ClassNotFoundException e ) { throw new RuntimeException( "Unable to create test class '" + className + "'", e ); } } String[] collectTests() { String[] tests = EMPTY_STRING_ARRAY; if ( basedir.exists() ) { org.apache.maven.shared.utils.io.DirectoryScanner scanner = new org.apache.maven.shared.utils.io.DirectoryScanner(); scanner.setBasedir( basedir ); if ( includes != null ) { scanner.setIncludes( processIncludesExcludes( includes ) ); } if ( excludes != null ) { scanner.setExcludes( processIncludesExcludes( excludes ) ); } scanner.scan(); tests = scanner.getIncludedFiles(); for ( int i = 0; i < tests.length; i++ ) { String test = tests[i]; test = test.substring( 0, test.indexOf( "." ) ); tests[i] = test.replace( FS.charAt( 0 ), '.' ); } } return tests; } private static String[] processIncludesExcludes( List list ) { List newList = new ArrayList(); for ( String include : list ) { String[] includes = include.split( "," ); Collections.addAll( newList, includes ); } String[] incs = new String[newList.size()]; for ( int i = 0; i < incs.length; i++ ) { String inc = newList.get( i ); if ( inc.endsWith( JAVA_SOURCE_FILE_EXTENSION ) ) { inc = inc.substring( 0, inc.lastIndexOf( JAVA_SOURCE_FILE_EXTENSION ) ) + JAVA_CLASS_FILE_EXTENSION; } incs[i] = inc; } return incs; } } DefaultRunOrderCalculator.java000066400000000000000000000111371330756104600371700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import org.apache.maven.plugin.surefire.runorder.RunEntryStatisticsMap; import org.apache.maven.surefire.testset.RunOrderParameters; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; import java.util.Comparator; import java.util.LinkedHashSet; import java.util.List; /** * Applies the final runorder of the tests * * @author Kristian Rosenvold */ public class DefaultRunOrderCalculator implements RunOrderCalculator { private final Comparator sortOrder; private final RunOrder[] runOrder; private final RunOrderParameters runOrderParameters; private final int threadCount; public DefaultRunOrderCalculator( RunOrderParameters runOrderParameters, int threadCount ) { this.runOrderParameters = runOrderParameters; this.threadCount = threadCount; this.runOrder = runOrderParameters.getRunOrder(); this.sortOrder = this.runOrder.length > 0 ? getSortOrderComparator( this.runOrder[0] ) : null; } @Override @SuppressWarnings( "checkstyle:magicnumber" ) public TestsToRun orderTestClasses( TestsToRun scannedClasses ) { List> result = new ArrayList>( 512 ); for ( Class scannedClass : scannedClasses ) { result.add( scannedClass ); } orderTestClasses( result, runOrder.length != 0 ? runOrder[0] : null ); return new TestsToRun( new LinkedHashSet>( result ) ); } private void orderTestClasses( List> testClasses, RunOrder runOrder ) { if ( RunOrder.RANDOM.equals( runOrder ) ) { Collections.shuffle( testClasses ); } else if ( RunOrder.FAILEDFIRST.equals( runOrder ) ) { RunEntryStatisticsMap stat = RunEntryStatisticsMap.fromFile( runOrderParameters.getRunStatisticsFile() ); List> prioritized = stat.getPrioritizedTestsByFailureFirst( testClasses ); testClasses.clear(); testClasses.addAll( prioritized ); } else if ( RunOrder.BALANCED.equals( runOrder ) ) { RunEntryStatisticsMap stat = RunEntryStatisticsMap.fromFile( runOrderParameters.getRunStatisticsFile() ); List> prioritized = stat.getPrioritizedTestsClassRunTime( testClasses, threadCount ); testClasses.clear(); testClasses.addAll( prioritized ); } else if ( sortOrder != null ) { Collections.sort( testClasses, sortOrder ); } } private Comparator getSortOrderComparator( RunOrder runOrder ) { if ( RunOrder.ALPHABETICAL.equals( runOrder ) ) { return getAlphabeticalComparator(); } else if ( RunOrder.REVERSE_ALPHABETICAL.equals( runOrder ) ) { return getReverseAlphabeticalComparator(); } else if ( RunOrder.HOURLY.equals( runOrder ) ) { final int hour = Calendar.getInstance().get( Calendar.HOUR_OF_DAY ); return ( ( hour % 2 ) == 0 ) ? getAlphabeticalComparator() : getReverseAlphabeticalComparator(); } else { return null; } } private Comparator getReverseAlphabeticalComparator() { return new Comparator() { @Override public int compare( Class o1, Class o2 ) { return o2.getName().compareTo( o1.getName() ); } }; } private Comparator getAlphabeticalComparator() { return new Comparator() { @Override public int compare( Class o1, Class o2 ) { return o1.getName().compareTo( o2.getName() ); } }; } } DefaultScanResult.java000066400000000000000000000101531330756104600354760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; /** * @author Kristian Rosenvold */ public class DefaultScanResult implements ScanResult { private final List classes; private static final String SCAN_RESULT_NUMBER = "tc."; public DefaultScanResult( List classes ) { this.classes = Collections.unmodifiableList( classes ); } @Override public int size() { return classes.size(); } @Override public String getClassName( int index ) { return classes.get( index ); } @Override public void writeTo( Map properties ) { for ( int i = 0, size = classes.size(); i < size; i++ ) { properties.put( SCAN_RESULT_NUMBER + i, classes.get( i ) ); } } public static DefaultScanResult from( Map properties ) { List result = new ArrayList(); int i = 0; while ( true ) { String item = properties.get( SCAN_RESULT_NUMBER + ( i++ ) ); if ( item == null ) { return new DefaultScanResult( result ); } result.add( item ); } } public boolean isEmpty() { return classes.isEmpty(); } public List getClasses() { return classes; } @Override public TestsToRun applyFilter( ScannerFilter scannerFilter, ClassLoader testClassLoader ) { Set> result = new LinkedHashSet>(); int size = size(); for ( int i = 0; i < size; i++ ) { String className = getClassName( i ); Class testClass = loadClass( testClassLoader, className ); if ( scannerFilter == null || scannerFilter.accept( testClass ) ) { result.add( testClass ); } } return new TestsToRun( result ); } @Override public List> getClassesSkippedByValidation( ScannerFilter scannerFilter, ClassLoader testClassLoader ) { List> result = new ArrayList>(); int size = size(); for ( int i = 0; i < size; i++ ) { String className = getClassName( i ); Class testClass = loadClass( testClassLoader, className ); if ( scannerFilter != null && !scannerFilter.accept( testClass ) ) { result.add( testClass ); } } return result; } private static Class loadClass( ClassLoader classLoader, String className ) { try { return classLoader.loadClass( className ); } catch ( ClassNotFoundException e ) { throw new RuntimeException( "Unable to create test class '" + className + "'", e ); } } public DefaultScanResult append( DefaultScanResult other ) { if ( other != null ) { List src = new ArrayList( classes ); src.addAll( other.classes ); return new DefaultScanResult( src ); } else { return this; } } } DirectoryScanner.java000066400000000000000000000024261330756104600353700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ /** * @author Kristian Rosenvold */ @Deprecated public interface DirectoryScanner { /** * Locates tests based on scanning directories * * @param classLoader The classloader to use when loading classes * @param scannerFilter The filter to include/exclude test classes * @return The found classes that match the filter */ TestsToRun locateTestClasses( ClassLoader classLoader, ScannerFilter scannerFilter ); } ReflectionUtils.java000066400000000000000000000242711330756104600352270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** * @author Kristian Rosenvold */ public final class ReflectionUtils { private static final Class[] EMPTY_CLASS_ARRAY = new Class[0]; private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0]; private ReflectionUtils() { throw new IllegalStateException( "no instantiable constructor" ); } public static Method getMethod( Object instance, String methodName, Class... parameters ) { return getMethod( instance.getClass(), methodName, parameters ); } public static Method getMethod( Class clazz, String methodName, Class... parameters ) { try { return clazz.getMethod( methodName, parameters ); } catch ( NoSuchMethodException e ) { throw new RuntimeException( "When finding method " + methodName, e ); } } public static Method tryGetMethod( Class clazz, String methodName, Class... parameters ) { try { return clazz.getMethod( methodName, parameters ); } catch ( NoSuchMethodException e ) { return null; } } public static Object invokeGetter( Object instance, String methodName ) { return invokeGetter( instance.getClass(), instance, methodName ); } public static Object invokeGetter( Class instanceType, Object instance, String methodName ) { Method method = getMethod( instanceType, methodName ); return invokeMethodWithArray( instance, method ); } public static Constructor getConstructor( Class clazz, Class... arguments ) { try { return clazz.getConstructor( arguments ); } catch ( NoSuchMethodException e ) { throw new SurefireReflectionException( e ); } } public static Object newInstance( Constructor constructor, Object... params ) { try { return constructor.newInstance( params ); } catch ( InvocationTargetException e ) { throw new SurefireReflectionException( e ); } catch ( InstantiationException e ) { throw new SurefireReflectionException( e ); } catch ( IllegalAccessException e ) { throw new SurefireReflectionException( e ); } } public static T instantiate( ClassLoader classLoader, String classname, Class returnType ) { try { Class clazz = loadClass( classLoader, classname ); return returnType.cast( clazz.newInstance() ); } catch ( InstantiationException e ) { throw new SurefireReflectionException( e ); } catch ( IllegalAccessException e ) { throw new SurefireReflectionException( e ); } } public static Object instantiateOneArg( ClassLoader classLoader, String className, Class param1Class, Object param1 ) { try { Class aClass = loadClass( classLoader, className ); Constructor constructor = getConstructor( aClass, param1Class ); return constructor.newInstance( param1 ); } catch ( InvocationTargetException e ) { throw new SurefireReflectionException( e.getTargetException() ); } catch ( InstantiationException e ) { throw new SurefireReflectionException( e ); } catch ( IllegalAccessException e ) { throw new SurefireReflectionException( e ); } } public static Object instantiateTwoArgs( ClassLoader classLoader, String className, Class param1Class, Object param1, Class param2Class, Object param2 ) { try { Class aClass = loadClass( classLoader, className ); Constructor constructor = getConstructor( aClass, param1Class, param2Class ); return constructor.newInstance( param1, param2 ); } catch ( InvocationTargetException e ) { throw new SurefireReflectionException( e.getTargetException() ); } catch ( InstantiationException e ) { throw new SurefireReflectionException( e ); } catch ( IllegalAccessException e ) { throw new SurefireReflectionException( e ); } } public static void invokeSetter( Object o, String name, Class value1clazz, Object value ) { Method setter = getMethod( o, name, value1clazz ); invokeSetter( o, setter, value ); } public static Object invokeSetter( Object target, Method method, Object value ) { return invokeMethodWithArray( target, method, value ); } public static Object invokeMethodWithArray( Object target, Method method, Object... args ) { try { return method.invoke( target, args ); } catch ( IllegalAccessException e ) { throw new SurefireReflectionException( e ); } catch ( InvocationTargetException e ) { throw new SurefireReflectionException( e.getTargetException() ); } } public static Object invokeMethodWithArray2( Object target, Method method, Object... args ) throws InvocationTargetException { try { return method.invoke( target, args ); } catch ( IllegalAccessException e ) { throw new SurefireReflectionException( e ); } } public static Object instantiateObject( String className, Class[] types, Object[] params, ClassLoader classLoader ) { Class clazz = loadClass( classLoader, className ); final Constructor constructor = getConstructor( clazz, types ); return newInstance( constructor, params ); } @SuppressWarnings( "checkstyle:emptyblock" ) public static Class tryLoadClass( ClassLoader classLoader, String className ) { try { return classLoader.loadClass( className ); } catch ( NoClassDefFoundError ignore ) { } catch ( ClassNotFoundException ignore ) { } return null; } public static Class loadClass( ClassLoader classLoader, String className ) { try { return classLoader.loadClass( className ); } catch ( NoClassDefFoundError e ) { throw new SurefireReflectionException( e ); } catch ( ClassNotFoundException e ) { throw new SurefireReflectionException( e ); } } /** * Invoker of public static no-argument method. * * @param clazz class on which public static no-argument {@code methodName} is invoked * @param methodName public static no-argument method to be called * @param parameterTypes method parameter types * @param parameters method parameters * @return value returned by {@code methodName} * @throws RuntimeException if no such method found * @throws SurefireReflectionException if the method could not be called or threw an exception. * It has original cause Exception. */ public static Object invokeStaticMethod( Class clazz, String methodName, Class[] parameterTypes, Object[] parameters ) { if ( parameterTypes.length != parameters.length ) { throw new IllegalArgumentException( "arguments length do not match" ); } Method method = getMethod( clazz, methodName, parameterTypes ); return invokeMethodWithArray( null, method, parameters ); } /** * Method chain invoker. * * @param classesChain classes to invoke on method chain * @param noArgMethodNames chain of public methods to call * @param fallback returned value if a chain could not be invoked due to an error * @return successfully returned value from the last method call; {@code fallback} otherwise * @throws IllegalArgumentException if {@code classes} and {@code noArgMethodNames} have different array length */ public static Object invokeMethodChain( Class[] classesChain, String[] noArgMethodNames, Object fallback ) { if ( classesChain.length != noArgMethodNames.length ) { throw new IllegalArgumentException( "arrays must have the same length" ); } Object obj = null; try { for ( int i = 0, len = noArgMethodNames.length; i < len; i++ ) { if ( i == 0 ) { obj = invokeStaticMethod( classesChain[i], noArgMethodNames[i], EMPTY_CLASS_ARRAY, EMPTY_OBJECT_ARRAY ); } else { Method method = getMethod( classesChain[i], noArgMethodNames[i] ); obj = invokeMethodWithArray( obj, method ); } } return obj; } catch ( RuntimeException e ) { return fallback; } } } RunOrder.java000066400000000000000000000105111330756104600336440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; /** * A RunOrder specifies the order in which the tests will be run. * * @author Stefan Birkner */ public class RunOrder { public static final RunOrder ALPHABETICAL = new RunOrder( "alphabetical" ); public static final RunOrder FILESYSTEM = new RunOrder( "filesystem" ); public static final RunOrder HOURLY = new RunOrder( "hourly" ); public static final RunOrder RANDOM = new RunOrder( "random" ); public static final RunOrder REVERSE_ALPHABETICAL = new RunOrder( "reversealphabetical" ); public static final RunOrder BALANCED = new RunOrder( "balanced" ); public static final RunOrder FAILEDFIRST = new RunOrder( "failedfirst" ); public static final RunOrder[] DEFAULT = new RunOrder[]{ FILESYSTEM }; /** * Returns the specified RunOrder * * @param values The runorder string value * @return An array of RunOrder objects, never null */ public static RunOrder[] valueOfMulti( String values ) { List result = new ArrayList(); if ( values != null ) { StringTokenizer stringTokenizer = new StringTokenizer( values, "," ); while ( stringTokenizer.hasMoreTokens() ) { result.add( valueOf( stringTokenizer.nextToken() ) ); } } return result.toArray( new RunOrder[result.size()] ); } public static RunOrder valueOf( String name ) { if ( name == null ) { return null; } else { RunOrder[] runOrders = values(); for ( RunOrder runOrder : runOrders ) { if ( runOrder.matches( name ) ) { return runOrder; } } String errorMessage = createMessageForMissingRunOrder( name ); throw new IllegalArgumentException( errorMessage ); } } private static String createMessageForMissingRunOrder( String name ) { RunOrder[] runOrders = values(); StringBuilder message = new StringBuilder( "There's no RunOrder with the name " ); message.append( name ); message.append( ". Please use one of the following RunOrders: " ); for ( int i = 0; i < runOrders.length; i++ ) { if ( i != 0 ) { message.append( ", " ); } message.append( runOrders[i] ); } message.append( '.' ); return message.toString(); } private static RunOrder[] values() { return new RunOrder[]{ ALPHABETICAL, FILESYSTEM, HOURLY, RANDOM, REVERSE_ALPHABETICAL, BALANCED, FAILEDFIRST }; } public static String asString( RunOrder[] runOrder ) { StringBuilder stringBuffer = new StringBuilder(); for ( int i = 0; i < runOrder.length; i++ ) { stringBuffer.append( runOrder[i].name ); if ( i < ( runOrder.length - 1 ) ) { stringBuffer.append( "," ); } } return stringBuffer.toString(); } private final String name; private RunOrder( String name ) { this.name = name; } private boolean matches( String anotherName ) { return name.equalsIgnoreCase( anotherName ); } public String name() { return name; } @Override public String toString() { return name; } }RunOrderCalculator.java000066400000000000000000000017401330756104600356620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ /** * @author Kristian Rosenvold */ public interface RunOrderCalculator { TestsToRun orderTestClasses( TestsToRun scannedClasses ); } ScanResult.java000066400000000000000000000023741330756104600341770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import java.util.List; import java.util.Map; /** * @author Kristian Rosenvold */ public interface ScanResult { int size(); String getClassName( int index ); TestsToRun applyFilter( ScannerFilter scannerFilter, ClassLoader testClassLoader ); List> getClassesSkippedByValidation( ScannerFilter scannerFilter, ClassLoader testClassLoader ); void writeTo( Map properties ); } ScannerFilter.java000066400000000000000000000022411330756104600346440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ /** * @author Kristian Rosenvold */ public interface ScannerFilter { /** * Indicates if the class should be accepted by the directory scanner * * @param testClass The class in question * @return true if the class should be part of the directory scan result. */ boolean accept( Class testClass ); } SurefireReflectionException.java000066400000000000000000000030741330756104600375700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ /** * Exception indicating that surefire had problems with reflection. This may be due * to programming errors, incorrect configuration or incorrect dependencies, but is * generally not recoverable and not relevant to handle. * * @author Kristian Rosenvold */ public class SurefireReflectionException extends RuntimeException { /** * Create a {@link SurefireReflectionException} with the specified cause. The method {@link #getMessage} of this * exception object will return {@code cause == null ? "" : cause.toString()}. * * @param cause The cause of this exception */ public SurefireReflectionException( Throwable cause ) { super( cause == null ? "" : cause.toString(), cause ); } } TestsToRun.java000066400000000000000000000145461330756104600342120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Set; import org.apache.maven.surefire.testset.TestSetFailedException; import static java.lang.Math.max; /** * Contains all the tests that have been found according to specified include/exclude * specification for a given surefire run. * * @author Kristian Rosenvold (junit core adaption) */ public class TestsToRun implements Iterable> { private final List> locatedClasses; private volatile boolean finished; private int iteratedCount; /** * Constructor * * @param locatedClasses A set of java.lang.Class objects representing tests to run */ public TestsToRun( Set> locatedClasses ) { this.locatedClasses = new ArrayList>( locatedClasses ); } public static TestsToRun fromClass( Class clazz ) throws TestSetFailedException { return new TestsToRun( Collections.>singleton( clazz ) ); } /** * @return test classes which have been retrieved by {@link TestsToRun#iterator()}. */ public Iterator> iterated() { return newWeakIterator(); } /** * Returns an iterator over the located java.lang.Class objects * * @return an unmodifiable iterator */ @Override public Iterator> iterator() { return new ClassesIterator(); } private final class ClassesIterator extends CloseableIterator> { private final Iterator> it = TestsToRun.this.locatedClasses.iterator(); private int iteratedCount; @Override protected boolean isClosed() { return TestsToRun.this.isFinished(); } @Override protected boolean doHasNext() { return it.hasNext(); } @Override protected Class doNext() { Class nextTest = it.next(); TestsToRun.this.iteratedCount = max( ++iteratedCount, TestsToRun.this.iteratedCount ); return nextTest; } @Override protected void doRemove() { } @Override public void remove() { throw new UnsupportedOperationException( "unsupported remove" ); } } public final void markTestSetFinished() { finished = true; } public final boolean isFinished() { return finished; } @Override public String toString() { StringBuilder sb = new StringBuilder( "TestsToRun: [" ); for ( Class clazz : this ) { sb.append( ' ' ) .append( clazz.getName() ); } sb.append( ']' ); return sb.toString(); } public boolean containsAtLeast( int atLeast ) { return containsAtLeast( iterator(), atLeast ); } private boolean containsAtLeast( Iterator> it, int atLeast ) { for ( int i = 0; i < atLeast; i++ ) { if ( !it.hasNext() ) { return false; } it.next(); } return true; } public boolean containsExactly( int items ) { Iterator> it = iterator(); return containsAtLeast( it, items ) && !it.hasNext(); } /** * @return {@code true}, if the classes may be read eagerly. {@code false}, * if the classes must only be read lazy. */ public boolean allowEagerReading() { return true; } public Class[] getLocatedClasses() { if ( !allowEagerReading() ) { throw new IllegalStateException( "Cannot eagerly read" ); } Collection> result = new ArrayList>(); for ( Class clazz : this ) { result.add( clazz ); } return result.toArray( new Class[result.size()] ); } /** * Get test class which matches className * * @param className string used to find the test class * @return Class object with the matching name, null if could not find a class with the matching name */ public Class getClassByName( String className ) { for ( Class clazz : this ) { if ( clazz.getName().equals( className ) ) { return clazz; } } return null; } /** * @return snapshot of tests upon constructs of internal iterator. * Therefore weakly consistent while {@link TestsToRun#iterator()} is being iterated. */ private Iterator> newWeakIterator() { final Iterator> it = locatedClasses.subList( 0, iteratedCount ).iterator(); return new CloseableIterator>() { @Override protected boolean isClosed() { return TestsToRun.this.isFinished(); } @Override protected boolean doHasNext() { return it.hasNext(); } @Override protected Class doNext() { return it.next(); } @Override protected void doRemove() { } @Override public void remove() { throw new UnsupportedOperationException( "unsupported remove" ); } }; } } maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/util/internal/000077500000000000000000000000001330756104600331365ustar00rootroot00000000000000ConcurrencyUtils.java000066400000000000000000000040321330756104600372340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/util/internalpackage org.apache.maven.surefire.util.internal; /* * 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. */ import java.util.concurrent.atomic.AtomicInteger; /** * Concurrency utilities. * * @author Tibor Digana (tibor17) * @since 2.19 */ public final class ConcurrencyUtils { private ConcurrencyUtils() { throw new IllegalStateException( "not instantiable constructor" ); } /** * Decreases {@code counter} to zero, or does not change the counter if negative. * This method pretends been atomic. Only one thread can succeed setting the counter to zero. * * @param counter atomic counter * @return {@code true} if this Thread modified concurrent counter from any positive number down to zero. */ @SuppressWarnings( "checkstyle:emptyforiteratorpad" ) public static boolean countDownToZero( AtomicInteger counter ) { for (;;) { int c = counter.get(); if ( c > 0 ) { int newCounter = c - 1; if ( counter.compareAndSet( c, newCounter ) ) { return newCounter == 0; } } else { return false; } } } } DaemonThreadFactory.java000066400000000000000000000067321330756104600376150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/util/internalpackage org.apache.maven.surefire.util.internal; /* * 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. */ import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; /** * Creates new daemon Thread. */ public final class DaemonThreadFactory implements ThreadFactory { private static final AtomicInteger POOL_NUMBER = new AtomicInteger( 1 ); private final AtomicInteger threadNumber = new AtomicInteger( 1 ); private final ThreadGroup group; private final String namePrefix; private DaemonThreadFactory() { SecurityManager s = System.getSecurityManager(); group = s != null ? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); namePrefix = "pool-" + POOL_NUMBER.getAndIncrement() + "-thread-"; } @Override public Thread newThread( Runnable r ) { Thread t = new Thread( group, r, namePrefix + threadNumber.getAndIncrement() ); if ( t.getPriority() != Thread.NORM_PRIORITY ) { t.setPriority( Thread.NORM_PRIORITY ); } t.setDaemon( true ); return t; } /** * Should be used by thread pools. * @return new instance of {@link ThreadFactory} where each {@link Thread thread} is daemon */ public static ThreadFactory newDaemonThreadFactory() { return new DaemonThreadFactory(); } public static ThreadFactory newDaemonThreadFactory( String name ) { return new NamedThreadFactory( name ); } public static Thread newDaemonThread( Runnable r ) { SecurityManager s = System.getSecurityManager(); ThreadGroup group = s == null ? Thread.currentThread().getThreadGroup() : s.getThreadGroup(); Thread t = new Thread( group, r ); if ( t.getPriority() != Thread.NORM_PRIORITY ) { t.setPriority( Thread.NORM_PRIORITY ); } t.setDaemon( true ); return t; } public static Thread newDaemonThread( Runnable r, String name ) { SecurityManager s = System.getSecurityManager(); ThreadGroup group = s == null ? Thread.currentThread().getThreadGroup() : s.getThreadGroup(); Thread t = new Thread( group, r, name ); if ( t.getPriority() != Thread.NORM_PRIORITY ) { t.setPriority( Thread.NORM_PRIORITY ); } t.setDaemon( true ); return t; } private static class NamedThreadFactory implements ThreadFactory { private final String name; private NamedThreadFactory( String name ) { this.name = name; } @Override public Thread newThread( Runnable r ) { return newDaemonThread( r, name ); } } } DumpFileUtils.java000066400000000000000000000102141330756104600364460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/util/internalpackage org.apache.maven.surefire.util.internal; /* * 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. */ import org.apache.maven.surefire.report.ReporterConfiguration; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Writer; import java.text.SimpleDateFormat; import java.util.Date; import static org.apache.maven.surefire.util.internal.StringUtils.UTF_8; /** * Dumps a text or exception in dump file. * Each call logs a date when it was written to the dump file. * * @author Tibor Digana (tibor17) * @since 2.20 */ public final class DumpFileUtils { private DumpFileUtils() { throw new IllegalStateException( "no instantiable constructor" ); } /** * New dump file. Synchronized object appears in main memory and perfectly visible in other threads. * * @param dumpFileName dump file name * @param configuration only report directory */ public static synchronized File newDumpFile( String dumpFileName, ReporterConfiguration configuration ) { return new File( configuration.getReportsDirectory(), dumpFileName ); } public static void dumpException( Throwable t, File dumpFile ) { dumpException( t, null, dumpFile ); } public static void dumpException( Throwable t, String msg, File dumpFile ) { try { if ( t != null && dumpFile != null && ( dumpFile.exists() || mkdirs( dumpFile ) && dumpFile.createNewFile() ) ) { Writer fw = createWriter( dumpFile ); if ( msg != null ) { fw.append( msg ) .append( StringUtils.NL ); } PrintWriter pw = new PrintWriter( fw ); t.printStackTrace( pw ); pw.flush(); fw.append( StringUtils.NL ) .append( StringUtils.NL ) .close(); } } catch ( Exception e ) { // do nothing } } public static void dumpText( String msg, File dumpFile ) { try { if ( msg != null && dumpFile != null && ( dumpFile.exists() || mkdirs( dumpFile ) && dumpFile.createNewFile() ) ) { createWriter( dumpFile ) .append( msg ) .append( StringUtils.NL ) .append( StringUtils.NL ) .close(); } } catch ( Exception e ) { // do nothing } } public static String newFormattedDateFileName() { return new SimpleDateFormat( "yyyy-MM-dd'T'HH-mm-ss_SSS" ).format( new Date() ); } private static Writer createWriter( File dumpFile ) throws IOException { return new OutputStreamWriter( new FileOutputStream( dumpFile, true ), UTF_8 ) .append( "# Created at " ) .append( new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS" ).format( new Date() ) ) .append( StringUtils.NL ); } private static boolean mkdirs( File dumpFile ) { File dir = dumpFile.getParentFile(); return dir.exists() || dir.mkdirs(); } } ImmutableMap.java000066400000000000000000000067431330756104600363110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/util/internalpackage org.apache.maven.surefire.util.internal; /* * 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. */ import java.util.AbstractMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import static java.util.Collections.unmodifiableSet; /** * Copies input map in {@link #ImmutableMap(Map) constructor}, and Entries are linked and thread-safe. * The map is immutable with linear list of entries. * * @param key * @param value * @since 2.20 */ public final class ImmutableMap extends AbstractMap { private final Node first; public ImmutableMap( Map map ) { Node first = null; Node previous = null; for ( Entry e : map.entrySet() ) { Node node = new Node( e.getKey(), e.getValue() ); if ( first == null ) { first = node; } else { previous.next = node; } previous = node; } this.first = first; } @Override public Set> entrySet() { Set> entries = new LinkedHashSet>(); Node node = first; while ( node != null ) { entries.add( node ); node = node.next; } return unmodifiableSet( entries ); } static final class Node implements Entry { final K key; final V value; volatile Node next; Node( K key, V value ) { this.key = key; this.value = value; } @Override public K getKey() { return key; } @Override public V getValue() { return value; } @Override public V setValue( V value ) { throw new UnsupportedOperationException(); } @Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } Node node = (Node) o; return getKey() != null ? getKey().equals( node.getKey() ) : node.getKey() == null && getValue() != null ? getValue().equals( node.getValue() ) : node.getValue() == null; } @Override public int hashCode() { int result = getKey() != null ? getKey().hashCode() : 0; result = 31 * result + ( getValue() != null ? getValue().hashCode() : 0 ); return result; } } } ObjectUtils.java000066400000000000000000000043411330756104600361530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/util/internalpackage org.apache.maven.surefire.util.internal; /* * 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. */ import java.lang.management.ManagementFactory; import java.util.Map; /** * Similar to Java 7 java.util.Objects. * * @author Tibor Digana (tibor17) * @since 2.20 */ public final class ObjectUtils { private ObjectUtils() { throw new IllegalStateException( "no instantiable constructor" ); } public static T useNonNull( T target, T fallback ) { return isNull( target ) ? fallback : target; } /* * In JDK7 use java.util.Objects instead. * todo * */ public static boolean isNull( Object target ) { return target == null; } /* * In JDK7 use java.util.Objects instead. * todo * */ public static boolean nonNull( Object target ) { return !isNull( target ); } /* * In JDK7 use java.util.Objects instead. * todo * */ public static T requireNonNull( T obj, String message ) { if ( isNull( obj ) ) { throw new NullPointerException( message ); } return obj; } /* * In JDK7 use java.util.Objects instead. * todo * */ public static T requireNonNull( T obj ) { return requireNonNull( obj, null ); } public static Map systemProps() { return ManagementFactory.getRuntimeMXBean().getSystemProperties(); } } StringUtils.java000066400000000000000000000310431330756104600362120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/util/internalpackage org.apache.maven.surefire.util.internal; /* * 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. */ import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.CharacterCodingException; import java.nio.charset.Charset; import java.util.StringTokenizer; /** *

* Common {@link String java.lang.String} manipulation routines. *

*
*

* Originally from Turbine and the GenerationJavaCore library. *

*
* NOTE: This class is not part of any api and is public purely for technical reasons ! * * @author Jon S. Stevens * @author Daniel Rall * @author Greg Coladonato * @author Henri Yandell * @author Ed Korthof * @author Rand McNeely * @author Stephen Colebourne * @author Fredrik Westermarck * @author Holger Krauth * @author Alexander Day Chaffee * @author Vincent Siveton * @version $Id: StringUtils.java 8001 2009-01-03 13:17:09Z vsiveton $ * @since 1.0 */ public final class StringUtils { public static final String NL = System.getProperty( "line.separator" ); private static final byte[] HEX_CHARS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; private static final Charset DEFAULT_CHARSET = Charset.defaultCharset(); /** * TODO * Use JDK7 StandardCharsets */ public static final Charset US_ASCII = Charset.forName( "US-ASCII" ); // 8-bit charset Latin-1 public static final Charset ISO_8859_1 = Charset.forName( "ISO-8859-1" ); public static final Charset UTF_8 = Charset.forName( "UTF-8" ); private StringUtils() { throw new IllegalStateException( "no instantiable constructor" ); } public static String[] split( String text, String separator ) { final StringTokenizer tok; if ( separator == null ) { // Null separator means we're using StringTokenizer's default // delimiter, which comprises all whitespace characters. tok = new StringTokenizer( text ); } else { tok = new StringTokenizer( text, separator ); } String[] list = new String[tok.countTokens()]; for ( int i = 0; tok.hasMoreTokens(); i++ ) { list[i] = tok.nextToken(); } return list; } /** *

* Checks if a (trimmed) String is {@code null} or blank. *

* * @param str the String to check * @return {@code true} if the String is {@code null}, or length zero once trimmed */ public static boolean isBlank( String str ) { return str == null || str.trim().isEmpty(); } /** *

* Checks if a (trimmed) String is not {@code null} and not blank. *

* * @param str the String to check * @return {@code true} if the String is not {@code null} and length of trimmed {@code str} is not zero. */ public static boolean isNotBlank( String str ) { return !isBlank( str ); } /** * Escape the specified string to a representation that only consists of nicely printable characters, without any * newlines and without a comma. *

* The reverse-method is {@link #unescapeString(StringBuilder, CharSequence)}. * * @param target target string buffer. The required space will be up to {@code str.getBytes().length * 5} chars. * @param str String to escape values in, may be {@code null}. */ @SuppressWarnings( "checkstyle:magicnumber" ) public static void escapeToPrintable( StringBuilder target, CharSequence str ) { if ( target == null ) { throw new IllegalArgumentException( "The target buffer must not be null" ); } if ( str == null ) { return; } for ( int i = 0; i < str.length(); i++ ) { char c = str.charAt( i ); // handle non-nicely printable chars and the comma if ( c < 32 || c > 126 || c == '\\' || c == ',' ) { target.append( '\\' ); target.append( (char) HEX_CHARS[( 0xF000 & c ) >> 12] ); target.append( (char) HEX_CHARS[( 0x0F00 & c ) >> 8] ); target.append( (char) HEX_CHARS[( 0x00F0 & c ) >> 4] ); target.append( (char) HEX_CHARS[( 0x000F & c )] ); } else { target.append( c ); } } } /** * Reverses the effect of {@link #escapeToPrintable(StringBuilder, CharSequence)}. * * @param target target string buffer * @param str the String to un-escape, as created by {@link #escapeToPrintable(StringBuilder, CharSequence)} */ public static void unescapeString( StringBuilder target, CharSequence str ) { if ( target == null ) { throw new IllegalArgumentException( "The target buffer must not be null" ); } if ( str == null ) { return; } for ( int i = 0; i < str.length(); i++ ) { char ch = str.charAt( i ); if ( ch == '\\' ) { target.append( (char) ( digit( str.charAt( ++i ) ) << 12 | digit( str.charAt( ++i ) ) << 8 | digit( str.charAt( ++i ) ) << 4 | digit( str.charAt( ++i ) ) ) ); } else { target.append( ch ); } } } private static int digit( char ch ) { if ( ch >= 'a' ) { return 10 + ch - 'a'; } else if ( ch >= 'A' ) { return 10 + ch - 'A'; } else { return ch - '0'; } } /** * Escapes the bytes in the array {@code input} to contain only 'printable' bytes. *
* Escaping is done by encoding the non-nicely printable bytes to {@code '\' + upperCaseHexBytes(byte)}. *
* The reverse-method is {@link #unescapeBytes(String, String)}. *
* The returned byte array is started with aligned sequence {@code header} and finished by {@code \n}. * * @param header prefix header * @param input input buffer * @param off offset in the input buffer * @param len number of bytes to copy from the input buffer * @return number of bytes written to {@code out} * @throws NullPointerException if the specified parameter {@code header} or {@code input} is null * @throws IndexOutOfBoundsException if {@code off} or {@code len} is out of range * ({@code off < 0 || len < 0 || off >= input.length || len > input.length || off + len > input.length}) */ @SuppressWarnings( "checkstyle:magicnumber" ) public static EncodedArray escapeBytesToPrintable( final byte[] header, final byte[] input, final int off, final int len ) { if ( input.length == 0 ) { return EncodedArray.EMPTY; } if ( off < 0 || len < 0 || off >= input.length || len > input.length || off + len > input.length ) { throw new IndexOutOfBoundsException( "off < 0 || len < 0 || off >= input.length || len > input.length || off + len > input.length" ); } // Hex-escaping can be up to 3 times length of a regular byte. Last character is '\n', see (+1). final byte[] encodeBytes = new byte[header.length + 3 * len + 1]; System.arraycopy( header, 0, encodeBytes, 0, header.length ); int outputPos = header.length; final int end = off + len; for ( int i = off; i < end; i++ ) { final byte b = input[i]; // handle non-nicely printable bytes if ( b < 32 || b > 126 || b == '\\' || b == ',' ) { final int upper = ( 0xF0 & b ) >> 4; final int lower = ( 0x0F & b ); encodeBytes[outputPos++] = '\\'; encodeBytes[outputPos++] = HEX_CHARS[upper]; encodeBytes[outputPos++] = HEX_CHARS[lower]; } else { encodeBytes[outputPos++] = b; } } encodeBytes[outputPos++] = (byte) '\n'; return new EncodedArray( encodeBytes, outputPos ); } /** * Reverses the effect of {@link #escapeBytesToPrintable(byte[], byte[], int, int)}. * * @param str the input String * @param charsetName the charset name * @return the number of bytes written to {@code out} */ public static ByteBuffer unescapeBytes( String str, String charsetName ) { int outPos = 0; if ( str == null ) { return ByteBuffer.wrap( new byte[0] ); } byte[] out = new byte[str.length()]; for ( int i = 0; i < str.length(); i++ ) { char ch = str.charAt( i ); if ( ch == '\\' ) { int upper = digit( str.charAt( ++i ) ); int lower = digit( str.charAt( ++i ) ); out[outPos++] = (byte) ( upper << 4 | lower ); } else { out[outPos++] = (byte) ch; } } Charset sourceCharset = Charset.forName( charsetName ); if ( !DEFAULT_CHARSET.equals( sourceCharset ) ) { CharBuffer decodedFromSourceCharset; try { decodedFromSourceCharset = sourceCharset.newDecoder().decode( ByteBuffer.wrap( out, 0, outPos ) ); return DEFAULT_CHARSET.encode( decodedFromSourceCharset ); } catch ( CharacterCodingException e ) { // ignore and fall through to the non-recoded version } } return ByteBuffer.wrap( out, 0, outPos ); } public static byte[] encodeStringForForkCommunication( String string ) { return string.getBytes( ISO_8859_1 ); } /** * Determines if {@code buffer} starts with specific literal(s). * * @param buffer Examined StringBuffer * @param pattern a pattern which should start in {@code buffer} * @return {@code true} if buffer's literal starts with given {@code pattern}, or both are empty. */ public static boolean startsWith( StringBuffer buffer, String pattern ) { if ( buffer.length() < pattern.length() ) { return false; } else { for ( int i = 0, len = pattern.length(); i < len; i++ ) { if ( buffer.charAt( i ) != pattern.charAt( i ) ) { return false; } } return true; } } /** * Escaped string to byte array with offset 0 and certain length. */ public static final class EncodedArray { private static final EncodedArray EMPTY = new EncodedArray( new byte[]{}, 0 ); private final byte[] array; private final int size; private EncodedArray( byte[] array, int size ) { this.array = array; this.size = size; } public byte[] getArray() { return array; } public int getSize() { return size; } } } TestClassMethodNameUtils.java000066400000000000000000000037021330756104600406140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/util/internalpackage org.apache.maven.surefire.util.internal; /* * 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. */ import java.util.regex.Matcher; import java.util.regex.Pattern; /** * JUnit Description parser. * Used by JUnit Version lower than 4.7. * * @author Tibor Digana (tibor17) * @since 2.20 */ public final class TestClassMethodNameUtils { /** * This pattern is verbatim copy from JUnit's code in class {@code Description}. * Parsing class and method from junit description would provide identical result to JUnit internal parser. */ private static final Pattern METHOD_CLASS_PATTERN = Pattern.compile( "([\\s\\S]*)\\((.*)\\)" ); private TestClassMethodNameUtils() { throw new IllegalStateException( "no instantiable constructor" ); } public static String extractClassName( String displayName ) { Matcher m = METHOD_CLASS_PATTERN.matcher( displayName ); return m.matches() ? m.group( 2 ) : displayName; } public static String extractMethodName( String displayName ) { Matcher m = METHOD_CLASS_PATTERN.matcher( displayName ); return m.matches() ? m.group( 1 ) : displayName; } } UrlUtils.java000066400000000000000000000050701330756104600355070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/java/org/apache/maven/surefire/util/internalpackage org.apache.maven.surefire.util.internal; /* * 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. */ import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.BitSet; import static org.apache.maven.surefire.util.internal.StringUtils.UTF_8; /** * Utility for dealing with URLs in pre-JDK 1.4. */ public final class UrlUtils { private static final BitSet UNRESERVED = new BitSet( Byte.MAX_VALUE - Byte.MIN_VALUE + 1 ); private static final int RADIX = 16; private static final int MASK = 0xf; private UrlUtils() { throw new IllegalStateException( "no instantiable constructor" ); } static { byte[] bytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.!~*'():/".getBytes( UTF_8 ); for ( byte aByte : bytes ) { UNRESERVED.set( aByte ); } } public static URL toURL( File file ) throws MalformedURLException { // with JDK 1.4+, code would be: return new URL( file.toURI().toASCIIString() ); //noinspection deprecation URL url = file.toURL(); // encode any characters that do not comply with RFC 2396 // this is primarily to handle Windows where the user's home directory contains spaces byte[] bytes = url.toString().getBytes( UTF_8 ); StringBuilder buf = new StringBuilder( bytes.length ); for ( byte b : bytes ) { if ( b > 0 && UNRESERVED.get( b ) ) { buf.append( (char) b ); } else { buf.append( '%' ); buf.append( Character.forDigit( b >>> 4 & MASK, RADIX ) ); buf.append( Character.forDigit( b & MASK, RADIX ) ); } } return new URL( buf.toString() ); } } maven-surefire-surefire-2.22.0/surefire-api/src/main/resources/000077500000000000000000000000001330756104600244745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/resources/org/000077500000000000000000000000001330756104600252635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/resources/org/apache/000077500000000000000000000000001330756104600265045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/resources/org/apache/maven/000077500000000000000000000000001330756104600276125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/resources/org/apache/maven/surefire/000077500000000000000000000000001330756104600314365ustar00rootroot00000000000000surefire.properties000066400000000000000000000022051330756104600353200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/main/resources/org/apache/maven/surefire# # 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. # setupFixtureFailed=Method setupFixture threw an exception prior to calling {0}. cleanupFixtureFailed=Method cleanupFixture threw an exception prior to calling {0}. testSetStarting=Test set starting. testSetCompletedNormally=Test set completed. testStarting=Test starting. executeException=Exception occurred. testSuccessful=Test succeeded. testSkipped=Test skipped.maven-surefire-surefire-2.22.0/surefire-api/src/site/000077500000000000000000000000001330756104600225025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/site/apt/000077500000000000000000000000001330756104600232665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/site/apt/index.apt000066400000000000000000000040511330756104600251030ustar00rootroot00000000000000 ~~ 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. ----- Surefire API Design ----- Brett Porter ----- 2007-03-03 ----- Surefire API * Definitions *-------------+-----------------------------------------------+ | test method | Individual test method within a class | *-------------+-----------------------------------------------+ | test | 1..N test methods in 1 or more classes. | *-------------+-----------------------------------------------+ | suite | 1..N tests. | *-------------+-----------------------------------------------+ | group | A named subset of test methods within a test. | *-------------+-----------------------------------------------+ How each definition is applied depends on the provider, and the test suite being used. * Directory test suite: this constructs a single suite from a directory file set. Each discovered class is treated as a test. * TestNG XML test suite: this constructs a single suite from a <<>> file. The definitions inside the file will match those above. * JUnit 3.x: Groups are not supported. [] See {{{../surefire-providers/index.html}Surefire Providers}} for more information on specific providers. ~~TODO: fix up URLs, move some to providers/javadoc. maven-surefire-surefire-2.22.0/surefire-api/src/site/site.xml000066400000000000000000000025111330756104600241670ustar00rootroot00000000000000

maven-surefire-surefire-2.22.0/surefire-api/src/test/000077500000000000000000000000001330756104600225155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/000077500000000000000000000000001330756104600234365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/000077500000000000000000000000001330756104600242255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/000077500000000000000000000000001330756104600254465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600265545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/JUnit4SuiteTest.java000066400000000000000000000061601330756104600324110ustar00rootroot00000000000000package org.apache.maven; /* * 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. */ import junit.framework.JUnit4TestAdapter; import junit.framework.Test; import org.apache.maven.plugin.surefire.runorder.ThreadedExecutionSchedulerTest; import org.apache.maven.surefire.SpecificTestClassFilterTest; import org.apache.maven.surefire.booter.ForkingRunListenerTest; import org.apache.maven.surefire.booter.MasterProcessCommandTest; import org.apache.maven.surefire.booter.SurefireReflectorTest; import org.apache.maven.surefire.report.LegacyPojoStackTraceWriterTest; import org.apache.maven.surefire.suite.RunResultTest; import org.apache.maven.surefire.testset.FundamentalFilterTest; import org.apache.maven.surefire.testset.ResolvedTestTest; import org.apache.maven.surefire.testset.TestListResolverTest; import org.apache.maven.surefire.util.DefaultDirectoryScannerTest; import org.apache.maven.surefire.util.ReflectionUtilsTest; import org.apache.maven.surefire.util.RunOrderCalculatorTest; import org.apache.maven.surefire.util.RunOrderTest; import org.apache.maven.surefire.util.ScanResultTest; import org.apache.maven.surefire.util.TestsToRunTest; import org.apache.maven.surefire.util.UrlUtilsTest; import org.apache.maven.surefire.util.internal.ConcurrencyUtilsTest; import org.apache.maven.surefire.util.internal.ImmutableMapTest; import org.apache.maven.surefire.util.internal.StringUtilsTest; import org.junit.runner.RunWith; import org.junit.runners.Suite; /** * Adapt the JUnit4 tests which use only annotations to the JUnit3 test suite. * * @author Tibor Digana (tibor17) * @since 2.19 */ @Suite.SuiteClasses( { ThreadedExecutionSchedulerTest.class, ForkingRunListenerTest.class, MasterProcessCommandTest.class, SurefireReflectorTest.class, LegacyPojoStackTraceWriterTest.class, RunResultTest.class, ResolvedTestTest.class, TestListResolverTest.class, ConcurrencyUtilsTest.class, StringUtilsTest.class, DefaultDirectoryScannerTest.class, RunOrderCalculatorTest.class, RunOrderTest.class, ScanResultTest.class, TestsToRunTest.class, UrlUtilsTest.class, SpecificTestClassFilterTest.class, FundamentalFilterTest.class, ImmutableMapTest.class, ReflectionUtilsTest.class } ) @RunWith( Suite.class ) public class JUnit4SuiteTest { public static Test suite() { return new JUnit4TestAdapter( JUnit4SuiteTest.class ); } } maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/plugin/000077500000000000000000000000001330756104600300525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/plugin/surefire/000077500000000000000000000000001330756104600316765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/plugin/surefire/runorder/000077500000000000000000000000001330756104600335365ustar00rootroot00000000000000ThreadedExecutionSchedulerTest.java000066400000000000000000000100561330756104600424270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/plugin/surefire/runorderpackage org.apache.maven.plugin.surefire.runorder; /* * 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. */ import java.util.List; import junit.framework.TestCase; /** * @author Kristian Rosenvold */ public class ThreadedExecutionSchedulerTest extends TestCase { private final RunEntryStatistics a1 = RunEntryStatistics.fromValues( 200, 2, A.class, "at1" ); private final RunEntryStatistics a2 = RunEntryStatistics.fromValues( 300, 2, A.class, "at2" ); private final RunEntryStatistics b1 = RunEntryStatistics.fromValues( 400, 2, B.class, "bt1" ); private final RunEntryStatistics b2 = RunEntryStatistics.fromValues( 300, 2, B.class, "bt2" ); private final RunEntryStatistics c1 = RunEntryStatistics.fromValues( 400, 2, C.class, "ct1" ); private final RunEntryStatistics c2 = RunEntryStatistics.fromValues( 200, 2, C.class, "ct2" ); private final RunEntryStatistics d1 = RunEntryStatistics.fromValues( 401, 2, D.class, "ct2" ); private final RunEntryStatistics e1 = RunEntryStatistics.fromValues( 200, 2, E.class, "ct2" ); public void testAddTest() throws Exception { ThreadedExecutionScheduler threadedExecutionScheduler = new ThreadedExecutionScheduler( 2 ); addPrioritizedTests( threadedExecutionScheduler ); final List> result = threadedExecutionScheduler.getResult(); assertEquals( 5, result.size() ); assertEquals( B.class, result.get( 0 ) ); assertEquals( C.class, result.get( 1 ) ); assertEquals( D.class, result.get( 2 ) ); assertEquals( A.class, result.get( 3 ) ); assertEquals( E.class, result.get( 4 ) ); } public void testAddTestJaggedResult() throws Exception { ThreadedExecutionScheduler threadedExecutionScheduler = new ThreadedExecutionScheduler( 4 ); addPrioritizedTests( threadedExecutionScheduler ); final List result = threadedExecutionScheduler.getResult(); assertEquals( 5, result.size() ); } private void addPrioritizedTests( ThreadedExecutionScheduler threadedExecutionScheduler ) { threadedExecutionScheduler.addTest( new PrioritizedTest( B.class, createPriority( b1, b2 ) ) ); threadedExecutionScheduler.addTest( new PrioritizedTest( C.class, createPriority( c1, c2 ) ) ); threadedExecutionScheduler.addTest( new PrioritizedTest( A.class, createPriority( a1, a2 ) ) ); threadedExecutionScheduler.addTest( new PrioritizedTest( D.class, createPriority( d1 ) ) ); threadedExecutionScheduler.addTest( new PrioritizedTest( E.class, createPriority( e1 ) ) ); } private Priority createPriority( RunEntryStatistics runEntryStatistics ) { final Priority priority = new Priority( A.class.getName() ); priority.addItem( runEntryStatistics ); return priority; } private Priority createPriority( RunEntryStatistics runEntryStatistics, RunEntryStatistics runEntryStatistics2 ) { final Priority priority = new Priority( A.class.getName() ); priority.addItem( runEntryStatistics ); priority.addItem( runEntryStatistics2 ); return priority; } class A { } // 500 total class B { } // 700 total class C { } // 600 total class D { } // 400 total class E { } // 200 total } maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/000077500000000000000000000000001330756104600304005ustar00rootroot00000000000000SpecificTestClassFilterTest.java000066400000000000000000000040511330756104600365450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefirepackage org.apache.maven.surefire; /* * 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. */ import junit.framework.TestCase; public class SpecificTestClassFilterTest extends TestCase { public void testMatchSingleCharacterWildcard() { SpecificTestClassFilter filter = new SpecificTestClassFilter( new String[]{ "org/apache/maven/surefire/?pecificTestClassFilter.class" } ); assertTrue( filter.accept( SpecificTestClassFilter.class ) ); } public void testMatchSingleSegmentWordWildcard() { SpecificTestClassFilter filter = new SpecificTestClassFilter( new String[]{ "org/apache/maven/surefire/*TestClassFilter.class" } ); assertTrue( filter.accept( SpecificTestClassFilter.class ) ); } public void testMatchMultiSegmentWildcard() { SpecificTestClassFilter filter = new SpecificTestClassFilter( new String[]{ "org/**/SpecificTestClassFilter.class" } ); assertTrue( filter.accept( SpecificTestClassFilter.class ) ); } public void testMatchSingleSegmentWildcard() { SpecificTestClassFilter filter = new SpecificTestClassFilter( new String[]{ "org/*/maven/surefire/SpecificTestClassFilter.class" } ); assertTrue( filter.accept( SpecificTestClassFilter.class ) ); } } maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/booter/000077500000000000000000000000001330756104600316725ustar00rootroot00000000000000ForkingRunListenerTest.java000066400000000000000000000027671330756104600371240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.io.ByteArrayOutputStream; import java.io.PrintStream; import junit.framework.TestCase; /** * @author Kristian Rosenvold */ public class ForkingRunListenerTest extends TestCase { public void testInfo() throws Exception { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); PrintStream target = new PrintStream( byteArrayOutputStream ); ForkingRunListener forkingRunListener = new ForkingRunListener( target, 1, true ); forkingRunListener.info( new String( new byte[]{ 65 } ) ); forkingRunListener.info( new String( new byte[]{ } ) ); } } MasterProcessCommandTest.java000066400000000000000000000166651330756104600374250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import junit.framework.TestCase; import org.junit.Rule; import org.junit.rules.ExpectedException; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import static org.apache.maven.surefire.booter.MasterProcessCommand.*; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; /** * @author Tibor Digana (tibor17) * @since 2.19 */ public class MasterProcessCommandTest extends TestCase { @Rule public final ExpectedException exception = ExpectedException.none(); public void testEncodedStreamSequence() { byte[] streamSequence = new byte[10]; streamSequence[8] = (byte) 'T'; streamSequence[9] = (byte) 'e'; setCommandAndDataLength( 256, 2, streamSequence ); assertEquals( streamSequence[0], (byte) 0 ); assertEquals( streamSequence[1], (byte) 0 ); assertEquals( streamSequence[2], (byte) 1 ); assertEquals( streamSequence[3], (byte) 0 ); assertEquals( streamSequence[4], (byte) 0 ); assertEquals( streamSequence[5], (byte) 0 ); assertEquals( streamSequence[6], (byte) 0 ); assertEquals( streamSequence[7], (byte) 2 ); // remain unchanged assertEquals( streamSequence[8], (byte) 'T' ); assertEquals( streamSequence[9], (byte) 'e' ); } public void testResolved() { for ( MasterProcessCommand command : MasterProcessCommand.values() ) { assertThat( command, is( resolve( command.getId() ) ) ); } } public void testDataToByteArrayAndBack() { String dummyData = "pkg.Test"; for ( MasterProcessCommand command : MasterProcessCommand.values() ) { switch ( command ) { case RUN_CLASS: assertEquals( String.class, command.getDataType() ); byte[] encoded = command.fromDataType( dummyData ); assertThat( encoded.length, is( 8 ) ); assertThat( encoded[0], is( (byte) 'p' ) ); assertThat( encoded[1], is( (byte) 'k' ) ); assertThat( encoded[2], is( (byte) 'g' ) ); assertThat( encoded[3], is( (byte) '.' ) ); assertThat( encoded[4], is( (byte) 'T' ) ); assertThat( encoded[5], is( (byte) 'e' ) ); assertThat( encoded[6], is( (byte) 's' ) ); assertThat( encoded[7], is( (byte) 't' ) ); String decoded = command.toDataTypeAsString( encoded ); assertThat( decoded, is( dummyData ) ); break; case TEST_SET_FINISHED: assertEquals( Void.class, command.getDataType() ); encoded = command.fromDataType( dummyData ); assertThat( encoded.length, is( 0 ) ); decoded = command.toDataTypeAsString( encoded ); assertNull( decoded ); break; case SKIP_SINCE_NEXT_TEST: assertEquals( Void.class, command.getDataType() ); encoded = command.fromDataType( dummyData ); assertThat( encoded.length, is( 0 ) ); decoded = command.toDataTypeAsString( encoded ); assertNull( decoded ); break; case SHUTDOWN: assertEquals( String.class, command.getDataType() ); encoded = command.fromDataType( Shutdown.EXIT.name() ); assertThat( encoded.length, is( 4 ) ); decoded = command.toDataTypeAsString( encoded ); assertThat( decoded, is( Shutdown.EXIT.name() ) ); break; case NOOP: assertEquals( Void.class, command.getDataType() ); encoded = command.fromDataType( dummyData ); assertThat( encoded.length, is( 0 ) ); decoded = command.toDataTypeAsString( encoded ); assertNull( decoded ); break; case BYE_ACK: assertEquals( Void.class, command.getDataType() ); encoded = command.fromDataType( dummyData ); assertThat( encoded.length, is( 0 ) ); decoded = command.toDataTypeAsString( encoded ); assertNull( decoded ); break; default: fail(); } assertThat( command, is( resolve( command.getId() ) ) ); } } public void testEncodedDecodedIsSameForRunClass() throws IOException { byte[] encoded = RUN_CLASS.encode( "pkg.Test" ); assertThat( encoded.length, is( 16 ) ); assertThat( encoded[0], is( (byte) 0 ) ); assertThat( encoded[1], is( (byte) 0 ) ); assertThat( encoded[2], is( (byte) 0 ) ); assertThat( encoded[3], is( (byte) 0 ) ); assertThat( encoded[4], is( (byte) 0 ) ); assertThat( encoded[5], is( (byte) 0 ) ); assertThat( encoded[6], is( (byte) 0 ) ); assertThat( encoded[7], is( (byte) 8 ) ); assertThat( encoded[8], is( (byte) 'p' ) ); assertThat( encoded[9], is( (byte) 'k' ) ); assertThat( encoded[10], is( (byte) 'g' ) ); assertThat( encoded[11], is( (byte) '.' ) ); assertThat( encoded[12], is( (byte) 'T' ) ); assertThat( encoded[13], is( (byte) 'e' ) ); assertThat( encoded[14], is( (byte) 's' ) ); assertThat( encoded[15], is( (byte) 't' ) ); Command command = decode( new DataInputStream( new ByteArrayInputStream( encoded ) ) ); assertNotNull( command ); assertThat( command.getCommandType(), is( RUN_CLASS ) ); assertThat( command.getData(), is( "pkg.Test" ) ); } public void testShouldDecodeTwoCommands() throws IOException { byte[] cmd1 = BYE_ACK.encode(); byte[] cmd2 = NOOP.encode(); byte[] stream = new byte[cmd1.length + cmd2.length]; System.arraycopy( cmd1, 0, stream, 0, cmd1.length ); System.arraycopy( cmd2, 0, stream, cmd1.length, cmd2.length ); DataInputStream is = new DataInputStream( new ByteArrayInputStream( stream ) ); Command bye = decode( is ); assertNotNull( bye ); assertThat( bye.getCommandType(), is( BYE_ACK ) ); Command noop = decode( is ); assertNotNull( noop ); assertThat( noop.getCommandType(), is( NOOP ) ); } } SurefireReflectorTest.java000066400000000000000000000035271330756104600367570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import junit.framework.TestCase; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.suite.RunResult; public class SurefireReflectorTest extends TestCase { public void testShouldCreateFactoryWithoutException() { ReporterFactory factory = new ReporterFactory() { @Override public RunListener createReporter() { return null; } @Override public RunResult close() { return null; } }; ClassLoader cl = Thread.currentThread().getContextClassLoader(); SurefireReflector reflector = new SurefireReflector( cl ); BaseProviderFactory baseProviderFactory = (BaseProviderFactory) reflector.createBooterConfiguration( cl, factory, true ); assertNotNull( baseProviderFactory.getReporterFactory() ); assertSame( factory, baseProviderFactory.getReporterFactory() ); } } maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/report/000077500000000000000000000000001330756104600317135ustar00rootroot00000000000000LegacyPojoStackTraceWriterTest.java000066400000000000000000000214111330756104600405340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import java.io.PrintWriter; import junit.framework.TestCase; /** * @author Kristian Rosenvold */ public class LegacyPojoStackTraceWriterTest extends TestCase { public void testWriteTrimmedTraceToString() { String stackTrace = "junit.framework.AssertionFailedError: blah\n" + " at junit.framework.Assert.fail(Assert.java:47)\n" + " at TestSurefire3.testQuote(TestSurefire3.java:23)\n" + " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n" + " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n" + " at java.lang.reflect.Method.invoke(Method.java:585)\n" + " at junit.framework.TestCase.runTest(TestCase.java:154)\n" + " at junit.framework.TestCase.runBare(TestCase.java:127)\n" + " at junit.framework.TestResult$1.protect(TestResult.java:106)\n" + " at junit.framework.TestResult.runProtected(TestResult.java:124)\n" + " at junit.framework.TestResult.run(TestResult.java:109)\n" + " at junit.framework.TestCase.run(TestCase.java:118)\n" + " at junit.framework.TestSuite.runTest(TestSuite.java:208)\n" + " at junit.framework.TestSuite.run(TestSuite.java:203)\n" + " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n" + " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n" + " at java.lang.reflect.Method.invoke(Method.java:585)\n" + " at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)\n" + " at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)\n" + " at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)\n" + " at org.apache.maven.surefire.Surefire.run(Surefire.java:132)\n" + " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n" + " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n" + " at java.lang.reflect.Method.invoke(Method.java:585)\n" + " at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:318)\n" + " at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:956)\n"; MockThrowable t = new MockThrowable( stackTrace ); LegacyPojoStackTraceWriter w = new LegacyPojoStackTraceWriter( "TestSurefire3", "testQuote", t ); String out = w.writeTrimmedTraceToString(); String expected = "junit.framework.AssertionFailedError: blah\n" + " at junit.framework.Assert.fail(Assert.java:47)\n" + " at TestSurefire3.testQuote(TestSurefire3.java:23)\n"; assertEquals( expected, out ); } public void testCausedBy() { String stackTrace = "java.lang.RuntimeException: blah\n" + " at TestSurefire3.testBlah(TestSurefire3.java:45)\n" + " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n" + " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n" + " at java.lang.reflect.Method.invoke(Method.java:585)\n" + " at junit.framework.TestCase.runTest(TestCase.java:154)\n" + " at junit.framework.TestCase.runBare(TestCase.java:127)\n" + " at junit.framework.TestResult$1.protect(TestResult.java:106)\n" + " at junit.framework.TestResult.runProtected(TestResult.java:124)\n" + " at junit.framework.TestResult.run(TestResult.java:109)\n" + " at junit.framework.TestCase.run(TestCase.java:118)\n" + " at junit.framework.TestSuite.runTest(TestSuite.java:208)\n" + " at junit.framework.TestSuite.run(TestSuite.java:203)\n" + " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n" + " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n" + " at java.lang.reflect.Method.invoke(Method.java:585)\n" + " at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)\n" + " at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)\n" + " at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)\n" + " at org.apache.maven.surefire.Surefire.run(Surefire.java:132)\n" + " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n" + " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n" + " at java.lang.reflect.Method.invoke(Method.java:585)\n" + " at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:318)\n" + " at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:956)\n" + "Caused by: junit.framework.AssertionFailedError: \"\n" + " at junit.framework.Assert.fail(Assert.java:47)\n" + " at TestSurefire3.testQuote(TestSurefire3.java:23)\n" + " at TestSurefire3.testBlah(TestSurefire3.java:43)\n" + " at TestSurefire3.testBlah(TestSurefire3.java:43)\n" + " ... 26 more\n"; MockThrowable t = new MockThrowable( stackTrace ); LegacyPojoStackTraceWriter w = new LegacyPojoStackTraceWriter( "TestSurefire3", "testBlah", t ); String out = w.writeTrimmedTraceToString(); String expected = "java.lang.RuntimeException: blah\n" + " at TestSurefire3.testBlah(TestSurefire3.java:45)\n" + "Caused by: junit.framework.AssertionFailedError: \"\n" + " at junit.framework.Assert.fail(Assert.java:47)\n" + " at TestSurefire3.testQuote(TestSurefire3.java:23)\n" + " at TestSurefire3.testBlah(TestSurefire3.java:43)\n" + " at TestSurefire3.testBlah(TestSurefire3.java:43)\n" + " ... 26 more\n"; assertEquals( expected, out ); } class MockThrowable extends Throwable { private static final long serialVersionUID = 1L; private final String stackTrace; public MockThrowable( String stackTrace ) { this.stackTrace = stackTrace; } @Override public void printStackTrace( PrintWriter s ) { s.write( stackTrace ); } } public void testMultiLineMessage() { String msg = "assert \"foo\" == \"bar\"\n" + " |\n" + " false"; try { throw new RuntimeException( msg ); } catch ( Throwable t ) { LegacyPojoStackTraceWriter writer = new LegacyPojoStackTraceWriter( null, null, t ); String stackTrace = writer.writeTraceToString(); assertTrue( stackTrace.startsWith( "java.lang.RuntimeException: \n" + msg ) ); } } } maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/suite/000077500000000000000000000000001330756104600315315ustar00rootroot00000000000000RunResultTest.java000066400000000000000000000025541330756104600351260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/suitepackage org.apache.maven.surefire.suite; /* * 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. */ import junit.framework.TestCase; /** * @author Kristian Rosenvold */ public class RunResultTest extends TestCase { public void testEmptySummaryShouldBeErrorFree() { RunResult summary = RunResult.noTestsRun(); assertTrue( summary.isErrorFree() ); } public void testFailuresInFirstRun() { RunResult resultOne = new RunResult( 10, 1, 3, 2 ); RunResult resultTwo = new RunResult( 20, 0, 0, 0 ); assertFalse( resultOne.aggregate( resultTwo ).isErrorFree() ); } } maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/testset/000077500000000000000000000000001330756104600320735ustar00rootroot00000000000000FundamentalFilterTest.java000066400000000000000000000455541330756104600371400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/testsetpackage org.apache.maven.surefire.testset; /* * 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. */ import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; @SuppressWarnings( { "javadoc", "checkstyle:javadoctype" } ) /** * Inclusive test patters:

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
test pattern
classmethodclassmethodshouldRunAsInclusive
nnnny (wildcard pattern)testIncludes1
nnnyy (suppose suite and custome filter)testIncludes2
nnyny (suppose Suite)testIncludes3
nnyyy (suppose Suite)testIncludes4
nynny (wildcard pattern)testIncludes5
nynymatch methodstestIncludes6
nyyny (due to Cucumber)testIncludes7
nyyyy (due to Cucumber)testIncludes8
ynnny (wildcard pattern)testIncludes9
ynnyy (suppose suite and custome filter)testIncludes10
ynynmatch classestestIncludes11
ynyymatch classestestIncludes12
yynny (wildcard pattern)testIncludes13
yynymatch methodstestIncludes14
yyynmatch classestestIncludes15
yyyymatch alltestIncludes16
*

*

* Exclusive test patters:

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
test pattern
classmethodclassmethodshouldRunAsExclusive
nnnnn (wildcard pattern)testExcludes1
nnnyn (suppose suite and custome filter)testExcludes2
nnynn (suppose Suite)testExcludes3
nnyyn (suppose Suite)testExcludes4
nynnn (wildcard pattern)testExcludes5
nynymatch methodstestExcludes6
nyynn (due to Cucumber)testExcludes7
nyyyn (due to Cucumber)testExcludes8
ynnnn (wildcard pattern)testExcludes9
ynnyn (suppose suite and custome filter)testExcludes10
ynynmatch classestestExcludes11
ynyyn (cannot exclude in dir.scanner)testExcludes12
yynnn (wildcard pattern)testExcludes13
yynymatch methodstestExcludes14
yyynmatch classestestExcludes15
yyyymatch alltestExcludes16
*/ public class FundamentalFilterTest { @Test public void testIncludes1() { ResolvedTest pattern = new ResolvedTest( (String) null, null, false ); assertThat( pattern.matchAsInclusive( null, null ), is( true ) ); } @Test public void testIncludes2() { ResolvedTest pattern = new ResolvedTest( (String) null, "method", false ); assertThat( pattern.matchAsInclusive( null, null ), is( true ) ); } @Test public void testIncludes3() { ResolvedTest pattern = new ResolvedTest( "Test", null, false ); assertThat( pattern.matchAsInclusive( null, null ), is( true ) ); } @Test public void testIncludes4() { ResolvedTest pattern = new ResolvedTest( "Test", "method", false ); assertThat( pattern.matchAsInclusive( null, null ), is( true ) ); } @Test public void testIncludes5() { ResolvedTest pattern = new ResolvedTest( (String) null, null, false ); assertThat( pattern.matchAsInclusive( null, "method" ), is( true ) ); } @Test public void testIncludes6() { ResolvedTest pattern = new ResolvedTest( (String) null, "method", false ); assertThat( pattern.matchAsInclusive( null, "method" ), is( true ) ); assertThat( pattern.matchAsInclusive( null, "otherMethod" ), is( false ) ); } /** * Does not throw NPE due to Cucumber has test class NULL and test method NOT NULL. */ @Test public void testIncludes7() { ResolvedTest pattern = new ResolvedTest( "Test", null, false ); assertThat( pattern.matchAsInclusive( null, "method" ), is( true ) ); } /** * Does not throw NPE due to Cucumber has test class NULL and test method NOT NULL. */ @Test public void testIncludes8() { ResolvedTest pattern = new ResolvedTest( "Test", "method", false ); assertThat( pattern.matchAsInclusive( null, "method" ), is( true ) ); assertThat( pattern.matchAsInclusive( null, "otherMethod" ), is( true ) ); } @Test public void testIncludes9() { ResolvedTest pattern = new ResolvedTest( (String) null, null, false ); assertThat( pattern.matchAsInclusive( "Test.class", null ), is( true ) ); } @Test public void testIncludes10() { ResolvedTest pattern = new ResolvedTest( (String) null, "method", false ); assertThat( pattern.matchAsInclusive( "Test.class", null ), is( true ) ); } @Test public void testIncludes11() { ResolvedTest pattern = new ResolvedTest( "Test", null, false ); assertThat( pattern.matchAsInclusive( "Test.class", null ), is( true ) ); assertThat( pattern.matchAsInclusive( "Other.class", null ), is( false ) ); } @Test public void testIncludes12() { ResolvedTest pattern = new ResolvedTest( "Test", "method", false ); assertThat( pattern.matchAsInclusive( "Test.class", null ), is( true ) ); assertThat( pattern.matchAsInclusive( "Other.class", null ), is( false ) ); } @Test public void testIncludes13() { ResolvedTest pattern = new ResolvedTest( (String) null, null, false ); assertThat( pattern.matchAsInclusive( "Test.class", "method" ), is( true ) ); } @Test public void testIncludes14() { ResolvedTest pattern = new ResolvedTest( (String) null, "method", false ); assertThat( pattern.matchAsInclusive( "Test.class", "method" ), is( true ) ); assertThat( pattern.matchAsInclusive( "Test.class", "otherMethod" ), is( false ) ); } @Test public void testIncludes15() { ResolvedTest pattern = new ResolvedTest( "Test", null, false ); assertThat( pattern.matchAsInclusive( "Test.class", "method" ), is( true ) ); assertThat( pattern.matchAsInclusive( "Other.class", "method" ), is( false ) ); } @Test public void testIncludes16() { ResolvedTest pattern = new ResolvedTest( "Test", "method", false ); assertThat( pattern.matchAsInclusive( "Test.class", "method" ), is( true ) ); assertThat( pattern.matchAsInclusive( "Test.class", "otherMethod" ), is( false ) ); assertThat( pattern.matchAsInclusive( "Other.class", "method" ), is( false ) ); assertThat( pattern.matchAsInclusive( "Other.class", "otherMethod" ), is( false ) ); } @Test public void testExcludes1() { ResolvedTest pattern = new ResolvedTest( (String) null, null, false ); assertThat( pattern.matchAsExclusive( null, null ), is( false ) ); } @Test public void testExcludes2() { ResolvedTest pattern = new ResolvedTest( (String) null, "method", false ); assertThat( pattern.matchAsExclusive( null, null ), is( false ) ); } @Test public void testExcludes3() { ResolvedTest pattern = new ResolvedTest( "Test", null, false ); assertThat( pattern.matchAsExclusive( null, null ), is( false ) ); } @Test public void testExcludes4() { ResolvedTest pattern = new ResolvedTest( "Test", "method", false ); assertThat( pattern.matchAsExclusive( null, null ), is( false ) ); } @Test public void testExcludes5() { ResolvedTest pattern = new ResolvedTest( (String) null, null, false ); assertThat( pattern.matchAsExclusive( null, "method" ), is( false ) ); } @Test public void testExcludes6() { ResolvedTest pattern = new ResolvedTest( (String) null, "method", false ); assertThat( pattern.matchAsExclusive( null, "method" ), is( true ) ); assertThat( pattern.matchAsExclusive( null, "otherMethod" ), is( false ) ); } /** * Does not throw NPE due to Cucumber has test class NULL and test method NOT NULL. */ @Test public void testExcludes7() { ResolvedTest pattern = new ResolvedTest( "Test", null, false ); assertThat( pattern.matchAsExclusive( null, "method" ), is( false ) ); } /** * Does not throw NPE due to Cucumber has test class NULL and test method NOT NULL. */ @Test public void testExcludes8() { ResolvedTest pattern = new ResolvedTest( "Test", "method", false ); assertThat( pattern.matchAsExclusive( null, "method" ), is( false ) ); assertThat( pattern.matchAsExclusive( null, "otherMethod" ), is( false ) ); } @Test public void testExcludes9() { ResolvedTest pattern = new ResolvedTest( (String) null, null, false ); assertThat( pattern.matchAsExclusive( "Test.class", null ), is( false ) ); } @Test public void testExcludes10() { ResolvedTest pattern = new ResolvedTest( (String) null, "method", false ); assertThat( pattern.matchAsExclusive( "Test.class", null ), is( false ) ); } @Test public void testExcludes11() { ResolvedTest pattern = new ResolvedTest( "Test", null, false ); assertThat( pattern.matchAsExclusive( "Test.class", null ), is( true ) ); assertThat( pattern.matchAsExclusive( "Other.class", null ), is( false ) ); } @Test public void testExcludes12() { ResolvedTest pattern = new ResolvedTest( "Test", "method", false ); assertThat( pattern.matchAsExclusive( "Test.class", null ), is( false ) ); assertThat( pattern.matchAsExclusive( "Other.class", null ), is( false ) ); } @Test public void testExcludes13() { ResolvedTest pattern = new ResolvedTest( (String) null, null, false ); assertThat( pattern.matchAsExclusive( "Test.class", "method" ), is( false ) ); } @Test public void testExcludes14() { ResolvedTest pattern = new ResolvedTest( (String) null, "method", false ); assertThat( pattern.matchAsExclusive( "Test.class", "method" ), is( true ) ); assertThat( pattern.matchAsExclusive( "Test.class", "otherMethod" ), is( false ) ); } @Test public void testExcludes15() { ResolvedTest pattern = new ResolvedTest( "Test", null, false ); assertThat( pattern.matchAsExclusive( "Test.class", "method" ), is( true ) ); assertThat( pattern.matchAsExclusive( "Other.class", "method" ), is( false ) ); } @Test public void testExcludes16() { ResolvedTest pattern = new ResolvedTest( "Test", "method", false ); assertThat( pattern.matchAsExclusive( "Test.class", "method" ), is( true ) ); assertThat( pattern.matchAsExclusive( "Test.class", "otherMethod" ), is( false ) ); assertThat( pattern.matchAsExclusive( "Other.class", "method" ), is( false ) ); assertThat( pattern.matchAsExclusive( "Other.class", "otherMethod" ), is( false ) ); } } ResolvedTestTest.java000066400000000000000000000054661330756104600361550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/testsetpackage org.apache.maven.surefire.testset; /* * 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. */ import junit.framework.TestCase; import static org.apache.maven.surefire.testset.ResolvedTest.Type.CLASS; import static org.apache.maven.surefire.testset.ResolvedTest.Type.METHOD; import static org.apache.maven.surefire.testset.ResolvedTest.fromFullyQualifiedClass; public class ResolvedTestTest extends TestCase { public void testEmptyClassRegex() { ResolvedTest test = new ResolvedTest( CLASS, " ", true ); assertNull( test.getTestClassPattern() ); assertNull( test.getTestMethodPattern() ); assertFalse( test.hasTestClassPattern() ); assertFalse( test.hasTestMethodPattern() ); assertTrue( test.isRegexTestClassPattern() ); assertFalse( test.isRegexTestMethodPattern() ); assertTrue( test.isEmpty() ); } public void testEmptyMethodRegex() { ResolvedTest test = new ResolvedTest( METHOD, " ", true ); assertNull( test.getTestClassPattern() ); assertNull( test.getTestMethodPattern() ); assertFalse( test.hasTestClassPattern() ); assertFalse( test.hasTestMethodPattern() ); assertFalse( test.isRegexTestClassPattern() ); assertTrue( test.isRegexTestMethodPattern() ); assertTrue( test.isEmpty() ); } public void testFromFullyQualifiedClass() { String classFileName = fromFullyQualifiedClass("my.package.MyTest"); assertEquals( "my/package/MyTest", classFileName ); classFileName = fromFullyQualifiedClass("my.package.MyTest.class"); assertEquals( "my/package/MyTest.class", classFileName ); classFileName = fromFullyQualifiedClass("my/package/MyTest.class"); assertEquals( "my/package/MyTest.class", classFileName ); classFileName = fromFullyQualifiedClass("my/package/MyTest.*"); assertEquals( "my/package/MyTest.*", classFileName ); classFileName = fromFullyQualifiedClass("my.package.MyTest.*"); assertEquals( "my/package/MyTest.*", classFileName ); } } TestListResolverTest.java000066400000000000000000000522101330756104600370140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/testsetpackage org.apache.maven.surefire.testset; /* * 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. */ import junit.framework.TestCase; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.Set; import static java.util.Collections.addAll; import static org.apache.maven.surefire.testset.TestListResolver.newTestListResolver; import static org.apache.maven.surefire.testset.ResolvedTest.Type.CLASS; import static java.util.Arrays.asList; import static java.util.Collections.emptySet; import static java.util.Collections.singleton; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; public class TestListResolverTest extends TestCase { private static final String DEFAULT_SUREFIRE_INCLUDED_TEST_PATTERNS = "**/Test*.java, **/*Test.java, **/*TestCase.java"; private static final String DEFAULT_SUREFIRE_EXCLUDED_TEST_PATTERNS = "**/*$*"; public void testRegexSanity1() { try { TestListResolver.isRegexPrefixedPattern( "#%regex[]" ); fail( "#%regex[]" ); } catch ( IllegalArgumentException e ) { // expected in junit 3.x } } public void testRegexSanity2() { try { TestListResolver.isRegexPrefixedPattern( "%regex[]#" ); fail( "%regex[]#" ); } catch ( IllegalArgumentException e ) { // expected in junit 3.x } } public void testRegexSanity3() { try { TestListResolver.isRegexPrefixedPattern( "%regex[]%regex[]" ); fail( "%regex[]%regex[]" ); } catch ( IllegalArgumentException e ) { // expected in junit 3.x } } public void testMinRegexLength() { assertFalse( TestListResolver.isRegexMinLength( "%regex[]" ) ); assertFalse( TestListResolver.isRegexMinLength( "%regex[ ]" ) ); assertTrue( TestListResolver.isRegexMinLength( "%regex[*Test]" ) ); } public void testRemoveExclamationMark() { String pattern = TestListResolver.removeExclamationMark( "!%regex[]" ); assertEquals( "%regex[]", pattern ); pattern = TestListResolver.removeExclamationMark( "%regex[]" ); assertEquals( "%regex[]", pattern ); } public void testUnwrapped() { String[] classAndMethod = TestListResolver.unwrap( " MyTest " ); assertEquals( "MyTest", classAndMethod[0] ); assertEquals( "", classAndMethod[1] ); classAndMethod = TestListResolver.unwrap( " # test " ); assertEquals( "", classAndMethod[0] ); assertEquals( "test", classAndMethod[1] ); classAndMethod = TestListResolver.unwrap( " MyTest # test " ); assertEquals( "MyTest", classAndMethod[0] ); assertEquals( "test", classAndMethod[1] ); } public void testUnwrappedRegex() { String[] classAndMethod = TestListResolver.unwrapRegex( "%regex[ .*.MyTest.class ]" ); assertEquals( ".*.MyTest.class", classAndMethod[0] ); assertEquals( "", classAndMethod[1] ); classAndMethod = TestListResolver.unwrapRegex( "%regex[ # myMethod|secondTest ]" ); assertEquals( "", classAndMethod[0] ); assertEquals( "myMethod|secondTest", classAndMethod[1] ); classAndMethod = TestListResolver.unwrapRegex( "%regex[ .*.MyTest.class # myMethod|secondTest ]" ); assertEquals( ".*.MyTest.class", classAndMethod[0] ); assertEquals( "myMethod|secondTest", classAndMethod[1] ); } public void testMakeRegex() { String regex = ResolvedTest.wrapRegex( ".*.MyTest.class" ); assertEquals( "%regex[.*.MyTest.class]", regex ); } public void testNonRegexClassAndMethod() { Collection includedFilters = new ArrayList(); Collection excludedFilters = new ArrayList(); IncludedExcludedPatterns includedExcludedPatterns = new IncludedExcludedPatterns(); TestListResolver.nonRegexClassAndMethods( "MyTest", "myTest", false, includedExcludedPatterns, includedFilters, excludedFilters ); assertTrue( includedExcludedPatterns.hasIncludedMethodPatterns ); assertFalse( includedExcludedPatterns.hasExcludedMethodPatterns ); assertFalse( includedFilters.isEmpty() ); assertTrue( excludedFilters.isEmpty() ); assertEquals( 1, includedFilters.size() ); ResolvedTest test = includedFilters.iterator().next(); assertFalse( test.isEmpty() ); assertFalse( test.isRegexTestClassPattern() ); assertFalse( test.isRegexTestMethodPattern() ); assertTrue( test.hasTestClassPattern() ); assertTrue( test.hasTestMethodPattern() ); assertEquals( "**/MyTest", test.getTestClassPattern() ); assertEquals( "myTest", test.getTestMethodPattern() ); assertTrue( test.matchAsInclusive( "MyTest", "myTest" ) ); assertFalse( test.matchAsInclusive( "MyTest", "otherTest" ) ); } public void testNonRegexClassAndMethods() { Collection includedFilters = new ArrayList(); Collection excludedFilters = new ArrayList(); IncludedExcludedPatterns includedExcludedPatterns = new IncludedExcludedPatterns(); TestListResolver.nonRegexClassAndMethods( "MyTest.class", "first*+second*", false, includedExcludedPatterns, includedFilters, excludedFilters ); assertTrue( includedExcludedPatterns.hasIncludedMethodPatterns ); assertFalse( includedExcludedPatterns.hasExcludedMethodPatterns ); assertFalse( includedFilters.isEmpty() ); assertTrue( excludedFilters.isEmpty() ); assertEquals( 2, includedFilters.size() ); Iterator tests = includedFilters.iterator(); ResolvedTest first = tests.next(); assertFalse( first.isEmpty() ); assertFalse( first.isRegexTestClassPattern() ); assertFalse( first.isRegexTestMethodPattern() ); assertTrue( first.hasTestClassPattern() ); assertTrue( first.hasTestMethodPattern() ); assertEquals( "**/MyTest.class", first.getTestClassPattern() ); assertEquals( "first*", first.getTestMethodPattern() ); assertTrue( first.matchAsInclusive( "your/pkg/MyTest.class", "firstTest" ) ); ResolvedTest second = tests.next(); assertFalse( second.isEmpty() ); assertFalse( second.isRegexTestClassPattern() ); assertFalse( second.isRegexTestMethodPattern() ); assertTrue( second.hasTestClassPattern() ); assertTrue( second.hasTestMethodPattern() ); assertEquals( "**/MyTest.class", second.getTestClassPattern() ); assertEquals( "second*", second.getTestMethodPattern() ); assertTrue( second.matchAsInclusive( "your/pkg/MyTest.class", "secondTest" ) ); assertFalse( second.matchAsInclusive( "your/pkg/MyTest.class", "thirdTest" ) ); } public void testNegativeNonRegexClassAndMethod() { Collection includedFilters = new ArrayList(); Collection excludedFilters = new ArrayList(); IncludedExcludedPatterns includedExcludedPatterns = new IncludedExcludedPatterns(); TestListResolver.nonRegexClassAndMethods( "MyTest", "myTest", true, includedExcludedPatterns, includedFilters, excludedFilters ); assertFalse( includedExcludedPatterns.hasIncludedMethodPatterns ); assertTrue( includedExcludedPatterns.hasExcludedMethodPatterns ); assertTrue( includedFilters.isEmpty() ); assertEquals( 1, excludedFilters.size() ); ResolvedTest test = excludedFilters.iterator().next(); assertFalse( test.isEmpty() ); assertFalse( test.isRegexTestClassPattern() ); assertFalse( test.isRegexTestMethodPattern() ); assertTrue( test.hasTestClassPattern() ); assertTrue( test.hasTestMethodPattern() ); assertEquals( "**/MyTest", test.getTestClassPattern() ); assertEquals( "myTest", test.getTestMethodPattern() ); // ResolvedTest should not care about isExcluded. This attribute is handled by TestListResolver. assertTrue( test.matchAsInclusive( "MyTest", "myTest" ) ); assertFalse( test.matchAsInclusive( "MyTest", "otherTest" ) ); assertFalse( test.matchAsInclusive( "pkg/OtherTest.class", "myTest" ) ); } public void testResolveTestRequest() { Collection includedFilters = new ArrayList(); Collection excludedFilters = new ArrayList(); IncludedExcludedPatterns includedExcludedPatterns = new IncludedExcludedPatterns(); TestListResolver.resolveTestRequest( "!%regex[.*.MyTest.class#myTest]", includedExcludedPatterns, includedFilters, excludedFilters ); assertFalse( includedExcludedPatterns.hasIncludedMethodPatterns ); assertTrue( includedExcludedPatterns.hasExcludedMethodPatterns ); assertTrue( includedFilters.isEmpty() ); assertFalse( excludedFilters.isEmpty() ); assertEquals( 1, excludedFilters.size() ); ResolvedTest test = excludedFilters.iterator().next(); // ResolvedTest should not care about isExcluded. This attribute is handled by TestListResolver. assertTrue( test.matchAsInclusive( "pkg/MyTest.class", "myTest" ) ); assertFalse( test.matchAsInclusive( "pkg/MyTest.class", "otherTest" ) ); assertFalse( test.matchAsInclusive( "pkg/OtherTest.class", "myTest" ) ); } public void testShouldRunTestWithoutMethod() { new TestListResolver("**/*Test.class, !%regex[.*.MyTest.class#myTest]").shouldRun( "pkg/MyTest.class", null ); } public void testShouldNotRunExcludedMethods() { TestListResolver resolver = new TestListResolver( "!#*Fail*, !%regex[#.*One], !#testSuccessThree" ); assertTrue( resolver.shouldRun( "pkg/MyTest.class", null ) ); } public void testShouldRunSuiteWithIncludedMethods() { TestListResolver resolver = new TestListResolver( "#*Fail*, %regex[#.*One], #testSuccessThree" ); assertTrue( resolver.shouldRun( "pkg/MyTest.class", null ) ); } public void testShouldRunAny() { TestListResolver resolver = TestListResolver.getEmptyTestListResolver(); assertTrue( resolver.shouldRun( "pkg/MyTest.class", null ) ); resolver = new TestListResolver( Collections.emptySet() ); assertTrue( resolver.shouldRun( "pkg/MyTest.class", null ) ); } public void testClassFilter() { TestListResolver resolver = new TestListResolver( "#test" ); assertTrue( resolver.shouldRun( "pkg/MyTest.class", null ) ); resolver = new TestListResolver( "!#test" ); assertTrue( resolver.shouldRun( "pkg/MyTest.class", null ) ); resolver = new TestListResolver( "SomeOtherClass" ); assertFalse( resolver.shouldRun( "pkg/MyTest.class", null ) ); } public void testBrokenPatternThrowsException() { Collection included = emptySet(); Collection excluded = asList( "BasicTest, !**/TestTwo, **/TestThree.java" ); try { new TestListResolver( included, excluded ); fail( "Expected: IllegalArgumentException" ); } catch ( IllegalArgumentException e ) { // JUnit 3.x style assertEquals( "Exclamation mark not expected in 'exclusion': BasicTest, !**/TestTwo, **/TestThree.java", e.getLocalizedMessage() ); } } public void testMultipleExcludedClassesOnly() { Collection included = emptySet(); Collection excluded = asList( "BasicTest, **/TestTwo, **/TestThree.java" ); TestListResolver resolver = new TestListResolver( included, excluded ); assertFalse( resolver.shouldRun( "jiras/surefire745/BasicTest.class", null ) ); assertFalse( resolver.shouldRun( "jiras/surefire745/TestTwo.class", null ) ); assertFalse( resolver.shouldRun( "jiras/surefire745/TestThree.class", null ) ); assertTrue( resolver.shouldRun( "jiras/surefire745/TestFour.class", null ) ); } public void testMultipleExcludedClasses() { Collection included = singleton( DEFAULT_SUREFIRE_INCLUDED_TEST_PATTERNS ); Collection excluded = asList( "BasicTest, **/TestTwo, **/TestThree.java" ); TestListResolver resolver = new TestListResolver( included, excluded ); assertFalse( resolver.shouldRun( "jiras/surefire745/BasicTest.class", null ) ); assertFalse( resolver.shouldRun( "jiras/surefire745/TestTwo.class", null ) ); assertFalse( resolver.shouldRun( "jiras/surefire745/TestThree.class", null ) ); assertTrue( resolver.shouldRun( "jiras/surefire745/TestFour.class", null ) ); } public void testAndFilters() { TestListResolver firstFilter = new TestListResolver( "BasicTest, **/TestTwo, **/TestThree.java" ); TestListResolver secondFilter = new TestListResolver( "*icTest, Test???*" ); TestFilter filter = firstFilter.and( secondFilter ); assertTrue( filter.shouldRun( "jiras/surefire745/BasicTest.class", null ) ); assertTrue( filter.shouldRun( "jiras/surefire745/TestTwo.class", null ) ); assertTrue( filter.shouldRun( "jiras/surefire745/TestThree.class", null ) ); assertFalse( filter.shouldRun( "jiras/surefire745/TestFour.class", null ) ); } public void testTestListResolverWithoutMethods() { ResolvedTest inc1 = new ResolvedTest( "A?Test.java", null, false ); ResolvedTest inc2 = new ResolvedTest( "**/?Test", null, false ); ResolvedTest exc1 = new ResolvedTest( "AATest", null, false ); ResolvedTest exc2 = new ResolvedTest( "**/BTest.java", null, false ); TestListResolver resolver = newTestListResolver( $( inc1, inc2 ), $( exc1, exc2 ) ); assertThat( resolver.getPluginParameterTest(), is( "A?Test.java, **/?Test, !AATest, !**/BTest.java" ) ); assertFalse( resolver.isEmpty() ); assertFalse( resolver.hasIncludedMethodPatterns() ); assertFalse( resolver.hasExcludedMethodPatterns() ); assertFalse( resolver.hasMethodPatterns() ); assertTrue( resolver.shouldRun( "ATest.class", null ) ); assertFalse( resolver.shouldRun( "AATest.class", null ) ); assertTrue( resolver.shouldRun( "ABTest.class", null ) ); assertFalse( resolver.shouldRun( "BTest.class", null ) ); assertTrue( resolver.shouldRun( "CTest.class", null ) ); assertFalse( resolver.hasMethodPatterns() ); } public void testTestListResolverWithMethods() { ResolvedTest inc1 = new ResolvedTest( "A?Test.java", null, false ); ResolvedTest inc2 = new ResolvedTest( "*?Test", null, false ); ResolvedTest exc1 = new ResolvedTest( "AATest", null, false ); ResolvedTest exc2 = new ResolvedTest( "*BTest.java", "failedTest", false ); TestListResolver resolver = newTestListResolver( $( inc1, inc2 ), $( exc1, exc2 ) ); assertThat( resolver.getPluginParameterTest(), is( "A?Test.java, *?Test, !AATest, !*BTest.java#failedTest" ) ); assertFalse( resolver.isEmpty() ); assertFalse( resolver.hasIncludedMethodPatterns() ); assertTrue( resolver.hasExcludedMethodPatterns() ); assertTrue( resolver.hasMethodPatterns() ); assertTrue( resolver.shouldRun( "ATest.class", null ) ); assertFalse( resolver.shouldRun( "AATest.class", null ) ); assertTrue( resolver.shouldRun( "ABTest.class", null ) ); assertTrue( resolver.shouldRun( "BTest.class", null ) ); assertFalse( resolver.shouldRun( "BTest.class", "failedTest" ) ); assertTrue( resolver.shouldRun( "CTest.class", null ) ); assertFalse( TestListResolver.optionallyWildcardFilter( resolver ).isEmpty() ); } private static Set $( ResolvedTest... patterns ) { Set set = new LinkedHashSet(); addAll( set, patterns ); return set; } public void testDefaultPatternsMatching() { Set inclusions = resolveClass( DEFAULT_SUREFIRE_INCLUDED_TEST_PATTERNS ); Set exclusions = resolveClass( DEFAULT_SUREFIRE_EXCLUDED_TEST_PATTERNS ); TestListResolver tlr = newTestListResolver( inclusions, exclusions ); boolean shouldRun = tlr.shouldRun( "org/apache/maven/surefire/SomeTest.class", null ); assertTrue( shouldRun ); } public void testDefaultPatternsNotMatching() { Set inclusions = resolveClass( DEFAULT_SUREFIRE_INCLUDED_TEST_PATTERNS ); Set exclusions = resolveClass( DEFAULT_SUREFIRE_EXCLUDED_TEST_PATTERNS ); TestListResolver tlr = newTestListResolver( inclusions, exclusions ); boolean shouldRun = tlr.shouldRun( "org/apache/maven/surefire/SomeTestNotRunning.class", null ); assertFalse( shouldRun ); } public void testInclusiveWithDefaultExclusivePattern() { Set defaultExclusions = resolveClass( DEFAULT_SUREFIRE_EXCLUDED_TEST_PATTERNS ); boolean runnable = newTestListResolver( resolveClass( "A*Test" ), defaultExclusions ) .shouldRun( "org/apache/maven/surefire/ARunnableTest.class", null ); assertTrue( runnable ); } public void testWildcard() { TestListResolver tlr = TestListResolver.optionallyWildcardFilter( new TestListResolver( (String) null ) ); assertThat( tlr, is( new TestListResolver( "**/*.class" ) ) ); assertThat( tlr.isWildcard(), is( true ) ); assertThat( tlr.isEmpty(), is( false ) ); tlr = TestListResolver.optionallyWildcardFilter( new TestListResolver( "**/**/MethodLessPattern.class" ) ); assertThat( tlr, is( new TestListResolver( "**/*.class" ) ) ); assertThat( tlr.isWildcard(), is( true ) ); assertThat( tlr.isEmpty(), is( false ) ); } public void testRegexRuleViolationQuotedHashMark() { try { new TestListResolver( "%regex[.\\Q#\\E.]" ); fail( "IllegalArgumentException is expected" ); } catch ( IllegalArgumentException iea ) { // expected } } public void testRegexRuleViolationEnclosedMethodSeparator() { try { new TestListResolver( "%regex[(.|.#.)]" ); fail( "IllegalArgumentException is expected" ); } catch ( IllegalArgumentException iea ) { // expected } } public void testRegexRuleViolationMultipleHashmarkWithClassConstraint() { try { new TestListResolver( "%regex[.*#.|#.]" ); fail( "IllegalArgumentException is expected" ); } catch ( IllegalArgumentException iea ) { // expected } } public void testRegexRuleViolationMultipleHashmarkForMethods() { try { new TestListResolver( "%regex[#.|#.]" ); fail( "IllegalArgumentException is expected" ); } catch ( IllegalArgumentException iea ) { // expected } } public void testRegexRuleViolationInvalidClassPattern() { try { new TestListResolver( "%regex[.(.]" ) .shouldRun( "x", "x" ); fail( "IllegalArgumentException is expected" ); } catch ( IllegalArgumentException iea ) { // expected } } public void testRegexRuleViolationInvalidMethodPattern() { try { new TestListResolver( "%regex[#.(.]" ); fail( "IllegalArgumentException is expected" ); } catch ( IllegalArgumentException iea ) { // expected } } private static Set resolveClass( String patterns ) { Set resolved = new HashSet(); for ( String pattern : patterns.split( "," ) ) { resolved.add( new ResolvedTest( CLASS, pattern, false ) ); } return resolved; } } maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/util/000077500000000000000000000000001330756104600313555ustar00rootroot00000000000000DefaultDirectoryScannerTest.java000066400000000000000000000037071330756104600375730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.apache.maven.surefire.testset.TestSetFailedException; import junit.framework.TestCase; /** * Test of the directory scanner. */ public class DefaultDirectoryScannerTest extends TestCase { public void testLocateTestClasses() throws IOException, TestSetFailedException { // use target as people can configure ide to compile in an other place than maven File baseDir = new File( new File( "target" ).getCanonicalPath() ); List include = new ArrayList(); include.add( "**/*ZT*A.java" ); List exclude = new ArrayList(); DefaultDirectoryScanner surefireDirectoryScanner = new DefaultDirectoryScanner( baseDir, include, exclude, new ArrayList() ); String[] classNames = surefireDirectoryScanner.collectTests(); assertNotNull( classNames ); System.out.println( "classNames " + Arrays.asList( classNames ) ); assertEquals( 4, classNames.length ); } } ReflectionUtilsTest.java000066400000000000000000000063711330756104600361230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import org.junit.Test; import static org.fest.assertions.Assertions.assertThat; /** * Unit test for {@link ReflectionUtils}. * * @author Tibor Digana (tibor17) * @since 2.20.1 */ public class ReflectionUtilsTest { @Test(expected = RuntimeException.class) public void shouldNotInvokeStaticMethod() { ReflectionUtils.invokeStaticMethod( ReflectionUtilsTest.class, "notCallable", new Class[0], new Object[0] ); } @Test public void shouldInvokeStaticMethod() { Object o = ReflectionUtils.invokeStaticMethod( ReflectionUtilsTest.class, "callable", new Class[0], new Object[0] ); assertThat( o ) .isEqualTo( 3L ); } @Test public void shouldInvokeMethodChain() { Class[] classes1 = { A.class, A.class }; String[] chain = { "current", "pid" }; Object o = ReflectionUtils.invokeMethodChain( classes1, chain, null ); assertThat( o ) .isEqualTo( 3L ); Class[] classes2 = { A.class, A.class, B.class }; String[] longChain = { "current", "createB", "pid" }; o = ReflectionUtils.invokeMethodChain( classes2, longChain, null ); assertThat( o ) .isEqualTo( 1L ); } @Test public void shouldInvokeFallbackOnMethodChain() { Class[] classes1 = { A.class, A.class }; String[] chain = { "current", "abc" }; Object o = ReflectionUtils.invokeMethodChain( classes1, chain, 5L ); assertThat( o ) .isEqualTo( 5L ); Class[] classes2 = { A.class, B.class, B.class }; String[] longChain = { "current", "createB", "abc" }; o = ReflectionUtils.invokeMethodChain( classes2, longChain, 6L ); assertThat( o ) .isEqualTo( 6L ); } private static void notCallable() { } public static long callable() { return 3L; } public static class A { public static A current() { return new A(); } public long pid() { return 3L; } public B createB() { return new B(); } } public static class B { public long pid() { return 1L; } } } RunOrderCalculatorTest.java000066400000000000000000000034461330756104600365620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import java.util.LinkedHashSet; import java.util.Set; import org.apache.maven.surefire.testset.RunOrderParameters; import junit.framework.TestCase; /** * @author Kristian Rosenvold */ public class RunOrderCalculatorTest extends TestCase { public void testOrderTestClasses() throws Exception { getClassesToRun(); TestsToRun testsToRun = new TestsToRun( getClassesToRun() ); RunOrderCalculator runOrderCalculator = new DefaultRunOrderCalculator( RunOrderParameters.alphabetical(), 1 ); final TestsToRun testsToRun1 = runOrderCalculator.orderTestClasses( testsToRun ); assertEquals( A.class, testsToRun1.iterator().next() ); } private Set> getClassesToRun() { Set> classesToRun = new LinkedHashSet>(); classesToRun.add( B.class ); classesToRun.add( A.class ); return classesToRun; } class A { } class B { } } RunOrderTest.java000066400000000000000000000041041330756104600345400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import junit.framework.TestCase; public class RunOrderTest extends TestCase { public void testShouldReturnRunOrderForLowerCaseName() { assertEquals( RunOrder.HOURLY, RunOrder.valueOfMulti( "hourly" )[0] ); } public void testMultiValue() { final RunOrder[] hourlies = RunOrder.valueOfMulti( "failedfirst,balanced" ); assertEquals( RunOrder.FAILEDFIRST, hourlies[0] ); assertEquals( RunOrder.BALANCED, hourlies[1] ); } public void testAsString() { RunOrder[] orders = new RunOrder[]{ RunOrder.FAILEDFIRST, RunOrder.ALPHABETICAL }; assertEquals( "failedfirst,alphabetical", RunOrder.asString( orders ) ); } public void testShouldReturnRunOrderForUpperCaseName() { assertEquals( RunOrder.HOURLY, RunOrder.valueOfMulti( "HOURLY" )[0] ); } public void testShouldReturnNullForNullName() { assertTrue( RunOrder.valueOfMulti( null ).length == 0 ); } public void testShouldThrowExceptionForInvalidName() { try { RunOrder.valueOfMulti( "arbitraryName" ); fail( "IllegalArgumentException not thrown." ); } catch ( IllegalArgumentException expected ) { } } }ScanResultTest.java000066400000000000000000000031511330756104600350640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import junit.framework.TestCase; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @author Kristian Rosenvold */ public class ScanResultTest extends TestCase { public void testWriteTo() throws Exception { List files = Arrays.asList( "abc", "cde" ); DefaultScanResult scanResult = new DefaultScanResult( files ); Map serialized = new HashMap(); scanResult.writeTo( serialized ); DefaultScanResult read = DefaultScanResult.from( serialized ); List classes = read.getClasses(); assertEquals( 2, classes.size() ); assertTrue( classes.contains( "abc" ) ); assertTrue( classes.contains( "cde" ) ); } } TestsToRunTest.java000066400000000000000000000075161330756104600351040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import java.util.Iterator; import java.util.LinkedHashSet; import java.util.Set; import junit.framework.TestCase; /* * @author Kristian Rosenvold */ public class TestsToRunTest extends TestCase { public void testGetTestSets() throws Exception { Set> classes = new LinkedHashSet>(); classes.add( T1.class ); classes.add( T2.class ); TestsToRun testsToRun = new TestsToRun( classes ); Iterator> it = testsToRun.iterator(); assertTrue( it.hasNext() ); assertEquals( it.next(), T1.class ); assertTrue( it.hasNext() ); assertEquals( it.next(), T2.class ); assertFalse( it.hasNext() ); } public void testContainsAtLeast() { Set> classes = new LinkedHashSet>(); classes.add( T1.class ); classes.add( T2.class ); TestsToRun testsToRun = new TestsToRun( classes ); assertTrue( testsToRun.containsAtLeast( 2 ) ); assertFalse( testsToRun.containsAtLeast( 3 ) ); } public void testContainsExactly() { Set> classes = new LinkedHashSet>(); classes.add( T1.class ); classes.add( T2.class ); TestsToRun testsToRun = new TestsToRun( classes ); assertFalse( testsToRun.containsExactly( 1 ) ); assertTrue( testsToRun.containsExactly( 2 ) ); assertFalse( testsToRun.containsExactly( 3 ) ); } public void testToRunArray() { Set> classes = new LinkedHashSet>(); classes.add( T1.class ); classes.add( T2.class ); TestsToRun testsToRun = new TestsToRun( classes ); Class[] locatedClasses = testsToRun.getLocatedClasses(); assertEquals( 2, locatedClasses.length ); } public void testGetClassByName() { Set> classes = new LinkedHashSet>(); classes.add( T1.class ); classes.add( T2.class ); TestsToRun testsToRun = new TestsToRun( classes ); assertEquals( T1.class, testsToRun.getClassByName( "org.apache.maven.surefire.util.TestsToRunTest$T1" ) ); assertEquals( T2.class, testsToRun.getClassByName( "org.apache.maven.surefire.util.TestsToRunTest$T2" ) ); assertEquals( null, testsToRun.getClassByName( "org.apache.maven.surefire.util.TestsToRunTest$T3" ) ); } public void testTwoIterators() { Set> classes = new LinkedHashSet>(); classes.add( T1.class ); classes.add( T2.class ); TestsToRun testsToRun = new TestsToRun( classes ); Iterator> it1 = testsToRun.iterator(); assertEquals( it1.next(), T1.class ); assertTrue( it1.hasNext() ); Iterator> it2 = testsToRun.iterated(); assertEquals( it1.next(), T2.class ); assertFalse( it1.hasNext() ); assertEquals( it2.next(), T1.class ); assertFalse( it1.hasNext() ); } class T1 { } class T2 { } } UrlUtilsTest.java000066400000000000000000000055471330756104600345770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/utilpackage org.apache.maven.surefire.util; /* * 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. */ import junit.framework.TestCase; import java.io.File; import java.net.URI; import java.net.URL; import static org.apache.maven.surefire.util.internal.UrlUtils.toURL; /** * Test the URL utilities. */ public class UrlUtilsTest extends TestCase { private String homeDir; @Override public void setUp() throws Exception { super.setUp(); homeDir = System.getProperty( "user.dir" ); if ( !homeDir.startsWith( "/" ) ) { homeDir = "/" + homeDir; } } private void verifyFileName( String fileName ) throws Exception { verifyFileName( fileName, fileName ); } private void verifyFileName( String fileName, String expectedFileName ) throws Exception { File f = new File( homeDir, fileName ); URL u = toURL( f ); URI uri = u.toURI(); File urlFile = new File( uri ); String url = u.toString(); assertStartsWith( url, "file:" ); assertEndsWith( url, expectedFileName ); assertEquals( f, urlFile ); } private void assertStartsWith( String string, String substring ) { assertTrue( "<" + string + "> should start with <" + substring + ">", string.startsWith( substring ) ); } private void assertEndsWith( String string, String substring ) { assertTrue( "<" + string + "> should end with <" + substring + ">", string.endsWith( substring ) ); } public void testTestNoSpecialCharacters() throws Exception { verifyFileName( "foo.txt" ); verifyFileName( "qwertyuiopasdfghjklzxcvbnm.txt" ); verifyFileName( "QWERTYUIOPASDFGHJKLZXCVBNM.txt" ); verifyFileName( "1234567890.txt" ); verifyFileName( ")('*~!._-.txt" ); } public void testTestWithSpaces() throws Exception { verifyFileName( "foo bar.txt", "foo%20bar.txt" ); } public void testTestWithUmlaut() throws Exception { verifyFileName( "fo\u00DC.txt", "fo%c3%9c.txt" ); } } maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/util/internal/000077500000000000000000000000001330756104600331715ustar00rootroot00000000000000ConcurrencyUtilsTest.java000066400000000000000000000064451330756104600401410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/util/internalpackage org.apache.maven.surefire.util.internal; /* * 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. */ import org.junit.Test; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.FutureTask; import java.util.concurrent.atomic.AtomicInteger; import static org.apache.maven.surefire.util.internal.ConcurrencyUtils.countDownToZero; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; /** * Concurrency utilities. * * @author Tibor Digana (tibor17) * @since 2.19 */ public class ConcurrencyUtilsTest { @Test public void countDownShouldBeUnchangedAsZero$NegativeTest() { AtomicInteger atomicCounter = new AtomicInteger( 0 ); assertFalse( countDownToZero( atomicCounter ) ); assertThat( atomicCounter.get(), is( 0 ) ); } @Test public void countDownShouldBeUnchangedAsNegative$NegativeTest() { AtomicInteger atomicCounter = new AtomicInteger( -1 ); assertFalse( countDownToZero( atomicCounter ) ); assertThat( atomicCounter.get(), is( -1 ) ); } @Test public void countDownShouldBeDecreasedByOneThreadModification() { AtomicInteger atomicCounter = new AtomicInteger( 10 ); assertFalse( countDownToZero( atomicCounter ) ); assertThat( atomicCounter.get(), is( 9 ) ); } @Test public void countDownToZeroShouldBeDecreasedByOneThreadModification() { AtomicInteger atomicCounter = new AtomicInteger( 1 ); assertTrue( countDownToZero( atomicCounter ) ); assertThat( atomicCounter.get(), is( 0 ) ); } @Test public void countDownShouldBeDecreasedByTwoThreadsModification() throws ExecutionException, InterruptedException { final AtomicInteger atomicCounter = new AtomicInteger( 3 ); FutureTask task = new FutureTask( new Callable() { @Override public Boolean call() throws Exception { return countDownToZero( atomicCounter ); } } ); Thread t = new Thread( task ); t.start(); assertFalse( countDownToZero( atomicCounter ) ); assertFalse( task.get() ); assertThat( atomicCounter.get(), is( 1 ) ); assertTrue( countDownToZero( atomicCounter ) ); assertThat( atomicCounter.get(), is( 0 ) ); } } ImmutableMapTest.java000066400000000000000000000056301330756104600371760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/util/internalpackage org.apache.maven.surefire.util.internal; /* * 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. */ import org.apache.maven.surefire.util.internal.ImmutableMap.Node; import org.junit.Before; import org.junit.Test; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; /** * @since 2.20 */ public class ImmutableMapTest { private ImmutableMap map; @Before public void setUp() throws Exception { Map backingMap = new HashMap(); backingMap.put( "a", "1" ); backingMap.put( "x", null ); backingMap.put( "b", "2" ); backingMap.put( "c", "3" ); backingMap.put( "", "" ); backingMap.put( null, "1" ); map = new ImmutableMap( backingMap ); } @Test public void testEntrySet() throws Exception { Set> entries = map.entrySet(); assertThat( entries, hasSize( 6 ) ); assertThat( entries, hasItem( new Node( "a", "1" ) ) ); assertThat( entries, hasItem( new Node( "x", null ) ) ); assertThat( entries, hasItem( new Node( "b", "2" ) ) ); assertThat( entries, hasItem( new Node( "c", "3" ) ) ); assertThat( entries, hasItem( new Node( "", "" ) ) ); assertThat( entries, hasItem( new Node( null, "1" ) ) ); } @Test public void testGetter() { assertThat( map.size(), is( 6 ) ); assertThat( map.get( "a" ), is( "1" ) ); assertThat( map.get( "x" ), is( (String) null ) ); assertThat( map.get( "b" ), is( "2" ) ); assertThat( map.get( "c" ), is( "3" ) ); assertThat( map.get( "" ), is( "" ) ); assertThat( map.get( null ), is( "1" ) ); } @Test( expected = UnsupportedOperationException.class ) public void shouldNotModifyEntries() { map.entrySet().clear(); } }StringUtilsTest.java000066400000000000000000000114601330756104600371060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/util/internalpackage org.apache.maven.surefire.util.internal; /* * 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. */ import java.nio.ByteBuffer; import java.nio.charset.Charset; import junit.framework.TestCase; import org.apache.maven.surefire.util.internal.StringUtils.EncodedArray; import static org.junit.Assert.assertArrayEquals; /** * @author Andreas Gudian */ public class StringUtilsTest extends TestCase { public void testUnescapeString() { CharSequence inputString = createInputString(); StringBuilder escaped = new StringBuilder( inputString.length() * 5 ); int initialCapacity = escaped.capacity(); StringUtils.escapeToPrintable( escaped, inputString ); assertEquals( initialCapacity, escaped.capacity() ); StringBuilder unescaped = new StringBuilder( inputString.length() ); StringUtils.unescapeString( unescaped, escaped ); assertEquals( inputString.length(), unescaped.length() ); for ( int i = 0; i < inputString.length(); i++ ) { if ( inputString.charAt( i ) != unescaped.charAt( i ) ) { fail( "Input and Unescaped String are not equal at position " + i ); } } } private CharSequence createInputString() { StringBuilder sb = new StringBuilder(); for ( int i = 0; i < Character.MAX_CODE_POINT; i++ ) { sb.appendCodePoint( i ); } return sb; } public void testUnescapeBytes() { byte[] input = new byte[256]; for ( int i = 0; i <= 0xFF; i++ ) { byte b = (byte) ( 0xFF & i ); input[i] = b; } EncodedArray encodedArray = StringUtils.escapeBytesToPrintable( new byte[0], input, 0, input.length ); String escapedString = new String( encodedArray.getArray(), 0, encodedArray.getSize() ); assertEquals( encodedArray.getSize(), escapedString.length() ); ByteBuffer unescaped = StringUtils.unescapeBytes( escapedString, Charset.defaultCharset().name() ); assertEquals( input.length + 1, unescaped.remaining() - unescaped.position() ); for ( int i = 0; i < input.length; i++ ) { assertEquals( "At position " + i, input[i], unescaped.get() ); } } public void testEscapeWithHeader() { byte[] header = { (byte) 'a' }; byte[] input = { (byte) '1' }; EncodedArray encodedArray = StringUtils.escapeBytesToPrintable( header, input, 0, input.length ); assertEquals( 3, encodedArray.getSize() ); byte[] expectedResult = new byte[] { (byte) 'a', (byte) '1', (byte) '\n' }; byte[] actualResult = new byte[encodedArray.getSize()]; System.arraycopy( encodedArray.getArray(), 0, actualResult, 0, encodedArray.getSize() ); assertArrayEquals( expectedResult, actualResult ); } public void testEmptyByteArray() { byte[] header = { (byte) 'a' }; byte[] input = {}; EncodedArray encodedArray = StringUtils.escapeBytesToPrintable( header, input, 0, input.length ); assertEquals( 0, encodedArray.getSize() ); assertEquals( 0, encodedArray.getArray().length ); } public void testSubstringSmall() { byte[] header = { (byte) 'a' }; byte[] input = "PleaseLookAfterThisBear".getBytes(); EncodedArray encodedArray = StringUtils.escapeBytesToPrintable( header, input, "Please".length(), "Look".length() ); assertEquals( "Look", new String( encodedArray.getArray(), 1, encodedArray.getArray().length-1).trim() ); } public void testSubstringLarge() { byte[] header = { (byte) 'a' }; byte[] input = "TheQuickBrownFoxJumpsOverTheLazyDog".getBytes(); EncodedArray encodedArray = StringUtils.escapeBytesToPrintable( header, input, "The".length(), "QuickBrownFoxJumpsOverTheLazy".length() ); assertEquals( "QuickBrownFoxJumpsOverTheLazy", new String( encodedArray.getArray(), 1, encodedArray.getArray().length-1).trim() ); } } maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/000077500000000000000000000000001330756104600331665ustar00rootroot00000000000000DataZT1A.java000066400000000000000000000015671330756104600352740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/* * 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. */ package org.apache.maven.surefire.util.testdata; public class DataZT1A { } DataZT2A.java000066400000000000000000000015701330756104600352670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/* * 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. */ package org.apache.maven.surefire.util.testdata; public class DataZT2A { } DataZT3A.java000066400000000000000000000015701330756104600352700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/* * 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. */ package org.apache.maven.surefire.util.testdata; public class DataZT3A { } java/000077500000000000000000000000001330756104600340305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/util/testdatajavascript/000077500000000000000000000000001330756104600361765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/javaDataJavaZT4A.java000066400000000000000000000017661330756104600411710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/java/javascript/* * 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. */ package org.apache.maven.surefire.util.testdata.java.javascript; /** * Test data class for SUREFIRE-638 * User: sslavic * Date: August 16, 2010 * Time: 11:13:18 PM */ public class DataJavaZT4A { } maven-surefire-surefire-2.22.0/surefire-booter/000077500000000000000000000000001330756104600214705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/pom.xml000066400000000000000000000122171330756104600230100ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire 2.22.0 surefire-booter SureFire Booter API and Facilities used by forked tests running in JVM sub-process. org.apache.maven.surefire surefire-api org.apache.maven.shared maven-shared-utils org.apache.maven.shared maven-shared-utils test org.apache.commons commons-lang3 commons-io commons-io com.google.code.findbugs jsr305 provided org.mockito mockito-core test org.powermock powermock-core test org.powermock powermock-module-junit4 test org.powermock powermock-api-mockito2 test maven-dependency-plugin build-test-classpath generate-sources build-classpath test target/test-classpath/cp.txt maven-surefire-plugin org.apache.maven.surefire surefire-shadefire 2.12.4 **/JUnit4SuiteTest.java org.apache.maven.plugins maven-shade-plugin package shade true org.apache.commons:commons-lang3 commons-io:commons-io org.apache.commons.lang3 org.apache.maven.surefire.shade.org.apache.commons.lang3 org.apache.commons.io org.apache.maven.surefire.shade.org.apache.commons.io maven-surefire-surefire-2.22.0/surefire-booter/src/000077500000000000000000000000001330756104600222575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/000077500000000000000000000000001330756104600232035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/000077500000000000000000000000001330756104600241245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/000077500000000000000000000000001330756104600247135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/000077500000000000000000000000001330756104600261345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600272425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/000077500000000000000000000000001330756104600310665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booter/000077500000000000000000000000001330756104600323605ustar00rootroot00000000000000AbstractPathConfiguration.java000066400000000000000000000074461330756104600402670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import javax.annotation.Nonnull; import static org.apache.maven.surefire.booter.Classpath.emptyClasspath; import static org.apache.maven.surefire.booter.Classpath.join; /** * @author Tibor Digana (tibor17) * @since 2.21.0.Jigsaw */ public abstract class AbstractPathConfiguration { public static final String CHILD_DELEGATION = "childDelegation"; public static final String ENABLE_ASSERTIONS = "enableAssertions"; public static final String CLASSPATH = "classPathUrl."; public static final String SUREFIRE_CLASSPATH = "surefireClassPathUrl."; private final Classpath surefireClasspathUrls; /** * Whether to enable assertions or not * (can be affected by the fork arguments, and the ability to do so based on the JVM). */ private final boolean enableAssertions; // todo: @deprecated because the IsolatedClassLoader is really isolated - no parent. private final boolean childDelegation; protected AbstractPathConfiguration( @Nonnull Classpath surefireClasspathUrls, boolean enableAssertions, boolean childDelegation ) { if ( isClassPathConfig() == isModularPathConfig() ) { throw new IllegalStateException( "modular path and class path should be exclusive" ); } this.surefireClasspathUrls = surefireClasspathUrls; this.enableAssertions = enableAssertions; this.childDelegation = childDelegation; } public abstract Classpath getTestClasspath(); /** * Must be exclusive with {@link #isClassPathConfig()}. * * @return {@code true} if this is {@link ModularClasspathConfiguration}. */ public abstract boolean isModularPathConfig(); /** * Must be exclusive with {@link #isModularPathConfig()}. * * @return {@code true} if this is {@link ClasspathConfiguration}. */ public abstract boolean isClassPathConfig(); protected Classpath getInprocClasspath() { return emptyClasspath(); } public T toRealPath( Class type ) { if ( isClassPathConfig() && type == ClasspathConfiguration.class || isModularPathConfig() && type == ModularClasspathConfiguration.class ) { return type.cast( this ); } throw new IllegalStateException( "no target matched " + type ); } public ClassLoader createMergedClassLoader() throws SurefireExecutionException { return join( getInprocClasspath(), getTestClasspath() ) .createClassLoader( isChildDelegation(), isEnableAssertions(), "test" ); } public Classpath getProviderClasspath() { return surefireClasspathUrls; } public boolean isEnableAssertions() { return enableAssertions; } @Deprecated public boolean isChildDelegation() { return childDelegation; } } BooterConstants.java000066400000000000000000000055451330756104600363040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ /** * Constants used by the serializer/deserializer * * @author Kristian Rosenvold */ public final class BooterConstants { private BooterConstants() { } public static final String SPECIFIC_TEST_PROPERTY_PREFIX = "specificTest"; public static final String INCLUDES_PROPERTY_PREFIX = "includes"; public static final String EXCLUDES_PROPERTY_PREFIX = "excludes"; public static final String USESYSTEMCLASSLOADER = "useSystemClassLoader"; public static final String USEMANIFESTONLYJAR = "useManifestOnlyJar"; public static final String FAILIFNOTESTS = "failIfNoTests"; public static final String ISTRIMSTACKTRACE = "isTrimStackTrace"; public static final String REPORTSDIRECTORY = "reportsDirectory"; public static final String TESTARTIFACT_VERSION = "testFwJarVersion"; public static final String TESTARTIFACT_CLASSIFIER = "testFwJarClassifier"; public static final String REQUESTEDTEST = "requestedTest"; public static final String REQUESTEDTESTMETHOD = "requestedTestMethod"; public static final String SOURCE_DIRECTORY = "testSuiteDefinitionTestSourceDirectory"; public static final String TEST_CLASSES_DIRECTORY = "testClassesDirectory"; public static final String RUN_ORDER = "runOrder"; public static final String RUN_STATISTICS_FILE = "runStatisticsFile"; public static final String TEST_SUITE_XML_FILES = "testSuiteXmlFiles"; public static final String PROVIDER_CONFIGURATION = "providerConfiguration"; public static final String FORKTESTSET = "forkTestSet"; public static final String FORKTESTSET_PREFER_TESTS_FROM_IN_STREAM = "preferTestsFromInStream"; public static final String RERUN_FAILING_TESTS_COUNT = "rerunFailingTestsCount"; public static final String MAIN_CLI_OPTIONS = "mainCliOptions"; public static final String FAIL_FAST_COUNT = "failFastCount"; public static final String SHUTDOWN = "shutdown"; public static final String SYSTEM_EXIT_TIMEOUT = "systemExitTimeout"; public static final String PLUGIN_PID = "pluginPid"; } BooterDeserializer.java000066400000000000000000000146631330756104600367530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.Collection; import java.util.List; import org.apache.maven.surefire.report.ReporterConfiguration; import org.apache.maven.surefire.testset.DirectoryScannerParameters; import org.apache.maven.surefire.testset.RunOrderParameters; import org.apache.maven.surefire.testset.TestArtifactInfo; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.testset.TestRequest; // CHECKSTYLE_OFF: imports import static org.apache.maven.surefire.booter.BooterConstants.*; import static org.apache.maven.surefire.cli.CommandLineOption.*; /** * Knows how to serialize and deserialize the booter configuration. *
* The internal serialization format is through a properties file. The long-term goal of this * class is not to expose this implementation information to its clients. This still leaks somewhat, * and there are some cases where properties are being accessed as "Properties" instead of * more representative domain objects. *
* * @author Jason van Zyl * @author Emmanuel Venisse * @author Kristian Rosenvold */ public class BooterDeserializer { private final PropertiesWrapper properties; public BooterDeserializer( InputStream inputStream ) throws IOException { properties = SystemPropertyManager.loadProperties( inputStream ); } /** * @return PID of Maven process where plugin is executed; or null if PID could not be determined. */ public Long getPluginPid() { return properties.getLongProperty( PLUGIN_PID ); } public ProviderConfiguration deserialize() { final File reportsDirectory = new File( properties.getProperty( REPORTSDIRECTORY ) ); final String testNgVersion = properties.getProperty( TESTARTIFACT_VERSION ); final String testArtifactClassifier = properties.getProperty( TESTARTIFACT_CLASSIFIER ); final TypeEncodedValue typeEncodedTestForFork = properties.getTypeEncodedValue( FORKTESTSET ); final boolean preferTestsFromInStream = properties.getBooleanProperty( FORKTESTSET_PREFER_TESTS_FROM_IN_STREAM ); final String requestedTest = properties.getProperty( REQUESTEDTEST ); final File sourceDirectory = properties.getFileProperty( SOURCE_DIRECTORY ); final List excludes = properties.getStringList( EXCLUDES_PROPERTY_PREFIX ); final List includes = properties.getStringList( INCLUDES_PROPERTY_PREFIX ); final List specificTests = properties.getStringList( SPECIFIC_TEST_PROPERTY_PREFIX ); final List testSuiteXmlFiles = properties.getStringList( TEST_SUITE_XML_FILES ); final File testClassesDirectory = properties.getFileProperty( TEST_CLASSES_DIRECTORY ); final String runOrder = properties.getProperty( RUN_ORDER ); final String runStatisticsFile = properties.getProperty( RUN_STATISTICS_FILE ); final int rerunFailingTestsCount = properties.getIntProperty( RERUN_FAILING_TESTS_COUNT ); DirectoryScannerParameters dirScannerParams = new DirectoryScannerParameters( testClassesDirectory, includes, excludes, specificTests, properties.getBooleanProperty( FAILIFNOTESTS ), runOrder ); RunOrderParameters runOrderParameters = new RunOrderParameters( runOrder, runStatisticsFile == null ? null : new File( runStatisticsFile ) ); TestArtifactInfo testNg = new TestArtifactInfo( testNgVersion, testArtifactClassifier ); TestRequest testSuiteDefinition = new TestRequest( testSuiteXmlFiles, sourceDirectory, new TestListResolver( requestedTest ), rerunFailingTestsCount ); ReporterConfiguration reporterConfiguration = new ReporterConfiguration( reportsDirectory, properties.getBooleanProperty( ISTRIMSTACKTRACE ) ); Collection cli = properties.getStringList( MAIN_CLI_OPTIONS ); int failFastCount = properties.getIntProperty( FAIL_FAST_COUNT ); Shutdown shutdown = Shutdown.valueOf( properties.getProperty( SHUTDOWN ) ); String systemExitTimeoutAsString = properties.getProperty( SYSTEM_EXIT_TIMEOUT ); Integer systemExitTimeout = systemExitTimeoutAsString == null ? null : Integer.valueOf( systemExitTimeoutAsString ); return new ProviderConfiguration( dirScannerParams, runOrderParameters, properties.getBooleanProperty( FAILIFNOTESTS ), reporterConfiguration, testNg, testSuiteDefinition, properties.getProperties(), typeEncodedTestForFork, preferTestsFromInStream, fromStrings( cli ), failFastCount, shutdown, systemExitTimeout ); } public StartupConfiguration getProviderConfiguration() { boolean useSystemClassLoader = properties.getBooleanProperty( USESYSTEMCLASSLOADER ); boolean useManifestOnlyJar = properties.getBooleanProperty( USEMANIFESTONLYJAR ); String providerConfiguration = properties.getProperty( PROVIDER_CONFIGURATION ); ClassLoaderConfiguration classLoaderConfiguration = new ClassLoaderConfiguration( useSystemClassLoader, useManifestOnlyJar ); ClasspathConfiguration classpathConfiguration = new ClasspathConfiguration( properties ); return StartupConfiguration.inForkedVm( providerConfiguration, classpathConfiguration, classLoaderConfiguration ); } } ClassLoaderConfiguration.java000066400000000000000000000032521330756104600400720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ /** * Configuration for forking tests. * * @author Brett Porter * @author Kenney Westerhof */ public class ClassLoaderConfiguration { private final boolean useSystemClassLoader; private final boolean useManifestOnlyJar; public ClassLoaderConfiguration( boolean useSystemClassLoader, boolean useManifestOnlyJar ) { this.useSystemClassLoader = useSystemClassLoader; this.useManifestOnlyJar = useManifestOnlyJar; } public boolean isUseSystemClassLoader() { return useSystemClassLoader; } public boolean isUseManifestOnlyJar() { return useManifestOnlyJar; } public boolean isManifestOnlyJarRequestedAndUsable() { return isUseSystemClassLoader() && useManifestOnlyJar; } } Classpath.java000066400000000000000000000152741330756104600350770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import javax.annotation.Nonnull; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; import static java.io.File.pathSeparatorChar; import static org.apache.maven.surefire.util.internal.UrlUtils.toURL; /** * An ordered list of classpath elements with set behaviour * * A Classpath is immutable and thread safe. * * Immutable and thread safe * * @author Kristian Rosenvold */ public final class Classpath implements Iterable { private final List unmodifiableElements; public static Classpath join( Classpath firstClasspath, Classpath secondClasspath ) { LinkedHashSet accumulated = new LinkedHashSet(); if ( firstClasspath != null ) { firstClasspath.addTo( accumulated ); } if ( secondClasspath != null ) { secondClasspath.addTo( accumulated ); } return new Classpath( accumulated ); } private void addTo( @Nonnull Collection c ) { c.addAll( unmodifiableElements ); } private Classpath() { unmodifiableElements = Collections.emptyList(); } public Classpath( @Nonnull Classpath other, @Nonnull String additionalElement ) { ArrayList elems = new ArrayList( other.unmodifiableElements ); elems.add( additionalElement ); unmodifiableElements = Collections.unmodifiableList( elems ); } public Classpath( @Nonnull Collection elements ) { List newCp = new ArrayList( elements.size() ); for ( String element : elements ) { element = element.trim(); if ( !element.isEmpty() ) { newCp.add( element ); } } unmodifiableElements = Collections.unmodifiableList( newCp ); } public static Classpath emptyClasspath() { return new Classpath(); } public Classpath addClassPathElementUrl( String path ) { if ( path == null ) { throw new IllegalArgumentException( "Null is not a valid class path element url." ); } return !unmodifiableElements.contains( path ) ? new Classpath( this, path ) : this; } @Nonnull public List getClassPath() { return unmodifiableElements; } /** * @deprecated this should be package private method which returns List of Files. It will be * removed in the next major version. * * @return list of {@link URL jar files paths} with {@code file} protocol in URL. * @throws MalformedURLException if {@link URL} could not be created upon given class-path element(s) */ @Deprecated public List getAsUrlList() throws MalformedURLException { List urls = new ArrayList(); for ( String url : unmodifiableElements ) { File f = new File( url ); urls.add( toURL( f ) ); } return urls; } public void writeToSystemProperty( @Nonnull String propertyName ) { StringBuilder sb = new StringBuilder(); for ( String element : unmodifiableElements ) { sb.append( element ) .append( pathSeparatorChar ); } System.setProperty( propertyName, sb.toString() ); } @Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } Classpath classpath = (Classpath) o; return unmodifiableElements.equals( classpath.unmodifiableElements ); } public ClassLoader createClassLoader( boolean childDelegation, boolean enableAssertions, @Nonnull String roleName ) throws SurefireExecutionException { try { ClassLoader parent = SystemUtils.platformClassLoader(); IsolatedClassLoader classLoader = new IsolatedClassLoader( parent, childDelegation, roleName ); for ( String classPathElement : unmodifiableElements ) { classLoader.addURL( new File( classPathElement ).toURL() ); } if ( parent != null ) { parent.setDefaultAssertionStatus( enableAssertions ); } classLoader.setDefaultAssertionStatus( enableAssertions ); return classLoader; } catch ( MalformedURLException e ) { throw new SurefireExecutionException( "When creating classloader", e ); } } @Override public int hashCode() { return unmodifiableElements.hashCode(); } public String getLogMessage( @Nonnull String descriptor ) { StringBuilder result = new StringBuilder( descriptor ); for ( String element : unmodifiableElements ) { result.append( " " ) .append( element ); } return result.toString(); } public String getCompactLogMessage( @Nonnull String descriptor ) { StringBuilder result = new StringBuilder( descriptor ); for ( String element : unmodifiableElements ) { result.append( " " ); if ( element != null ) { int pos = element.lastIndexOf( File.separatorChar ); result.append( pos == -1 ? element : element.substring( pos + 1 ) ); } else { result.append( (String) null ); } } return result.toString(); } @Override public Iterator iterator() { return unmodifiableElements.iterator(); } } ClasspathConfiguration.java000066400000000000000000000057441330756104600376300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import javax.annotation.Nonnull; import static org.apache.maven.surefire.booter.Classpath.emptyClasspath; /** * Represents the classpaths for the BooterConfiguration. *
* * @author Jason van Zyl * @author Emmanuel Venisse * @author Kristian Rosenvold */ public class ClasspathConfiguration extends AbstractPathConfiguration { private final Classpath testClasspathUrls; /** * The surefire classpath to use when invoking in-process with the plugin */ private final Classpath inprocClasspath; public ClasspathConfiguration( boolean enableAssertions, boolean childDelegation ) { this( emptyClasspath(), emptyClasspath(), emptyClasspath(), enableAssertions, childDelegation ); } ClasspathConfiguration( @Nonnull PropertiesWrapper properties ) { this( properties.getClasspath( CLASSPATH ), properties.getClasspath( SUREFIRE_CLASSPATH ), emptyClasspath(), properties.getBooleanProperty( ENABLE_ASSERTIONS ), properties.getBooleanProperty( CHILD_DELEGATION ) ); } public ClasspathConfiguration( @Nonnull Classpath testClasspathUrls, @Nonnull Classpath surefireClassPathUrls, @Nonnull Classpath inprocClasspath, boolean enableAssertions, boolean childDelegation ) { super( surefireClassPathUrls, enableAssertions, childDelegation ); this.testClasspathUrls = testClasspathUrls; this.inprocClasspath = inprocClasspath; } @Override protected Classpath getInprocClasspath() { return inprocClasspath; } public Classpath getTestClasspath() { return testClasspathUrls; } @Override public final boolean isModularPathConfig() { return !isClassPathConfig(); } @Override public final boolean isClassPathConfig() { return true; } public void trickClassPathWhenManifestOnlyClasspath() throws SurefireExecutionException { System.setProperty( "surefire.real.class.path", System.getProperty( "java.class.path" ) ); getTestClasspath().writeToSystemProperty( "java.class.path" ); } } ForkedBooter.java000066400000000000000000000466051330756104600355440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.surefire.providerapi.ProviderParameters; import org.apache.maven.surefire.providerapi.SurefireProvider; import org.apache.maven.surefire.report.LegacyPojoStackTraceWriter; import org.apache.maven.surefire.report.StackTraceWriter; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.TestSetFailedException; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; import java.lang.management.ManagementFactory; import java.lang.reflect.InvocationTargetException; import java.security.AccessControlException; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.Semaphore; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicBoolean; import static java.lang.Math.max; import static java.lang.Thread.currentThread; import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.TimeUnit.SECONDS; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_BYE; import static org.apache.maven.surefire.booter.ForkingRunListener.BOOTERCODE_ERROR; import static org.apache.maven.surefire.booter.ForkingRunListener.encode; import static org.apache.maven.surefire.booter.SystemPropertyManager.setSystemProperties; import static org.apache.maven.surefire.util.ReflectionUtils.instantiateOneArg; import static org.apache.maven.surefire.util.internal.DaemonThreadFactory.newDaemonThreadFactory; import static org.apache.maven.surefire.util.internal.StringUtils.encodeStringForForkCommunication; /** * The part of the booter that is unique to a forked vm. *
* Deals with deserialization of the booter wire-level protocol *
* * @author Jason van Zyl * @author Emmanuel Venisse * @author Kristian Rosenvold */ public final class ForkedBooter { private static final long DEFAULT_SYSTEM_EXIT_TIMEOUT_IN_SECONDS = 30L; private static final long PING_TIMEOUT_IN_SECONDS = 30L; private static final long ONE_SECOND_IN_MILLIS = 1000L; private static final String LAST_DITCH_SHUTDOWN_THREAD = "surefire-forkedjvm-last-ditch-daemon-shutdown-thread-"; private static final String PING_THREAD = "surefire-forkedjvm-ping-"; private final CommandReader commandReader = CommandReader.getReader(); private final PrintStream originalOut = System.out; private volatile long systemExitTimeoutInSeconds = DEFAULT_SYSTEM_EXIT_TIMEOUT_IN_SECONDS; private volatile PingScheduler pingScheduler; private ScheduledThreadPoolExecutor jvmTerminator; private ProviderConfiguration providerConfiguration; private StartupConfiguration startupConfiguration; private Object testSet; private void setupBooter( String tmpDir, String dumpFileName, String surefirePropsFileName, String effectiveSystemPropertiesFileName ) throws IOException, SurefireExecutionException { BooterDeserializer booterDeserializer = new BooterDeserializer( createSurefirePropertiesIfFileExists( tmpDir, surefirePropsFileName ) ); // todo: print PID in debug console logger in version 2.21.2 pingScheduler = isDebugging() ? null : listenToShutdownCommands( booterDeserializer.getPluginPid() ); setSystemProperties( new File( tmpDir, effectiveSystemPropertiesFileName ) ); providerConfiguration = booterDeserializer.deserialize(); DumpErrorSingleton.getSingleton().init( dumpFileName, providerConfiguration.getReporterConfiguration() ); startupConfiguration = booterDeserializer.getProviderConfiguration(); systemExitTimeoutInSeconds = providerConfiguration.systemExitTimeout( DEFAULT_SYSTEM_EXIT_TIMEOUT_IN_SECONDS ); AbstractPathConfiguration classpathConfiguration = startupConfiguration.getClasspathConfiguration(); if ( classpathConfiguration.isClassPathConfig() ) { if ( startupConfiguration.isManifestOnlyJarRequestedAndUsable() ) { classpathConfiguration.toRealPath( ClasspathConfiguration.class ) .trickClassPathWhenManifestOnlyClasspath(); } startupConfiguration.writeSurefireTestClasspathProperty(); } ClassLoader classLoader = currentThread().getContextClassLoader(); classLoader.setDefaultAssertionStatus( classpathConfiguration.isEnableAssertions() ); boolean readTestsFromCommandReader = providerConfiguration.isReadTestsFromInStream(); testSet = createTestSet( providerConfiguration.getTestForFork(), readTestsFromCommandReader, classLoader ); } private void execute() { try { runSuitesInProcess(); } catch ( InvocationTargetException t ) { DumpErrorSingleton.getSingleton().dumpException( t ); StackTraceWriter stackTraceWriter = new LegacyPojoStackTraceWriter( "test subsystem", "no method", t.getTargetException() ); StringBuilder stringBuilder = new StringBuilder(); encode( stringBuilder, stackTraceWriter, false ); encodeAndWriteToOutput( ( (char) BOOTERCODE_ERROR ) + ",0," + stringBuilder + "\n" ); } catch ( Throwable t ) { DumpErrorSingleton.getSingleton().dumpException( t ); StackTraceWriter stackTraceWriter = new LegacyPojoStackTraceWriter( "test subsystem", "no method", t ); StringBuilder stringBuilder = new StringBuilder(); encode( stringBuilder, stackTraceWriter, false ); encodeAndWriteToOutput( ( (char) BOOTERCODE_ERROR ) + ",0," + stringBuilder + "\n" ); } acknowledgedExit(); } private Object createTestSet( TypeEncodedValue forkedTestSet, boolean readTestsFromCommandReader, ClassLoader cl ) { if ( forkedTestSet != null ) { return forkedTestSet.getDecodedValue( cl ); } else if ( readTestsFromCommandReader ) { return new LazyTestsToRun( originalOut ); } return null; } private void cancelPingScheduler() { if ( pingScheduler != null ) { try { AccessController.doPrivileged( new PrivilegedAction() { @Override public Object run() { pingScheduler.shutdown(); return null; } } ); } catch ( AccessControlException e ) { // ignore } } } private PingScheduler listenToShutdownCommands( Long ppid ) { commandReader.addShutdownListener( createExitHandler() ); AtomicBoolean pingDone = new AtomicBoolean( true ); commandReader.addNoopListener( createPingHandler( pingDone ) ); PingScheduler pingMechanisms = new PingScheduler( createPingScheduler(), ppid == null ? null : new PpidChecker( ppid ) ); if ( pingMechanisms.pluginProcessChecker != null ) { Runnable checkerJob = processCheckerJob( pingMechanisms ); pingMechanisms.pingScheduler.scheduleWithFixedDelay( checkerJob, 0L, 1L, SECONDS ); } Runnable pingJob = createPingJob( pingDone, pingMechanisms.pluginProcessChecker ); pingMechanisms.pingScheduler.scheduleAtFixedRate( pingJob, 0L, PING_TIMEOUT_IN_SECONDS, SECONDS ); return pingMechanisms; } private Runnable processCheckerJob( final PingScheduler pingMechanism ) { return new Runnable() { @Override public void run() { try { if ( pingMechanism.pluginProcessChecker.canUse() && !pingMechanism.pluginProcessChecker.isProcessAlive() && !pingMechanism.pingScheduler.isShutdown() ) { DumpErrorSingleton.getSingleton() .dumpText( "Killing self fork JVM. Maven process died." ); kill(); } } catch ( RuntimeException e ) { DumpErrorSingleton.getSingleton() .dumpException( e, "System.exit() or native command error interrupted process checker." ); } } }; } private CommandListener createPingHandler( final AtomicBoolean pingDone ) { return new CommandListener() { @Override public void update( Command command ) { pingDone.set( true ); } }; } private CommandListener createExitHandler() { return new CommandListener() { @Override public void update( Command command ) { Shutdown shutdown = command.toShutdownData(); if ( shutdown.isKill() ) { DumpErrorSingleton.getSingleton() .dumpText( "Killing self fork JVM. Received SHUTDOWN command from Maven shutdown hook." ); kill(); } else if ( shutdown.isExit() ) { cancelPingScheduler(); DumpErrorSingleton.getSingleton() .dumpText( "Exiting self fork JVM. Received SHUTDOWN command from Maven shutdown hook." ); exit( 1 ); } // else refers to shutdown=testset, but not used now, keeping reader open } }; } private Runnable createPingJob( final AtomicBoolean pingDone, final PpidChecker pluginProcessChecker ) { return new Runnable() { @Override public void run() { if ( !canUseNewPingMechanism( pluginProcessChecker ) ) { boolean hasPing = pingDone.getAndSet( false ); if ( !hasPing ) { DumpErrorSingleton.getSingleton() .dumpText( "Killing self fork JVM. PING timeout elapsed." ); kill(); } } } }; } private void encodeAndWriteToOutput( String string ) { byte[] encodeBytes = encodeStringForForkCommunication( string ); //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized ( originalOut ) { originalOut.write( encodeBytes, 0, encodeBytes.length ); originalOut.flush(); } } private void kill() { kill( 1 ); } private void kill( int returnCode ) { commandReader.stop(); Runtime.getRuntime().halt( returnCode ); } private void exit( int returnCode ) { launchLastDitchDaemonShutdownThread( returnCode ); System.exit( returnCode ); } private void acknowledgedExit() { final Semaphore barrier = new Semaphore( 0 ); commandReader.addByeAckListener( new CommandListener() { @Override public void update( Command command ) { barrier.release(); } } ); encodeAndWriteToOutput( ( (char) BOOTERCODE_BYE ) + ",0,BYE!\n" ); launchLastDitchDaemonShutdownThread( 0 ); long timeoutMillis = max( systemExitTimeoutInSeconds * ONE_SECOND_IN_MILLIS, ONE_SECOND_IN_MILLIS ); acquireOnePermit( barrier, timeoutMillis ); cancelPingScheduler(); commandReader.stop(); System.exit( 0 ); } private RunResult runSuitesInProcess() throws SurefireExecutionException, TestSetFailedException, InvocationTargetException { ForkingReporterFactory factory = createForkingReporterFactory(); return invokeProviderInSameClassLoader( factory ); } private ForkingReporterFactory createForkingReporterFactory() { final boolean trimStackTrace = providerConfiguration.getReporterConfiguration().isTrimStackTrace(); return new ForkingReporterFactory( trimStackTrace, originalOut ); } private synchronized ScheduledThreadPoolExecutor getJvmTerminator() { if ( jvmTerminator == null ) { ThreadFactory threadFactory = newDaemonThreadFactory( LAST_DITCH_SHUTDOWN_THREAD + systemExitTimeoutInSeconds + "s" ); jvmTerminator = new ScheduledThreadPoolExecutor( 1, threadFactory ); jvmTerminator.setMaximumPoolSize( 1 ); } return jvmTerminator; } @SuppressWarnings( "checkstyle:emptyblock" ) private void launchLastDitchDaemonShutdownThread( final int returnCode ) { getJvmTerminator().schedule( new Runnable() { @Override public void run() { kill( returnCode ); } }, systemExitTimeoutInSeconds, SECONDS ); } private RunResult invokeProviderInSameClassLoader( ForkingReporterFactory factory ) throws TestSetFailedException, InvocationTargetException { return createProviderInCurrentClassloader( factory ) .invoke( testSet ); } private SurefireProvider createProviderInCurrentClassloader( ForkingReporterFactory reporterManagerFactory ) { BaseProviderFactory bpf = new BaseProviderFactory( reporterManagerFactory, true ); bpf.setTestRequest( providerConfiguration.getTestSuiteDefinition() ); bpf.setReporterConfiguration( providerConfiguration.getReporterConfiguration() ); ClassLoader classLoader = currentThread().getContextClassLoader(); bpf.setClassLoaders( classLoader ); bpf.setTestArtifactInfo( providerConfiguration.getTestArtifact() ); bpf.setProviderProperties( providerConfiguration.getProviderProperties() ); bpf.setRunOrderParameters( providerConfiguration.getRunOrderParameters() ); bpf.setDirectoryScannerParameters( providerConfiguration.getDirScannerParams() ); bpf.setMainCliOptions( providerConfiguration.getMainCliOptions() ); bpf.setSkipAfterFailureCount( providerConfiguration.getSkipAfterFailureCount() ); bpf.setShutdown( providerConfiguration.getShutdown() ); bpf.setSystemExitTimeout( providerConfiguration.getSystemExitTimeout() ); String providerClass = startupConfiguration.getActualClassName(); return (SurefireProvider) instantiateOneArg( classLoader, providerClass, ProviderParameters.class, bpf ); } /** * This method is invoked when Surefire is forked - this method parses and organizes the arguments passed to it and * then calls the Surefire class' run method.
The system exit code will be 1 if an exception is thrown. * * @param args Commandline arguments */ public static void main( String... args ) { ForkedBooter booter = new ForkedBooter(); try { booter.setupBooter( args[0], args[1], args[2], args.length > 3 ? args[3] : null ); booter.execute(); } catch ( Throwable t ) { DumpErrorSingleton.getSingleton().dumpException( t ); t.printStackTrace(); booter.cancelPingScheduler(); booter.exit( 1 ); } } private static boolean canUseNewPingMechanism( PpidChecker pluginProcessChecker ) { return pluginProcessChecker != null && pluginProcessChecker.canUse(); } private static boolean acquireOnePermit( Semaphore barrier, long timeoutMillis ) { try { return barrier.tryAcquire( timeoutMillis, MILLISECONDS ); } catch ( InterruptedException e ) { return true; } } private static ScheduledExecutorService createPingScheduler() { ThreadFactory threadFactory = newDaemonThreadFactory( PING_THREAD + PING_TIMEOUT_IN_SECONDS + "s" ); ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor( 1, threadFactory ); executor.setKeepAliveTime( 3L, SECONDS ); executor.setMaximumPoolSize( 2 ); return executor; } private static InputStream createSurefirePropertiesIfFileExists( String tmpDir, String propFileName ) throws FileNotFoundException { File surefirePropertiesFile = new File( tmpDir, propFileName ); return surefirePropertiesFile.exists() ? new FileInputStream( surefirePropertiesFile ) : null; } private static boolean isDebugging() { for ( String argument : ManagementFactory.getRuntimeMXBean().getInputArguments() ) { if ( "-Xdebug".equals( argument ) || argument.startsWith( "-agentlib:jdwp" ) ) { return true; } } return false; } private static class PingScheduler { private final ScheduledExecutorService pingScheduler; private final PpidChecker pluginProcessChecker; PingScheduler( ScheduledExecutorService pingScheduler, PpidChecker pluginProcessChecker ) { this.pingScheduler = pingScheduler; this.pluginProcessChecker = pluginProcessChecker; } void shutdown() { pingScheduler.shutdown(); if ( pluginProcessChecker != null ) { pluginProcessChecker.destroyActiveCommands(); } } boolean isShutdown() { return pingScheduler.isShutdown(); } } } IsolatedClassLoader.java000066400000000000000000000056651330756104600370410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.net.URL; import java.net.URLClassLoader; import java.util.HashSet; import java.util.Set; /** * Loads classes from jar files added via {@link #addURL(URL)}. */ public class IsolatedClassLoader extends URLClassLoader { private final ClassLoader parent = ClassLoader.getSystemClassLoader(); private final Set urls = new HashSet(); private final String roleName; private boolean childDelegation = true; private static final URL[] EMPTY_URL_ARRAY = new URL[0]; public IsolatedClassLoader( ClassLoader parent, boolean childDelegation, String roleName ) { super( EMPTY_URL_ARRAY, parent ); this.childDelegation = childDelegation; this.roleName = roleName; } /** * @deprecated this method will use {@link java.io.File} instead of {@link URL} in the next * major version. */ @Override @Deprecated public void addURL( URL url ) { // avoid duplicates // todo avoid URL due to calling equals method may cause some overhead due to resolving host or file. if ( !urls.contains( url ) ) { super.addURL( url ); urls.add( url ); } } @Override public synchronized Class loadClass( String name ) throws ClassNotFoundException { if ( childDelegation ) { Class c = findLoadedClass( name ); if ( c == null ) { try { c = findClass( name ); } catch ( ClassNotFoundException e ) { if ( parent == null ) { throw e; } else { c = parent.loadClass( name ); } } } return c; } else { return super.loadClass( name ); } } @Override public String toString() { return "IsolatedClassLoader{roleName='" + roleName + "'}"; } } KeyValueSource.java000066400000000000000000000020241330756104600360500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.util.Map; /** * A key-value source obeying the geneal constrains of java.util.Properties */ public interface KeyValueSource { void copyTo( Map target ); } LazyTestsToRun.java000066400000000000000000000113121330756104600360740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.io.PrintStream; import java.util.Collections; import java.util.Iterator; import org.apache.maven.surefire.util.CloseableIterator; import org.apache.maven.surefire.util.TestsToRun; import static org.apache.maven.surefire.booter.CommandReader.getReader; import static org.apache.maven.surefire.util.ReflectionUtils.loadClass; /** * A variant of TestsToRun that is provided with test class names * from an {@code System.in}. * The method {@link #iterator()} returns an Iterator that blocks on calls to * {@link Iterator#hasNext()} or {@link Iterator#next()} until new classes are available, or no more * classes will be available or the internal stream is closed. * The iterator can be used only in one Thread and it is the thread which executes * {@link org.apache.maven.surefire.providerapi.SurefireProvider provider implementation}. * * @author Andreas Gudian * @author Tibor Digana */ final class LazyTestsToRun extends TestsToRun { private final PrintStream originalOutStream; /** * C'tor * * @param originalOutStream the output stream to use when requesting new new tests */ LazyTestsToRun( PrintStream originalOutStream ) { super( Collections.>emptySet() ); this.originalOutStream = originalOutStream; } private final class BlockingIterator implements Iterator> { private final Iterator it = getReader().getIterableClasses( originalOutStream ).iterator(); @Override public boolean hasNext() { return it.hasNext(); } @Override public Class next() { return findClass( it.next() ); } @Override public void remove() { throw new UnsupportedOperationException(); } } /** * @return test classes which have been retrieved by {@link LazyTestsToRun#iterator()}. */ @Override public Iterator> iterated() { return newWeakIterator(); } /** * The iterator can be used only in one Thread. * {@inheritDoc} * @see org.apache.maven.surefire.util.TestsToRun#iterator() * */ @Override public Iterator> iterator() { return new BlockingIterator(); } /* (non-Javadoc) * {@inheritDoc} * @see org.apache.maven.surefire.util.TestsToRun#toString() */ @Override public String toString() { return "LazyTestsToRun"; } /* (non-Javadoc) * {@inheritDoc} * @see org.apache.maven.surefire.util.TestsToRun#allowEagerReading() */ @Override public boolean allowEagerReading() { return false; } private static Class findClass( String clazz ) { return loadClass( Thread.currentThread().getContextClassLoader(), clazz ); } /** * @return snapshot of tests upon constructs of {@link CommandReader#iterated() iterator}. * Therefore weakly consistent while {@link LazyTestsToRun#iterator()} is being iterated. */ private Iterator> newWeakIterator() { final Iterator it = getReader().iterated(); return new CloseableIterator>() { @Override protected boolean isClosed() { return LazyTestsToRun.this.isFinished(); } @Override protected boolean doHasNext() { return it.hasNext(); } @Override protected Class doNext() { return findClass( it.next() ); } @Override protected void doRemove() { } @Override public void remove() { throw new UnsupportedOperationException( "unsupported remove" ); } }; } } ModularClasspath.java000066400000000000000000000042721330756104600364170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import javax.annotation.Nonnull; import java.io.File; import java.util.Collection; import java.util.List; import static java.util.Collections.unmodifiableCollection; import static java.util.Collections.unmodifiableList; /** * Jigsaw class-path and module-path. * * @author Tibor Digana (tibor17) * @since 2.21.0.Jigsaw */ public final class ModularClasspath { private final File moduleDescriptor; private final List modulePath; private final Collection packages; private final File patchFile; public ModularClasspath( @Nonnull File moduleDescriptor, @Nonnull List modulePath, @Nonnull Collection packages, @Nonnull File patchFile ) { this.moduleDescriptor = moduleDescriptor; this.modulePath = modulePath; this.packages = packages; this.patchFile = patchFile; } @Nonnull public File getModuleDescriptor() { return moduleDescriptor; } @Nonnull public List getModulePath() { return unmodifiableList( modulePath ); } @Nonnull public Collection getPackages() { return unmodifiableCollection( packages ); } @Nonnull public File getPatchFile() { return patchFile; } } ModularClasspathConfiguration.java000066400000000000000000000041561330756104600411500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import javax.annotation.Nonnull; /** * @author Tibor Digana (tibor17) * @since 2.21.0.Jigsaw */ public class ModularClasspathConfiguration extends AbstractPathConfiguration { private final ModularClasspath modularClasspath; private final Classpath testClasspathUrls; public ModularClasspathConfiguration( @Nonnull ModularClasspath modularClasspath, @Nonnull Classpath testClasspathUrls, @Nonnull Classpath surefireClasspathUrls, boolean enableAssertions, boolean childDelegation ) { super( surefireClasspathUrls, enableAssertions, childDelegation ); this.modularClasspath = modularClasspath; this.testClasspathUrls = testClasspathUrls; } @Override public Classpath getTestClasspath() { return testClasspathUrls; } @Override public final boolean isModularPathConfig() { return true; } @Override public final boolean isClassPathConfig() { return !isModularPathConfig(); } public ModularClasspath getModularClasspath() { return modularClasspath; } } PpidChecker.java000066400000000000000000000336671330756104600353440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.io.File; import java.io.IOException; import java.nio.charset.Charset; import java.text.SimpleDateFormat; import java.util.Queue; import java.util.Scanner; import java.util.TimeZone; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.regex.Matcher; import java.util.regex.Pattern; import static java.lang.Integer.parseInt; import static java.lang.Long.parseLong; import static java.util.concurrent.TimeUnit.DAYS; import static java.util.concurrent.TimeUnit.HOURS; import static java.util.concurrent.TimeUnit.MINUTES; import static java.util.regex.Pattern.compile; import static org.apache.commons.io.IOUtils.closeQuietly; import static org.apache.commons.lang3.StringUtils.isNotBlank; import static org.apache.commons.lang3.SystemUtils.IS_OS_HP_UX; import static org.apache.commons.lang3.SystemUtils.IS_OS_UNIX; import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS; import static org.apache.maven.surefire.booter.ProcessInfo.unixProcessInfo; import static org.apache.maven.surefire.booter.ProcessInfo.windowsProcessInfo; import static org.apache.maven.surefire.booter.ProcessInfo.ERR_PROCESS_INFO; import static org.apache.maven.surefire.booter.ProcessInfo.INVALID_PROCESS_INFO; /** * Recognizes PID of Plugin process and determines lifetime. * * @author Tibor Digana (tibor17) * @since 2.20.1 */ final class PpidChecker { private static final int MINUTES_TO_MILLIS = 60 * 1000; // 25 chars https://superuser.com/questions/937380/get-creation-time-of-file-in-milliseconds/937401#937401 private static final int WMIC_CREATION_DATE_VALUE_LENGTH = 25; private static final int WMIC_CREATION_DATE_TIMESTAMP_LENGTH = 18; private static final SimpleDateFormat WMIC_CREATION_DATE_FORMAT = IS_OS_WINDOWS ? createWindowsCreationDateFormat() : null; private static final String WMIC_CREATION_DATE = "CreationDate"; private static final String WINDOWS_SYSTEM_ROOT_ENV = "SystemRoot"; private static final String RELATIVE_PATH_TO_WMIC = "System32\\Wbem"; private static final String SYSTEM_PATH_TO_WMIC = "%" + WINDOWS_SYSTEM_ROOT_ENV + "%\\" + RELATIVE_PATH_TO_WMIC + "\\"; private final Queue destroyableCommands = new ConcurrentLinkedQueue(); /** * The etime is in the form of [[dd-]hh:]mm:ss on Unix like systems. * See the workaround https://issues.apache.org/jira/browse/SUREFIRE-1451. */ static final Pattern UNIX_CMD_OUT_PATTERN = compile( "^(((\\d+)-)?(\\d{1,2}):)?(\\d{1,2}):(\\d{1,2})$" ); private final long ppid; private volatile ProcessInfo parentProcessInfo; private volatile boolean stopped; PpidChecker( long ppid ) { this.ppid = ppid; //todo WARN logger (after new logger is finished) that (IS_OS_UNIX && canExecuteUnixPs()) is false } boolean canUse() { final ProcessInfo ppi = parentProcessInfo; return ppi == null ? IS_OS_WINDOWS || IS_OS_UNIX && canExecuteUnixPs() : ppi.canUse(); } /** * This method can be called only after {@link #canUse()} has returned {@code true}. * * @return {@code true} if parent process is alive; {@code false} otherwise * @throws IllegalStateException if {@link #canUse()} returns {@code false}, error to read process * or this object has been {@link #destroyActiveCommands() destroyed} * @throws NullPointerException if extracted e-time is null */ @SuppressWarnings( "unchecked" ) boolean isProcessAlive() { if ( !canUse() ) { throw new IllegalStateException( "irrelevant to call isProcessAlive()" ); } final ProcessInfo previousInfo = parentProcessInfo; try { if ( IS_OS_WINDOWS ) { parentProcessInfo = windows(); checkProcessInfo(); // let's compare creation time, should be same unless killed or PID is reused by OS into another process return previousInfo == null || parentProcessInfo.isTimeEqualTo( previousInfo ); } else if ( IS_OS_UNIX ) { parentProcessInfo = unix(); checkProcessInfo(); // let's compare elapsed time, should be greater or equal if parent process is the same and still alive return previousInfo == null || !parentProcessInfo.isTimeBefore( previousInfo ); } throw new IllegalStateException( "unknown platform or you did not call canUse() before isProcessAlive()" ); } finally { if ( parentProcessInfo == null ) { parentProcessInfo = INVALID_PROCESS_INFO; } } } private void checkProcessInfo() { if ( isStopped() ) { throw new IllegalStateException( "error [STOPPED] to read process " + ppid ); } if ( parentProcessInfo.isError() ) { throw new IllegalStateException( "error to read process " + ppid ); } if ( !parentProcessInfo.canUse() ) { throw new IllegalStateException( "Cannot use PPID " + ppid + " process information. " + "Going to use NOOP events." ); } } // https://www.freebsd.org/cgi/man.cgi?ps(1) // etimes elapsed running time, in decimal integer seconds // http://manpages.ubuntu.com/manpages/xenial/man1/ps.1.html // etimes elapsed time since the process was started, in seconds. // http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/9b8c96f96a0f/test/java/lang/ProcessBuilder/Basic.java#L167 ProcessInfo unix() { ProcessInfoConsumer reader = new ProcessInfoConsumer( Charset.defaultCharset().name() ) { @Override ProcessInfo consumeLine( String line, ProcessInfo previousOutputLine ) { if ( previousOutputLine.isInvalid() ) { Matcher matcher = UNIX_CMD_OUT_PATTERN.matcher( line ); if ( matcher.matches() ) { long pidUptime = fromDays( matcher ) + fromHours( matcher ) + fromMinutes( matcher ) + fromSeconds( matcher ); return unixProcessInfo( ppid, pidUptime ); } } return previousOutputLine; } }; return reader.execute( "/bin/sh", "-c", unixPathToPS() + " -o etime= -p " + ppid ); } ProcessInfo windows() { ProcessInfoConsumer reader = new ProcessInfoConsumer( "US-ASCII" ) { private boolean hasHeader; @Override ProcessInfo consumeLine( String line, ProcessInfo previousProcessInfo ) throws Exception { if ( previousProcessInfo.isInvalid() && !line.isEmpty() ) { if ( hasHeader ) { // now the line is CreationDate, e.g. 20180406142327.741074+120 if ( line.length() != WMIC_CREATION_DATE_VALUE_LENGTH ) { throw new IllegalStateException( "WMIC CreationDate should have 25 characters " + line ); } String startTimestamp = line.substring( 0, WMIC_CREATION_DATE_TIMESTAMP_LENGTH ); int indexOfTimeZone = WMIC_CREATION_DATE_VALUE_LENGTH - 4; long startTimestampMillisUTC = WMIC_CREATION_DATE_FORMAT.parse( startTimestamp ).getTime() - parseInt( line.substring( indexOfTimeZone ) ) * MINUTES_TO_MILLIS; return windowsProcessInfo( ppid, startTimestampMillisUTC ); } else { hasHeader = WMIC_CREATION_DATE.equals( line ); } } return previousProcessInfo; } }; String wmicPath = hasWmicStandardSystemPath() ? SYSTEM_PATH_TO_WMIC : ""; return reader.execute( "CMD", "/A", "/X", "/C", wmicPath + "wmic process where (ProcessId=" + ppid + ") get " + WMIC_CREATION_DATE ); } void destroyActiveCommands() { stopped = true; for ( Process p = destroyableCommands.poll(); p != null; p = destroyableCommands.poll() ) { p.destroy(); } } private boolean isStopped() { return stopped; } private static String unixPathToPS() { return canExecuteLocalUnixPs() ? "/usr/bin/ps" : "/bin/ps"; } static boolean canExecuteUnixPs() { return canExecuteLocalUnixPs() || canExecuteStandardUnixPs(); } private static boolean canExecuteLocalUnixPs() { return new File( "/usr/bin/ps" ).canExecute(); } private static boolean canExecuteStandardUnixPs() { return new File( "/bin/ps" ).canExecute(); } private static boolean hasWmicStandardSystemPath() { String systemRoot = System.getenv( WINDOWS_SYSTEM_ROOT_ENV ); return isNotBlank( systemRoot ) && new File( systemRoot, RELATIVE_PATH_TO_WMIC + "\\wmic.exe" ).isFile(); } static long fromDays( Matcher matcher ) { String s = matcher.group( 3 ); return s == null ? 0L : DAYS.toSeconds( parseLong( s ) ); } static long fromHours( Matcher matcher ) { String s = matcher.group( 4 ); return s == null ? 0L : HOURS.toSeconds( parseLong( s ) ); } static long fromMinutes( Matcher matcher ) { String s = matcher.group( 5 ); return s == null ? 0L : MINUTES.toSeconds( parseLong( s ) ); } static long fromSeconds( Matcher matcher ) { String s = matcher.group( 6 ); return s == null ? 0L : parseLong( s ); } private static void checkValid( Scanner scanner ) throws IOException { IOException exception = scanner.ioException(); if ( exception != null ) { throw exception; } } /** * The beginning part of Windows WMIC format yyyymmddHHMMSS.xxx
* https://technet.microsoft.com/en-us/library/ee198928.aspx
* We use UTC time zone which avoids DST changes, see SUREFIRE-1512. * * @return Windows WMIC format yyyymmddHHMMSS.xxx */ private static SimpleDateFormat createWindowsCreationDateFormat() { SimpleDateFormat formatter = new SimpleDateFormat( "yyyyMMddHHmmss'.'SSS" ); formatter.setTimeZone( TimeZone.getTimeZone( "UTC" ) ); return formatter; } /** * Reads standard output from {@link Process}. *
* The artifact maven-shared-utils has non-daemon Threads which is an issue in Surefire to satisfy System.exit. * This implementation is taylor made without using any Thread. * It's easy to destroy Process from other Thread. */ private abstract class ProcessInfoConsumer { private final String charset; ProcessInfoConsumer( String charset ) { this.charset = charset; } abstract ProcessInfo consumeLine( String line, ProcessInfo previousProcessInfo ) throws Exception; ProcessInfo execute( String... command ) { ProcessBuilder processBuilder = new ProcessBuilder( command ); processBuilder.redirectErrorStream( true ); Process process = null; ProcessInfo processInfo = INVALID_PROCESS_INFO; try { if ( IS_OS_HP_UX ) // force to run shell commands in UNIX Standard mode on HP-UX { processBuilder.environment().put( "UNIX95", "1" ); } process = processBuilder.start(); destroyableCommands.add( process ); Scanner scanner = new Scanner( process.getInputStream(), charset ); while ( scanner.hasNextLine() ) { String line = scanner.nextLine().trim(); processInfo = consumeLine( line, processInfo ); } checkValid( scanner ); int exitCode = process.waitFor(); return exitCode == 0 ? processInfo : INVALID_PROCESS_INFO; } catch ( Exception e ) { DumpErrorSingleton.getSingleton() .dumpException( e ); return ERR_PROCESS_INFO; } finally { if ( process != null ) { destroyableCommands.remove( process ); process.destroy(); closeQuietly( process.getInputStream() ); closeQuietly( process.getErrorStream() ); closeQuietly( process.getOutputStream() ); } } } } } ProcessInfo.java000066400000000000000000000057571330756104600354140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ /** * Immutable object which encapsulates PID and elapsed time (Unix) or start time (Windows). *
* Methods * ({@link #getPID()}, {@link #getTime()}, {@link #isTimeBefore(ProcessInfo)}, {@link #isTimeEqualTo(ProcessInfo)}) * throw {@link IllegalStateException} * if {@link #canUse()} returns {@code false} or {@link #isError()} returns {@code true}. * * @author Tibor Digana (tibor17) * @since 2.20.1 */ final class ProcessInfo { static final ProcessInfo INVALID_PROCESS_INFO = new ProcessInfo( null, null ); static final ProcessInfo ERR_PROCESS_INFO = new ProcessInfo( null, null ); /** * On Unix we do not get PID due to the command is interested only to etime of PPID: *
*
/bin/ps -o etime= -p 123
*/ static ProcessInfo unixProcessInfo( long pid, long etime ) { return new ProcessInfo( pid, etime ); } static ProcessInfo windowsProcessInfo( long pid, long startTimestamp ) { return new ProcessInfo( pid, startTimestamp ); } private final Long pid; private final Comparable time; private ProcessInfo( Long pid, Comparable time ) { this.pid = pid; this.time = time; } boolean canUse() { return !isInvalid() && !isError(); } boolean isInvalid() { return this == INVALID_PROCESS_INFO; } boolean isError() { return this == ERR_PROCESS_INFO; } long getPID() { checkValid(); return pid; } Comparable getTime() { checkValid(); return time; } @SuppressWarnings( "unchecked" ) boolean isTimeEqualTo( ProcessInfo that ) { checkValid(); that.checkValid(); return this.time.compareTo( that.time ) == 0; } @SuppressWarnings( "unchecked" ) boolean isTimeBefore( ProcessInfo that ) { checkValid(); that.checkValid(); return this.time.compareTo( that.time ) < 0; } private void checkValid() { if ( !canUse() ) { throw new IllegalStateException( "invalid process info" ); } } } PropertiesWrapper.java000066400000000000000000000117451330756104600366510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.maven.surefire.util.internal.StringUtils; /** * @author Kristian Rosenvold */ public class PropertiesWrapper implements KeyValueSource { private final Map properties; public PropertiesWrapper( Map properties ) { if ( properties == null ) { throw new IllegalStateException( "Properties cannot be null" ); } this.properties = properties; } public Map getProperties() { return properties; } public void setAsSystemProperties() { for ( Map.Entry entry : properties.entrySet() ) { System.setProperty( entry.getKey(), entry.getValue() ); } } public String getProperty( String key ) { return properties.get( key ); } public boolean getBooleanProperty( String propertyName ) { return Boolean.valueOf( properties.get( propertyName ) ); } public int getIntProperty( String propertyName ) { return Integer.parseInt( properties.get( propertyName ) ); } public Long getLongProperty( String propertyName ) { String number = getProperty( propertyName ); return number == null ? null : Long.parseLong( number ); } public File getFileProperty( String key ) { final String property = getProperty( key ); if ( property == null ) { return null; } TypeEncodedValue typeEncodedValue = new TypeEncodedValue( File.class.getName(), property ); return (File) typeEncodedValue.getDecodedValue(); } public List getStringList( String propertyPrefix ) { List result = new ArrayList(); for ( int i = 0; ; i++ ) { String value = getProperty( propertyPrefix + i ); if ( value == null ) { return result; } result.add( value ); } } /** * Retrieves as single object that is persisted with type encoding * * @param key The key for the propery * @return The object, of a supported type */ public TypeEncodedValue getTypeEncodedValue( String key ) { String typeEncoded = getProperty( key ); if ( typeEncoded != null ) { int typeSep = typeEncoded.indexOf( "|" ); String type = typeEncoded.substring( 0, typeSep ); String value = typeEncoded.substring( typeSep + 1 ); return new TypeEncodedValue( type, value ); } else { return null; } } Classpath getClasspath( String prefix ) { List elements = getStringList( prefix ); return new Classpath( elements ); } public void setClasspath( String prefix, Classpath classpath ) { List classpathElements = classpath.getClassPath(); for ( int i = 0, size = classpathElements.size(); i < size; ++i ) { String element = (String) classpathElements.get( i ); setProperty( prefix + i, element ); } } public void setProperty( String key, String value ) { if ( value != null ) { properties.put( key, value ); } } public void addList( List items, String propertyPrefix ) { if ( items != null && !items.isEmpty() ) { int i = 0; for ( Object item : items ) { if ( item == null ) { throw new NullPointerException( propertyPrefix + i + " has null value" ); } String[] stringArray = StringUtils.split( item.toString(), "," ); for ( String aStringArray : stringArray ) { properties.put( propertyPrefix + i, aStringArray ); i++; } } } } @Override public void copyTo( Map target ) { target.putAll( properties ); } } ProviderConfiguration.java000066400000000000000000000123321330756104600374670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.io.File; import java.util.List; import java.util.Map; import org.apache.maven.surefire.cli.CommandLineOption; import org.apache.maven.surefire.report.ReporterConfiguration; import org.apache.maven.surefire.testset.DirectoryScannerParameters; import org.apache.maven.surefire.testset.RunOrderParameters; import org.apache.maven.surefire.testset.TestArtifactInfo; import org.apache.maven.surefire.testset.TestRequest; /** * Represents the surefire configuration that passes all the way into the provider * classloader and the provider. *
* * @author Jason van Zyl * @author Emmanuel Venisse * @author Kristian Rosenvold */ public class ProviderConfiguration { private final DirectoryScannerParameters dirScannerParams; private final ReporterConfiguration reporterConfiguration; private final TestArtifactInfo testArtifact; private final TestRequest testSuiteDefinition; private final RunOrderParameters runOrderParameters; private final Map providerProperties; private final boolean failIfNoTests; private final TypeEncodedValue forkTestSet; private final boolean readTestsFromInStream; private final List mainCliOptions; private final int skipAfterFailureCount; private final Shutdown shutdown; private final Integer systemExitTimeout; @SuppressWarnings( "checkstyle:parameternumber" ) public ProviderConfiguration( DirectoryScannerParameters directoryScannerParameters, RunOrderParameters runOrderParameters, boolean failIfNoTests, ReporterConfiguration reporterConfiguration, TestArtifactInfo testArtifact, TestRequest testSuiteDefinition, Map providerProperties, TypeEncodedValue typeEncodedTestSet, boolean readTestsFromInStream, List mainCliOptions, int skipAfterFailureCount, Shutdown shutdown, Integer systemExitTimeout ) { this.runOrderParameters = runOrderParameters; this.providerProperties = providerProperties; this.reporterConfiguration = reporterConfiguration; this.testArtifact = testArtifact; this.testSuiteDefinition = testSuiteDefinition; this.dirScannerParams = directoryScannerParameters; this.failIfNoTests = failIfNoTests; this.forkTestSet = typeEncodedTestSet; this.readTestsFromInStream = readTestsFromInStream; this.mainCliOptions = mainCliOptions; this.skipAfterFailureCount = skipAfterFailureCount; this.shutdown = shutdown; this.systemExitTimeout = systemExitTimeout; } public ReporterConfiguration getReporterConfiguration() { return reporterConfiguration; } public boolean isFailIfNoTests() { return failIfNoTests; } public File getBaseDir() { return dirScannerParams.getTestClassesDirectory(); } public DirectoryScannerParameters getDirScannerParams() { return dirScannerParams; } @Deprecated public List getIncludes() { return dirScannerParams.getIncludes(); } @Deprecated public List getExcludes() { return dirScannerParams.getExcludes(); } public TestArtifactInfo getTestArtifact() { return testArtifact; } public TestRequest getTestSuiteDefinition() { return testSuiteDefinition; } public Map getProviderProperties() { return providerProperties; } public TypeEncodedValue getTestForFork() { return forkTestSet; } public RunOrderParameters getRunOrderParameters() { return runOrderParameters; } public boolean isReadTestsFromInStream() { return readTestsFromInStream; } public List getMainCliOptions() { return mainCliOptions; } public int getSkipAfterFailureCount() { return skipAfterFailureCount; } public Shutdown getShutdown() { return shutdown; } public Integer getSystemExitTimeout() { return systemExitTimeout; } public long systemExitTimeout( long fallback ) { return systemExitTimeout == null || systemExitTimeout < 0 ? fallback : systemExitTimeout; } } ProviderFactory.java000066400000000000000000000174271330756104600363010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.io.PrintStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import org.apache.maven.surefire.providerapi.SurefireProvider; import org.apache.maven.surefire.report.ReporterException; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.TestSetFailedException; import static org.apache.maven.surefire.util.ReflectionUtils.getMethod; import static org.apache.maven.surefire.util.ReflectionUtils.invokeGetter; import static org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray; import static org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2; /** * Creates the surefire provider. *
* * @author Kristian Rosenvold */ public class ProviderFactory { private final StartupConfiguration startupConfiguration; private final ProviderConfiguration providerConfiguration; private final ClassLoader classLoader; private final SurefireReflector surefireReflector; private final Object reporterManagerFactory; private static final Class[] INVOKE_PARAMETERS = { Object.class }; private static final Class[] INVOKE_EMPTY_PARAMETER_TYPES = { }; private static final Class[] INVOKE_EMPTY_PARAMETERS = { }; public ProviderFactory( StartupConfiguration startupConfiguration, ProviderConfiguration providerConfiguration, ClassLoader testsClassLoader, Object reporterManagerFactory ) { this.providerConfiguration = providerConfiguration; this.startupConfiguration = startupConfiguration; this.surefireReflector = new SurefireReflector( testsClassLoader ); this.classLoader = testsClassLoader; this.reporterManagerFactory = reporterManagerFactory; } public static RunResult invokeProvider( Object testSet, ClassLoader testsClassLoader, Object factory, ProviderConfiguration providerConfiguration, boolean insideFork, StartupConfiguration startupConfig, boolean restoreStreams ) throws TestSetFailedException, InvocationTargetException { final PrintStream orgSystemOut = System.out; final PrintStream orgSystemErr = System.err; // Note that System.out/System.err are also read in the "ReporterConfiguration" instantiation // in createProvider below. These are the same values as here. try { return new ProviderFactory( startupConfig, providerConfiguration, testsClassLoader, factory ) .createProvider( insideFork ) .invoke( testSet ); } finally { if ( restoreStreams && System.getSecurityManager() == null ) { System.setOut( orgSystemOut ); System.setErr( orgSystemErr ); } } } public SurefireProvider createProvider( boolean isInsideFork ) { final Thread currentThread = Thread.currentThread(); final ClassLoader systemClassLoader = currentThread.getContextClassLoader(); currentThread.setContextClassLoader( classLoader ); // Note: Duplicated in ForkedBooter#createProviderInCurrentClassloader Object o = surefireReflector.createBooterConfiguration( classLoader, reporterManagerFactory, isInsideFork ); surefireReflector.setTestSuiteDefinitionAware( o, providerConfiguration.getTestSuiteDefinition() ); surefireReflector.setProviderPropertiesAware( o, providerConfiguration.getProviderProperties() ); surefireReflector.setReporterConfigurationAware( o, providerConfiguration.getReporterConfiguration() ); surefireReflector.setTestClassLoaderAware( o, classLoader ); surefireReflector.setTestArtifactInfoAware( o, providerConfiguration.getTestArtifact() ); surefireReflector.setRunOrderParameters( o, providerConfiguration.getRunOrderParameters() ); surefireReflector.setIfDirScannerAware( o, providerConfiguration.getDirScannerParams() ); surefireReflector.setMainCliOptions( o, providerConfiguration.getMainCliOptions() ); surefireReflector.setSkipAfterFailureCount( o, providerConfiguration.getSkipAfterFailureCount() ); surefireReflector.setShutdown( o, providerConfiguration.getShutdown() ); if ( isInsideFork ) { surefireReflector.setSystemExitTimeout( o, providerConfiguration.getSystemExitTimeout() ); } Object provider = surefireReflector.instantiateProvider( startupConfiguration.getActualClassName(), o ); currentThread.setContextClassLoader( systemClassLoader ); return new ProviderProxy( provider, classLoader ); } private final class ProviderProxy implements SurefireProvider { private final Object providerInOtherClassLoader; private final ClassLoader testsClassLoader; private ProviderProxy( Object providerInOtherClassLoader, ClassLoader testsClassLoader ) { this.providerInOtherClassLoader = providerInOtherClassLoader; this.testsClassLoader = testsClassLoader; } @Override @SuppressWarnings( "unchecked" ) public Iterable> getSuites() { ClassLoader current = swapClassLoader( testsClassLoader ); try { return (Iterable>) invokeGetter( providerInOtherClassLoader, "getSuites" ); } finally { Thread.currentThread().setContextClassLoader( current ); } } @Override public RunResult invoke( Object forkTestSet ) throws TestSetFailedException, ReporterException, InvocationTargetException { ClassLoader current = swapClassLoader( testsClassLoader ); try { Method invoke = getMethod( providerInOtherClassLoader.getClass(), "invoke", INVOKE_PARAMETERS ); Object result = invokeMethodWithArray2( providerInOtherClassLoader, invoke, forkTestSet ); return (RunResult) surefireReflector.convertIfRunResult( result ); } finally { if ( System.getSecurityManager() == null ) { Thread.currentThread().setContextClassLoader( current ); } } } private ClassLoader swapClassLoader( ClassLoader newClassLoader ) { ClassLoader current = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader( newClassLoader ); return current; } @Override public void cancel() { Class providerType = providerInOtherClassLoader.getClass(); Method invoke = getMethod( providerType, "cancel", INVOKE_EMPTY_PARAMETER_TYPES ); invokeMethodWithArray( providerInOtherClassLoader, invoke, INVOKE_EMPTY_PARAMETERS ); } } } StartupConfiguration.java000066400000000000000000000110741330756104600373410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import javax.annotation.Nonnull; /** * Configuration that is used by the SurefireStarter but does not make it into the provider itself. * * @author Kristian Rosenvold */ public class StartupConfiguration { private static final String SUREFIRE_TEST_CLASSPATH = "surefire.test.class.path"; private final String providerClassName; private final AbstractPathConfiguration classpathConfiguration; private final ClassLoaderConfiguration classLoaderConfiguration; private final boolean isForkRequested; private final boolean isInForkedVm; public StartupConfiguration( @Nonnull String providerClassName, @Nonnull AbstractPathConfiguration classpathConfiguration, @Nonnull ClassLoaderConfiguration classLoaderConfiguration, boolean isForkRequested, boolean inForkedVm ) { this.classpathConfiguration = classpathConfiguration; this.classLoaderConfiguration = classLoaderConfiguration; this.isForkRequested = isForkRequested; this.providerClassName = providerClassName; isInForkedVm = inForkedVm; } public boolean isProviderMainClass() { return providerClassName.endsWith( "#main" ); } public static StartupConfiguration inForkedVm( String providerClassName, ClasspathConfiguration classpathConfiguration, ClassLoaderConfiguration classLoaderConfiguration ) { return new StartupConfiguration( providerClassName, classpathConfiguration, classLoaderConfiguration, true, true ); } public AbstractPathConfiguration getClasspathConfiguration() { return classpathConfiguration; } @Deprecated public boolean useSystemClassLoader() { // todo; I am not totally convinced this logic is as simple as it could be return classLoaderConfiguration.isUseSystemClassLoader() && ( isInForkedVm || isForkRequested ); } public boolean isManifestOnlyJarRequestedAndUsable() { return classLoaderConfiguration.isManifestOnlyJarRequestedAndUsable(); } public String getProviderClassName() { return providerClassName; } public String getActualClassName() { return isProviderMainClass() ? stripEnd( providerClassName, "#main" ) : providerClassName; } /** *

Strip any of a supplied String from the end of a String.

*
*

If the strip String is {@code null}, whitespace is * stripped.

* * @param str the String to remove characters from * @param strip the String to remove * @return the stripped String */ private static String stripEnd( String str, String strip ) { if ( str == null ) { return null; } int end = str.length(); if ( strip == null ) { while ( ( end != 0 ) && Character.isWhitespace( str.charAt( end - 1 ) ) ) { end--; } } else { while ( end != 0 && strip.indexOf( str.charAt( end - 1 ) ) != -1 ) { end--; } } return str.substring( 0, end ); } public ClassLoaderConfiguration getClassLoaderConfiguration() { return classLoaderConfiguration; } public boolean isShadefire() { return providerClassName.startsWith( "org.apache.maven.surefire.shadefire" ); } public void writeSurefireTestClasspathProperty() { getClasspathConfiguration().getTestClasspath().writeToSystemProperty( SUREFIRE_TEST_CLASSPATH ); } } SurefireBooterForkException.java000066400000000000000000000061631330756104600406120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.surefire.suite.RunResult; import static org.apache.maven.surefire.util.internal.StringUtils.isNotBlank; /** * Encapsulates exceptions thrown during Surefire forking. */ public class SurefireBooterForkException extends Exception { public SurefireBooterForkException( String message, RunResult runResult ) { this( message, null, null, runResult ); } public SurefireBooterForkException( String message, String rethrownMessage, Throwable rethrownCause, RunResult runResult ) { super( toString( message, rethrownMessage, rethrownCause, runResult ), rethrownCause ); } public SurefireBooterForkException( String message, Throwable cause ) { super( message, cause ); } public SurefireBooterForkException( String msg ) { super( msg ); } private static String toString( String message, String rethrownMessage, Throwable rethrownCause, RunResult runResult ) { return toNewLines( message, rethrownMessage, rethrownCause == null ? null : rethrownCause.getLocalizedMessage(), runResult == null ? null : runResult.getFailure(), runResult == null ? null : toString( runResult ) ); } private static String toString( RunResult runResult ) { return "Fatal Tests run: " + runResult.getCompletedCount() + ", Failures: " + runResult.getFailures() + ", Errors: " + runResult.getErrors() + ", Skipped: " + runResult.getSkipped() + ", Flakes: " + runResult.getFlakes() + ", Elapsed timeout: " + runResult.isTimeout(); } private static String toNewLines( String... messages ) { StringBuilder result = new StringBuilder(); for ( String message : messages ) { if ( isNotBlank( message ) ) { if ( result.length() == 0 ) { result.append( '\n' ); } result.append( message ); } } return result.toString(); } } SurefireExecutionException.java000066400000000000000000000022611330756104600404740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ /** * An error occurring during the invocation of Surefire via an alternate class loader. * * @author Brett Porter */ public class SurefireExecutionException extends Exception { public SurefireExecutionException( String message, Throwable nested ) { super( message, nested ); } } SystemPropertyManager.java000066400000000000000000000065451330756104600375020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Map; import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; /** * @author Kristian Rosenvold */ public class SystemPropertyManager { /** * Loads the properties, closes the stream * * @param inStream The stream to read from, will be closed * @return The properties * @throws java.io.IOException If something bad happens */ public static PropertiesWrapper loadProperties( InputStream inStream ) throws IOException { try { Properties p = new Properties(); p.load( inStream ); Map map = new ConcurrentHashMap( p.size() ); for ( String key : p.stringPropertyNames() ) { map.put( key, p.getProperty( key ) ); } return new PropertiesWrapper( map ); } finally { close( inStream ); // @todo use try-with-resources JDK7, search in all code } } private static PropertiesWrapper loadProperties( File file ) throws IOException { return loadProperties( new FileInputStream( file ) ); } public static void setSystemProperties( File file ) throws IOException { PropertiesWrapper p = loadProperties( file ); p.setAsSystemProperties(); } public static File writePropertiesFile( Properties properties, File tempDirectory, String name, boolean keepForkFiles ) throws IOException { File file = File.createTempFile( name, "tmp", tempDirectory ); if ( !keepForkFiles ) { file.deleteOnExit(); } writePropertiesFile( file, name, properties ); return file; } public static void writePropertiesFile( File file, String name, Properties properties ) throws IOException { FileOutputStream out = new FileOutputStream( file ); try { properties.store( out, name ); } finally { out.close(); } } public static void close( InputStream inputStream ) { if ( inputStream == null ) { return; } try { inputStream.close(); } catch ( IOException ex ) { // ignore } } } SystemUtils.java000066400000000000000000000330151330756104600354530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.surefire.util.ReflectionUtils; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.lang.management.ManagementFactory; import java.lang.reflect.Method; import java.math.BigDecimal; import java.util.Properties; import java.util.StringTokenizer; import static java.lang.Character.isDigit; import static java.lang.Thread.currentThread; import static org.apache.commons.io.IOUtils.closeQuietly; import static org.apache.commons.lang3.StringUtils.isNumeric; import static org.apache.commons.lang3.SystemUtils.IS_OS_FREE_BSD; import static org.apache.commons.lang3.SystemUtils.IS_OS_LINUX; import static org.apache.commons.lang3.SystemUtils.IS_OS_NET_BSD; import static org.apache.commons.lang3.SystemUtils.IS_OS_OPEN_BSD; import static org.apache.maven.surefire.util.ReflectionUtils.invokeMethodChain; import static org.apache.maven.surefire.util.ReflectionUtils.tryLoadClass; import static org.apache.maven.surefire.util.internal.ObjectUtils.requireNonNull; /** * JDK 9 support. * * @author Tibor Digana (tibor17) * @since 2.20.1 */ public final class SystemUtils { public static final BigDecimal JAVA_SPECIFICATION_VERSION = getJavaSpecificationVersion(); private static final BigDecimal JAVA_VERSION_7 = new BigDecimal( "1.7" ).stripTrailingZeros(); private static final BigDecimal JIGSAW_JAVA_VERSION = new BigDecimal( 9 ).stripTrailingZeros(); private static final int PROC_STATUS_PID_FIRST_CHARS = 20; private SystemUtils() { throw new IllegalStateException( "no instantiable constructor" ); } /** * @param jvmExecPath e.g. /jdk/bin/java, /jdk/jre/bin/java * @return {@code true} if {@code jvmExecPath} is path to java binary executor */ public static boolean endsWithJavaPath( String jvmExecPath ) { File javaExec = new File( jvmExecPath ).getAbsoluteFile(); File bin = javaExec.getParentFile(); String exec = javaExec.getName(); return exec.startsWith( "java" ) && bin != null && bin.getName().equals( "bin" ); } /** * If {@code jvmExecutable} is /jdk/bin/java (since jdk9) or /jdk/jre/bin/java (prior to jdk9) * then the absolute path to JDK home is returned /jdk. *
* Null is returned if {@code jvmExecutable} is incorrect. * * @param jvmExecutable /jdk/bin/java* or /jdk/jre/bin/java* * @return path to jdk directory; or null if wrong path or directory layout of JDK installation. */ public static File toJdkHomeFromJvmExec( String jvmExecutable ) { File bin = new File( jvmExecutable ).getAbsoluteFile().getParentFile(); if ( "bin".equals( bin.getName() ) ) { File parent = bin.getParentFile(); if ( "jre".equals( parent.getName() ) ) { File jdk = parent.getParentFile(); return new File( jdk, "bin" ).isDirectory() ? jdk : null; } return parent; } return null; } /** * If system property java.home is /jdk (since jdk9) or /jdk/jre (prior to jdk9) then * the absolute path to * JDK home is returned /jdk. * * @return path to JDK */ public static File toJdkHomeFromJre() { return toJdkHomeFromJre( System.getProperty( "java.home" ) ); } /** * If {@code jreHome} is /jdk (since jdk9) or /jdk/jre (prior to jdk9) then * the absolute path to JDK home is returned /jdk. *
* JRE home directory {@code jreHome} must be taken from system property java.home. * * @param jreHome path to /jdk or /jdk/jre * @return path to JDK */ static File toJdkHomeFromJre( String jreHome ) { File pathToJreOrJdk = new File( jreHome ).getAbsoluteFile(); return "jre".equals( pathToJreOrJdk.getName() ) ? pathToJreOrJdk.getParentFile() : pathToJreOrJdk; } public static BigDecimal toJdkVersionFromReleaseFile( File jdkHome ) { File release = new File( requireNonNull( jdkHome ).getAbsoluteFile(), "release" ); if ( !release.isFile() ) { return null; } InputStream is = null; try { Properties properties = new Properties(); is = new FileInputStream( release ); properties.load( is ); String javaVersion = properties.getProperty( "JAVA_VERSION" ).replace( "\"", "" ); StringTokenizer versions = new StringTokenizer( javaVersion, "._" ); if ( versions.countTokens() == 1 ) { javaVersion = versions.nextToken(); } else if ( versions.countTokens() >= 2 ) { String majorVersion = versions.nextToken(); String minorVersion = versions.nextToken(); javaVersion = isNumeric( minorVersion ) ? majorVersion + "." + minorVersion : majorVersion; } else { return null; } return new BigDecimal( javaVersion ); } catch ( IOException e ) { return null; } finally { closeQuietly( is ); } } /** * Safely extracts major and minor version as fractional number from *
     *     $MAJOR.$MINOR.$SECURITY
     * 
. *
* The security version is usually not needed to know. * It can be applied to not certified JRE. * * @return major.minor version derived from java specification version of this JVM, e.g. 1.8, 9, etc. */ private static BigDecimal getJavaSpecificationVersion() { StringBuilder fractionalVersion = new StringBuilder( "0" ); for ( char c : org.apache.commons.lang3.SystemUtils.JAVA_SPECIFICATION_VERSION.toCharArray() ) { if ( isDigit( c ) ) { fractionalVersion.append( c ); } else if ( c == '.' ) { if ( fractionalVersion.indexOf( "." ) == -1 ) { fractionalVersion.append( '.' ); } else { break; } } } String majorMinorVersion = fractionalVersion.toString(); return new BigDecimal( majorMinorVersion.endsWith( "." ) ? majorMinorVersion + "0" : majorMinorVersion ) .stripTrailingZeros(); } public static boolean isJava9AtLeast( String jvmExecutablePath ) { File externalJavaHome = toJdkHomeFromJvmExec( jvmExecutablePath ); File thisJavaHome = toJdkHomeFromJre(); if ( thisJavaHome.equals( externalJavaHome ) ) { return isBuiltInJava9AtLeast(); } else { BigDecimal releaseFileVersion = externalJavaHome == null ? null : toJdkVersionFromReleaseFile( externalJavaHome ); return isJava9AtLeast( releaseFileVersion ); } } public static boolean isBuiltInJava9AtLeast() { return JAVA_SPECIFICATION_VERSION.compareTo( JIGSAW_JAVA_VERSION ) >= 0; } public static boolean isBuiltInJava7AtLeast() { return JAVA_SPECIFICATION_VERSION.compareTo( JAVA_VERSION_7 ) >= 0; } public static boolean isJava9AtLeast( BigDecimal version ) { return version != null && version.compareTo( JIGSAW_JAVA_VERSION ) >= 0; } public static ClassLoader platformClassLoader() { if ( isBuiltInJava9AtLeast() ) { return reflectClassLoader( ClassLoader.class, "getPlatformClassLoader" ); } return null; } public static Long pid() { if ( isBuiltInJava9AtLeast() ) { Long pid = pidOnJava9(); if ( pid != null ) { return pid; } } if ( IS_OS_LINUX ) { try { return pidStatusOnLinux(); } catch ( Exception e ) { // examine PID via JMX } } else if ( IS_OS_FREE_BSD || IS_OS_NET_BSD || IS_OS_OPEN_BSD ) { try { return pidStatusOnBSD(); } catch ( Exception e ) { // examine PID via JMX } } return pidOnJMX(); } static Long pidOnJMX() { String processName = ManagementFactory.getRuntimeMXBean().getName(); if ( processName.contains( "@" ) ) { String pid = processName.substring( 0, processName.indexOf( '@' ) ).trim(); try { return Long.parseLong( pid ); } catch ( NumberFormatException e ) { return null; } } return null; } /** * $ cat /proc/self/stat *
* 48982 (cat) R 9744 48982 9744 34818 48982 8192 185 0 0 0 0 0 0 0 20 0 1 0 * 137436614 103354368 134 18446744073709551615 4194304 4235780 140737488346592 * 140737488343784 252896458544 0 0 0 0 0 0 0 17 2 0 0 0 0 0 *
* $ SELF_PID=$(cat /proc/self/stat) *
* $ echo $CPU_ID | gawk '{print $1}' *
* 48982 * * @return self PID * @throws Exception i/o and number format exc */ static Long pidStatusOnLinux() throws Exception { return pidStatusOnLinux( "" ); } /** * For testing purposes only. * * @param root shifted to test-classes * @return same as in {@link #pidStatusOnLinux()} * @throws Exception same as in {@link #pidStatusOnLinux()} */ static Long pidStatusOnLinux( String root ) throws Exception { FileReader input = new FileReader( root + "/proc/self/stat" ); try { // Reading and encoding 20 characters is bit faster than whole line. // size of (long) = 19, + 1 space char[] buffer = new char[PROC_STATUS_PID_FIRST_CHARS]; String startLine = new String( buffer, 0, input.read( buffer ) ); return Long.parseLong( startLine.substring( 0, startLine.indexOf( ' ' ) ) ); } finally { input.close(); } } /** * The process status. This file is read-only and returns a single * line containing multiple space-separated fields. *
* See procfs status *
* # cat /proc/curproc/status *
* cat 60424 60386 60424 60386 5,0 ctty 972854153,236415 0,0 0,1043 nochan 0 0 0,0 prisoner *
* Fields are: *
* comm pid ppid pgid sid maj, min ctty, sldr start user/system time wmsg euid ruid rgid,egid, * groups[1 .. NGROUPS] hostname * * @return current PID * @throws Exception if could not read /proc/curproc/status */ static Long pidStatusOnBSD() throws Exception { return pidStatusOnBSD( "" ); } /** * For testing purposes only. * * @param root shifted to test-classes * @return same as in {@link #pidStatusOnBSD()} * @throws Exception same as in {@link #pidStatusOnBSD()} */ static Long pidStatusOnBSD( String root ) throws Exception { BufferedReader input = new BufferedReader( new FileReader( root + "/proc/curproc/status" ) ); try { String line = input.readLine(); int i1 = 1 + line.indexOf( ' ' ); int i2 = line.indexOf( ' ', i1 ); return Long.parseLong( line.substring( i1, i2 ) ); } finally { input.close(); } } static Long pidOnJava9() { ClassLoader classLoader = currentThread().getContextClassLoader(); Class processHandle = tryLoadClass( classLoader, "java.lang.ProcessHandle" ); Class[] classesChain = { processHandle, processHandle }; String[] methodChain = { "current", "pid" }; return (Long) invokeMethodChain( classesChain, methodChain, null ); } static ClassLoader reflectClassLoader( Class target, String getterMethodName ) { try { Method getter = ReflectionUtils.getMethod( target, getterMethodName ); return (ClassLoader) ReflectionUtils.invokeMethodWithArray( null, getter ); } catch ( RuntimeException e ) { return null; } } } TypeEncodedValue.java000066400000000000000000000072501330756104600363500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/main/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; import java.util.Properties; import static org.apache.maven.surefire.util.ReflectionUtils.loadClass; import static org.apache.maven.surefire.util.internal.StringUtils.ISO_8859_1; /** * @author Kristian Rosenvold */ public class TypeEncodedValue { private final String type; private final String value; public TypeEncodedValue( String type, String value ) { this.type = type; this.value = value; } public boolean isTypeClass() { return Class.class.getName().equals( type ); } public Object getDecodedValue() { return getDecodedValue( Thread.currentThread().getContextClassLoader() ); } public Object getDecodedValue( ClassLoader classLoader ) { if ( type.trim().isEmpty() ) { return null; } else if ( type.equals( String.class.getName() ) ) { return value; } else if ( isTypeClass() ) { return loadClass( classLoader, value ); } else if ( type.equals( File.class.getName() ) ) { return new File( value ); } else if ( type.equals( Boolean.class.getName() ) ) { return Boolean.valueOf( value ); } else if ( type.equals( Integer.class.getName() ) ) { return Integer.valueOf( value ); } else if ( type.equals( Properties.class.getName() ) ) { Properties result = new Properties(); try { result.load( new ByteArrayInputStream( value.getBytes( ISO_8859_1 ) ) ); return result; } catch ( IOException e ) { throw new IllegalStateException( "bug in property conversion", e ); } } else { throw new IllegalArgumentException( "Unknown parameter type: " + type ); } } @Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } TypeEncodedValue that = (TypeEncodedValue) o; return equalsType( that ) && equalsValue( that ); } @Override public int hashCode() { int result = type != null ? type.hashCode() : 0; result = 31 * result + ( value != null ? value.hashCode() : 0 ); return result; } private boolean equalsType( TypeEncodedValue that ) { return type == null ? that.type == null : type.equals( that.type ); } private boolean equalsValue( TypeEncodedValue that ) { return value == null ? that.value == null : value.equals( that.value ); } } maven-surefire-surefire-2.22.0/surefire-booter/src/test/000077500000000000000000000000001330756104600232365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/000077500000000000000000000000001330756104600241575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/org/000077500000000000000000000000001330756104600247465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/org/apache/000077500000000000000000000000001330756104600261675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600272755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/org/apache/maven/surefire/000077500000000000000000000000001330756104600311215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/org/apache/maven/surefire/booter/000077500000000000000000000000001330756104600324135ustar00rootroot00000000000000ClasspathTest.java000066400000000000000000000133361330756104600357670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.io.File; import java.util.List; import junit.framework.TestCase; import static org.apache.maven.surefire.booter.Classpath.emptyClasspath; /** * @author Kristian Rosenvold */ public class ClasspathTest extends TestCase { private static final String DUMMY_PROPERTY_NAME = "dummyProperty"; private static final String DUMMY_URL_1 = "foo.jar"; private static final String DUMMY_URL_2 = "bar.jar"; public void testShouldWriteEmptyPropertyForEmptyClasspath() throws Exception { Classpath classpath = Classpath.emptyClasspath(); classpath.writeToSystemProperty( DUMMY_PROPERTY_NAME ); assertEquals( "", System.getProperty( DUMMY_PROPERTY_NAME ) ); } public void testShouldWriteSeparatedElementsAsSystemProperty() throws Exception { Classpath classpath = Classpath.emptyClasspath().addClassPathElementUrl( DUMMY_URL_1 ).addClassPathElementUrl( DUMMY_URL_2 ); classpath.writeToSystemProperty( DUMMY_PROPERTY_NAME ); assertEquals( DUMMY_URL_1 + File.pathSeparatorChar + DUMMY_URL_2 + File.pathSeparatorChar, System.getProperty( DUMMY_PROPERTY_NAME ) ); } public void testShouldAddNoDuplicateElements() { Classpath classpath = emptyClasspath().addClassPathElementUrl( DUMMY_URL_1 ).addClassPathElementUrl( DUMMY_URL_1 ); assertClasspathConsistsOfElements( classpath, new String[]{ DUMMY_URL_1 } ); } public void testGetAsUrlList() throws Exception { final List asUrlList = createClasspathWithTwoElements().getAsUrlList(); assertEquals( 2, asUrlList.size() ); assertTrue( asUrlList.get( 0 ).toString().endsWith( DUMMY_URL_1 ) ); assertTrue( asUrlList.get( 1 ).toString().endsWith( DUMMY_URL_2 ) ); } public void testShouldJoinTwoNullClasspaths() { Classpath joinedClasspath = Classpath.join( null, null ); assertEmptyClasspath( joinedClasspath ); } public void testShouldHaveAllElementsAfterJoiningTwoDifferentClasspaths() throws Exception { Classpath firstClasspath = Classpath.emptyClasspath(); Classpath secondClasspath = firstClasspath.addClassPathElementUrl( DUMMY_URL_1 ).addClassPathElementUrl( DUMMY_URL_2 ); Classpath joinedClasspath = Classpath.join( firstClasspath, secondClasspath ); assertClasspathConsistsOfElements( joinedClasspath, new String[]{ DUMMY_URL_1, DUMMY_URL_2 } ); } public void testShouldNotHaveDuplicatesAfterJoiningTowClasspathsWithEqualElements() throws Exception { Classpath firstClasspath = Classpath.emptyClasspath().addClassPathElementUrl( DUMMY_URL_1 ); Classpath secondClasspath = Classpath.emptyClasspath().addClassPathElementUrl( DUMMY_URL_1 ); Classpath joinedClasspath = Classpath.join( firstClasspath, secondClasspath ); assertClasspathConsistsOfElements( joinedClasspath, new String[]{ DUMMY_URL_1 } ); } public void testShouldNotBeAbleToRemoveElement() throws Exception { try { Classpath classpath = createClasspathWithTwoElements(); classpath.getClassPath().remove( 0 ); } catch ( java.lang.UnsupportedOperationException ignore ) { } } private void assertClasspathConsistsOfElements( Classpath classpath, String[] elements ) { List classpathElements = classpath.getClassPath(); for ( String element : elements ) { assertTrue( "The element '" + element + " is missing.", classpathElements.contains( element ) ); } assertEquals( "Wrong number of classpath elements.", elements.length, classpathElements.size() ); } private void assertEmptyClasspath( Classpath classpath ) { List classpathElements = classpath.getClassPath(); assertEquals( "Wrong number of classpath elements.", 0, classpathElements.size() ); } private Classpath createClasspathWithTwoElements() { Classpath classpath = Classpath.emptyClasspath(); return classpath.addClassPathElementUrl( DUMMY_URL_1 ).addClassPathElementUrl( DUMMY_URL_2 ); } public void testShouldThrowIllegalArgumentExceptionWhenNullIsAddedAsClassPathElementUrl() throws Exception { Classpath classpath = Classpath.emptyClasspath(); try { classpath.addClassPathElementUrl( null ); fail( "IllegalArgumentException not thrown." ); } catch ( IllegalArgumentException expected ) { } } public void testShouldNotAddNullAsClassPathElementUrl() throws Exception { Classpath classpath = Classpath.emptyClasspath(); try { classpath.addClassPathElementUrl( null ); } catch ( IllegalArgumentException ignored ) { } assertEmptyClasspath( classpath ); } } CommandReaderTest.java000066400000000000000000000201711330756104600365410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.apache.maven.surefire.testset.TestSetFailedException; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.util.Iterator; import java.util.NoSuchElementException; import java.util.concurrent.BlockingQueue; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.FutureTask; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; import static org.apache.maven.surefire.util.internal.StringUtils.ISO_8859_1; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.fest.assertions.Assertions.assertThat; /** * Testing singleton {@code MasterProcessReader} in multiple class loaders. * * @author Tibor Digana (tibor17) * @since 2.19 */ @RunWith( NewClassLoaderRunner.class ) public class CommandReaderTest { private final BlockingQueue blockingStream = new LinkedBlockingQueue(); private InputStream realInputStream; private CommandReader reader; static class A { } static class B { } static class C { } static class D { } @Before public void init() throws UnsupportedEncodingException { Thread.interrupted(); realInputStream = System.in; addTestToPipeline( getClass().getName() ); System.setIn( new SystemInputStream() ); reader = CommandReader.getReader(); } @After public void deinit() { reader.stop(); System.setIn( realInputStream ); } @Test public void readJustOneClass() throws Exception { Iterator it = reader.getIterableClasses( nul() ).iterator(); assertTrue( it.hasNext() ); assertThat( it.next(), is( getClass().getName() ) ); reader.stop(); assertFalse( it.hasNext() ); try { it.next(); fail(); } catch ( NoSuchElementException e ) { // expected } } @Test public void manyClasses() throws Exception { Iterator it1 = reader.getIterableClasses( nul() ).iterator(); assertThat( it1.next(), is( getClass().getName() ) ); addTestToPipeline( A.class.getName() ); assertThat( it1.next(), is( A.class.getName() ) ); addTestToPipeline( B.class.getName() ); assertThat( it1.next(), is( B.class.getName() ) ); addTestToPipeline( C.class.getName() ); assertThat( it1.next(), is( C.class.getName() ) ); addEndOfPipeline(); addTestToPipeline( D.class.getName() ); assertFalse( it1.hasNext() ); } @Test public void twoIterators() throws Exception { Iterator it1 = reader.getIterableClasses( nul() ).iterator(); assertThat( it1.next(), is( getClass().getName() ) ); addTestToPipeline( A.class.getName() ); assertThat( it1.next(), is( A.class.getName() ) ); addTestToPipeline( B.class.getName() ); TimeUnit.MILLISECONDS.sleep( 200 ); // give the test chance to fail Iterator it2 = reader.iterated(); assertThat( it1.next(), is( B.class.getName() ) ); addTestToPipeline( C.class.getName() ); assertThat( it2.hasNext(), is( true ) ); assertThat( it2.next(), is( getClass().getName() ) ); assertThat( it2.hasNext(), is( true ) ); assertThat( it2.next(), is( A.class.getName() ) ); assertThat( it2 ).isEmpty(); assertThat( it1.next(), is( C.class.getName() ) ); addEndOfPipeline(); assertThat( it1 ).isEmpty(); } @Test( expected = NoSuchElementException.class ) public void stopBeforeReadInThread() throws Throwable { Runnable runnable = new Runnable() { @Override public void run() { Iterator it = reader.getIterableClasses( nul() ).iterator(); assertThat( it.next(), is( CommandReaderTest.class.getName() ) ); } }; FutureTask futureTask = new FutureTask( runnable, null ); Thread t = new Thread( futureTask ); reader.stop(); t.start(); try { futureTask.get(); } catch ( ExecutionException e ) { throw e.getCause(); } } @Test public void readTwoClassesInThread() throws Throwable { final CountDownLatch counter = new CountDownLatch( 1 ); Runnable runnable = new Runnable() { @Override public void run() { Iterator it = reader.getIterableClasses( nul() ).iterator(); assertThat( it.next(), is( CommandReaderTest.class.getName() ) ); counter.countDown(); assertThat( it.next(), is( PropertiesWrapperTest.class.getName() ) ); } }; FutureTask futureTask = new FutureTask( runnable, null ); Thread t = new Thread( futureTask ); t.start(); counter.await(); addTestToPipeline( PropertiesWrapperTest.class.getName() ); try { futureTask.get(); } catch ( ExecutionException e ) { throw e.getCause(); } } @Test( timeout = 15000 ) public void shouldAwaitReaderUp() throws TestSetFailedException { assertTrue( reader.awaitStarted() ); reader.stop(); assertFalse( reader.awaitStarted() ); } private class SystemInputStream extends InputStream { @Override public int read() throws IOException { try { return CommandReaderTest.this.blockingStream.take(); } catch ( InterruptedException e ) { throw new IOException( e ); } } } private void addTestToPipeline( String cls ) throws UnsupportedEncodingException { byte[] clazz = cls.getBytes( ISO_8859_1 ); ByteBuffer buffer = ByteBuffer.allocate( 8 + clazz.length ) .putInt( MasterProcessCommand.RUN_CLASS.getId() ) .putInt( clazz.length ) .put( clazz ); buffer.rewind(); for ( ; buffer.hasRemaining(); ) { blockingStream.add( buffer.get() ); } } private void addEndOfPipeline() throws UnsupportedEncodingException { ByteBuffer buffer = ByteBuffer.allocate( 8 ) .putInt( MasterProcessCommand.TEST_SET_FINISHED.getId() ) .putInt( 0 ); buffer.rewind(); for ( ; buffer.hasRemaining(); ) { blockingStream.add( buffer.get() ); } } private static PrintStream nul() { return new PrintStream( new ByteArrayOutputStream() ); } } Foo.java000066400000000000000000000063151330756104600337270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.util.Map; import org.apache.maven.surefire.report.ReporterConfiguration; import org.apache.maven.surefire.testset.DirectoryScannerParameters; import org.apache.maven.surefire.testset.RunOrderParameters; import org.apache.maven.surefire.testset.TestArtifactInfo; import org.apache.maven.surefire.testset.TestRequest; /** * @author Kristian Rosenvold */ public class Foo implements DirectoryScannerParametersAware, TestRequestAware, ProviderPropertiesAware, ReporterConfigurationAware, SurefireClassLoadersAware, TestArtifactInfoAware, RunOrderParametersAware { DirectoryScannerParameters directoryScannerParameters; Map providerProperties; ReporterConfiguration reporterConfiguration; ClassLoader surefireClassLoader; ClassLoader testClassLoader; TestRequest testRequest; TestArtifactInfo testArtifactInfo; RunOrderParameters runOrderParameters; boolean called = false; @Override public void setDirectoryScannerParameters( DirectoryScannerParameters directoryScanner ) { this.directoryScannerParameters = directoryScanner; this.called = true; } /** * @return true if it has been called */ public Boolean isCalled() { return called; } @Override public void setProviderProperties( Map providerProperties ) { this.providerProperties = providerProperties; this.called = true; } @Override public void setReporterConfiguration( ReporterConfiguration reporterConfiguration ) { this.reporterConfiguration = reporterConfiguration; this.called = true; } @Override public void setClassLoaders( ClassLoader testClassLoader ) { this.testClassLoader = testClassLoader; this.surefireClassLoader = surefireClassLoader; this.called = true; } @Override public void setTestRequest( TestRequest testRequest1 ) { this.testRequest = testRequest1; this.called = true; } @Override public void setTestArtifactInfo( TestArtifactInfo testArtifactInfo ) { this.testArtifactInfo = testArtifactInfo; this.called = true; } @Override public void setRunOrderParameters( RunOrderParameters runOrderParameters ) { this.runOrderParameters = runOrderParameters; this.called = true; } } JUnit4SuiteTest.java000066400000000000000000000027251330756104600361740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import junit.framework.JUnit4TestAdapter; import junit.framework.Test; import org.junit.runner.RunWith; import org.junit.runners.Suite; /** * Adapt the JUnit4 tests which use only annotations to the JUnit3 test suite. * * @author Tibor Digana (tibor17) * @since 2.19 */ @Suite.SuiteClasses( { ClasspathTest.class, CommandReaderTest.class, PropertiesWrapperTest.class, SurefireReflectorTest.class, PpidCheckerTest.class, SystemUtilsTest.class } ) @RunWith( Suite.class ) public class JUnit4SuiteTest { public static Test suite() { return new JUnit4TestAdapter( JUnit4SuiteTest.class ); } } NewClassLoaderRunner.java000066400000000000000000000206241330756104600372430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.internal.runners.model.ReflectiveCallable; import org.junit.internal.runners.statements.ExpectException; import org.junit.internal.runners.statements.Fail; import org.junit.internal.runners.statements.RunAfters; import org.junit.internal.runners.statements.RunBefores; import org.junit.runner.notification.RunNotifier; import org.junit.runners.BlockJUnit4ClassRunner; import org.junit.runners.model.FrameworkMethod; import org.junit.runners.model.InitializationError; import org.junit.runners.model.Statement; import org.junit.runners.model.TestClass; import java.io.File; import java.io.IOException; import java.lang.annotation.Annotation; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.util.Collection; import java.util.HashSet; import java.util.List; import static java.io.File.pathSeparator; import static org.apache.commons.io.FileUtils.readFileToString; /** * JUnit runner testing methods in a separate class loader. * * @author Tibor Digana (tibor17) * @since 2.19 */ public class NewClassLoaderRunner extends BlockJUnit4ClassRunner { private Class cls; public NewClassLoaderRunner( Class clazz ) throws InitializationError { super( clazz ); } @Override protected void runChild( FrameworkMethod method, RunNotifier notifier ) { ClassLoader backup = Thread.currentThread().getContextClassLoader(); try { TestClassLoader loader = new TestClassLoader(); Thread.currentThread().setContextClassLoader( loader ); cls = getFromTestClassLoader( getTestClass().getName(), loader ); method = new FrameworkMethod( cls.getMethod( method.getName() ) ); super.runChild( method, notifier ); } catch ( NoSuchMethodException e ) { throw new IllegalStateException( e ); } finally { Thread.currentThread().setContextClassLoader( backup ); } } @Override protected Statement methodBlock( FrameworkMethod method ) { try { Object test = new ReflectiveCallable() { @Override protected Object runReflectiveCall() throws Throwable { return createTest(); } }.run(); Statement statement = methodInvoker( method, test ); statement = possiblyExpectingExceptions( method, test, statement ); statement = withBefores( method, test, statement ); statement = withAfters( method, test, statement ); return statement; } catch ( Throwable e ) { return new Fail( e ); } } @Override @SuppressWarnings( "unchecked" ) protected Statement possiblyExpectingExceptions( FrameworkMethod method, Object test, Statement next ) { try { Class t = (Class) Thread.currentThread().getContextClassLoader().loadClass( Test.class.getName() ); Annotation annotation = method.getAnnotation( t ); Class exp = (Class) t.getMethod( "expected" ).invoke( annotation ); boolean isException = exp != null && !Test.None.class.getName().equals( exp.getName() ); return isException ? new ExpectException( next, exp ) : next; } catch ( Exception e ) { throw new IllegalStateException( e ); } } @Override @SuppressWarnings( "unchecked" ) protected Statement withBefores( FrameworkMethod method, Object target, Statement statement ) { try { Class before = (Class) Thread.currentThread().getContextClassLoader().loadClass( Before.class.getName() ); List befores = new TestClass( target.getClass() ).getAnnotatedMethods( before ); return befores.isEmpty() ? statement : new RunBefores( statement, befores, target ); } catch ( ClassNotFoundException e ) { throw new IllegalStateException( e ); } } @Override @SuppressWarnings( "unchecked" ) protected Statement withAfters( FrameworkMethod method, Object target, Statement statement ) { try { Class after = (Class) Thread.currentThread().getContextClassLoader().loadClass( After.class.getName() ); List afters = new TestClass( target.getClass() ).getAnnotatedMethods( after ); return afters.isEmpty() ? statement : new RunAfters( statement, afters, target ); } catch ( ClassNotFoundException e ) { throw new IllegalStateException( e ); } } @Override protected Object createTest() throws Exception { return cls == null ? super.createTest() : cls.getConstructor().newInstance(); } private static Class getFromTestClassLoader( String clazz, TestClassLoader loader ) { try { return Class.forName( clazz, true, loader ); } catch ( ClassNotFoundException e ) { throw new IllegalStateException( e ); } } public static class TestClassLoader extends URLClassLoader { public TestClassLoader() { super( toClassPath(), null ); } /** * Compliant with Java 9 or prior version of JRE. * * @return classpath */ private static URL[] toClassPath() { try { Collection cp = toPathList(); // if Maven run if ( cp.isEmpty() ) { // if IDE cp = toPathList( System.getProperty( "java.class.path" ) ); } return cp.toArray( new URL[cp.size()] ); } catch ( IOException e ) { return new URL[0]; } } private static Collection toPathList( String path ) throws MalformedURLException { Collection classPath = new HashSet(); for ( String file : path.split( pathSeparator ) ) { classPath.add( new File( file ).toURL() ); } return classPath; } private static Collection toPathList() { Collection classPath = new HashSet(); try { String[] files = readFileToString( new File( "target/test-classpath/cp.txt" ) ).split( pathSeparator ); for ( String file : files ) { File f = new File( file ); File dir = f.getParentFile(); classPath.add( ( dir.getName().equals( "target" ) ? new File( dir, "classes" ) : f ).toURL() ); } classPath.add( new File( "target/classes" ).toURL() ); classPath.add( new File( "target/test-classes" ).toURL() ); } catch ( IOException e ) { // turn to java.class.path classPath.clear(); } return classPath; } } } PpidCheckerTest.java000066400000000000000000000151711330756104600362250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.io.File; import java.lang.management.ManagementFactory; import java.util.regex.Matcher; import static org.apache.commons.lang3.SystemUtils.IS_OS_UNIX; import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS; import static org.fest.assertions.Assertions.assertThat; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.fail; import static org.junit.Assume.assumeThat; import static org.junit.Assume.assumeTrue; import static org.powermock.reflect.Whitebox.invokeMethod; /** * Testing {@link PpidChecker} on a platform. * * @author Tibor Digana (tibor17) * @since 2.20.1 */ public class PpidCheckerTest { @Rule public final ExpectedException exceptions = ExpectedException.none(); @Test public void shouldHavePpidAsWindows() { assumeTrue( IS_OS_WINDOWS ); long expectedPid = Long.parseLong( ManagementFactory.getRuntimeMXBean().getName().split( "@" )[0].trim() ); PpidChecker checker = new PpidChecker( expectedPid ); ProcessInfo processInfo = checker.windows(); assertThat( processInfo ) .isNotNull(); assertThat( checker.canUse() ) .isTrue(); assertThat( checker.isProcessAlive() ) .isTrue(); assertThat( processInfo.getPID() ) .isEqualTo( expectedPid ); assertThat( processInfo.getTime() ) .isNotNull(); } @Test public void shouldHavePpidAsUnix() { assumeTrue( IS_OS_UNIX ); assertThat( PpidChecker.canExecuteUnixPs() ) .as( "Surefire should be tested on real box OS, e.g. Ubuntu or FreeBSD." ) .isTrue(); long expectedPid = Long.parseLong( ManagementFactory.getRuntimeMXBean().getName().split( "@" )[0].trim() ); PpidChecker checker = new PpidChecker( expectedPid ); ProcessInfo processInfo = checker.unix(); assertThat( processInfo ) .isNotNull(); assertThat( checker.canUse() ) .isTrue(); assertThat( checker.isProcessAlive() ) .isTrue(); assertThat( processInfo.getPID() ) .isEqualTo( expectedPid ); assertThat( processInfo.getTime() ) .isNotNull(); } @Test public void shouldNotFindSuchPID() { long ppid = 1000000L; PpidChecker checker = new PpidChecker( ppid ); assertThat( checker.canUse() ) .isTrue(); exceptions.expect( IllegalStateException.class ); exceptions.expectMessage( "Cannot use PPID " + ppid + " process information. Going to use NOOP events." ); checker.isProcessAlive(); fail( "this test should throw exception" ); } @Test public void shouldParseEtime() { Matcher m = PpidChecker.UNIX_CMD_OUT_PATTERN.matcher( "38" ); assertThat( m.matches() ) .isFalse(); m = PpidChecker.UNIX_CMD_OUT_PATTERN.matcher( "05:38" ); assertThat( m.matches() ) .isTrue(); assertThat( PpidChecker.fromDays( m ) ).isEqualTo( 0L ); assertThat( PpidChecker.fromHours( m ) ).isEqualTo( 0L ); assertThat( PpidChecker.fromMinutes( m ) ).isEqualTo( 300L ); assertThat( PpidChecker.fromSeconds( m ) ).isEqualTo( 38L ); m = PpidChecker.UNIX_CMD_OUT_PATTERN.matcher( "00:05:38" ); assertThat( m.matches() ) .isTrue(); assertThat( PpidChecker.fromDays( m ) ).isEqualTo( 0L ); assertThat( PpidChecker.fromHours( m ) ).isEqualTo( 0L ); assertThat( PpidChecker.fromMinutes( m ) ).isEqualTo( 300L ); assertThat( PpidChecker.fromSeconds( m ) ).isEqualTo( 38L ); m = PpidChecker.UNIX_CMD_OUT_PATTERN.matcher( "01:05:38" ); assertThat( m.matches() ) .isTrue(); assertThat( PpidChecker.fromDays( m ) ).isEqualTo( 0L ); assertThat( PpidChecker.fromHours( m ) ).isEqualTo( 3600L ); assertThat( PpidChecker.fromMinutes( m ) ).isEqualTo( 300L ); assertThat( PpidChecker.fromSeconds( m ) ).isEqualTo( 38L ); m = PpidChecker.UNIX_CMD_OUT_PATTERN.matcher( "02-01:05:38" ); assertThat( m.matches() ) .isTrue(); assertThat( PpidChecker.fromDays( m ) ).isEqualTo( 2 * 24 * 3600L ); assertThat( PpidChecker.fromHours( m ) ).isEqualTo( 3600L ); assertThat( PpidChecker.fromMinutes( m ) ).isEqualTo( 300L ); assertThat( PpidChecker.fromSeconds( m ) ).isEqualTo( 38L ); m = PpidChecker.UNIX_CMD_OUT_PATTERN.matcher( "02-1:5:3" ); assertThat( m.matches() ) .isTrue(); assertThat( PpidChecker.fromDays( m ) ).isEqualTo( 2 * 24 * 3600L ); assertThat( PpidChecker.fromHours( m ) ).isEqualTo( 3600L ); assertThat( PpidChecker.fromMinutes( m ) ).isEqualTo( 300L ); assertThat( PpidChecker.fromSeconds( m ) ).isEqualTo( 3L ); } @Test public void shouldHaveSystemPathToWmicOnWindows() throws Exception { assumeTrue( IS_OS_WINDOWS ); assumeThat( System.getenv( "SystemRoot" ), is( notNullValue() ) ); assumeThat( System.getenv( "SystemRoot" ), is( not( "" ) ) ); assumeTrue( new File( System.getenv( "SystemRoot" ), "System32\\Wbem" ).isDirectory() ); assumeTrue( new File( System.getenv( "SystemRoot" ), "System32\\Wbem\\wmic.exe" ).isFile() ); assertThat( (Boolean) invokeMethod( PpidChecker.class, "hasWmicStandardSystemPath" ) ).isTrue(); assertThat( new File( System.getenv( "SystemRoot" ), "System32\\Wbem\\wmic.exe" ) ).isFile(); } } PropertiesWrapperTest.java000066400000000000000000000070731330756104600375430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.util.*; import junit.framework.TestCase; /** * @author Kristian Rosenvold */ public class PropertiesWrapperTest extends TestCase { public void testAddList() throws Exception { PropertiesWrapper propertiesWrapper = new PropertiesWrapper( new HashMap() ); List items = new ArrayList(); items.add( "String1" ); items.add( "String2,String3" ); items.add( "String4" ); items.add( "String5," ); propertiesWrapper.addList( items, "Test" ); final List test = propertiesWrapper.getStringList( "Test" ); assertEquals( 5, test.size() ); assertEquals( "String5", test.get( 4 ) ); assertEquals( "String3", test.get( 2 ) ); assertEquals( "String2", test.get( 1 ) ); } private static final String DUMMY_PREFIX = "dummyPrefix"; private static final String FIRST_ELEMENT = "foo0"; private static final String SECOND_ELEMENT = "foo1"; private final Map properties = new HashMap(); private final PropertiesWrapper mapper = new PropertiesWrapper( properties ); private final Classpath classpathWithTwoElements = createClasspathWithTwoElements(); public void testReadFromProperties() throws Exception { properties.put( DUMMY_PREFIX + "0", FIRST_ELEMENT ); properties.put( DUMMY_PREFIX + "1", SECOND_ELEMENT ); Classpath recreatedClasspath = readClasspathFromProperties(); assertEquals( classpathWithTwoElements, recreatedClasspath ); } public void testReadFromPropertiesWithEmptyProperties() throws Exception { Classpath recreatedClasspath = readClasspathFromProperties(); assertTrue( recreatedClasspath.getClassPath().isEmpty() ); } public void testWriteToProperties() throws Exception { mapper.setClasspath( DUMMY_PREFIX, classpathWithTwoElements ); assertEquals( FIRST_ELEMENT, mapper.getProperty( DUMMY_PREFIX + "0" ) ); assertEquals( SECOND_ELEMENT, mapper.getProperty( DUMMY_PREFIX + "1" ) ); } public void testRoundtrip() throws Exception { mapper.setClasspath( DUMMY_PREFIX, classpathWithTwoElements ); Classpath recreatedClasspath = readClasspathFromProperties(); assertEquals( classpathWithTwoElements, recreatedClasspath ); } private Classpath createClasspathWithTwoElements() { return Classpath.emptyClasspath() .addClassPathElementUrl( FIRST_ELEMENT ) .addClassPathElementUrl( SECOND_ELEMENT ); } private Classpath readClasspathFromProperties() { return mapper.getClasspath( DUMMY_PREFIX ); } } SurefireReflectorTest.java000066400000000000000000000124611330756104600374750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import java.io.File; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import org.apache.maven.surefire.report.ReporterConfiguration; import org.apache.maven.surefire.testset.DirectoryScannerParameters; import org.apache.maven.surefire.testset.RunOrderParameters; import org.apache.maven.surefire.testset.TestArtifactInfo; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.testset.TestRequest; import org.apache.maven.surefire.util.RunOrder; import junit.framework.TestCase; /** * @author Kristian Rosenvold */ public class SurefireReflectorTest extends TestCase { public void testSetDirectoryScannerParameters() throws Exception { SurefireReflector surefireReflector = getReflector(); Object foo = getFoo(); DirectoryScannerParameters directoryScannerParameters = new DirectoryScannerParameters( new File( "ABC" ), new ArrayList(), new ArrayList(), new ArrayList(), false, "hourly" ); surefireReflector.setDirectoryScannerParameters( foo, directoryScannerParameters ); assertTrue( isCalled( foo ) ); } public void testRunOrderParameters() throws Exception { SurefireReflector surefireReflector = getReflector(); Object foo = getFoo(); RunOrderParameters runOrderParameters = new RunOrderParameters( RunOrder.DEFAULT, new File( "." ) ); surefireReflector.setRunOrderParameters( foo, runOrderParameters ); assertTrue( isCalled( foo ) ); } public void testTestSuiteDefinition() throws Exception { SurefireReflector surefireReflector = getReflector(); Object foo = getFoo(); TestRequest testSuiteDefinition = new TestRequest( Arrays.asList( new File( "file1" ), new File( "file2" ) ), new File( "TestSOurce" ), new TestListResolver( "aUserRequestedTest#aMethodRequested" ) ); surefireReflector.setTestSuiteDefinition( foo, testSuiteDefinition ); assertTrue( isCalled( foo ) ); } public void testProviderProperties() throws Exception { SurefireReflector surefireReflector = getReflector(); Object foo = getFoo(); surefireReflector.setProviderProperties( foo, new HashMap() ); assertTrue( isCalled( foo ) ); } public void testReporterConfiguration() throws Exception { SurefireReflector surefireReflector = getReflector(); Object foo = getFoo(); ReporterConfiguration reporterConfiguration = getReporterConfiguration(); surefireReflector.setReporterConfigurationAware( foo, reporterConfiguration ); assertTrue( isCalled( foo ) ); } private ReporterConfiguration getReporterConfiguration() { return new ReporterConfiguration( new File( "CDE" ), true ); } public void testTestClassLoaderAware() throws Exception { SurefireReflector surefireReflector = getReflector(); Object foo = getFoo(); surefireReflector.setTestClassLoader( foo, getClass().getClassLoader() ); assertTrue( isCalled( foo ) ); } public void testArtifactInfoAware() throws Exception { SurefireReflector surefireReflector = getReflector(); Object foo = getFoo(); TestArtifactInfo testArtifactInfo = new TestArtifactInfo( "12.3", "test" ); surefireReflector.setTestArtifactInfo( foo, testArtifactInfo ); assertTrue( isCalled( foo ) ); } private SurefireReflector getReflector() { return new SurefireReflector( this.getClass().getClassLoader() ); } public Object getFoo() { // Todo: Setup a different classloader so we can really test crossing return new Foo(); } private Boolean isCalled( Object foo ) { final Method isCalled; try { isCalled = foo.getClass().getMethod( "isCalled" ); return (Boolean) isCalled.invoke( foo ); } catch ( IllegalAccessException e ) { throw new RuntimeException( e ); } catch ( InvocationTargetException e ) { throw new RuntimeException( e ); } catch ( NoSuchMethodException e ) { throw new RuntimeException( e ); } } } SystemUtilsTest.java000066400000000000000000000320541330756104600363500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/java/org/apache/maven/surefire/booterpackage org.apache.maven.surefire.booter; /* * 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. */ import org.junit.Test; import org.junit.experimental.runners.Enclosed; import org.junit.runner.RunWith; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import java.io.File; import java.io.IOException; import java.lang.management.ManagementFactory; import java.math.BigDecimal; import static java.io.File.separator; import static org.apache.commons.lang3.JavaVersion.JAVA_9; import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT; import static org.apache.commons.lang3.SystemUtils.IS_OS_FREE_BSD; import static org.apache.commons.lang3.SystemUtils.IS_OS_LINUX; import static org.apache.commons.lang3.SystemUtils.IS_OS_NET_BSD; import static org.apache.commons.lang3.SystemUtils.IS_OS_OPEN_BSD; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assume.assumeTrue; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.times; import static org.mockito.Mockito.when; import static org.powermock.api.mockito.PowerMockito.mockStatic; import static org.powermock.api.mockito.PowerMockito.verifyStatic; import static org.powermock.reflect.Whitebox.invokeMethod; /** * Test of {@link SystemUtils}. * * @author Tibor Digana (tibor17) * @since 2.20.1 */ @RunWith( Enclosed.class ) public class SystemUtilsTest { public static class PlainUnitTests { @Test public void shouldMatchJavaSpecVersion() throws Exception { BigDecimal actual = invokeMethod( SystemUtils.class, "getJavaSpecificationVersion" ); BigDecimal expected = new BigDecimal( System.getProperty( "java.specification.version" ) ).stripTrailingZeros(); assertThat( actual ).isEqualTo( expected ); assertThat( SystemUtils.JAVA_SPECIFICATION_VERSION ).isEqualTo( expected ); } @Test public void shouldParseProprietaryReleaseFile() throws IOException { String classes = new File( "." ).getCanonicalPath() + separator + "target" + separator + "test-classes"; File path = new File( classes, "jdk8-IBM" + separator + "bin" + separator + "java" ); assertThat( SystemUtils.isJava9AtLeast( path.getAbsolutePath() ) ).isFalse(); path = new File( classes, "jdk8-oracle" + separator + "bin" + separator + "java" ); assertThat( SystemUtils.isJava9AtLeast( path.getAbsolutePath() ) ).isFalse(); path = new File( classes, "jdk9-oracle" + separator + "bin" + separator + "java" ); assertThat( SystemUtils.isJava9AtLeast( path.getAbsolutePath() ) ).isTrue(); } @Test public void incorrectJdkPath() { File jre = new File( System.getProperty( "java.home" ) ); File jdk = jre.getParentFile(); File incorrect = jdk.getParentFile(); assertThat( SystemUtils.isJava9AtLeast( incorrect.getAbsolutePath() ) ).isFalse(); } @Test public void shouldHaveJavaPath() { String javaPath = System.getProperty( "java.home" ) + separator + "bin" + separator + "java"; assertThat( SystemUtils.endsWithJavaPath( javaPath ) ).isTrue(); } @Test public void shouldNotHaveJavaPath() { assertThat( SystemUtils.endsWithJavaPath( "/jdk" ) ).isFalse(); } @Test public void shouldNotExtractJdkHomeFromJavaExec() { File pathToJdk = SystemUtils.toJdkHomeFromJvmExec( "/jdk/binx/java" ); assertThat( pathToJdk ).isNull(); } @Test public void shouldExtractJdkHomeFromJavaExec() { File pathToJdk = SystemUtils.toJdkHomeFromJvmExec( "/jdk/bin/java" ); assertThat( pathToJdk ).isEqualTo( new File( "/jdk" ).getAbsoluteFile() ); } @Test public void shouldNotExtractJdkHomeFromJreExec() throws IOException { String classes = new File( "." ).getCanonicalPath() + separator + "target" + separator + "test-classes"; File jdk = new File( classes, "jdk" ); String pathToJreExec = jdk.getAbsolutePath() + separator + "jre" + separator + "binx" + separator + "java"; File pathToJdk = SystemUtils.toJdkHomeFromJvmExec( pathToJreExec ); assertThat( pathToJdk ).isNull(); } @Test public void shouldExtractJdkHomeFromJreExec() throws IOException { String classes = new File( "." ).getCanonicalPath() + separator + "target" + separator + "test-classes"; File jdk = new File( classes, "jdk" ); String pathToJreExec = jdk.getAbsolutePath() + separator + "jre" + separator + "bin" + separator + "java"; File pathToJdk = SystemUtils.toJdkHomeFromJvmExec( pathToJreExec ); assertThat( pathToJdk ).isEqualTo( jdk ); } @Test public void shouldExtractJdkHomeFromJre() { File pathToJdk = SystemUtils.toJdkHomeFromJre( "/jdk/jre" ); assertThat( pathToJdk ).isEqualTo( new File( "/jdk" ).getAbsoluteFile() ); } @Test public void shouldExtractJdkHomeFromJdk() { File pathToJdk = SystemUtils.toJdkHomeFromJre( "/jdk/" ); assertThat( pathToJdk ).isEqualTo( new File( "/jdk" ).getAbsoluteFile() ); } @Test public void shouldExtractJdkHomeFromRealPath() { File pathToJdk = SystemUtils.toJdkHomeFromJre(); if ( JAVA_RECENT.atLeast( JAVA_9 ) ) { File realJdkHome = new File( System.getProperty( "java.home" ) ).getAbsoluteFile(); assertThat( realJdkHome ).isDirectory(); assertThat( realJdkHome.getName() ).isNotEqualTo( "jre" ); assertThat( pathToJdk ).isEqualTo( realJdkHome ); } else { File realJreHome = new File( System.getProperty( "java.home" ) ).getAbsoluteFile(); assertThat( realJreHome ).isDirectory(); assertThat( realJreHome.getName() ).isEqualTo( "jre" ); File realJdkHome = realJreHome.getParentFile(); assertThat( pathToJdk ).isEqualTo( realJdkHome ); } } @Test public void shouldBeJavaVersion() { assertThat( SystemUtils.isJava9AtLeast( (BigDecimal ) null ) ).isFalse(); assertThat( SystemUtils.isJava9AtLeast( new BigDecimal( "1.8" ) ) ).isFalse(); assertThat( SystemUtils.isJava9AtLeast( new BigDecimal( 9 ) ) ).isTrue(); } @Test public void shouldBePlatformClassLoader() { ClassLoader cl = SystemUtils.platformClassLoader(); if ( JAVA_RECENT.atLeast( JAVA_9 ) ) { assertThat( cl ).isNotNull(); } else { assertThat( cl ).isNull(); } } @Test public void shouldNotFindClassLoader() { ClassLoader cl = SystemUtils.reflectClassLoader( getClass(), "_getPlatformClassLoader_" ); assertThat( cl ).isNull(); } @Test public void shouldFindClassLoader() { ClassLoader cl = SystemUtils.reflectClassLoader( getClass(), "getPlatformClassLoader" ); assertThat( cl ).isSameAs( ClassLoader.getSystemClassLoader() ); } @Test public void shouldBePidOnJigsaw() { assumeTrue( JAVA_RECENT.atLeast( JAVA_9 ) ); Long actualPid = SystemUtils.pidOnJava9(); String expectedPid = ManagementFactory.getRuntimeMXBean().getName().split( "@" )[0].trim(); assertThat( actualPid + "" ) .isEqualTo( expectedPid ); } @Test public void shouldBePidStatusOnLinux() throws Exception { assumeTrue( IS_OS_LINUX ); Long actualPid = SystemUtils.pidStatusOnLinux(); String expectedPid = ManagementFactory.getRuntimeMXBean().getName().split( "@" )[0].trim(); assertThat( actualPid + "" ) .isEqualTo( expectedPid ); } @Test public void shouldBeMockPidStatusOnLinux() throws Exception { String root = new File( System.getProperty( "user.dir" ), "target/test-classes" ).getAbsolutePath(); Long actualPid = SystemUtils.pidStatusOnLinux( root ); assertThat( actualPid ) .isEqualTo( 48982L ); } @Test public void shouldBePidStatusOnBSD() throws Exception { assumeTrue( IS_OS_FREE_BSD || IS_OS_NET_BSD || IS_OS_OPEN_BSD ); Long actualPid = SystemUtils.pidStatusOnBSD(); String expectedPid = ManagementFactory.getRuntimeMXBean().getName().split( "@" )[0].trim(); assertThat( actualPid + "" ) .isEqualTo( expectedPid ); } @Test public void shouldBeMockPidStatusOnBSD() throws Exception { String root = new File( System.getProperty( "user.dir" ), "target/test-classes" ).getAbsolutePath(); Long actualPid = SystemUtils.pidStatusOnBSD( root ); assertThat( actualPid ) .isEqualTo( 60424L ); } @Test public void shouldBePidOnJMX() { Long actualPid = SystemUtils.pidOnJMX(); String expectedPid = ManagementFactory.getRuntimeMXBean().getName().split( "@" )[0].trim(); assertThat( actualPid + "" ) .isEqualTo( expectedPid ); } @Test public void shouldBePid() { Long actualPid = SystemUtils.pid(); String expectedPid = ManagementFactory.getRuntimeMXBean().getName().split( "@" )[0].trim(); assertThat( actualPid + "" ) .isEqualTo( expectedPid ); } @SuppressWarnings( "unused" ) public static ClassLoader getPlatformClassLoader() { return ClassLoader.getSystemClassLoader(); } } @RunWith( PowerMockRunner.class ) @PrepareForTest( SystemUtils.class ) public static class MockTest { @Test public void shouldBeDifferentJdk9() { testIsJava9AtLeast( new File( System.getProperty( "java.home" ) ) ); } @Test public void shouldBeSameJdk9() { // PowerMockJUnit44RunnerDelegateImpl does not work with Assumptions: assumeFalse if ( !JAVA_RECENT.atLeast( JAVA_9 ) ) { testIsJava9AtLeast( new File( System.getProperty( "java.home" ) ).getParentFile() ); } } private static void testIsJava9AtLeast( File pathInJdk ) { File path = new File( pathInJdk, "bin" + separator + "java" ); mockStatic( SystemUtils.class ); when( SystemUtils.isJava9AtLeast( anyString() ) ) .thenCallRealMethod(); when( SystemUtils.toJdkHomeFromJvmExec( anyString() ) ) .thenCallRealMethod(); when( SystemUtils.toJdkHomeFromJre() ) .thenCallRealMethod(); when( SystemUtils.toJdkHomeFromJre( anyString() ) ) .thenCallRealMethod(); when( SystemUtils.isBuiltInJava9AtLeast() ) .thenCallRealMethod(); when( SystemUtils.toJdkVersionFromReleaseFile( any( File.class ) ) ) .thenCallRealMethod(); when( SystemUtils.isJava9AtLeast( any( BigDecimal.class ) ) ) .thenCallRealMethod(); if ( JAVA_RECENT.atLeast( JAVA_9 ) ) { assertThat( SystemUtils.isJava9AtLeast( path.getAbsolutePath() ) ).isTrue(); } else { assertThat( SystemUtils.isJava9AtLeast( path.getAbsolutePath() ) ).isFalse(); } verifyStatic( SystemUtils.class, times( 0 ) ); SystemUtils.toJdkVersionFromReleaseFile( any( File.class ) ); verifyStatic( SystemUtils.class, times( 1 ) ); SystemUtils.isBuiltInJava9AtLeast(); } } } maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/000077500000000000000000000000001330756104600252505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/jdk/000077500000000000000000000000001330756104600260205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/jdk/bin/000077500000000000000000000000001330756104600265705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/jdk/bin/java000066400000000000000000000000001330756104600274220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/jdk/jre/000077500000000000000000000000001330756104600266005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/jdk/jre/bin/000077500000000000000000000000001330756104600273505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/jdk/jre/bin/java000066400000000000000000000000001330756104600302020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/jdk8-IBM/000077500000000000000000000000001330756104600265155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/jdk8-IBM/release000066400000000000000000000000251330756104600300550ustar00rootroot00000000000000JAVA_VERSION="1.8.0" maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/jdk8-oracle/000077500000000000000000000000001330756104600273535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/jdk8-oracle/release000066400000000000000000000000311330756104600307100ustar00rootroot00000000000000JAVA_VERSION="1.8.0_141" maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/jdk9-oracle/000077500000000000000000000000001330756104600273545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/jdk9-oracle/release000066400000000000000000000000211330756104600307100ustar00rootroot00000000000000JAVA_VERSION="9" maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/proc/000077500000000000000000000000001330756104600262135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/proc/curproc/000077500000000000000000000000001330756104600276705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/proc/curproc/status000066400000000000000000000001301330756104600311300ustar00rootroot00000000000000cat 60424 60386 60424 60386 5,0 ctty 972854153,236415 0,0 0,1043 nochan 0 0 0,0 prisonermaven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/proc/self/000077500000000000000000000000001330756104600271445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-booter/src/test/resources/proc/self/stat000066400000000000000000000003201330756104600300350ustar00rootroot0000000000000048982 (cat) R 9744 48982 9744 34818 48982 8192 185 0 0 0 0 0 0 0 20 0 1 0 137436614 103354368 134 18446744073709551615 4194304 4235780 140737488346592 140737488343784 252896458544 0 0 0 0 0 0 0 17 2 0 0 0 0 0maven-surefire-surefire-2.22.0/surefire-grouper/000077500000000000000000000000001330756104600216615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/pom.xml000066400000000000000000000051121330756104600231750ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire 2.22.0 surefire-grouper Maven Surefire Test-Grouping Support Maven Surefire Test-Grouping Support 2.2.1 org.codehaus.mojo javacc-maven-plugin 2.6 javacc javacc maven-surefire-plugin org.apache.maven.surefire surefire-shadefire 2.12.4 maven-jar-plugin org.apache.maven.surefire.group.parse.GroupMatcherParser maven-surefire-surefire-2.22.0/surefire-grouper/src/000077500000000000000000000000001330756104600224505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/000077500000000000000000000000001330756104600233745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/java/000077500000000000000000000000001330756104600243155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/java/org/000077500000000000000000000000001330756104600251045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/java/org/apache/000077500000000000000000000000001330756104600263255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600274335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/java/org/apache/maven/surefire/000077500000000000000000000000001330756104600312575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/java/org/apache/maven/surefire/group/000077500000000000000000000000001330756104600324135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/java/org/apache/maven/surefire/group/match/000077500000000000000000000000001330756104600335075ustar00rootroot00000000000000AndGroupMatcher.java000066400000000000000000000056531330756104600373270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/java/org/apache/maven/surefire/group/matchpackage org.apache.maven.surefire.group.match; /* * 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. */ import java.util.Collection; /** * AND group matcher * */ public class AndGroupMatcher extends JoinGroupMatcher { public AndGroupMatcher( GroupMatcher... matchers ) { for ( GroupMatcher matcher : matchers ) { addMatcher( matcher ); } } public AndGroupMatcher( Collection matchers ) { for ( GroupMatcher matcher : matchers ) { addMatcher( matcher ); } } @Override public boolean enabled( Class... cats ) { for ( GroupMatcher matcher : getMatchers() ) { boolean result = matcher.enabled( cats ); if ( !result ) { return false; } } return true; } @Override public boolean enabled( String... cats ) { for ( GroupMatcher matcher : getMatchers() ) { boolean result = matcher.enabled( cats ); if ( !result ) { return false; } } return true; } @Override public String toString() { StringBuilder sb = new StringBuilder(); for ( GroupMatcher matcher : getMatchers() ) { if ( sb.length() > 0 ) { sb.append( " AND " ); } sb.append( matcher ); } return sb.toString(); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result; for ( GroupMatcher matcher : getMatchers() ) { result += matcher.hashCode(); } return result; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } AndGroupMatcher other = (AndGroupMatcher) obj; return getMatchers().equals( other.getMatchers() ); } } GroupMatcher.java000066400000000000000000000020371330756104600366750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/java/org/apache/maven/surefire/group/matchpackage org.apache.maven.surefire.group.match; /* * 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. */ /** * Group Matcher * */ public interface GroupMatcher { void loadGroupClasses( ClassLoader cloader ); boolean enabled( Class... cats ); boolean enabled( String... cats ); } InverseGroupMatcher.java000066400000000000000000000045001330756104600402260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/java/org/apache/maven/surefire/group/matchpackage org.apache.maven.surefire.group.match; /* * 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. */ /** * Inverse group matcher * */ public class InverseGroupMatcher implements GroupMatcher { private final GroupMatcher matcher; public InverseGroupMatcher( GroupMatcher matcher ) { this.matcher = matcher; } @Override public boolean enabled( Class... cats ) { return cats == null || !matcher.enabled( cats ); } @Override public boolean enabled( String... cats ) { return cats == null || !matcher.enabled( cats ); } @Override public String toString() { return "NOT " + matcher; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ( matcher == null ? 0 : matcher.hashCode() ); return result; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || getClass() != obj.getClass() ) { return false; } InverseGroupMatcher other = (InverseGroupMatcher) obj; if ( matcher == null ) { if ( other.matcher != null ) { return false; } } else if ( !matcher.equals( other.matcher ) ) { return false; } return true; } @Override public void loadGroupClasses( ClassLoader cloader ) { matcher.loadGroupClasses( cloader ); } } JoinGroupMatcher.java000066400000000000000000000027211330756104600375150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/java/org/apache/maven/surefire/group/matchpackage org.apache.maven.surefire.group.match; /* * 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. */ import java.util.HashSet; import java.util.Set; /** * Joins several group matchers * */ public abstract class JoinGroupMatcher implements GroupMatcher { Set matchers = new HashSet(); public final boolean addMatcher( GroupMatcher matcher ) { return matchers.add( matcher ); } protected final Set getMatchers() { return matchers; } @Override public void loadGroupClasses( ClassLoader cloader ) { for ( GroupMatcher matcher : matchers ) { matcher.loadGroupClasses( cloader ); } } } OrGroupMatcher.java000066400000000000000000000056431330756104600372040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/java/org/apache/maven/surefire/group/matchpackage org.apache.maven.surefire.group.match; /* * 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. */ import java.util.Collection; /** * OR group matcher * */ public class OrGroupMatcher extends JoinGroupMatcher { public OrGroupMatcher( GroupMatcher... matchers ) { for ( GroupMatcher matcher : matchers ) { addMatcher( matcher ); } } public OrGroupMatcher( Collection matchers ) { for ( GroupMatcher matcher : matchers ) { addMatcher( matcher ); } } @Override public boolean enabled( Class... cats ) { for ( GroupMatcher matcher : getMatchers() ) { boolean result = matcher.enabled( cats ); if ( result ) { return true; } } return false; } @Override public boolean enabled( String... cats ) { for ( GroupMatcher matcher : getMatchers() ) { boolean result = matcher.enabled( cats ); if ( result ) { return true; } } return false; } @Override public String toString() { StringBuilder sb = new StringBuilder(); for ( GroupMatcher matcher : getMatchers() ) { if ( sb.length() > 0 ) { sb.append( " OR " ); } sb.append( matcher ); } return sb.toString(); } @Override public int hashCode() { final int prime = 37; int result = 1; result = prime * result; for ( GroupMatcher matcher : getMatchers() ) { result += matcher.hashCode(); } return result; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } AndGroupMatcher other = (AndGroupMatcher) obj; return getMatchers().equals( other.getMatchers() ); } } SingleGroupMatcher.java000066400000000000000000000073551330756104600400470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/java/org/apache/maven/surefire/group/matchpackage org.apache.maven.surefire.group.match; /* * 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. */ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; /** * Single group matcher * */ public class SingleGroupMatcher implements GroupMatcher { private final String enabled; private final Pattern pattern; private Class enabledClass; public SingleGroupMatcher( String enabled ) { this.enabled = enabled.endsWith( ".class" ) ? enabled.substring( 0, enabled.length() - 6 ) : enabled; Pattern p; try { p = Pattern.compile( enabled ); } catch ( PatternSyntaxException e ) { p = null; } pattern = p; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + enabled.hashCode(); return result; } @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } SingleGroupMatcher other = (SingleGroupMatcher) obj; return enabled.equals( other.enabled ); } @Override public String toString() { return "*" + enabled; } @Override public boolean enabled( Class... cats ) { if ( cats != null ) { for ( Class cls : cats ) { if ( enabledClass != null && enabledClass.isAssignableFrom( cls ) ) { return true; } String name = cls.getName(); if ( name.endsWith( enabled ) ) { return true; } } } return false; } @Override public boolean enabled( String... cats ) { for ( String cat : cats ) { if ( cat == null || cat.trim().isEmpty() ) { continue; } if ( cat.equals( enabled ) ) { return true; } if ( pattern != null && pattern.matcher( cat ).matches() ) { return true; } } return false; } @Override public void loadGroupClasses( ClassLoader classLoader ) { try { enabledClass = classLoader.loadClass( enabled ); } catch ( ClassNotFoundException e ) { // class is not available at runtime, for instance this would happen in reactor projects // in which not all modules have the required class on the classpath/module path System.out.println( "[WARNING] Couldn't load group class '" + enabled + "' in Surefire|Failsafe plugin. " + "The group class is ignored!" ); } } } maven-surefire-surefire-2.22.0/surefire-grouper/src/main/javacc/000077500000000000000000000000001330756104600246235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/main/javacc/category-expression.jj000066400000000000000000000060611330756104600311650ustar00rootroot00000000000000options { DEBUG_PARSER = false; DEBUG_LOOKAHEAD = false; DEBUG_TOKEN_MANAGER = false; LOOKAHEAD=3; FORCE_LA_CHECK=true; STATIC = false; } PARSER_BEGIN(GroupMatcherParser) package org.apache.maven.surefire.group.parse; import org.apache.maven.surefire.group.match.*; import java.io.*; public class GroupMatcherParser { public static void main( String[] args ) throws Exception { BufferedReader reader = new BufferedReader( new InputStreamReader( System.in ) ); while( true ) { try { System.out.print( "Enter expression: " ); String expr = reader.readLine(); GroupMatcherParser parser = new GroupMatcherParser( expr ); GroupMatcher matcher = parser.parse(); System.out.println( matcher ); } catch ( ParseException e ) { e.printStackTrace(); } } } public GroupMatcherParser( String expression ) { this( (Reader)(new StringReader( expression ) ) ); } private GroupMatcher getMatcher( Op op, GroupMatcher...matchers ) { GroupMatcher matcher = null; if ( Op.AND == op ) { matcher = new AndGroupMatcher( matchers ); } else { matcher = new OrGroupMatcher( matchers ); } return matcher; } public enum Op { AND, OR; } } PARSER_END(GroupMatcherParser) SKIP : { " " | "\t" | "\r" | "\n" } TOKEN: { | | | | | | | | | | } GroupMatcher parse() : {GroupMatcher matcher = null;} { matcher=expr() { return matcher; } } GroupMatcher expr() : { GroupMatcher matcher=null; } { ( matcher=igroup() | matcher=group() ) {return matcher;} } GroupMatcher igroup() : { GroupMatcher lhs=null; GroupMatcher rhs=null; Op op=null; } { (lhs=value() (op=op() rhs=expr())?) { GroupMatcher matcher = lhs; if ( op != null ) { matcher = getMatcher( op, lhs, rhs ); } return matcher; } } GroupMatcher group() : { boolean inverted=false; GroupMatcher lhs=null; GroupMatcher rhs=null; Op op=null; } { (not() { inverted=true; } )? lhs=expr() ( op=op() rhs=expr() )? { GroupMatcher matcher = lhs; if ( op != null ) { matcher = getMatcher( op, lhs, rhs ); } return inverted ? new InverseGroupMatcher( matcher ) : matcher; } } GroupMatcher value() : { boolean inverted=false; Token val=null; } { ( not() {inverted=true;} )? val= { GroupMatcher m = new SingleGroupMatcher( val.image ); return inverted ? new InverseGroupMatcher( m ) : m; } } Op op() : {Op o=null;} { ( {o=Op.AND;} | {o=Op.OR;} | {o=Op.AND;} | {o=Op.OR;} | {o=Op.OR;} ) {return o;} } void not() : {} { | } maven-surefire-surefire-2.22.0/surefire-grouper/src/test/000077500000000000000000000000001330756104600234275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/test/java/000077500000000000000000000000001330756104600243505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/test/java/org/000077500000000000000000000000001330756104600251375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/test/java/org/apache/000077500000000000000000000000001330756104600263605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600274665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/test/java/org/apache/maven/surefire/000077500000000000000000000000001330756104600313125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/test/java/org/apache/maven/surefire/group/000077500000000000000000000000001330756104600324465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/000077500000000000000000000000001330756104600335425ustar00rootroot00000000000000AndGroupMatcherTest.java000066400000000000000000000040641330756104600402150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/test/java/org/apache/maven/surefire/group/matchpackage org.apache.maven.surefire.group.match; /* * 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. */ import junit.framework.TestCase; public class AndGroupMatcherTest extends TestCase { public void testDontMatchOneInGroup() { AndGroupMatcher matcher = new AndGroupMatcher( new SingleGroupMatcher( SingleGroupMatcher.class.getName() ), new SingleGroupMatcher( InverseGroupMatcher.class.getName() ) ); assertFalse( matcher.enabled( InverseGroupMatcher.class, AndGroupMatcher.class ) ); } public void testMatchBothInGroup() { AndGroupMatcher matcher = new AndGroupMatcher( new SingleGroupMatcher( SingleGroupMatcher.class.getName() ), new SingleGroupMatcher( InverseGroupMatcher.class.getName() ) ); assertTrue( matcher.enabled( InverseGroupMatcher.class, SingleGroupMatcher.class ) ); } public void testDontMatchAnyInGroup() { AndGroupMatcher matcher = new AndGroupMatcher( new SingleGroupMatcher( SingleGroupMatcher.class.getName() ), new SingleGroupMatcher( InverseGroupMatcher.class.getName() ) ); assertFalse( matcher.enabled( OrGroupMatcher.class, AndGroupMatcher.class ) ); } } InverseGroupMatcherTest.java000066400000000000000000000023031330756104600411200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/test/java/org/apache/maven/surefire/group/matchpackage org.apache.maven.surefire.group.match; /* * 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. */ import junit.framework.TestCase; public class InverseGroupMatcherTest extends TestCase { public void testInvertSingleMatcher() { InverseGroupMatcher matcher = new InverseGroupMatcher( new SingleGroupMatcher( InverseGroupMatcher.class.getName() ) ); assertFalse( matcher.enabled( InverseGroupMatcher.class ) ); } } OrGroupMatcherTest.java000066400000000000000000000040531330756104600400710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/test/java/org/apache/maven/surefire/group/matchpackage org.apache.maven.surefire.group.match; /* * 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. */ import junit.framework.TestCase; public class OrGroupMatcherTest extends TestCase { public void testMatchOneInOredGroup() { OrGroupMatcher matcher = new OrGroupMatcher( new SingleGroupMatcher( SingleGroupMatcher.class.getName() ), new SingleGroupMatcher( InverseGroupMatcher.class.getName() ) ); assertTrue( matcher.enabled( InverseGroupMatcher.class, AndGroupMatcher.class ) ); } public void testMatchBothInOredGroup() { OrGroupMatcher matcher = new OrGroupMatcher( new SingleGroupMatcher( SingleGroupMatcher.class.getName() ), new SingleGroupMatcher( InverseGroupMatcher.class.getName() ) ); assertTrue( matcher.enabled( InverseGroupMatcher.class, SingleGroupMatcher.class ) ); } public void testMatchNoneInOredGroup() { OrGroupMatcher matcher = new OrGroupMatcher( new SingleGroupMatcher( SingleGroupMatcher.class.getName() ), new SingleGroupMatcher( InverseGroupMatcher.class.getName() ) ); assertFalse( matcher.enabled( OrGroupMatcher.class, AndGroupMatcher.class ) ); } } SingleGroupMatcherTest.java000066400000000000000000000036721330756104600407400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/test/java/org/apache/maven/surefire/group/matchpackage org.apache.maven.surefire.group.match; /* * 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. */ import junit.framework.TestCase; public class SingleGroupMatcherTest extends TestCase { public void testMatchExactClassName() { SingleGroupMatcher matcher = new SingleGroupMatcher( SingleGroupMatcher.class.getName() ); assertTrue( matcher.enabled( SingleGroupMatcher.class ) ); } public void testMatchLoadedClass() { SingleGroupMatcher matcher = new SingleGroupMatcher( SingleGroupMatcher.class.getName() ); matcher.loadGroupClasses( Thread.currentThread().getContextClassLoader() ); assertTrue( matcher.enabled( SingleGroupMatcher.class ) ); } public void testMatchUnknownClass() { SingleGroupMatcher matcher = new SingleGroupMatcher( "BadClass" ); matcher.loadGroupClasses( Thread.currentThread().getContextClassLoader() ); assertTrue( matcher.enabled( "BadClass" ) ); } public void testMatchClassNameWithoutPackage() { SingleGroupMatcher matcher = new SingleGroupMatcher( SingleGroupMatcher.class.getSimpleName() ); assertTrue( matcher.enabled( SingleGroupMatcher.class ) ); } } maven-surefire-surefire-2.22.0/surefire-grouper/src/test/java/org/apache/maven/surefire/group/parse/000077500000000000000000000000001330756104600335605ustar00rootroot00000000000000GroupMatcherParserTest.java000066400000000000000000000145701330756104600407700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-grouper/src/test/java/org/apache/maven/surefire/group/parsepackage org.apache.maven.surefire.group.parse; /* * 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. */ import org.apache.maven.surefire.group.match.AndGroupMatcher; import org.apache.maven.surefire.group.match.GroupMatcher; import org.apache.maven.surefire.group.match.InverseGroupMatcher; import org.apache.maven.surefire.group.match.OrGroupMatcher; import org.apache.maven.surefire.group.match.SingleGroupMatcher; import junit.framework.TestCase; public class GroupMatcherParserTest extends TestCase { public void testParseSingleClass() throws ParseException { GroupMatcher matcher = new GroupMatcherParser( GroupMatcherParser.class.getName() ).parse(); assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof SingleGroupMatcher ); assertTrue( matcher.enabled( GroupMatcherParser.class ) ); } public void testParseInvertedSingleClass() throws ParseException { GroupMatcher matcher = new GroupMatcherParser( "NOT " + GroupMatcherParser.class.getName() ).parse(); assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof InverseGroupMatcher ); assertFalse( matcher.enabled( GroupMatcherParser.class ) ); } public void testParseBareANDedPair() throws ParseException { GroupMatcher matcher = new GroupMatcherParser( GroupMatcherParser.class.getName() + " AND " + SingleGroupMatcher.class.getName() ).parse(); assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof AndGroupMatcher ); assertFalse( matcher.enabled( GroupMatcherParser.class ) ); assertTrue( matcher.enabled( GroupMatcherParser.class, SingleGroupMatcher.class ) ); } public void testParseBareORedPair() throws ParseException { GroupMatcher matcher = new GroupMatcherParser( GroupMatcherParser.class.getName() + " OR " + SingleGroupMatcher.class.getName() ).parse(); assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof OrGroupMatcher ); assertTrue( matcher.enabled( GroupMatcherParser.class ) ); assertTrue( matcher.enabled( GroupMatcherParser.class, SingleGroupMatcher.class ) ); } public void testBareCommaSeparatedORedPair() throws ParseException { GroupMatcher matcher = new GroupMatcherParser( GroupMatcherParser.class.getName() + ", " + SingleGroupMatcher.class.getName() ).parse(); assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof OrGroupMatcher ); assertTrue( matcher.enabled( GroupMatcherParser.class ) ); assertTrue( matcher.enabled( GroupMatcherParser.class, SingleGroupMatcher.class ) ); } public void testParseGroupedANDedPair() throws ParseException { GroupMatcher matcher = new GroupMatcherParser( "(" + GroupMatcherParser.class.getName() + " AND " + SingleGroupMatcher.class.getName() + ")" ).parse(); assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof AndGroupMatcher ); assertFalse( matcher.enabled( GroupMatcherParser.class ) ); assertTrue( matcher.enabled( GroupMatcherParser.class, SingleGroupMatcher.class ) ); } public void testParseGroupedORedPair() throws ParseException { GroupMatcher matcher = new GroupMatcherParser( "(" + GroupMatcherParser.class.getName() + " OR " + SingleGroupMatcher.class.getName() + ")" ).parse(); assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof OrGroupMatcher ); assertTrue( matcher.enabled( GroupMatcherParser.class ) ); assertTrue( matcher.enabled( GroupMatcherParser.class, SingleGroupMatcher.class ) ); } public void testParseInvertedGroupedANDedPair() throws ParseException { GroupMatcher matcher = new GroupMatcherParser( "NOT (" + GroupMatcherParser.class.getName() + " AND " + SingleGroupMatcher.class.getName() + ")" ).parse(); assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof InverseGroupMatcher ); assertTrue( matcher.enabled( GroupMatcherParser.class ) ); assertFalse( matcher.enabled( GroupMatcherParser.class, SingleGroupMatcher.class ) ); } public void testParseInvertedGroupedORedPair() throws ParseException { GroupMatcher matcher = new GroupMatcherParser( "NOT (" + GroupMatcherParser.class.getName() + " OR " + SingleGroupMatcher.class.getName() + ")" ).parse(); assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof InverseGroupMatcher ); assertFalse( matcher.enabled( GroupMatcherParser.class ) ); assertFalse( matcher.enabled( GroupMatcherParser.class, SingleGroupMatcher.class ) ); } public void testSingleMatchWhenDotClassAppended() throws ParseException { GroupMatcher matcher = new GroupMatcherParser( SingleGroupMatcher.class.getName() + ".class" ).parse(); assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof SingleGroupMatcher ); assertTrue( matcher.enabled( SingleGroupMatcher.class ) ); } public void testSingleMatchWithOnlyClassSimpleName() throws ParseException { GroupMatcher matcher = new GroupMatcherParser( SingleGroupMatcher.class.getSimpleName() ).parse(); assertTrue( "Wrong matcher type: " + matcher.getClass().getName(), matcher instanceof SingleGroupMatcher ); assertTrue( matcher.enabled( SingleGroupMatcher.class ) ); } } maven-surefire-surefire-2.22.0/surefire-its/000077500000000000000000000000001330756104600207755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/pom.xml000066400000000000000000000160431330756104600223160ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire 2.22.0 surefire-its Maven Surefire Integration Tests Used internally testing MOJOs. The project is not deployed. UTF-8 org.apache.maven.surefire surefire-report-parser ${project.version} test org.apache.maven.shared maven-verifier org.apache.maven maven-settings test net.sourceforge.htmlunit htmlunit 2.8 test org.apache.maven maven-artifact org.apache.maven.shared maven-shared-utils commons-io commons-io org.apache.commons commons-lang3 maven-surefire-plugin org.apache.maven.surefire surefire-shadefire 2.12.4 org/apache/maven/surefire/its/fixture/JUnit4SuiteTest.java maven-failsafe-plugin 2.12.4 ${jdk.home}/bin/java alphabetical 1 false once -server -Xmx64m -XX:+UseG1GC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.awt.headless=true org/apache/**/*IT*.java ${project.version} ${maven.home} ${project.basedir}/../surefire-setup-integration-tests/target/private/it-settings.xml ${project.basedir}/../surefire-setup-integration-tests/target/private/toolchains.xml ${project.basedir}/../surefire-setup-integration-tests/target/it-repo ${project.build.directory} ${settings.localRepository} false ${project.build.testOutputDirectory} forked ${jdk.home} ${jacoco-it.agent} false org.apache.maven.surefire surefire-junit47 2.12.4 integration-test verify maven-jar-plugin true org.jacoco jacoco-maven-plugin jacoco-agent prepare-agent jacoco-agent-it prepare-agent-integration jacoco-it.agent maven-install-plugin true maven-deploy-plugin true maven-surefire-surefire-2.22.0/surefire-its/src/000077500000000000000000000000001330756104600215645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/000077500000000000000000000000001330756104600225435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/000077500000000000000000000000001330756104600234645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/000077500000000000000000000000001330756104600242535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/000077500000000000000000000000001330756104600254745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600266025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/000077500000000000000000000000001330756104600304265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/000077500000000000000000000000001330756104600312255ustar00rootroot00000000000000AbstractFailFastIT.java000066400000000000000000000062121330756104600354240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.MavenLauncher; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import java.util.HashMap; import java.util.Map; import static org.junit.runners.Parameterized.Parameter; /** * Base test class for SUREFIRE-580, configuration parameter {@code skipAfterFailureCount}. * * @author Tibor Digana (tibor17) * @since 2.19 */ @RunWith( Parameterized.class ) public abstract class AbstractFailFastIT extends SurefireJUnit4IntegrationTestCase { @Parameter( 0 ) public String description; @Parameter( 1 ) public String profile; @Parameter( 2 ) public Map properties; @Parameter( 3 ) public int total; @Parameter( 4 ) public int failures; @Parameter( 5 ) public int errors; @Parameter( 6 ) public int skipped; protected abstract String withProvider(); protected final OutputValidator prepare( String description, String profile, Map properties ) { MavenLauncher launcher = unpack( "/fail-fast-" + withProvider(), "_" + description ) .maven(); if ( profile != null ) { launcher.addGoal( "-P " + profile ); } if ( failures != 0 || errors != 0 ) { launcher.withFailure(); } return launcher.sysProp( properties ).executeTest(); } protected final OutputValidator prepare( String description, Map properties ) { return prepare( description, null, properties ); } protected static Map props( int forkCount, int skipAfterFailureCount, boolean reuseForks ) { Map props = new HashMap( 3 ); props.put( "surefire.skipAfterFailureCount", "" + skipAfterFailureCount ); props.put( "forkCount", "" + forkCount ); props.put( "reuseForks", "" + reuseForks ); return props; } @Test public void test() { prepare( description, profile, properties ) .assertTestSuiteResults( total, errors, failures, skipped ); } } AbstractJigsawIT.java000066400000000000000000000073751330756104600351720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import java.util.StringTokenizer; import static org.apache.maven.surefire.its.fixture.SurefireLauncher.EXT_JDK_HOME; import static org.apache.maven.surefire.its.fixture.SurefireLauncher.EXT_JDK_HOME_KEY; import static org.junit.Assert.fail; import static org.junit.Assume.assumeTrue; /** * Abstract test class for Jigsaw tests. * * @author Tibor Digana (tibor17) * @since 2.20.1 */ public abstract class AbstractJigsawIT extends SurefireJUnit4IntegrationTestCase { private static final double JIGSAW_JAVA_VERSION = 9.0d; protected abstract String getProjectDirectoryName(); protected SurefireLauncher assumeJigsaw() throws IOException { assumeTrue( "There's no JDK 9 provided.", isJavaVersion9AtLeast() || EXT_JDK_HOME != null && isExtJavaVerion9AtLeast() ); // fail( EXT_JDK_HOME_KEY + " was provided with value " + EXT_JDK_HOME + " but it is not Jigsaw Java 9." ); SurefireLauncher launcher = unpack(); return EXT_JDK_HOME == null ? launcher : launcher.setLauncherJavaHome( EXT_JDK_HOME ); } protected SurefireLauncher assumeJava9Property() throws IOException { assumeTrue( "There's no JDK 9 provided.", EXT_JDK_HOME != null && isExtJavaVerion9AtLeast() ); return unpack(); } private SurefireLauncher unpack() { return unpack( getProjectDirectoryName() ); } private static boolean isJavaVersion9AtLeast() { return Double.valueOf( System.getProperty( "java.specification.version" ) ) >= JIGSAW_JAVA_VERSION; } private static boolean isExtJavaVerion9AtLeast() throws IOException { File release = new File( EXT_JDK_HOME, "release" ); assumeTrue( EXT_JDK_HOME_KEY + " was provided with value " + EXT_JDK_HOME + " but file does not exist " + EXT_JDK_HOME + File.separator + "release", release.exists() ); Properties properties = new Properties(); InputStream is = new FileInputStream( release ); properties.load( is ); is.close(); String javaVersion = properties.getProperty( "JAVA_VERSION" ).replace( "\"", "" ); StringTokenizer versions = new StringTokenizer( javaVersion, "._" ); if ( versions.countTokens() == 1 ) { javaVersion = versions.nextToken(); } else if ( versions.countTokens() >= 2 ) { javaVersion = versions.nextToken() + "." + versions.nextToken(); } else { fail( "unexpected java version format" ); } return Double.valueOf( javaVersion ) >= JIGSAW_JAVA_VERSION; } } AbstractTestCaseIT.java000066400000000000000000000026761330756104600354600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test files with "Abstract" in their name that aren't really abstract, * and abstract classes that don't say "Abstract" in their name * * @author Dan Fabulich * @author Kristian Rosenvold */ public class AbstractTestCaseIT extends SurefireJUnit4IntegrationTestCase { @Test public void abstractTestCase() { unpack( "/default-configuration-abstract" ).executeTest().verifyErrorFree( 1 ); } } AbstractTestMultipleMethodPatterns.java000066400000000000000000000403541330756104600410200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.Settings; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import static org.apache.maven.surefire.its.fixture.TestFramework.*; import static org.apache.maven.surefire.its.fixture.Configuration.*; import static org.hamcrest.core.AnyOf.anyOf; import static org.hamcrest.core.Is.is; import static org.junit.Assume.assumeThat; /** * Test project using multiple method patterns, including wildcards in class and method names. */ public abstract class AbstractTestMultipleMethodPatterns extends SurefireJUnit4IntegrationTestCase { private static final String CSV_DELIMITER_SHORT = ","; private static final String CSV_DELIMITER_LONG = ", "; private static final String NOT_DELIMITER = "!"; protected abstract Settings getSettings(); protected abstract SurefireLauncher unpack(); protected SurefireLauncher prepare( String tests ) { SurefireLauncher launcher = unpack().addGoal( "-P " + getSettings().profile() ); String[] includedExcluded = splitIncludesExcludes( tests ); switch ( getSettings().getConfiguration() ) { case TEST: launcher.setTestToRun( tests ); break; case INCLUDES: launcher.sysProp( "included", tests ); break; case INCLUDES_EXCLUDES: launcher.sysProp( "included", includedExcluded[0] ); launcher.sysProp( "excluded", includedExcluded[1] ); break; default: throw new IllegalArgumentException( "Unsupported configuration " + getSettings().getConfiguration() ); } return launcher; } private static String[] splitIncludesExcludes( String patterns ) { String included = ""; String excluded = ""; for ( String pattern : patterns.split( CSV_DELIMITER_SHORT ) ) { pattern = pattern.trim(); if ( pattern.startsWith( NOT_DELIMITER ) ) { excluded += pattern.substring( NOT_DELIMITER.length() ).trim(); excluded += CSV_DELIMITER_LONG; } else { included += pattern; included += CSV_DELIMITER_LONG; } } return new String[]{ trimEndComma( included ), trimEndComma( excluded ) }; } private static String trimEndComma( String pattern ) { pattern = pattern.trim(); return pattern.endsWith( CSV_DELIMITER_LONG ) ? pattern.substring( 0, pattern.length() - CSV_DELIMITER_LONG.length() ) : pattern; } @Test public void simpleNameTest() throws Exception { prepare( "TestTwo" ) .executeTest() .verifyErrorFree( 2 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessOne" ) .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessTwo" ); } @Test public void simpleNameTestAsParallel() throws Exception { assumeThat( getSettings().getFramework(), anyOf( is( JUNIT47 ), is( TestNG ) ) ); prepare( "TestTwo" ) .parallel( "classes" ) .useUnlimitedThreads() .executeTest() .verifyErrorFree( 2 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessOne" ) .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessTwo" ); } @Test public void simpleNameTestWithJavaExt() throws Exception { prepare( "TestTwo.java" ) .executeTest() .verifyErrorFree( 2 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessOne" ) .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessTwo" ); } @Test public void simpleNameTestWithWildcardPkg() throws Exception { prepare( "**/TestTwo" ) .executeTest() .verifyErrorFree( 2 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessOne" ) .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessTwo" ); } @Test public void simpleNameTestWithJavaExtWildcardPkg() throws Exception { prepare( "**/TestTwo.java" ) .executeTest() .verifyErrorFree( 2 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessOne" ) .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessTwo" ); } @Test public void fullyQualifiedTest() throws Exception { prepare( "jiras/surefire745/TestTwo.java" ) .executeTest() .verifyErrorFree( 2 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessOne" ) .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessTwo" ); } @Test public void shouldMatchSimpleClassNameAndMethod() throws Exception { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "BasicTest#testSuccessTwo" ) .executeTest() .verifyErrorFree( 1 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" ); } /** * This method name was shorten because it cause 261 character long path on Windows with Jenkins Pipeline. */ @Test public void matchSimpleClassAndMethodWithJavaExt() { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "BasicTest.java#testSuccessTwo" ) .executeTest() .verifyErrorFree( 1 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" ); } /** * This method name was shorten because it cause 261 character long path on Windows with Jenkins Pipeline. */ @Test public void matchSimpleClassAndMethodWithWildcardPkg() { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "**/BasicTest#testSuccessTwo" ) .executeTest() .verifyErrorFree( 1 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" ); } /** * This method name was shorten because it cause 261 character long path on Windows with Jenkins Pipeline. */ @Test public void matchSimpleClassAndMethodWithJavaExtWildcardPkg() { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "**/BasicTest.java#testSuccessTwo" ) .executeTest() .verifyErrorFree( 1 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" ); } @Test public void shouldMatchWildcardPackageAndClassAndMethod() throws Exception { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "jiras/**/BasicTest#testSuccessTwo" ) .executeTest() .verifyErrorFree( 1 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" ); } @Test public void regexClass() throws Exception { prepare( "%regex[.*.TestTwo.*]" ) .executeTest() .verifyErrorFree( 2 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessOne" ) .verifyTextInLog( "jiras.surefire745.TestTwo#testSuccessTwo" ); } @Test public void testSuccessTwo() throws Exception { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "#testSuccessTwo" ) .maven().debugLogging() .executeTest() .verifyErrorFree( 5 ) .verifyErrorFreeLog(); } @Test public void testRegexSuccessTwo() throws Exception { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "%regex[#testSuccessTwo]" ) .executeTest() .verifyErrorFree( 5 ) .verifyErrorFreeLog(); } @Test public void regexClassAndMethod() throws Exception { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "%regex[.*.BasicTest.*#testSuccessTwo]" ) .executeTest() .verifyErrorFree( 1 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" ); } @Test public void shouldMatchExactClassAndMethodWildcard() throws Exception { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "BasicTest#test*One" ) .executeTest() .verifyErrorFree( 1 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessOne" ); } @Test public void shouldMatchExactClassAndMethodsWildcard() throws Exception { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "BasicTest#testSuccess*" ) .executeTest() .verifyErrorFree( 2 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessOne" ) .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessTwo" ); } @Test public void shouldMatchExactClassAndMethodCharacters() throws Exception { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "BasicTest#test???????One" ) .executeTest() .verifyErrorFree( 1 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.BasicTest#testSuccessOne" ); } @Test public void shouldMatchExactClassAndMethodsPostfix() throws Exception { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "TestFive#testSuccess???" ) .executeTest() .verifyErrorFree( 2 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessOne" ) .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessTwo" ); } @Test public void shouldMatchExactClassAndMethodPostfix() throws Exception { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "TestFive#testSuccess?????" ) .executeTest() .verifyErrorFree( 1 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessThree" ); } @Test public void shouldMatchExactClassAndMultipleMethods() throws Exception { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "TestFive#testSuccessOne+testSuccessThree" ) .executeTest() .verifyErrorFree( 2 ) .verifyErrorFreeLog() .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessOne" ) .verifyTextInLog( "jiras.surefire745.TestFive#testSuccessThree" ); } @Test public void shouldMatchMultiplePatterns() throws Exception { assumeThat( getSettings().getConfiguration(), is( TEST ) ); String test = "jiras/surefire745/BasicTest#testSuccessOne+testSuccessTwo"//2 + ',' + "jiras/**/TestTwo"//2 + ',' + "jiras/surefire745/TestThree#testSuccess*"//2 + ',' + "TestFour#testSuccess???"//2 + ',' + "jiras/surefire745/*Five#test*One";//1 prepare( test ) .executeTest() .verifyErrorFree( 9 ) .verifyErrorFreeLog(); } @Test public void shouldMatchMultiplePatternsAsParallel() throws Exception { assumeThat( getSettings().getFramework(), anyOf( is( JUNIT47 ), is( TestNG ) ) ); assumeThat( getSettings().getConfiguration(), is( TEST ) ); String test = "jiras/surefire745/BasicTest#testSuccessOne+testSuccessTwo"//2 + ',' + "jiras/**/TestTwo"//2 + ',' + "jiras/surefire745/TestThree#testSuccess*"//2 + ',' + "TestFour#testSuccess???"//2 + ',' + "jiras/surefire745/*Five#test*One";//1 prepare( test ) .parallel( "classes" ) .useUnlimitedThreads() .executeTest() .verifyErrorFree( 9 ) .verifyErrorFreeLog(); } @Test public void shouldMatchMultiplePatternsComplex() throws Exception { assumeThat( getSettings().getConfiguration(), is( TEST ) ); String test = "**/BasicTest#testSuccessOne+testSuccessTwo"//2 + ',' + "jiras/**/TestTwo"//2 + ',' + "?????/surefire745/TestThree#testSuccess*"//2 + ',' + "jiras/surefire745/TestFour.java#testSuccess???"//2 + ',' + "jiras/surefire745/*Five#test*One";//1 prepare( test ) .executeTest() .verifyErrorFree( 9 ) .verifyErrorFreeLog(); } @Test public void shouldMatchMultiplePatternsComplexAsParallel() throws Exception { assumeThat( getSettings().getFramework(), anyOf( is( JUNIT47 ), is( TestNG ) ) ); assumeThat( getSettings().getConfiguration(), is( TEST ) ); String test = "**/BasicTest#testSuccessOne+testSuccessTwo"//2 + ',' + "jiras/**/TestTwo"//2 + ',' + "?????/surefire745/TestThree#testSuccess*"//2 + ',' + "jiras/surefire745/TestFour.java#testSuccess???"//2 + ',' + "jiras/surefire745/*Five#test*One";//1 prepare( test ) .parallel( "classes" ) .useUnlimitedThreads() .executeTest() .verifyErrorFree( 9 ) .verifyErrorFreeLog(); } @Test public void shouldNotRunExcludedClasses() { prepare( "!BasicTest, !**/TestTwo, !**/TestThree.java" ) .executeTest() .verifyErrorFree( 6 ) .verifyErrorFreeLog(); } @Test public void shouldNotRunExcludedClassesIfIncluded() { prepare( "TestF*.java, !**/TestFour.java" ) .executeTest() .verifyErrorFree( 3 ) .verifyErrorFreeLog(); } @Test public void shouldNotRunExcludedMethods() { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "!#*Fail*, !%regex[#.*One], !#testSuccessThree" ) .executeTest() .verifyErrorFree( 5 ) .verifyErrorFreeLog(); } @Test public void shouldNotRunExcludedClassesAndMethods() { assumeThat( getSettings().getConfiguration(), is( TEST ) ); prepare( "!#*Fail*, !TestFour#testSuccessTwo" ) .executeTest() .verifyErrorFree( 11 ) .verifyErrorFreeLog(); } @Test public void negativeTest() { assumeThat( getSettings().getConfiguration(), anyOf( is( INCLUDES ), is( INCLUDES_EXCLUDES ), is( INCLUDES_FILE ), is( INCLUDES_EXCLUDES_FILE ) ) ); String pattern = "TestFive#testSuccessOne+testSuccessThree"; prepare( pattern ) .failNever() .executeTest() .verifyTextInLog( "Method filter prohibited in includes|excludes|includesFile|excludesFile parameter: " + pattern ); } } AdditionalClasspathIT.java000066400000000000000000000025241330756104600361640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test additionalClasspathElements * * @author Dan Fabulich * @author Kristian Rosenvold */ public class AdditionalClasspathIT extends SurefireJUnit4IntegrationTestCase { @Test public void additionalClasspath() { unpack( "/additional-classpath" ).executeTest().verifyErrorFree( 1 ); } } AggregateReportIT.java000066400000000000000000000045111330756104600353310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import java.io.File; import org.apache.maven.surefire.its.fixture.IntegrationTestSuiteResults; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.TestFile; import org.junit.Test; import static org.apache.maven.surefire.its.fixture.HelperAssertions.parseTestResults; import static org.apache.maven.surefire.its.fixture.HelperAssertions.assertTestSuiteResults; import static org.junit.Assert.assertTrue; /** * Test report aggregation * * @author Dan Fabulich * @author Kristian Rosenvold */ public class AggregateReportIT extends SurefireJUnit4IntegrationTestCase { @Test public void aggregateReport() { OutputValidator outputValidator = unpack( "/aggregate-report" ).addSurefireReportGoal().executeCurrentGoals(); TestFile surefireReportHtml = outputValidator.getSiteFile( "surefire-report.html" ); assertTrue( "surefire report missing: " + surefireReportHtml.getAbsolutePath(), surefireReportHtml.exists() ); // TODO HtmlUnit tests on the surefire report IntegrationTestSuiteResults suite = parseTestResults( new File( outputValidator.getBaseDir(), "child1" ), new File( outputValidator.getBaseDir(), "child2" ) ); assertTestSuiteResults( 2, 0, 1, 0, suite ); } } ArgLineIT.java000066400000000000000000000024721330756104600335740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test passing an argLine parameter * * @author Dan Fabulich * @author Kristian Rosenvold */ public class ArgLineIT extends SurefireJUnit4IntegrationTestCase { @Test public void argLine() { unpack( "/argLine-parameter" ).executeTest().verifyErrorFree( 1 ); } } ArgLinePropertiesIT.java000066400000000000000000000025051330756104600356460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test passing an argLine parameter * * @author Dan Fabulich * @author Kristian Rosenvold */ public class ArgLinePropertiesIT extends SurefireJUnit4IntegrationTestCase { @Test public void argLine() { unpack( "/argLine-properties" ).executeTest().verifyErrorFree( 4 ); } } AssumptionFailureReportIT.java000066400000000000000000000027641330756104600371250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.TestFile; import org.junit.Test; public class AssumptionFailureReportIT extends SurefireJUnit4IntegrationTestCase { @Test public void testWriteSkippedMessageToReport() { final OutputValidator outputValidator = unpack( "/assumpationFailureReport" ).executeTest(); TestFile xmlReportFile = outputValidator.getSurefireReportsXmlFile( "TEST-assumptionFailure.Test1.xml" ); xmlReportFile.assertContainsText( "The test is skipped if it is false" ); } } CheckSingleTestIT.java000066400000000000000000000044471330756104600352760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.*; import org.junit.Test; import static org.junit.Assert.assertFalse; /** * Test running a single test with -Dtest=BasicTest * * @author Dan Fabulich * @author Kristian Rosenvold */ public class CheckSingleTestIT extends SurefireJUnit4IntegrationTestCase { @Test public void singleTest() { unpack().setTestToRun( "BasicTest" ).executeTest().verifyErrorFree( 1 ); } @Test public void singleTestDotJava() { unpack().setTestToRun( "BasicTest.java" ).executeTest().verifyErrorFree( 1 ); } @Test public void singleTestNonExistent() { final OutputValidator output = unpack().setTestToRun( "DoesNotExist" ).maven().withFailure().executeTest(); TestFile reportsDir = output.getTargetFile( "surefire-reports" ); assertFalse( "Unexpected reports directory", reportsDir.exists() ); } @Test public void singleTestNonExistentOverride() { final OutputValidator output = unpack().setTestToRun( "DoesNotExist" ).failIfNoTests( false ).executeTest().verifyErrorFreeLog(); output.getTargetFile( "surefire-reports" ); // assertFalse( "Unexpected reports directory", reportsDir.exists() ); Hmpf. Not really a good test } private SurefireLauncher unpack() { return unpack( "/default-configuration" ); } } CheckTestFailIfNoTestsForkModeIT.java000066400000000000000000000046351330756104600401550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Test failIfNoTests with various forkModes. * * @author Dan Fabulich * @author Kristian Rosenvold */ public class CheckTestFailIfNoTestsForkModeIT extends SurefireJUnit4IntegrationTestCase { @Test public void failIfNoTestsForkModeAlways() { unpack().forkAlways().failIfNoTests( true ).maven().withFailure().executeTest(); } @Test public void failIfNoTestsForkModeNever() { unpack().forkNever().failIfNoTests( true ).maven().withFailure().executeTest(); } @Test public void failIfNoTestsForkModeOnce() { unpack().forkOnce().failIfNoTests( true ).maven().withFailure().executeTest(); } @Test public void dontFailIfNoTestsForkModeAlways() { doTest( unpack().forkAlways().failIfNoTests( false ) ); } @Test public void dontFailIfNoTestsForkModeNever() { doTest( unpack().forkNever().failIfNoTests( false ) ); } @Test public void dontFailIfNoTestsForkModeOnce() { doTest( unpack().forkOnce().failIfNoTests( false ) ); } private void doTest( SurefireLauncher launcher ) { launcher.executeTest().verifyErrorFreeLog().assertTestSuiteResults( 0, 0, 0, 0 ); } private SurefireLauncher unpack() { return unpack( "default-configuration-classWithNoTests" ); } } CheckTestFailIfNoTestsIT.java000066400000000000000000000037671330756104600365330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.*; import org.junit.Test; import static org.junit.Assert.assertFalse; /** * Test failIfNoTests * * @author Dan Fabulich * @author Kristian Rosenvold */ public class CheckTestFailIfNoTestsIT extends SurefireJUnit4IntegrationTestCase { private SurefireLauncher unpack() { return unpack( "/default-configuration-noTests" ); } @Test public void failIfNoTests() { unpack().failIfNoTests( true ).maven().withFailure().executeTest(); } @Test public void dontFailIfNoTests() { final OutputValidator outputValidator = unpack().failIfNoTests( false ).executeTest(); outputValidator.verifyErrorFreeLog(); TestFile reportsDir = outputValidator.getSurefireReportsFile( "" ); assertFalse( "Unexpected reports directory", reportsDir.exists() ); } @Test public void jUnit48CategoriesFailWhenNoTests() { unpack().failIfNoTests( false ).activateProfile( "junit47" ).setJUnitVersion( "4.8.1" ).executeTest().verifyErrorFreeLog(); } } CheckTestNgBeforeMethodFailureIT.java000066400000000000000000000031631330756104600402070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test failures in @BeforeMethod annotation on TestNg suite * * @author Dan Fabulich * @author Kristian Rosenvold */ public class CheckTestNgBeforeMethodFailureIT extends SurefireJUnit4IntegrationTestCase { @Test public void TestNgBeforeMethodFailure() throws Exception { unpack( "/testng-beforeMethodFailure" ) .maven() .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .withFailure() .executeTest() .assertTestSuiteResults( 2, 0, 1, 1 ); } } CheckTestNgBeforeMethodIT.java000066400000000000000000000030111330756104600366670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test @BeforeMethod annotation on TestNg suite * * @author Dan Fabulich * @author Kristian Rosenvold */ public class CheckTestNgBeforeMethodIT extends SurefireJUnit4IntegrationTestCase { @Test public void TestNgBeforeMethod() throws Exception { unpack( "/testng-beforeMethod" ) .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .executeTest() .verifyErrorFree( 1 ); } } CheckTestNgCustomObjectFactoryIT.java000066400000000000000000000035751330756104600402740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import java.io.File; import static org.fest.assertions.Assertions.assertThat; /** * Test TestNG with custom object factory defined. * * @author Orien Madgwick */ public class CheckTestNgCustomObjectFactoryIT extends SurefireJUnit4IntegrationTestCase { @Test public void testTestNgListenerReporter() throws Exception { File baseDir = unpack() .executeTest() .verifyErrorFreeLog() .assertTestSuiteResults( 1, 0, 0, 0 ) .getBaseDir(); baseDir = baseDir.getCanonicalFile(); File targetDir = new File( baseDir, "target" ); assertThat( targetDir ).isDirectory(); assertThat( new File( targetDir, "objectFactory-output.txt" ) ).isFile(); } private SurefireLauncher unpack() { return unpack( "/testng-objectFactory" ); } } CheckTestNgCustomTestRunnerFactoryIT.java000066400000000000000000000036171330756104600411740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import java.io.File; import static org.fest.assertions.Assertions.assertThat; /** * Test TestNG with custom test runner factory defined. * * @author Orien Madgwick */ public class CheckTestNgCustomTestRunnerFactoryIT extends SurefireJUnit4IntegrationTestCase { @Test public void testTestNgListenerReporter() throws Exception { File baseDir = unpack() .executeTest() .verifyErrorFreeLog() .assertTestSuiteResults( 1, 0, 0, 0 ) .getBaseDir(); baseDir = baseDir.getCanonicalFile(); File targetDir = new File( baseDir, "target" ); assertThat( targetDir ).isDirectory(); assertThat( new File( targetDir, "testrunnerfactory-output.txt" ) ).isFile(); } private SurefireLauncher unpack() { return unpack( "/testng-testRunnerFactory" ); } } CheckTestNgExecuteErrorIT.java000066400000000000000000000055621330756104600367550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; import java.io.File; import java.io.FilenameFilter; import static org.fest.assertions.Assertions.assertThat; /** * Test for checking that the output from a forked suite is properly captured even if the suite encounters a severe error. * * @author Dan Fabulich * @author Kristian Rosenvold */ public class CheckTestNgExecuteErrorIT extends SurefireJUnit4IntegrationTestCase { @Test public void executionError() throws Exception { OutputValidator outputValidator = unpack( "/testng-execute-error" ) .maven() .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .showErrorStackTraces() .withFailure() .executeTest(); File reportDir = outputValidator.getSurefireReportsDirectory(); String[] dumpFiles = reportDir.list( new FilenameFilter() { @Override public boolean accept( File dir, String name ) { return name.endsWith( ".dump" ); } }); assertThat( dumpFiles ).isNotEmpty(); for ( String dump : dumpFiles ) { outputValidator.getSurefireReportsFile( dump ) .assertContainsText( "at org.apache.maven.surefire.testng.TestNGExecutor.run" ); } } } CheckTestNgGroupThreadParallelIT.java000066400000000000000000000030151330756104600402310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test TestNG groups, together with TestNG parallelism * * @author Dan Fabulich * @author Kristian Rosenvold */ public class CheckTestNgGroupThreadParallelIT extends SurefireJUnit4IntegrationTestCase { @Test public void TestNgGroupThreadParallel() { unpack( "testng-group-thread-parallel" ) .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .executeTest() .verifyErrorFree( 3 ); } } CheckTestNgJdk14IT.java000066400000000000000000000024431330756104600352110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test TestNG running in the JDK 1.4 JavaDoc style * * @author Dan Fabulich */ public class CheckTestNgJdk14IT extends SurefireJUnit4IntegrationTestCase { @Test public void TestNgJdk14() throws Exception { unpack( "/testng-jdk14" ).executeTest().verifyErrorFree( 1 ); } } CheckTestNgListenerReporterIT.java000066400000000000000000000111571330756104600376460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import java.util.Arrays; import java.util.Collection; import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion; import static org.junit.runners.Parameterized.Parameter; import static org.junit.runners.Parameterized.Parameters; /** * Test simple TestNG listener and reporter * * @author Dan Fabulich * @author Kristian Rosenvold */ @RunWith( Parameterized.class ) public class CheckTestNgListenerReporterIT extends SurefireJUnit4IntegrationTestCase { @Parameters( name = "{index}: TestNG {0}" ) public static Collection data() { return Arrays.asList(new Object[][] { { "5.6", "jdk15", 1.5d }, // First TestNG version with reporter support { "5.7", "jdk15", 1.5d }, // default version from pom of the test case { "5.10", "jdk15", 1.5d }, { "5.13", null, 1.5d }, // "reporterslist" param becomes String instead of List // "listener" param becomes String instead of List // configure(Map) in 5.14.1 and 5.14.2 is transforming List into a String with a space as separator. // Then configure(CommandLineArgs) splits this String into a List with , or ; as separator => fail. // If we used configure(CommandLineArgs), we would not have the problem with white spaces. //{ "5.14.1", null, "1.5" }, // "listener" param becomes List instead of String // Fails: Issue with 5.14.1 and 5.14.2 => join with , split with "," // TODO will work with "configure(CommandLineArgs)" //{ "5.14.2", null, "1.5" }, // ReporterConfig is not available //{ "5.14.3", null, "1.5" }, // TestNG uses "reporter" instead of "reporterslist" // Both String or List are possible for "listener" // Fails: not able to test due to system dependency org.testng:guice missed the path and use to break CI // ClassNotFoundException: com.beust.jcommander.ParameterException //{ "5.14.4", null, "1.5" }, { "5.14.5", null, "1.5" }, // Fails: not able to test due to system dependency org.testng:guice missed the path and use to break CI // ClassNotFoundException: com.beust.jcommander.ParameterException { "5.14.6", null, 1.5d }, // Usage of org.testng:guice removed { "5.14.9", null, 1.5d }, // Latest 5.14.x TestNG version { "6.0", null, 1.5d }, { "6.9.9", null, 1.7d } // Currently latest TestNG version }); } @Parameter public String version; @Parameter(1) public String classifier; @Parameter(2) public double javaVersion; @Test public void testNgListenerReporter() { assumeJavaVersion( javaVersion ); final SurefireLauncher launcher = unpack( "testng-listener-reporter", "_" + version ) .sysProp( "testNgVersion", version ); if ( classifier != null ) { launcher.sysProp( "testNgClassifier", "jdk15" ); } launcher.executeTest() .verifyErrorFree( 1 ) .getTargetFile( "resultlistener-output.txt" ).assertFileExists() .getTargetFile( "suitelistener-output.txt" ).assertFileExists() .getTargetFile( "reporter-output.txt" ).assertFileExists(); } } CheckTestNgListenersIT.java000066400000000000000000000023721330756104600363050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test annotation-based TestNG listener */ public class CheckTestNgListenersIT extends SurefireJUnit4IntegrationTestCase { @Test public void TestNgListenerReporter() { unpack( "testng-listeners" ).mavenTestFailureIgnore( true ).executeTest().assertTestSuiteResults( 1, 0, 1, 0 ); } } CheckTestNgPathWithSpacesIT.java000066400000000000000000000026461330756104600372300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test TestNG test in a directory with spaces * * @author Dan Fabulich */ public class CheckTestNgPathWithSpacesIT extends SurefireJUnit4IntegrationTestCase { @Test public void TestWithSpaces() { unpack( "testng-path with spaces" ) .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .executeTest() .verifyErrorFree( 1 ); } } CheckTestNgReportTestIT.java000066400000000000000000000046341330756104600364530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; /** * Test surefire-report on TestNG test * * @author Dan Fabulich */ public class CheckTestNgReportTestIT extends SurefireJUnit4IntegrationTestCase { @Test public void testNgReport() throws Exception { unpack( "/testng-simple" ) .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .addSurefireReportGoal() .executeCurrentGoals() .verifyErrorFree( 3 ) .getSiteFile( "surefire-report.html" ) .assertFileExists(); } @Test public void shouldNotBeVerbose() throws Exception { unpack( "/testng-simple" ) .sysProp( "testNgVersion", "5.10" ) .sysProp( "testNgClassifier", "jdk15" ) .executeTest() .verifyErrorFreeLog() .assertThatLogLine( containsString( "[Parser] Running:" ), is( 0 ) ); } @Test public void shouldBeVerbose() throws Exception { unpack( "/testng-simple" ) .sysProp( "testNgVersion", "5.10" ) .sysProp( "testNgClassifier", "jdk15" ) .sysProp( "surefire.testng.verbose", "10" ) .executeTest() .verifyErrorFreeLog() .assertThatLogLine( containsString( "[Parser] Running:" ), is( 1 ) ); } } CheckTestNgSuiteXmlIT.java000066400000000000000000000035401330756104600361050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Ignore; import org.junit.Test; /** * Test simple TestNG suite XML file * * @author Dan Fabulich */ public class CheckTestNgSuiteXmlIT extends SurefireJUnit4IntegrationTestCase { @Test public void suiteXml() { unpack().executeTest().verifyErrorFree( 2 ); } @Test @Ignore( "Fails - see SUREFIRE-1123" ) public void suiteXmlForkModeAlways() { unpack().forkAlways().executeTest().verifyErrorFree( 2 ); } @Test public void suiteXmlForkCountTwoReuse() { unpack().forkCount( 2 ).reuseForks( true ).executeTest().verifyErrorFree( 2 ); } private SurefireLauncher unpack() { return unpack( "testng-suite-xml" ) .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ); } } CheckTestNgSuiteXmlSingleIT.java000066400000000000000000000027661330756104600372600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Use -Dtest to run a single TestNG test, overriding the suite XML parameter. * * @author Dan Fabulich */ public class CheckTestNgSuiteXmlSingleIT extends SurefireJUnit4IntegrationTestCase { @Test public void TestNgSuite() { unpack( "/testng-twoTestCaseSuite" ) .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .setTestToRun( "TestNGTestTwo" ) .executeTest() .verifyErrorFree( 1 ); } } CheckTestNgVersionsIT.java000066400000000000000000000140021330756104600361360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import java.util.List; import org.apache.maven.plugins.surefire.report.ReportTestSuite; import org.apache.maven.surefire.its.fixture.HelperAssertions; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Ignore; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; /** * Basic suite test using all known versions of TestNG. Used for regression testing Surefire against old versions. To * check new versions of TestNG work with current versions of Surefire, instead run the full test suite with * -Dtestng.version=5.14.2 (for example) * * @author Dan Fabulich * @author Kristian Rosenvold */ public class CheckTestNgVersionsIT extends SurefireJUnit4IntegrationTestCase { @Test public void test47() throws Exception { runTestNgTest( "4.7", "jdk15" ); } @Test @Ignore( "5.0 and 5.0.1 jars on central are malformed SUREFIRE-375 + MAVENUPLOAD-1024" ) public void XXXtest50() throws Exception { runTestNgTest( "5.0", "jdk15" ); } @Test @Ignore( "5.0 and 5.0.1 jars on central are malformed SUREFIRE-375 + MAVENUPLOAD-1024" ) public void XXXtest501() throws Exception { runTestNgTest( "5.0.1", "jdk15" ); } @Test public void test502() throws Exception { runTestNgTest( "5.0.2", "jdk15" ); } @Test public void test51() throws Exception { runTestNgTest( "5.1", "jdk15" ); } @Test public void test55() throws Exception { runTestNgTest( "5.5", "jdk15" ); } @Test public void test56() throws Exception { runTestNgTest( "5.6", "jdk15" ); } @Test public void test57() throws Exception { runTestNgTest( "5.7", "jdk15" ); } @Test public void test58() throws Exception { runTestNgTest( "5.8", "jdk15" ); } @Test public void test59() throws Exception { runTestNgTest( "5.9", "jdk15" ); } @Test public void test510() throws Exception { runTestNgTest( "5.10", "jdk15" ); } @Test public void test511() throws Exception { runTestNgTest( "5.11", "jdk15" ); } @Test public void test512() throws Exception { runTestNgTest( "5.12.1" ); } @Test public void test513() throws Exception { runTestNgTest( "5.13" ); } @Test public void test5131() throws Exception { runTestNgTest( "5.13.1" ); } @Test public void test514() throws Exception { runTestNgTest( "5.14" ); } @Test public void test5141() throws Exception { runTestNgTest( "5.14.1" ); } @Test public void test5142() throws Exception { runTestNgTest( "5.14.2" ); } @Test public void test60() throws Exception { runTestNgTest( "6.0" ); } @Test public void test685() throws Exception { runTestNgTestWithRunOrder( "6.8.5" ); } private void runTestNgTestWithRunOrder( String version ) throws Exception { runTestNgTest( version, null, true ); } private void runTestNgTest( String version ) throws Exception { runTestNgTest( version, null, false ); } private void runTestNgTest( String version, boolean validateRunOrder ) throws Exception { runTestNgTest( version, null, validateRunOrder ); } private void runTestNgTest( String version, String classifier ) throws Exception { runTestNgTest( version, classifier, false ); } private void runTestNgTest( String version, String classifier, boolean validateRunOrder ) throws Exception { final SurefireLauncher launcher = unpack( "testng-simple" ) .sysProp( "testNgVersion", version ); if ( classifier != null ) { launcher.sysProp( "testNgClassifier", classifier ); } final OutputValidator outputValidator = launcher.executeTest(); outputValidator.verifyErrorFreeLog().assertTestSuiteResults( 3, 0, 0, 0 ); if ( validateRunOrder ) { // assert correct run order of tests List report = HelperAssertions.extractReports( outputValidator.getBaseDir() ); assertEquals( 3, report.size() ); assertTrue( "TestNGSuiteTestC was executed first", getTestClass( report, 0 ).endsWith( "TestNGSuiteTestC" ) ); assertTrue( "TestNGSuiteTestB was executed second", getTestClass( report, 1 ).endsWith( "TestNGSuiteTestB" ) ); assertTrue( "TestNGSuiteTestA was executed last", getTestClass( report, 2 ).endsWith( "TestNGSuiteTestA" ) ); } } private String getTestClass( List report, int i ) { return report.get( i ).getFullClassName(); } } ClassPathOrderIT.java000066400000000000000000000025271330756104600351320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test for checking the order of class path elements * * @author Dan Fabulich * @author Kristian Rosenvold */ public class ClassPathOrderIT extends SurefireJUnit4IntegrationTestCase { @Test public void classPathOrder() { unpack( "/classpath-order" ).executeTest().verifyErrorFree( 2 ); } } ClasspathFilteringIT.java000066400000000000000000000023771330756104600360450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test additionalClasspathElements * * @author pgier */ public class ClasspathFilteringIT extends SurefireJUnit4IntegrationTestCase { @Test public void additionalClasspath() throws Exception { unpack( "classpath-filtering" ).debugLogging().executeTest().verifyErrorFree( 1 ); } } ClasspathScopeFilteringIT.java000066400000000000000000000024531330756104600370320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test additionalClasspathElements * * @author pgier * @author Kristian Rosenvold */ public class ClasspathScopeFilteringIT extends SurefireJUnit4IntegrationTestCase { @Test public void additionalClasspath() { unpack( "classpath-scope-filtering" ).executeTest().verifyErrorFree( 1 ); } } ConsoleOutputIT.java000066400000000000000000000070421330756104600350740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import java.nio.charset.Charset; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.TestFile; import org.junit.Test; /** * Basic suite test using all known versions of JUnit 4.x * * @author Kristian Rosenvold */ public class ConsoleOutputIT extends SurefireJUnit4IntegrationTestCase { @Test public void properNewlinesAndEncodingWithDefaultEncodings() { final OutputValidator outputValidator = unpack( "/consoleOutput" ).forkOnce().executeTest(); validate( outputValidator, true ); } @Test public void properNewlinesAndEncodingWithDifferentEncoding() { final OutputValidator outputValidator = unpack( "/consoleOutput" ).forkOnce().argLine( "-Dfile.encoding=UTF-16" ).executeTest(); validate( outputValidator, true ); } @Test public void properNewlinesAndEncodingWithoutFork() { final OutputValidator outputValidator = unpack( "/consoleOutput" ).forkNever().executeTest(); validate( outputValidator, false ); } private void validate( final OutputValidator outputValidator, boolean includeShutdownHook ) { TestFile xmlReportFile = outputValidator.getSurefireReportsXmlFile( "TEST-consoleOutput.Test1.xml" ); xmlReportFile.assertContainsText( "SoutLine" ); xmlReportFile.assertContainsText( normalizeToDefaultCharset( "äöüß" ) ); xmlReportFile.assertContainsText( normalizeToDefaultCharset( "failing with ü" ) ); TestFile outputFile = outputValidator.getSurefireReportsFile( "consoleOutput.Test1-output.txt" ); outputFile.assertContainsText( "SoutAgain" ); outputFile.assertContainsText( "SoutLine" ); outputFile.assertContainsText( normalizeToDefaultCharset( "äöüß" ) ); if ( includeShutdownHook ) { outputFile.assertContainsText( "Printline in shutdown hook" ); } } /** * @param string the string to normalize * @return the string with all characters not available in the current charset being replaced, e.g. for US-ASCII, * German umlauts would be replaced to ? */ private String normalizeToDefaultCharset( String string ) { Charset cs = Charset.defaultCharset(); if ( cs.canEncode() ) { string = cs.decode( cs.encode( string ) ).toString(); } return string; } @Test public void largerSoutThanMemory() throws Exception { unpack( "consoleoutput-noisy" ).setMavenOpts( "-Xmx64m" ).sysProp( "thousand", "32000" ).executeTest(); } }CrashDetectionIT.java000066400000000000000000000035131330756104600351470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * @author Kristian Rosenvold */ public class CrashDetectionIT extends SurefireJUnit4IntegrationTestCase { @Test public void crashInFork() { unpack( "crash-detection" ).maven().withFailure().executeTest(); } @Test public void crashInReusableFork() { unpack( "crash-detection" ) .forkPerThread() .reuseForks( true ) .threadCount( 1 ) .maven() .withFailure() .executeTest(); } @Test public void hardCrashInReusableFork() { unpack( "crash-detection" ) .forkPerThread() .reuseForks( true ) .threadCount( 1 ) .addGoal( "-DkillHard=true" ) .maven() .withFailure() .executeTest(); } } DefaultConfigurationIT.java000066400000000000000000000024551330756104600363700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test basic default configuration, runs the JUnit 3 test in the src/test directory. * * @author Dan Fabulich */ public class DefaultConfigurationIT extends SurefireJUnit4IntegrationTestCase { @Test public void defaultConfiguration() { executeErrorFreeTest( "default-configuration", 1 ); } } EnvironmentVariableIT.java000066400000000000000000000024531330756104600362240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test basic default configuration, runs the JUnit 3 test in the src/test directory. * * @author Dan Fabulich */ public class EnvironmentVariableIT extends SurefireJUnit4IntegrationTestCase { @Test public void environmentVariable() { executeErrorFreeTest( "junit44-environment", 1 ); } } EnvironmentVariablesIT.java000066400000000000000000000031451330756104600364060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-763 Asserts that environment variables are correctly populated using "useSystemClassLoader=false" * SUREFIRE-963 Asserts that empty environment variables are read as "". * * @author Kristian Rosenvold * @author Christophe Deneux */ public class EnvironmentVariablesIT extends SurefireJUnit4IntegrationTestCase { @Test public void testWhenUseSystemClassLoader() { unpack( "/environment-variables" ).addGoal( "-DuseSystemClassLoader=true" ).executeTest(); } @Test public void testWhenDontUseSystemClassLoader() { unpack( "/environment-variables" ).addGoal( "-DuseSystemClassLoader=false" ).executeTest(); } }FailFastJUnitIT.java000066400000000000000000000102561330756104600347150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import java.util.ArrayList; import static org.junit.runners.Parameterized.Parameters; /** * Test class for SUREFIRE-580, configuration parameter {@code skipAfterFailureCount}. * * @author Tibor Digana (tibor17) * @since 2.19 */ public class FailFastJUnitIT extends AbstractFailFastIT { @Parameters(name = "{0}") public static Iterable data() { /** * reuseForks=false is not used because of race conditions and unpredictable commands received by * MasterProcessReader, this feature has significant limitation. */ ArrayList args = new ArrayList(); // description // profile // forkCount, // fail-fast-count, // reuseForks // total // failures // errors // skipped args.add( new Object[] { "junit4-oneFork-ff1", "junit4", props( 1, 1, true ), 5, 0, 1, 4 } ); args.add( new Object[] { "junit47-oneFork-ff1", "junit47", props( 1, 1, true ), 5, 0, 1, 4 } ); args.add( new Object[] { "junit4-oneFork-ff2", "junit4", props( 1, 2, true ), 5, 0, 2, 3 } ); args.add( new Object[] { "junit47-oneFork-ff2", "junit47", props( 1, 2, true ), 5, 0, 2, 3 } ); args.add( new Object[] { "junit4-twoForks-ff1", "junit4", props( 2, 1, true ), 5, 0, 2, 3 } ); args.add( new Object[] { "junit47-twoForks-ff1", "junit47",props( 2, 1, true ), 5, 0, 2, 3 } ); args.add( new Object[] { "junit4-twoForks-ff2", "junit4", props( 2, 2, true ), 5, 0, 2, 2 } ); args.add( new Object[] { "junit47-twoForks-ff2", "junit47",props( 2, 2, true ), 5, 0, 2, 2 } ); args.add( new Object[] { "junit4-oneFork-ff3", "junit4", props( 1, 3, true ), 5, 0, 2, 0 } ); args.add( new Object[] { "junit47-oneFork-ff3", "junit47", props( 1, 3, true ), 5, 0, 2, 0 } ); args.add( new Object[] { "junit4-twoForks-ff3", "junit4", props( 2, 3, true ), 5, 0, 2, 0 } ); args.add( new Object[] { "junit47-twoForks-ff3", "junit47",props( 2, 3, true ), 5, 0, 2, 0 } ); /*args.add( new Object[] { "junit4-twoForks-ff1x","junit4", props( 2, 1, false ), 5, 0, 2, 3 } ); args.add( new Object[] { "junit47-twoForks-ff1x","junit47",props( 2, 1, false ), 5, 0, 2, 3 } ); args.add( new Object[] { "junit4-twoForks-ff2x","junit4", props( 2, 2, false ), 5, 0, 2, 2 } ); args.add( new Object[] { "junit47-twoForks-ff2x","junit47",props( 2, 2, false ), 5, 0, 2, 2 } );*/ return args; } @Override protected String withProvider() { return "junit"; } } FailFastTestNgIT.java000066400000000000000000000064221330756104600350700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import java.util.ArrayList; import static org.junit.runners.Parameterized.Parameters; /** * Test class for SUREFIRE-580, configuration parameter {@code skipAfterFailureCount}. * * @author Tibor Digana (tibor17) * @since 2.19 */ public class FailFastTestNgIT extends AbstractFailFastIT { @Parameters(name = "{0}") public static Iterable data() { /** * reuseForks=false is not used because of race conditions and unpredictable commands received by * MasterProcessReader, this feature has significant limitation. */ ArrayList args = new ArrayList(); // description // profile // forkCount, // fail-fast-count, // reuseForks // total // failures // errors // skipped args.add( new Object[] { "testng-oneFork-ff1", null, props( 1, 1, true ), 5, 1, 0, 4 } ); args.add( new Object[] { "testng-oneFork-ff2", null, props( 1, 2, true ), 5, 2, 0, 3 } ); args.add( new Object[] { "testng-twoForks-ff1", null, props( 2, 1, true ), 5, 2, 0, 3 } ); args.add( new Object[] { "testng-twoForks-ff2", null, props( 2, 2, true ), 5, 2, 0, 2 } ); args.add( new Object[] { "testng-oneFork-ff3", null, props( 1, 3, true ), 5, 2, 0, 0 } ); args.add( new Object[] { "testng-twoForks-ff3", null, props( 2, 3, true ), 5, 2, 0, 0 } ); /*args.add( new Object[] { "testng-twoForks-ff1x", null, props( 2, 1, false ), 5, 2, 0, 3 } ); args.add( new Object[] { "testng-twoForks-ff2x", null, props( 2, 2, false ), 5, 2, 0, 2 } );*/ return args; } @Override protected String withProvider() { return "testng"; } } ForkConsoleOutputIT.java000066400000000000000000000052461330756104600357220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Asserts proper behaviour of console output when forking * SUREFIRE-639 * SUREFIRE-651 * * @author Kristian Rosenvold */ public class ForkConsoleOutputIT extends SurefireJUnit4IntegrationTestCase { @Test public void printSummaryTrueWithRedirect() { unpack().setForkJvm() .redirectToFile( true ) .printSummary( true ) .executeTest() .getSurefireReportsFile( "forkConsoleOutput.Test1-output.txt" ) .assertFileExists(); } @Test public void printSummaryTrueWithoutRedirect() { unpack().setForkJvm() .redirectToFile( false ) .printSummary( true ) .executeTest() .getSurefireReportsFile( "forkConsoleOutput.Test1-output.txt" ) .assertFileNotExists(); } @Test public void printSummaryFalseWithRedirect() { unpack().setForkJvm() .redirectToFile( true ) .printSummary( false ) .debugLogging() .showErrorStackTraces() .executeTest() .getSurefireReportsFile( "forkConsoleOutput.Test1-output.txt" ) .assertFileExists(); } @Test public void printSummaryFalseWithoutRedirect() { unpack().setForkJvm() .redirectToFile( false ) .printSummary( false ) .executeTest() .getSurefireReportsFile( "forkConsoleOutput.Test1-output.txt" ) .assertFileNotExists(); } private SurefireLauncher unpack() { return unpack( "/fork-consoleOutput" ); } } ForkConsoleOutputWithErrorsIT.java000066400000000000000000000031461330756104600377500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Asserts proper behaviour of console output when forking * SUREFIRE-639 * SUREFIRE-651 * * @author Kristian Rosenvold */ public class ForkConsoleOutputWithErrorsIT extends SurefireJUnit4IntegrationTestCase { @Test public void xmlFileContainsConsoleOutput() { unpack( "/fork-consoleOutputWithErrors" ) .setForkJvm() .failNever() .redirectToFile( true ) .executeTest() .getSurefireReportsXmlFile( "TEST-forkConsoleOutput.Test2.xml" ) .assertContainsText( "sout: Will Fail soon" ) .assertContainsText( "serr: Will Fail now" ); } } ForkModeIT.java000066400000000000000000000177021330756104600337630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.fail; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.apache.maven.surefire.its.fixture.TestFile; import org.junit.BeforeClass; import org.junit.Test; /** * Test forkMode * * @author Dan Fabulich */ public class ForkModeIT extends SurefireJUnit4IntegrationTestCase { private OutputValidator outputValidator; @BeforeClass public static void installDumpPidPlugin() throws Exception { unpack( ForkModeIT.class, "test-helper-dump-pid-plugin", "plugin" ).executeInstall(); } @Test public void testForkModeAlways() { String[] pids = doTest( unpack( getProject() ).setForkJvm().forkAlways() ); assertDifferentPids( pids ); assertEndWith( pids, "_1_1", 3 ); assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) ); } @Test public void testForkModePerTest() { String[] pids = doTest( unpack( getProject() ).setForkJvm().forkPerTest() ); assertDifferentPids( pids ); assertEndWith( pids, "_1_1", 3 ); assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) ); } @Test public void testForkModeNever() { String[] pids = doTest( unpack( getProject() ).forkNever() ); assertSamePids( pids ); assertEndWith( pids, "_1_1", 3 ); assertEquals( "my pid is equal to pid 1 of the test", getMainPID(), pids[0] ); } @Test public void testForkModeNone() { String[] pids = doTest( unpack( getProject() ).forkMode( "none" ) ); assertSamePids( pids ); assertEndWith( pids, "_1_1", 3 ); assertEquals( "my pid is equal to pid 1 of the test", getMainPID(), pids[0] ); } @Test public void testForkModeOncePerThreadSingleThread() { String[] pids = doTest( unpack( getProject() ) .setForkJvm() .forkPerThread() .reuseForks( true ) .threadCount( 1 ) ); assertSamePids( pids ); assertEndWith( pids, "_1_1", 3 ); assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) ); } @Test public void testForkModeOncePerThreadTwoThreads() { String[] pids = doTest( unpack( getProject() ) .forkPerThread() .reuseForks( true ) .threadCount( 2 ) .addGoal( "-DsleepLength=7200" ) ); assertDifferentPids( pids, 2 ); assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) ); } @Test public void testForkCountZero() { String[] pids = doTest( unpack( getProject() ).forkCount( 0 ) ); assertSamePids( pids ); assertEndWith( pids, "_1_1", 3 ); assertEquals( "my pid is equal to pid 1 of the test", getMainPID(), pids[0] ); } @Test public void testForkCountOneNoReuse() { String[] pids = doTest( unpack( getProject() ).setForkJvm().forkCount( 1 ).reuseForks( false ) ); assertDifferentPids( pids ); assertEndWith( pids, "_1_1", 3 ); assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) ); } @Test public void testForkCountOneReuse() { String[] pids = doTest( unpack( getProject() ).setForkJvm().forkCount( 1 ).reuseForks( true ) ); assertSamePids( pids ); assertEndWith( pids, "_1_1", 3 ); assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) ); } @Test public void testForkCountTwoNoReuse() { String[] pids = doTest( unpack( getProject() ).setForkJvm().forkCount( 2 ).reuseForks( false ).addGoal( "-DsleepLength=7200" ) ); assertDifferentPids( pids ); assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) ); } @Test public void testForkCountTwoReuse() { String[] pids = doTest( unpack( getProject() ).forkCount( 2 ).reuseForks( true ).addGoal( "-DsleepLength=7200" ) ); assertDifferentPids( pids, 2 ); assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) ); } private void assertEndWith( String[] pids, String suffix, int expectedMatches ) { int matches = 0; for ( String pid : pids ) { if ( pid.endsWith( suffix ) ) { matches++; } } assertEquals( "suffix " + suffix + " matched the correct number of pids", expectedMatches, matches ); } private void assertDifferentPids( String[] pids, int numOfDifferentPids ) { Set pidSet = new HashSet( Arrays.asList( pids ) ); assertEquals( "number of different pids is not as expected", numOfDifferentPids, pidSet.size() ); } @Test public void testForkModeOnce() { String[] pids = doTest( unpack( getProject() ).forkOnce() ); assertSamePids( pids ); assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) ); } private String getMainPID() { final TestFile targetFile = outputValidator.getTargetFile( "maven.pid" ); String pid = targetFile.slurpFile(); return pid + " testValue_1_1"; } private void assertSamePids( String[] pids ) { assertEquals( "pid 1 didn't match pid 2", pids[0], pids[1] ); assertEquals( "pid 1 didn't match pid 3", pids[0], pids[2] ); } private void assertDifferentPids( String[] pids ) { if ( pids[0].equals( pids[1] ) ) { fail( "pid 1 matched pid 2: " + pids[0] ); } if ( pids[0].equals( pids[2] ) ) { fail( "pid 1 matched pid 3: " + pids[0] ); } if ( pids[1].equals( pids[2] ) ) { fail( "pid 2 matched pid 3: " + pids[0] ); } } private String[] doTest( SurefireLauncher forkMode ) { forkMode.sysProp( "testProperty", "testValue_${surefire.threadNumber}_${surefire.forkNumber}" ); forkMode.addGoal( "org.apache.maven.plugins.surefire:maven-dump-pid-plugin:dump-pid" ); outputValidator = forkMode.executeTest(); outputValidator.verifyErrorFreeLog().assertTestSuiteResults( 3, 0, 0, 0 ); String[] pids = new String[3]; for ( int i = 1; i <= pids.length; i++ ) { final TestFile targetFile = outputValidator.getTargetFile( "test" + i + "-pid" ); String pid = targetFile.slurpFile(); pids[i - 1] = pid; } return pids; } protected String getProject() { return "fork-mode"; } } ForkModeMultiModuleIT.java000066400000000000000000000137061330756104600361440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.*; import org.junit.Test; import java.io.File; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; /** * Test forkMode in a multi module project with parallel maven builds * * @author Andreas Gudian */ public class ForkModeMultiModuleIT extends SurefireJUnit4IntegrationTestCase { @Test public void testForkCountOneNoReuse() { List pids = doTest( unpack( getProject() ).forkCount( 1 ).reuseForks( false ) ); assertAllDifferentPids( pids ); int matchesOne = countSuffixMatches( pids, "_1_1"); int matchesTwo = countSuffixMatches( pids, "_2_2" ); assertTrue( "At least one fork had forkNumber 1", matchesOne >= 1 ); assertTrue( "At least one fork had forkNumber 2", matchesTwo >= 1 ); assertEquals( "No other forkNumbers than 1 and 2 have been used", 6, matchesOne + matchesTwo); } @Test public void testForkCountOneReuse() { List pids = doTest( unpack( getProject() ).forkCount( 1 ).reuseForks( true ) ); assertDifferentPids( pids, 2 ); assertEndWith( pids, "_1_1", 3 ); assertEndWith( pids, "_2_2", 3 ); } @Test public void testForkCountTwoNoReuse() { List pids = doTest( unpack( getProject() ).forkCount( 2 ).reuseForks( false ) ); assertAllDifferentPids( pids ); int matchesOne = countSuffixMatches( pids, "_1_1"); int matchesTwo = countSuffixMatches( pids, "_2_2" ); int matchesThree = countSuffixMatches( pids, "_3_3"); int matchesFour = countSuffixMatches( pids, "_4_4" ); assertTrue( "At least one fork had forkNumber 1", matchesOne >= 1 ); assertTrue( "At least one fork had forkNumber 2", matchesTwo >= 1 ); assertTrue( "At least one fork had forkNumber 3", matchesThree >= 1 ); assertTrue( "At least one fork had forkNumber 4", matchesFour >= 1 ); assertEquals( "No other forkNumbers than 1, 2, 3, or 4 have been used", 6, matchesOne + matchesTwo + matchesThree + matchesFour ); } @Test public void testForkCountTwoReuse() { List pids = doTest( unpack( getProject() ).forkCount( 2 ).reuseForks( true ) ); assertDifferentPids( pids, 4 ); int matchesOne = countSuffixMatches( pids, "_1_1"); int matchesTwo = countSuffixMatches( pids, "_2_2" ); int matchesThree = countSuffixMatches( pids, "_3_3"); int matchesFour = countSuffixMatches( pids, "_4_4" ); assertTrue( "At least one fork had forkNumber 1", matchesOne >= 1 ); assertTrue( "At least one fork had forkNumber 2", matchesTwo >= 1 ); assertTrue( "At least one fork had forkNumber 3", matchesThree >= 1 ); assertTrue( "At least one fork had forkNumber 4", matchesFour >= 1 ); assertEquals( "No other forkNumbers than 1, 2, 3, or 4 have been used", 6, matchesOne + matchesTwo + matchesThree + matchesFour ); } private void assertEndWith( List pids, String suffix, int expectedMatches ) { int matches = countSuffixMatches( pids, suffix ); assertEquals( "suffix " + suffix + " matched the correct number of pids", expectedMatches, matches ); } private int countSuffixMatches( List pids, String suffix ) { int matches = 0; for ( String pid : pids ) { if ( pid.endsWith( suffix ) ) { matches++; } } return matches; } private void assertDifferentPids( List pids, int numOfDifferentPids ) { Set pidSet = new HashSet( pids ); assertEquals( "number of different pids is not as expected", numOfDifferentPids, pidSet.size() ); } private void assertAllDifferentPids( List pids ) { assertDifferentPids( pids, pids.size() ); } private List doTest( SurefireLauncher forkMode ) { forkMode.addGoal( "-T2" ); forkMode.sysProp( "testProperty", "testValue_${surefire.threadNumber}_${surefire.forkNumber}" ); final OutputValidator outputValidator = forkMode.setForkJvm().executeTest(); List pids = new ArrayList( 6 ); pids.addAll( validateModule( outputValidator, "module-a" ) ); pids.addAll( validateModule( outputValidator, "module-b" ) ); return pids; } private List validateModule( OutputValidator outputValidator, String module ) { HelperAssertions.assertTestSuiteResults( 3, 0, 0, 0, new File( outputValidator.getBaseDir(), module ) ); List pids = new ArrayList( 3 ); for ( int i = 1; i <= 3; i++ ) { final TestFile targetFile = outputValidator.getTargetFile( module, "test" + i + "-pid" ); String pid = targetFile.slurpFile(); pids.add( pid ); } return pids; } protected String getProject() { return "fork-mode-multimodule"; } } ForkModeTestNGIT.java000066400000000000000000000021101330756104600350330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ /** * Test forkMode * * @author Marvin Froeder */ public class ForkModeTestNGIT extends ForkModeIT { @Override protected String getProject() { return "fork-mode-testng"; } } IncludesExcludesFromFileIT.java000066400000000000000000000053551330756104600371450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Test include/exclude from files. *
* Based on {@link IncludesExcludesIT}. */ public class IncludesExcludesFromFileIT extends SurefireJUnit4IntegrationTestCase { private SurefireLauncher unpack() { return unpack( "/includes-excludes-from-file" ); } @Test public void testSimple() { testWithProfile( "simple" ); } @Test public void testSimpleMixed() { testWithProfile( "simple-mixed" ); } @Test public void testRegex() { testWithProfile( "regex" ); } @Test public void testPath() { testWithProfile( "path" ); } @Test public void testMissingExcludes() { expectBuildFailure("missing-excludes-file", "Failed to load list from file", "no-such-excludes-file"); } @Test public void testMissingIncludes() { expectBuildFailure( "missing-includes-file", "Failed to load list from file", "no-such-includes-file" ); } private void testWithProfile( String profile ) { final OutputValidator outputValidator = unpack(). activateProfile( profile ).executeTest().verifyErrorFree( 2 ); outputValidator.getTargetFile( "testTouchFile.txt" ).assertFileExists(); outputValidator.getTargetFile( "defaultTestTouchFile.txt" ).assertFileExists(); } private void expectBuildFailure( final String profile, final String... messages ) { final OutputValidator outputValidator = unpack().activateProfile( profile ) .maven().withFailure().executeTest(); for ( String message : messages ) { outputValidator.verifyTextInLog( message ); } } } IncludesExcludesIT.java000066400000000000000000000040201330756104600355050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Test include/exclude patterns. * * @author Benjamin Bentmann */ public class IncludesExcludesIT extends SurefireJUnit4IntegrationTestCase { private SurefireLauncher unpack() { return unpack( "/includes-excludes" ); } /** * Test surefire inclusions/exclusions */ @Test public void testIncludesExcludes() { testWithProfile( "simple" ); } @Test public void testRegexIncludesExcludes() { testWithProfile( "regex" ); } @Test public void testPathBasedIncludesExcludes() { testWithProfile( "path" ); } private void testWithProfile( String profile ) { final OutputValidator outputValidator = unpack(). activateProfile( profile ).executeTest().verifyErrorFree( 2 ); outputValidator.getTargetFile( "testTouchFile.txt" ).assertFileExists(); outputValidator.getTargetFile( "defaultTestTouchFile.txt" ).assertFileExists(); } } JUnit44HamcrestIT.java000066400000000000000000000024131330756104600351360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test project using JUnit4.4 (including Hamcrest extensions) * * @author Dan Fabulich */ public class JUnit44HamcrestIT extends SurefireJUnit4IntegrationTestCase { @Test public void testJUnit44Hamcrest() { executeErrorFreeTest( "junit44-hamcrest", 1 ); } } JUnit47ConcurrencyIT.java000066400000000000000000000040441330756104600356670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; import static org.hamcrest.CoreMatchers.containsString; import static org.junit.Assert.*; import static org.hamcrest.CoreMatchers.*; /** * Basic suite test using all known versions of JUnit 4.x * * @author Kristian Rosenvold */ public class JUnit47ConcurrencyIT extends SurefireJUnit4IntegrationTestCase { @Test public void test47() throws Exception { OutputValidator validator = unpack( "junit47-concurrency" ) .executeTest() .verifyErrorFree( 4 ); String result = null; for ( String line : validator.loadLogLines() ) { if ( line.startsWith( "[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:" ) ) { result = line; break; } } assertNotNull( result); assertThat( result, anyOf( containsString( "Time elapsed: 1." ), containsString( "Time elapsed: 0.9" ) ) ); assertThat( result, endsWith( " s - in concurrentjunit47.src.test.java.junit47.BasicTest" ) ); } }JUnit47ParallelIT.java000066400000000000000000000502171330756104600351340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Testing JUnitCoreWrapper with ParallelComputerBuilder. * * @author Tibor Digana (tibor17) * @since 2.16 */ public class JUnit47ParallelIT extends SurefireJUnit4IntegrationTestCase { @Test public void unknownThreadCountSuites() { unpack().parallelSuites().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog( "Use threadCount or threadCountSuites > 0 or useUnlimitedThreads=true for parallel='suites'" ); } @Test public void unknownThreadCountClasses() { unpack().parallelClasses().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog( "Use threadCount or threadCountClasses > 0 or useUnlimitedThreads=true for parallel='classes'" ); } @Test public void unknownThreadCountMethods() { unpack().parallelMethods().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog( "Use threadCount or threadCountMethods > 0 or useUnlimitedThreads=true for parallel='methods'" ); } @Test public void unknownThreadCountBoth() { unpack().parallelBoth().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog( "Use useUnlimitedThreads=true, " + "or only threadCount > 0, " + "or (threadCountClasses > 0 and threadCountMethods > 0), " + "or (threadCount > 0 and threadCountClasses > 0 and threadCountMethods > 0), " + "or (threadCount > 0 and threadCountClasses > 0 and threadCount > threadCountClasses) " + "for parallel='both' or parallel='classesAndMethods'" ); } @Test public void unknownThreadCountAll() { unpack().parallelAll().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog( "Use useUnlimitedThreads=true, " + "or only threadCount > 0, " + "or (threadCountSuites > 0 and threadCountClasses > 0 and threadCountMethods > 0), " + "or every thread-count is specified, " + "or (threadCount > 0 and threadCountSuites > 0 and threadCountClasses > 0 " + "and threadCount > threadCountSuites + threadCountClasses) " + "for parallel='all'" ); } @Test public void unknownThreadCountSuitesAndClasses() { unpack().parallelSuitesAndClasses().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog( "Use useUnlimitedThreads=true, " + "or only threadCount > 0, " + "or (threadCountSuites > 0 and threadCountClasses > 0), " + "or (threadCount > 0 and threadCountSuites > 0 and threadCountClasses > 0) " + "or (threadCount > 0 and threadCountSuites > 0 and threadCount > threadCountSuites) " + "for parallel='suitesAndClasses' or 'both'" ); } @Test public void unknownThreadCountSuitesAndMethods() { unpack().parallelSuitesAndMethods().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog( "Use useUnlimitedThreads=true, " + "or only threadCount > 0, " + "or (threadCountSuites > 0 and threadCountMethods > 0), " + "or (threadCount > 0 and threadCountSuites > 0 and threadCountMethods > 0), " + "or (threadCount > 0 and threadCountSuites > 0 and threadCount > threadCountSuites) " + "for parallel='suitesAndMethods'" ); } @Test public void unknownThreadCountClassesAndMethods() { unpack().parallelClassesAndMethods().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog( "Use useUnlimitedThreads=true, " + "or only threadCount > 0, " + "or (threadCountClasses > 0 and threadCountMethods > 0), " + "or (threadCount > 0 and threadCountClasses > 0 and threadCountMethods > 0), " + "or (threadCount > 0 and threadCountClasses > 0 and threadCount > threadCountClasses) " + "for parallel='both' or parallel='classesAndMethods'" ); } @Test public void serial() { // takes 7.2 sec unpack().setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void unlimitedThreadsSuites1() { // takes 3.6 sec unpack().parallelSuites().useUnlimitedThreads().setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void unlimitedThreadsSuites2() { // takes 3.6 sec unpack().parallelSuites().useUnlimitedThreads().threadCountSuites( 5 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void unlimitedThreadsClasses1() { // takes 1.8 sec unpack().parallelClasses().useUnlimitedThreads().setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void unlimitedThreadsClasses2() { // takes 1.8 sec unpack().parallelClasses().useUnlimitedThreads().threadCountClasses( 5 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void unlimitedThreadsMethods1() { // takes 2.4 sec unpack().parallelMethods().useUnlimitedThreads().setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void unlimitedThreadsMethods2() { // takes 2.4 sec unpack().parallelMethods().useUnlimitedThreads().threadCountMethods( 5 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void unlimitedThreadsSuitesAndClasses1() { // takes 0.9 sec unpack().parallelSuitesAndClasses().useUnlimitedThreads().setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void unlimitedThreadsSuitesAndClasses2() { // takes 0.9 sec // 1.8 sec with 4 parallel classes unpack().parallelSuitesAndClasses().useUnlimitedThreads().threadCountSuites( 5 ).threadCountClasses( 15 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void unlimitedThreadsSuitesAndMethods1() { // takes 1.2 sec unpack().parallelSuitesAndMethods().useUnlimitedThreads().setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void unlimitedThreadsSuitesAndMethods2() { // takes 1.2 sec unpack().parallelSuitesAndMethods().useUnlimitedThreads().threadCountSuites( 5 ).threadCountMethods( 15 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void unlimitedThreadsClassesAndMethods1() { // takes 0.6 sec unpack().parallelClassesAndMethods().useUnlimitedThreads().setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void unlimitedThreadsClassesAndMethods2() { // takes 0.6 sec unpack().parallelClassesAndMethods().useUnlimitedThreads().threadCountClasses( 5 ).threadCountMethods( 15 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void unlimitedThreadsAll1() { // takes 0.3 sec unpack().parallelAll().useUnlimitedThreads().setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void unlimitedThreadsAll2() { // takes 0.3 sec unpack().parallelAll().useUnlimitedThreads().threadCountSuites( 5 ).threadCountClasses( 15 ).threadCountMethods( 30 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void threadCountSuites() { // takes 3.6 sec unpack().parallelSuites().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void threadCountClasses() { // takes 3.6 sec for single core // takes 1.8 sec for double core unpack().parallelClasses().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void threadCountMethods() { // takes 2.4 sec unpack().parallelMethods().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void threadCountClassesAndMethodsOneCore() { // takes 4.8 sec unpack().disablePerCoreThreadCount().disableParallelOptimization().parallelClassesAndMethods().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void threadCountClassesAndMethodsOneCoreOptimized() { // the number of reused threads in leafs depends on the number of runners and CPU unpack().disablePerCoreThreadCount().parallelClassesAndMethods().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void threadCountClassesAndMethods() { // takes 2.4 sec for double core CPU unpack().disableParallelOptimization().parallelClassesAndMethods().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void threadCountClassesAndMethodsOptimized() { // the number of reused threads in leafs depends on the number of runners and CPU unpack().parallelClassesAndMethods().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void threadCountSuitesAndMethods() { // usually 24 times 0.3 sec = 7.2 sec with one core CPU // takes 1.8 sec for double core CPU unpack().disableParallelOptimization().parallelSuitesAndMethods().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void threadCountSuitesAndMethodsOptimized() { // the number of reused threads in leafs depends on the number of runners and CPU unpack().parallelSuitesAndMethods().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void threadCountSuitesAndClasses() { unpack().disableParallelOptimization().parallelSuitesAndClasses().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void threadCountSuitesAndClassesOptimized() { // the number of reused threads in leafs depends on the number of runners and CPU unpack().parallelSuitesAndClasses().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void threadCountAll() { unpack().disableParallelOptimization().parallelAll().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void threadCountAllOptimized() { // the number of reused threads in leafs depends on the number of runners and CPU unpack().parallelAll().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void everyThreadCountSuitesAndClasses() { // takes 1.8 sec for double core CPU unpack().parallelSuitesAndClasses().threadCount( 3 ).threadCountSuites( 34 ).threadCountClasses( 66 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void everyThreadCountSuitesAndMethods() { // takes 1.8 sec for double core CPU unpack().parallelSuitesAndMethods().threadCount( 3 ).threadCountSuites( 34 ).threadCountMethods( 66 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void everyThreadCountClassesAndMethods() { // takes 1.8 sec for double core CPU unpack().parallelClassesAndMethods().threadCount( 3 ).threadCountClasses( 34 ).threadCountMethods( 66 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void everyThreadCountAll() { // takes 2.4 sec for double core CPU unpack().parallelAll().threadCount( 3 ).threadCountSuites( 17 ).threadCountClasses( 34 ).threadCountMethods( 49 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void reusableThreadCountSuitesAndClasses() { // 4 * cpu to 5 * cpu threads to run test classes // takes cca 1.8 sec unpack().disableParallelOptimization().parallelSuitesAndClasses().disablePerCoreThreadCount().threadCount( 6 ).threadCountSuites( 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void reusableThreadCountSuitesAndClassesOptimized() { // the number of reused threads in leafs depends on the number of runners and CPU unpack().parallelSuitesAndClasses().disablePerCoreThreadCount().threadCount( 6 ).threadCountSuites( 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void reusableThreadCountSuitesAndMethods() { // 4 * cpu to 5 * cpu threads to run test methods // takes cca 1.8 sec unpack().disableParallelOptimization().parallelSuitesAndMethods().disablePerCoreThreadCount().threadCount( 6 ).threadCountSuites( 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void reusableThreadCountSuitesAndMethodsOptimized() { // the number of reused threads in leafs depends on the number of runners and CPU unpack().parallelSuitesAndMethods().disablePerCoreThreadCount().threadCount( 6 ).threadCountSuites( 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void reusableThreadCountClassesAndMethods() { // 4 * cpu to 5 * cpu threads to run test methods // takes cca 1.8 sec unpack().disableParallelOptimization().parallelClassesAndMethods().disablePerCoreThreadCount().threadCount( 6 ).threadCountClasses( 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void reusableThreadCountClassesAndMethodsOptimized() { // the number of reused threads in leafs depends on the number of runners and CPU unpack().parallelClassesAndMethods().disablePerCoreThreadCount().threadCount( 6 ).threadCountClasses( 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void reusableThreadCountAll() { // 8 * cpu to 13 * cpu threads to run test methods // takes 0.9 sec unpack().disableParallelOptimization().parallelAll().disablePerCoreThreadCount().threadCount( 14 ).threadCountSuites( 2 ).threadCountClasses( 4 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void reusableThreadCountAllOptimized() { // the number of reused threads in leafs depends on the number of runners and CPU unpack().parallelAll().disablePerCoreThreadCount().threadCount( 14 ).threadCountSuites( 2 ).threadCountClasses( 4 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void suites() { // takes 3.6 sec unpack().parallelSuites().threadCountSuites( 5 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void classes() { // takes 1.8 sec on any CPU because the suites are running in a sequence unpack().parallelClasses().threadCountClasses( 5 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void methods() { // takes 2.4 sec on any CPU because every class has only three methods // and the suites and classes are running in a sequence unpack().parallelMethods().threadCountMethods( 5 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void suitesAndClasses() { // takes 0.9 sec unpack().parallelSuitesAndClasses().threadCountSuites( 5 ).threadCountClasses( 15 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void suitesAndMethods() { // takes 1.2 sec on any CPU unpack().parallelSuitesAndMethods().threadCountSuites( 5 ).threadCountMethods( 15 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void classesAndMethods() { // takes 0.6 sec on any CPU unpack().parallelClassesAndMethods().threadCountClasses( 5 ).threadCountMethods( 15 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void all() { // takes 0.3 sec on any CPU unpack().parallelAll().threadCountSuites( 5 ).threadCountClasses( 15 ).threadCountMethods( 30 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 ); } @Test public void shutdown() { // executes for 2.5 sec until timeout has elapsed unpack().parallelMethods().threadCountMethods( 2 ).parallelTestsTimeoutInSeconds( 2.5d ).setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog( "The test run has finished abruptly after timeout of 2.5 seconds." ); } @Test public void forcedShutdown() { // executes for 2.5 sec until timeout has elapsed unpack().parallelMethods().threadCountMethods( 2 ).parallelTestsTimeoutForcedInSeconds( 2.5d ).setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog( "The test run has finished abruptly after timeout of 2.5 seconds." ); } @Test public void timeoutAndForcedShutdown() { // executes for one sec until timeout has elapsed unpack().parallelMethods().threadCountMethods( 2 ).parallelTestsTimeoutInSeconds( 1 ).parallelTestsTimeoutForcedInSeconds( 2.5d ).setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog( "The test run has finished abruptly after timeout of 1.0 seconds." ); } @Test public void forcedShutdownVerifyingLogs() { // attempts to run for 2.4 sec until timeout has elapsed unpack().parallelMethods().threadCountMethods( 3 ).disablePerCoreThreadCount() .parallelTestsTimeoutForcedInSeconds( 1.05d ).setTestToRun( "Waiting*Test" ).failNever().executeTest() .verifyTextInLog( "The test run has finished abruptly after timeout of 1.05 seconds." ) .verifyTextInLog( "These tests were executed in prior to the shutdown operation:" ) .verifyTextInLog( "These tests are incomplete:" ); } private SurefireLauncher unpack() { return unpack( "junit47-parallel" ) .showErrorStackTraces() .forkOnce() .redirectToFile( false ); } }JUnit47ParallelNotThreadSafeIT.java000066400000000000000000000032601330756104600375400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Testing {@code @net.jcip.annotations.NotThreadSafe} with ParallelComputerBuilder. * * @author Tibor Digana (tibor17) * @since 2.19 */ public class JUnit47ParallelNotThreadSafeIT extends SurefireJUnit4IntegrationTestCase { private SurefireLauncher unpack() { return unpack( "junit47-parallel-nts" ); } @Test public void test() { unpack() .parallelAll() .useUnlimitedThreads() .executeTest() .verifyErrorFree( 2 ) .verifyTextInLog( "xxx-maven-surefire-plugin@NotThreadSafe" ) .verifyTextInLog( "expected-thread" ); } } JUnit47RedirectOutputIT.java000066400000000000000000000047211330756104600363610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.commons.lang.StringUtils; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import java.io.IOException; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; public class JUnit47RedirectOutputIT extends SurefireJUnit4IntegrationTestCase { @Test public void testPrintSummaryTrueWithRedirect() throws Exception { final OutputValidator clean = unpack().redirectToFile( true ).addGoal( "clean" ).executeTest(); checkReports( clean ); } @Test public void testClassesParallel() throws Exception { final OutputValidator clean = unpack().redirectToFile( true ).parallelClasses().addGoal( "clean" ).executeTest(); checkReports( clean ); } private void checkReports( OutputValidator validator ) throws IOException { String report = StringUtils.trimToNull( validator.getSurefireReportsFile( "junit47ConsoleOutput.Test1-output.txt" ).readFileToString() ); assertNotNull( report ); String report2 = StringUtils.trimToNull( validator.getSurefireReportsFile( "junit47ConsoleOutput.Test2-output.txt" ).readFileToString() ); assertNotNull( report2 ); assertFalse( validator.getSurefireReportsFile( "junit47ConsoleOutput.Test3-output.txt" ).exists() ); } private SurefireLauncher unpack() { return unpack( "/junit47-redirect-output" ); } } JUnit47RerunFailingTestWithCucumberIT.java000066400000000000000000000051171330756104600411460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Before; import org.junit.Test; /** * Tests using the JUnit 47 provider to rerun failing tests with the cucumber runner. The main * problem that the junit4 provider has with the cucumber runner is that the junit Description * instance created by the runner has a null test class attribute. This requires that tests are * rerun based on their description. * * @author mpkorstanje */ public class JUnit47RerunFailingTestWithCucumberIT extends SurefireJUnit4IntegrationTestCase { @Before public void assumeJdk17() { assumeJavaVersion(1.7d); } private SurefireLauncher unpack() { return unpack("junit47-rerun-failing-tests-with-cucumber") .setJUnitVersion("4.12"); } @Test public void testRerunFailingErrorTestsFalse() { unpack() .maven() .addGoal("-Dsurefire.rerunFailingTestsCount=" + 0) .withFailure() .executeTest() .assertTestSuiteResults(1, 0, 1, 0, 0); } @Test public void testRerunFailingErrorTestsWithOneRetry() { unpack() .maven() .addGoal("-Dsurefire.rerunFailingTestsCount=" + 1) .withFailure() .executeTest() .assertTestSuiteResults(1, 0, 1, 0, 0); } @Test public void testRerunFailingErrorTestsTwoRetry() { unpack() .maven() .addGoal("-Dsurefire.rerunFailingTestsCount=" + 2) .executeTest() .assertTestSuiteResults(1, 0, 0, 0, 2); } } JUnit47StaticInnerClassTestsIT.java000066400000000000000000000022431330756104600376300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; public class JUnit47StaticInnerClassTestsIT extends SurefireJUnit4IntegrationTestCase { @Test public void testStaticInnerClassTests() { executeErrorFreeTest( "junit47-static-inner-class-tests", 3 ); } } JUnit47WithCucumberIT.java000066400000000000000000000046361330756104600360050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Before; import org.junit.Test; import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion; /** * Tests the JUnit 47 provider with the cucumber runner. At the moment, they don't play along that perfectly (minor * glitches in the reports with parallel=classes), but at least all tests are executed, the execution times are counted * correctly and failing tests are reported. The main problem that the junit47 provider has with the cucumber runner is * that the junit Description instance created by the runner has a null test class attribute. * * @author agudian */ public class JUnit47WithCucumberIT extends SurefireJUnit4IntegrationTestCase { @Before public void assumeJdk16() { assumeJavaVersion( 1.6d ); } @Test public void testWithoutParallel() { // 8 tests in total is what's probably correct doTest( "none", 8 ); } @Test public void testWithParallelClasses() { // with parallel=classes, we get 9 tests in total, // as the dummy "scenario" test entry is reported twice: once as success, and once with the failure from the // failing test step doTest( "classes", 9 ); } private void doTest( String parallel, int total ) { unpack( "junit47-cucumber" ) .sysProp( "parallel", parallel ) .sysProp( "threadCount", "2" ) .executeTest() .assertTestSuiteResults( total, 0, 2, 0 ); } } JUnit48TestCategoriesIT.java000066400000000000000000000106161330756104600363250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Test project using "groups" support * * @author Todd Lipcon * @author Kristian Rosenvold */ public class JUnit48TestCategoriesIT extends SurefireJUnit4IntegrationTestCase { @Test public void testCategoriesAB() { runAB( unpacked() ); } @Test public void testCategoriesABForkAlways() { runAB( unpacked().forkAlways() ); } @Test public void testCategoriesACFullyQualifiedClassName() { runACFullyQualifiedClassName( unpacked() ); } @Test public void testCategoriesACFullyQualifiedClassNameForkAlways() { runACFullyQualifiedClassName( unpacked().forkAlways() ); } @Test public void testCategoriesACClassNameSuffix() { runACClassNameSuffix( unpacked() ); } @Test public void testCategoriesACClassNameSuffixForkAlways() { runACClassNameSuffix( unpacked().forkAlways() ); } @Test public void testCategoriesBadCategory() { runBadCategory( unpacked() ); } @Test public void testBadCategoryForkAlways() { runBadCategory( unpacked().forkAlways() ); } private static void runAB( SurefireLauncher unpacked ) { unpacked.executeTest() .verifyErrorFreeLog() .assertTestSuiteResults( 3, 0, 0, 0 ) .verifyTextInLog( "catA: 1" ) .verifyTextInLog( "catB: 1" ) .verifyTextInLog( "catC: 0" ) .verifyTextInLog( "catNone: 0" ); } private static void runACClassNameSuffix( SurefireLauncher unpacked ) { unpacked.groups( "CategoryA,CategoryC" ) .executeTest() .verifyErrorFreeLog() .assertTestSuiteResults( 6, 0, 0, 0 ) .verifyTextInLog( "catA: 1" ) .verifyTextInLog( "catB: 0" ) .verifyTextInLog( "catC: 1" ) .verifyTextInLog( "catNone: 0" ) .verifyTextInLog( "mA: 1" ) // This seems questionable !? The class is annotated with category C and method with B .verifyTextInLog( "mB: 1" ) .verifyTextInLog( "mC: 1" ) .verifyTextInLog( "CatNone: 1" ); } private static void runACFullyQualifiedClassName( SurefireLauncher unpacked ) { unpacked.groups( "junit4.CategoryA,junit4.CategoryC" ) .executeTest() .verifyErrorFreeLog() .assertTestSuiteResults( 6, 0, 0, 0 ) .verifyTextInLog( "catA: 1" ) .verifyTextInLog( "catB: 0" ) .verifyTextInLog( "catC: 1" ) .verifyTextInLog( "catNone: 0" ) .verifyTextInLog( "mA: 1" ) // This seems questionable !? The class is annotated with category C and method with B .verifyTextInLog( "mB: 1" ) .verifyTextInLog( "mC: 1" ) .verifyTextInLog( "CatNone: 1" ); } private static void runBadCategory( SurefireLauncher unpacked ) { unpacked.failIfNoTests( false ) .groups( "BadCategory" ) .executeTest() .verifyErrorFreeLog(); } private SurefireLauncher unpacked() { return unpack( "/junit48-categories" ); // .debugSurefireFork(); } } JUnit4ForkAlwaysStaticInitPollutionIT.java000066400000000000000000000024361330756104600412750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test JUnit 4 tests marked with "Ignore" attribute * * @author Dan Fabulich */ public class JUnit4ForkAlwaysStaticInitPollutionIT extends SurefireJUnit4IntegrationTestCase { @Test public void testJunit4Ignore() { executeErrorFreeTest( "junit4-forkAlways-staticInit", 2 ); } } JUnit4IgnoreIT.java000066400000000000000000000033211330756104600345260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Test JUnit 4 tests marked with "Ignore" attribute * * @author Dan Fabulich */ public class JUnit4IgnoreIT extends SurefireJUnit4IntegrationTestCase { @Test public void testJunit4Ignore() { // Todo: Support assumption failure == ignore for junit4 unpack().executeTest().verifyErrorFreeLog().assertTestSuiteResults( 7, 0, 0, 6 ); } @Test public void testJunit47ParallelIgnore() { unpack().setJUnitVersion( "4.8.1" ).parallelClasses().executeTest().verifyErrorFreeLog().assertTestSuiteResults( 7, 0, 0, 7 ); } private SurefireLauncher unpack() { return unpack( "/junit-ignore" ); } } JUnit4RerunFailingTestsIT.java000066400000000000000000000325271330756104600367250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * JUnit4 RunListener Integration Test. * * @author Qingzhou Luo */ public class JUnit4RerunFailingTestsIT extends SurefireJUnit4IntegrationTestCase { private SurefireLauncher unpack() { return unpack( "/junit4-rerun-failing-tests" ); } @Test public void testRerunFailingErrorTestsWithOneRetry() throws Exception { OutputValidator outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=1" ).withFailure().executeTest().assertTestSuiteResults( 5, 1, 1, 0, 0 ); verifyFailuresOneRetryAllClasses( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-DforkCount=2" ).withFailure().executeTest().assertTestSuiteResults( 5, 1, 1, 0, 0 ); verifyFailuresOneRetryAllClasses( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-Dparallel=methods" ).addGoal( "-DuseUnlimitedThreads=true" ).withFailure().executeTest().assertTestSuiteResults( 5, 1, 1, 0, 0 ); verifyFailuresOneRetryAllClasses( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-Dparallel=classes" ).addGoal( "-DuseUnlimitedThreads=true" ).withFailure().executeTest().assertTestSuiteResults( 5, 1, 1, 0, 0 ); verifyFailuresOneRetryAllClasses( outputValidator ); } @Test public void testRerunFailingErrorTestsTwoRetry() throws Exception { // Four flakes, both tests have been re-run twice OutputValidator outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=2" ).executeTest().assertTestSuiteResults( 5, 0, 0, 0, 4 ); verifyFailuresTwoRetryAllClasses( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=2" ).addGoal( "-DforkCount=3" ).executeTest() .assertTestSuiteResults( 5, 0, 0, 0, 4 ); verifyFailuresTwoRetryAllClasses( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=2" ).addGoal( "-Dparallel=methods" ).addGoal( "-DuseUnlimitedThreads=true" ).executeTest().assertTestSuiteResults( 5, 0, 0, 0, 4 ); verifyFailuresTwoRetryAllClasses( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=2" ).addGoal( "-Dparallel=classes" ).addGoal( "-DuseUnlimitedThreads=true" ).executeTest().assertTestSuiteResults( 5, 0, 0, 0, 4 ); verifyFailuresTwoRetryAllClasses( outputValidator ); } @Test public void testRerunFailingErrorTestsFalse() throws Exception { OutputValidator outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().withFailure().executeTest().assertTestSuiteResults( 5, 1, 1, 0, 0 ); verifyFailuresNoRetryAllClasses( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-DforkCount=3" ).withFailure().executeTest().assertTestSuiteResults( 5, 1, 1, 0, 0 ); verifyFailuresNoRetryAllClasses( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dparallel=methods" ).addGoal( "-DuseUnlimitedThreads=true" ).withFailure().executeTest().assertTestSuiteResults( 5, 1, 1, 0, 0 ); verifyFailuresNoRetryAllClasses( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dparallel=classes" ).addGoal( "-DuseUnlimitedThreads=true" ).withFailure().executeTest().assertTestSuiteResults( 5, 1, 1, 0, 0 ); verifyFailuresNoRetryAllClasses( outputValidator ); } @Test public void testRerunOneTestClass() throws Exception { OutputValidator outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-Dtest=FlakyFirstTimeTest" ).withFailure().executeTest().assertTestSuiteResults( 3, 1, 1, 0, 0 ); verifyFailuresOneRetryOneClass( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-DforkCount=3" ).addGoal( "-Dtest=FlakyFirstTimeTest" ).withFailure().executeTest().assertTestSuiteResults( 3, 1, 1, 0, 0 ); verifyFailuresOneRetryOneClass( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-Dparallel=methods" ).addGoal( "-DuseUnlimitedThreads=true" ).addGoal( "-Dtest=FlakyFirstTimeTest" ).withFailure().executeTest().assertTestSuiteResults( 3, 1, 1, 0, 0 ); verifyFailuresOneRetryOneClass( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-Dparallel=classes" ).addGoal( "-DuseUnlimitedThreads=true" ).addGoal( "-Dtest=FlakyFirstTimeTest" ).withFailure().executeTest().assertTestSuiteResults( 3, 1, 1, 0, 0 ); verifyFailuresOneRetryOneClass( outputValidator ); } @Test public void testRerunOneTestMethod() throws Exception { OutputValidator outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-Dtest=FlakyFirstTimeTest#testFailing*" ).withFailure().executeTest().assertTestSuiteResults( 1, 0, 1, 0, 0 ); verifyFailuresOneRetryOneMethod( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-DforkCount=3" ).addGoal( "-Dtest=FlakyFirstTimeTest#testFailing*" ).withFailure().executeTest().assertTestSuiteResults( 1, 0, 1, 0, 0 ); verifyFailuresOneRetryOneMethod( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-Dparallel=methods" ).addGoal( "-DuseUnlimitedThreads=true" ).addGoal( "-Dtest=FlakyFirstTimeTest#testFailing*" ).withFailure().executeTest().assertTestSuiteResults( 1, 0, 1, 0, 0 ); verifyFailuresOneRetryOneMethod( outputValidator ); outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.12" ).maven().addGoal( "-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-Dparallel=classes" ).addGoal( "-DuseUnlimitedThreads=true" ).addGoal( "-Dtest=FlakyFirstTimeTest#testFailing*" ).withFailure().executeTest().assertTestSuiteResults( 1, 0, 1, 0, 0 ); verifyFailuresOneRetryOneMethod( outputValidator ); } private void verifyFailuresOneRetryAllClasses( OutputValidator outputValidator ) { verifyFailuresOneRetry( outputValidator, 5, 1, 1, 0 ); } private void verifyFailuresTwoRetryAllClasses( OutputValidator outputValidator ) { verifyFailuresTwoRetry( outputValidator, 5, 0, 0, 2 ); } private void verifyFailuresNoRetryAllClasses( OutputValidator outputValidator ) { verifyFailuresNoRetry( outputValidator, 5, 1, 1, 0 ); } private void verifyFailuresOneRetryOneClass( OutputValidator outputValidator ) { verifyFailuresOneRetry( outputValidator, 3, 1, 1, 0 ); } private void verifyFailuresOneRetryOneMethod( OutputValidator outputValidator ) { verifyOnlyFailuresOneRetry( outputValidator, 1, 1, 0, 0 ); } private void verifyFailuresOneRetry( OutputValidator outputValidator, int run, int failures, int errors, int flakes ) { outputValidator.verifyTextInLog( "Failures:" ); outputValidator.verifyTextInLog( "Run 1: FlakyFirstTimeTest.testFailingTestOne" ); outputValidator.verifyTextInLog( "Run 2: FlakyFirstTimeTest.testFailingTestOne" ); outputValidator.verifyTextInLog( "Errors:" ); outputValidator.verifyTextInLog( "Run 1: FlakyFirstTimeTest.testErrorTestOne" ); outputValidator.verifyTextInLog( "Run 2: FlakyFirstTimeTest.testErrorTestOne" ); verifyStatistics( outputValidator, run, failures, errors, flakes ); } private void verifyOnlyFailuresOneRetry( OutputValidator outputValidator, int run, int failures, int errors, int flakes ) { outputValidator.verifyTextInLog( "Failures:" ); outputValidator.verifyTextInLog( "Run 1: FlakyFirstTimeTest.testFailingTestOne" ); outputValidator.verifyTextInLog( "Run 2: FlakyFirstTimeTest.testFailingTestOne" ); verifyStatistics( outputValidator, run, failures, errors, flakes ); } private void verifyFailuresTwoRetry( OutputValidator outputValidator, int run, int failures, int errors, int flakes ) { outputValidator.verifyTextInLog( "Flakes:" ); outputValidator.verifyTextInLog( "Run 1: FlakyFirstTimeTest.testFailingTestOne" ); outputValidator.verifyTextInLog( "Run 2: FlakyFirstTimeTest.testFailingTestOne" ); outputValidator.verifyTextInLog( "Run 3: PASS" ); outputValidator.verifyTextInLog( "Run 1: FlakyFirstTimeTest.testErrorTestOne" ); outputValidator.verifyTextInLog( "Run 2: FlakyFirstTimeTest.testErrorTestOne" ); verifyStatistics( outputValidator, run, failures, errors, flakes ); } private void verifyFailuresNoRetry( OutputValidator outputValidator, int run, int failures, int errors, int flakes ) { outputValidator.verifyTextInLog( "Failures:" ); outputValidator.verifyTextInLog( "testFailingTestOne(junit4.FlakyFirstTimeTest)" ); outputValidator.verifyTextInLog( "ERROR" ); outputValidator.verifyTextInLog( "testErrorTestOne(junit4.FlakyFirstTimeTest)" ); verifyStatistics( outputValidator, run, failures, errors, flakes ); } private void verifyStatistics( OutputValidator outputValidator, int run, int failures, int errors, int flakes ) { if ( flakes > 0 ) { outputValidator.verifyTextInLog( "Tests run: " + run + ", Failures: " + failures + ", Errors: " + errors + ", Skipped: 0, Flakes: " + flakes ); } else { outputValidator.verifyTextInLog( "Tests run: " + run + ", Failures: " + failures + ", Errors: " + errors + ", Skipped: 0" ); } } } JUnit4RunListenerIT.java000066400000000000000000000054321330756104600355620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * JUnit4 RunListener Integration Test. * * @author Matthew Gilliard */ public class JUnit4RunListenerIT extends SurefireJUnit4IntegrationTestCase { private SurefireLauncher unpack() { return unpack( "/junit4-runlistener" ); } @Test public void testJUnit4RunListener() throws Exception { final OutputValidator outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.4" ).executeTest().verifyErrorFreeLog(); assertResults( outputValidator ); outputValidator.verifyTextInLog( "testRunStarted null" ); outputValidator.verifyTextInLog( "testFinished simpleTest" ); outputValidator.verifyTextInLog( "testRunFinished org.junit.runner.Result" ); } @Test public void testRunlistenerJunitCoreProvider() throws Exception { final OutputValidator outputValidator = unpack().addGoal( "-Dprovider=surefire-junit47" ).setJUnitVersion( "4.8.1" ).addGoal( "-DjunitVersion=4.8.1" ).executeTest().verifyErrorFreeLog(); // Todo: Fix junitVesion assertResults( outputValidator ); outputValidator.verifyTextInLog( "testRunStarted null" ); outputValidator.verifyTextInLog( "testFinished simpleTest" ); outputValidator.verifyTextInLog( "testRunFinished org.junit.runner.Result" ); } private void assertResults( OutputValidator outputValidator ) { outputValidator.assertTestSuiteResults( 1, 0, 0, 0 ); outputValidator.getTargetFile( "runlistener-output-1.txt" ).assertFileExists(); outputValidator.getTargetFile( "runlistener-output-2.txt" ).assertFileExists(); } } JUnit4VersionsIT.java000066400000000000000000000070101330756104600351120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import java.util.Collection; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import static java.util.Arrays.asList; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_10; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_11; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_12; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_8; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_8_1; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_8_2; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_9; import static org.junit.runners.Parameterized.*; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_0; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_1; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_2; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_3; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_3_1; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_4; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_5; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_6; import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_7; /** * Basic suite test using all known versions of JUnit 4.x * * @author Dan Fabulich */ @RunWith( Parameterized.class ) public class JUnit4VersionsIT extends SurefireJUnit4IntegrationTestCase { @Parameters( name = "{index}: JUnit {0}" ) public static Collection junitVersions() { return asList( new Object[][] { { JUNIT_4_0 }, { JUNIT_4_1 }, { JUNIT_4_2 }, { JUNIT_4_3 }, { JUNIT_4_3_1 }, { JUNIT_4_4 }, { JUNIT_4_5 }, { JUNIT_4_6 }, { JUNIT_4_7 }, { JUNIT_4_8 }, { JUNIT_4_8_1 }, { JUNIT_4_8_2 }, { JUNIT_4_9 }, { JUNIT_4_10 }, { JUNIT_4_11 }, { JUNIT_4_12 } } ); } @Parameter public JUnitVersion version; @Test public void testJunit() { version.configure( unpack() ) .executeTest() .verifyErrorFree( 1 ); } private SurefireLauncher unpack() { return unpack( "/junit4", version.toString() ); } } JUnitDepIT.java000066400000000000000000000045111330756104600337310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Test project using JUnit4.4 -dep. junit-dep includes only junit.* classes, and depends explicitly on hamcrest-core * * @author Dan Fabulich */ public class JUnitDepIT extends SurefireJUnit4IntegrationTestCase { public SurefireLauncher unpack() { return unpack( "/junit44-dep" ); } @Test public void testJUnit44Dep() throws Exception { unpack().debugLogging().sysProp( "junit-dep.version", "4.4" ).executeTest().verifyErrorFree( 1 ).verifyTextInLog( "surefire-junit4" ); // Ahem. Will match on the 4.7 provider too } @Test public void testJUnit44DepWithSneaky381() throws Exception { unpack().debugLogging().sysProp( "junit-dep.version", "4.4" ).activateProfile( "provided381" ).executeTest().verifyErrorFree( 1 ); } @Test public void testJUnit47Dep() throws Exception { unpack().debugLogging().sysProp( "junit-dep.version", "4.7" ).executeTest().verifyErrorFree( 1 ).verifyTextInLog( "surefire-junit47" ); } @Test public void testJUnit48Dep() throws Exception { unpack().debugLogging().sysProp( "junit-dep.version", "4.8" ).executeTest().verifyErrorFree( 1 ).verifyTextInLog( "surefire-junit47" ); } } JUnitPlatformIT.java000066400000000000000000000050351330756104600350070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Before; import org.junit.Test; import static java.lang.System.getProperty; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.is; import static org.junit.Assume.assumeThat; public class JUnitPlatformIT extends SurefireJUnit4IntegrationTestCase { @Before public void setUp() { assumeThat( "java.specification.version: ", getProperty( "java.specification.version" ), is( greaterThanOrEqualTo( "1.8" ) ) ); } @Test public void testJupiterEngine() { unpack( "/junit-platform-engine-jupiter" ).executeTest().verifyErrorFree( 5 ); } @Test public void testVintageEngine() { unpack( "/junit-platform-engine-vintage" ).executeTest().verifyErrorFree( 1 ); } @Test public void testJQwikEngine() { unpack( "/junit-platform-engine-jqwik" ).executeTest().verifyErrorFree( 1 ); } @Test public void testMultipleEngines() { unpack( "/junit-platform-multiple-engines" ).executeTest().verifyErrorFree( 7 ); } @Test public void testJUnitPlatform_1_0_0() { unpack( "/junit-platform-1.0.0" ).executeTest().verifyErrorFree( 1 ); } @Test public void testJUnitPlatform_1_1_1() { unpack( "/junit-platform-1.1.1" ).executeTest().verifyErrorFree( 1 ); } @Test public void testJUnitPlatform_1_2_0() { unpack( "/junit-platform-1.2.0" ).executeTest().verifyErrorFree( 1 ); } @Test public void testTags() { unpack( "/junit-platform-tags" ).executeTest().verifyErrorFree( 2 ); } } JUnitVersion.java000066400000000000000000000032531330756104600344130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireLauncher; /** * Enum listing all the JUnit version. */ public enum JUnitVersion { JUNIT_4_0( "4.0" ), JUNIT_4_1( "4.1" ), JUNIT_4_2( "4.2" ), JUNIT_4_3( "4.3" ), JUNIT_4_3_1( "4.3.1" ), JUNIT_4_4( "4.4" ), JUNIT_4_5( "4.5" ), JUNIT_4_6( "4.6" ), JUNIT_4_7( "4.7" ), JUNIT_4_8( "4.8" ), JUNIT_4_8_1( "4.8.1" ), JUNIT_4_8_2( "4.8.2" ), JUNIT_4_9( "4.9" ), JUNIT_4_10( "4.10" ), JUNIT_4_11( "4.11" ), JUNIT_4_12( "4.12" ); private final String version; JUnitVersion( String version ) { this.version = version; } public SurefireLauncher configure( SurefireLauncher launcher ) { return launcher.setJUnitVersion( version ); } public String toString() { return version; } } Java9FullApiIT.java000066400000000000000000000120131330756104600344720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.junit.Test; import java.io.File; import static org.apache.maven.surefire.its.fixture.SurefireLauncher.EXT_JDK_HOME; import static org.apache.maven.surefire.its.fixture.SurefireLauncher.EXT_JDK_HOME_KEY; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.is; /** * Running Surefire on the top of JDK 9 and should be able to load * classes of multiple different Jigsaw modules without error. * * @author Tibor Digana (tibor17) * @since 2.20.1 */ public class Java9FullApiIT extends AbstractJigsawIT { @Test public void shouldLoadMultipleJavaModules_JavaHome() throws Exception { OutputValidator validator = assumeJigsaw() .setForkJvm() .debugLogging() .execute( "verify" ) .verifyErrorFree( 1 ); validator.verifyTextInLog( "loaded class java.sql.SQLException" ) .verifyTextInLog( "loaded class javax.xml.ws.Holder" ) .verifyTextInLog( "loaded class javax.xml.bind.JAXBException" ) .verifyTextInLog( "loaded class javax.transaction.TransactionManager" ) .verifyTextInLog( "loaded class javax.transaction.InvalidTransactionException" ) .assertThatLogLine( anyOf( is( "java.specification.version=9" ), is( "java.specification.version=10" ) ), greaterThanOrEqualTo( 1 ) ); } @Test public void shouldLoadMultipleJavaModules_JvmParameter() throws Exception { OutputValidator validator = assumeJava9Property() .setForkJvm() .debugLogging() .sysProp( EXT_JDK_HOME_KEY, new File( EXT_JDK_HOME ).getCanonicalPath() ) .execute( "verify" ) .verifyErrorFree( 1 ); validator.verifyTextInLog( "loaded class java.sql.SQLException" ) .verifyTextInLog( "loaded class javax.xml.ws.Holder" ) .verifyTextInLog( "loaded class javax.xml.bind.JAXBException" ) .verifyTextInLog( "loaded class javax.transaction.TransactionManager" ) .verifyTextInLog( "loaded class javax.transaction.InvalidTransactionException" ) .assertThatLogLine( anyOf( is( "java.specification.version=9" ), is( "java.specification.version=10" ) ), greaterThanOrEqualTo( 1 ) ); } @Test public void shouldLoadMultipleJavaModules_ToolchainsXML() throws Exception { OutputValidator validator = assumeJava9Property() .setForkJvm() .activateProfile( "use-toolchains" ) .addGoal( "--toolchains" ) .addGoal( System.getProperty( "maven.toolchains.file" ) ) .execute( "verify" ) .verifyErrorFree( 1 ); validator.verifyTextInLog( "loaded class java.sql.SQLException" ) .verifyTextInLog( "loaded class javax.xml.ws.Holder" ) .verifyTextInLog( "loaded class javax.xml.bind.JAXBException" ) .verifyTextInLog( "loaded class javax.transaction.TransactionManager" ) .verifyTextInLog( "loaded class javax.transaction.InvalidTransactionException" ) .assertThatLogLine( anyOf( is( "java.specification.version=9" ), is( "java.specification.version=10" ) ), greaterThanOrEqualTo( 1 ) ); } @Override protected String getProjectDirectoryName() { return "java9-full-api"; } } LongWindowsPathIT.java000066400000000000000000000065671330756104600353530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import java.io.File; import java.io.IOException; import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS; import static org.fest.assertions.Assertions.assertThat; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assume.assumeTrue; /** * Testing long path of base.dir where Windows CLI crashes. *
* Integration test for SUREFIRE-1400. * * @author Tibor Digana (tibor17) * @since 2.20.1 */ public class LongWindowsPathIT extends SurefireJUnit4IntegrationTestCase { private static final String PROJECT_DIR = "long-windows-path"; private static final String LONG_PATH = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // the IT engine crashes using long path private static final String LONG_DIR = LONG_PATH + LONG_PATH + LONG_PATH; @Test public void shouldRunInSystemTmp() throws Exception { assumeTrue( IS_OS_WINDOWS ); OutputValidator validator = unpack().setForkJvm() .showErrorStackTraces() .executeTest() .verifyErrorFreeLog(); validator.assertThatLogLine( containsString( "SUREFIRE-1400 user.dir=" ), is( 1 ) ) .assertThatLogLine( containsString( "SUREFIRE-1400 surefire.real.class.path=" ), is( 1 ) ); for ( String line : validator.loadLogLines() ) { if ( line.contains( "SUREFIRE-1400 user.dir=" ) ) { File buildDir = new File( System.getProperty( "user.dir" ), "target" ); File itBaseDir = new File( buildDir, "LongWindowsPathIT_shouldRunInSystemTmp" ); assertThat( line ) .contains( itBaseDir.getAbsolutePath() ); } else if ( line.contains( "SUREFIRE-1400 surefire.real.class.path=" ) ) { assertThat( line ) .contains( System.getProperty( "java.io.tmpdir" ) ); } } } private SurefireLauncher unpack() throws IOException { return unpack( PROJECT_DIR/*, "_" + LONG_DIR*/ ); } } ModulePathIT.java000066400000000000000000000024561330756104600343170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.junit.Test; import java.io.IOException; public class ModulePathIT extends AbstractJigsawIT { @Test public void testModulePath() throws IOException { assumeJigsaw() .debugLogging() .executeTest() .verifyErrorFreeLog() .assertTestSuiteResults( 2 ); } @Override protected String getProjectDirectoryName() { return "modulepath"; } } NoRunnableTestsInClassIT.java000066400000000000000000000025521330756104600366150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-621 Asserts proper test counts when running junit 3 tests in parallel * * @author Kristian Rosenvold */ public class NoRunnableTestsInClassIT extends SurefireJUnit4IntegrationTestCase { @Test public void testJunit3ParallelBuildResultCount() { unpack( "norunnableTests" ).failNever().executeTest().verifyTextInLog( "No tests found in junit.norunnabletests.BasicTest" ); } }PlainOldJavaClasspathIT.java000066400000000000000000000024021330756104600364130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test useManifestOnlyJar option * * @author Dan Fabulich */ public class PlainOldJavaClasspathIT extends SurefireJUnit4IntegrationTestCase { @Test public void testPlainOldJavaClasspath() { executeErrorFreeTest( "plain-old-java-classpath", 1 ); } } PlexusConflictIT.java000066400000000000000000000031021330756104600352040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Test library using a conflicting version of plexus-utils * * @author Dan Fabulich */ public class PlexusConflictIT extends SurefireJUnit4IntegrationTestCase { @Test public void testPlexusConflict() { unpack().executeTest().verifyErrorFree( 1 ); } @Test public void testPlexusConflictIsolatedClassLoader() { unpack().useSystemClassLoader(false).executeTest().verifyErrorFree( 1 ); } private SurefireLauncher unpack() { return unpack( "/plexus-conflict" ); } }PojoSimpleIT.java000066400000000000000000000023221330756104600343260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test support for POJO tests. * * @author Benjamin Bentmann */ public class PojoSimpleIT extends SurefireJUnit4IntegrationTestCase { @Test public void testit() { unpack( "pojo-simple" ).executeTest().assertTestSuiteResults( 2, 0, 1, 0 ); } } ReporterTime.java000066400000000000000000000016261330756104600344370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ /** * @author Kristian Rosenvold */ public class ReporterTime { } ReportersIT.java000066400000000000000000000031571330756104600342410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Asserts proper behaviour of console output when forking * SUREFIRE-679 * * @author Kristian Rosenvold */ public class ReportersIT extends SurefireJUnit4IntegrationTestCase { @Test public void testRedirectOutputTestNg() { OutputValidator reporters = unpack( "reporters" ).redirectToFile( true ).printSummary( true ).executeTest(); reporters.getSurefireReportsFile( "TestSuite-output.txt" ).assertFileExists(); reporters.getSurefireReportsXmlFile( "TEST-TestSuite.xml" ).assertFileExists(); reporters.getSurefireReportsFile( "TestSuite.txt" ).assertFileExists(); } } ResultCountingIT.java000066400000000000000000000042221330756104600352330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; import java.io.IOException; /** * Verifies that the providers get the result summary at the bottom of the run correctly, in different forkmodes * SUREFIRE-613 Asserts proper test counts when running in parallel * * @author Kristian Rosenvold */ public class ResultCountingIT extends SurefireJUnit4IntegrationTestCase { @Test public void testCountingWithJunit481ForkNever() throws Exception { assertForkMode( "never" ); } @Test public void testCountingWithJunit481ForkOnce() throws Exception { assertForkMode( "once" ); } @Test public void testCountingWithJunit481ForkAlways() throws Exception { assertForkMode( "always" ); } private void assertForkMode( String forkMode ) throws IOException, VerificationException { OutputValidator outputValidator = unpack( "result-counting" ).failNever().forkMode( forkMode ).executeTest(); outputValidator.assertTestSuiteResults( 36, 23, 4, 2 ); outputValidator.verifyTextInLog( "Tests run: 36, Failures: 4, Errors: 23, Skipped: 2" ); } }RunOrderIT.java000066400000000000000000000072231330756104600340120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import java.io.IOException; import java.util.Calendar; import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Verifies the runOrder setting and its effect * * @author Kristian Rosenvold */ public class RunOrderIT extends SurefireJUnit4IntegrationTestCase { private static final String[] TESTS_IN_ALPHABETICAL_ORDER = { "TA", "TB", "TC" }; private static final String[] TESTS_IN_REVERSE_ALPHABETICAL_ORDER = { "TC", "TB", "TA" }; // testing random is left as an exercise to the reader. Patches welcome @Test public void testAlphabetical() throws Exception { OutputValidator validator = executeWithRunOrder( "alphabetical" ); assertTestnamesAppearInSpecificOrder( validator, TESTS_IN_ALPHABETICAL_ORDER ); } @Test public void testReverseAlphabetical() throws Exception { OutputValidator validator = executeWithRunOrder( "reversealphabetical" ); assertTestnamesAppearInSpecificOrder( validator, TESTS_IN_REVERSE_ALPHABETICAL_ORDER ); } @Test public void testHourly() throws Exception { int startHour = Calendar.getInstance().get( Calendar.HOUR_OF_DAY ); OutputValidator validator = executeWithRunOrder( "hourly" ); int endHour = Calendar.getInstance().get( Calendar.HOUR_OF_DAY ); if ( startHour != endHour ) { return; // Race condition, cannot test when hour changed mid-run } String[] testnames = ( ( startHour % 2 ) == 0 ) ? TESTS_IN_ALPHABETICAL_ORDER : TESTS_IN_REVERSE_ALPHABETICAL_ORDER; assertTestnamesAppearInSpecificOrder( validator, testnames ); } @Test public void testNonExistingRunOrder() throws Exception { unpack().forkMode( getForkMode() ).runOrder( "nonExistingRunOrder" ).maven().withFailure().executeTest().verifyTextInLog( "There's no RunOrder with the name nonExistingRunOrder." ); } private OutputValidator executeWithRunOrder( String runOrder ) { return unpack().forkMode( getForkMode() ).runOrder( runOrder ).executeTest().verifyErrorFree( 3 ); } protected String getForkMode() { return "once"; } private SurefireLauncher unpack() { return unpack( "runOrder" ); } private void assertTestnamesAppearInSpecificOrder( OutputValidator validator, String[] testnames ) throws VerificationException { if ( !validator.stringsAppearInSpecificOrderInLog( testnames ) ) { throw new VerificationException( "Response does not contain expected item" ); } } } RunOrderParallelForksIT.java000066400000000000000000000017551330756104600365000ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ public class RunOrderParallelForksIT extends RunOrderIT { @Override protected String getForkMode() { return "perthread"; } } SiblingAggregatorIT.java000066400000000000000000000034351330756104600356450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Test aggregator as a sibling to child modules; invokes modules as "../child" * * @author Dan Fabulich * @author Kristian Rosenvold */ public class SiblingAggregatorIT extends SurefireJUnit4IntegrationTestCase { @Test public void testSiblingAggregator() throws Exception { final SurefireLauncher unpack = unpack( "sibling-aggregator" ); SurefireLauncher aggregator = unpack.getSubProjectLauncher( "aggregator" ); aggregator.executeTest().verifyErrorFreeLog(); OutputValidator child2 = unpack.getSubProjectValidator( "child2" ); child2.assertTestSuiteResults( 1, 0, 0, 0 ); } } SmartStackTraceIT.java000066400000000000000000000031221330756104600352770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * IT of smart stack trace parser * * @author Kristian Rosenvold */ public class SmartStackTraceIT extends SurefireJUnit4IntegrationTestCase { @Test public void misg() throws Exception { OutputValidator outputValidator = unpack( "/junit48-smartStackTrace" ).maven().withFailure().executeTest(); outputValidator.verifyTextInLog( "SmartStackTraceTest.shouldFailInMethodButDoesnt Expected exception: java.lang.RuntimeException" ); outputValidator.verifyTextInLog( "SmartStackTraceTest.shortName Expected exception: java.io.IOException" ); } } SystemPropertiesTestIT.java000066400000000000000000000034551330756104600364560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Test system properties * * @author Dan Fabulich */ public class SystemPropertiesTestIT extends SurefireJUnit4IntegrationTestCase { @Test public void testSystemProperties() { unpack().addGoal( "-DsetOnMavenCommandLine=baz" ).addGoal( "-DsetOnArgLineWorkAround=baz" ).executeTest().verifyErrorFree( 8 ); } @Test public void testSystemPropertiesNoFork() { unpack().forkNever().addGoal( "-DsetOnMavenCommandLine=baz" ).addGoal( "-DsetOnArgLineWorkAround=baz" ) // DGF fake the argLine, since we're not forking .addGoal( "-DsetOnArgLine=bar" ).executeTest().verifyErrorFree( 8 ); } public SurefireLauncher unpack() { return unpack( "/system-properties" ); } } TestMethodPatternIT.java000066400000000000000000000072701330756104600356720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; /** * Test project using -Dtest=mtClass#myMethod * * @author Olivier Lamy */ public class TestMethodPatternIT extends SurefireJUnit4IntegrationTestCase { private static final String RUNNING_WITH_PROVIDER47 = "parallel='none', perCoreThreadCount=true, threadCount=0"; public OutputValidator runMethodPattern( String projectName, Map props, String... goals ) { SurefireLauncher launcher = unpack( projectName ); for ( Entry entry : props.entrySet() ) { launcher.sysProp( entry.getKey(), entry.getValue() ); } for ( String goal : goals ) { launcher.addGoal( goal ); } return launcher.showErrorStackTraces().debugLogging() .executeTest() .assertTestSuiteResults( 2, 0, 0, 0 ); } @Test public void testJUnit44() { runMethodPattern( "junit44-method-pattern", Collections.emptyMap() ); } @Test public void testJUnit48Provider4() { runMethodPattern( "junit48-method-pattern", Collections.emptyMap(), "-P surefire-junit4" ); } @Test public void testJUnit48Provider47() { runMethodPattern( "junit48-method-pattern", Collections.emptyMap(), "-P surefire-junit47" ) .verifyTextInLog( RUNNING_WITH_PROVIDER47 ); } @Test public void testJUnit48WithCategoryFilter() { unpack( "junit48-method-pattern" ) .addGoal( "-Dgroups=junit4.SampleCategory" ) .executeTest() .assertTestSuiteResults( 1, 0, 0, 0 ); } @Test public void testTestNgMethodBefore() { Map props = new HashMap(); props.put( "testNgVersion", "5.7" ); props.put( "testNgClassifier", "jdk15" ); runMethodPattern( "testng-method-pattern-before", props ); } @Test public void testTestNGMethodPattern() { Map props = new HashMap(); props.put( "testNgVersion", "5.7" ); props.put( "testNgClassifier", "jdk15" ); runMethodPattern( "/testng-method-pattern", props ); } @Test public void testMethodPatternAfter() { unpack( "testng-method-pattern-after" ) .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .executeTest() .verifyErrorFree( 2 ) .verifyTextInLog( "Called tearDown" ); } } TestMultipleMethodPatternsIT.java000066400000000000000000000040621330756104600375650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.Settings; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import java.util.Arrays; /** * JUnit test project using multiple method patterns, including wildcards in class and method names. */ @RunWith( Parameterized.class ) public class TestMultipleMethodPatternsIT extends AbstractTestMultipleMethodPatterns { private final Settings settings; public TestMultipleMethodPatternsIT( Settings settings ) { this.settings = settings; } @Parameterized.Parameters public static Iterable data() { return Arrays.asList( new Object[][]{ { Settings.JUNIT4_TEST }, { Settings.JUNIT47_TEST }, { Settings.JUNIT4_INCLUDES }, { Settings.JUNIT47_INCLUDES }, { Settings.JUNIT4_INCLUDES_EXCLUDES }, { Settings.JUNIT47_INCLUDES_EXCLUDES } } ); } @Override protected Settings getSettings() { return settings; } @Override protected SurefireLauncher unpack() { return unpack( "junit48-multiple-method-patterns", "_" + settings.path() ); } } TestMultipleMethodPatternsTestNGIT.java000066400000000000000000000036701330756104600406560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.Settings; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import java.util.Arrays; /** * TestNG test project using multiple method patterns, including wildcards in class and method names. */ @RunWith( Parameterized.class ) public class TestMultipleMethodPatternsTestNGIT extends AbstractTestMultipleMethodPatterns { private final Settings settings; public TestMultipleMethodPatternsTestNGIT( Settings settings ) { this.settings = settings; } @Parameterized.Parameters public static Iterable data() { return Arrays.asList( new Object[][]{ { Settings.TestNG_TEST }, { Settings.TestNG_INCLUDES }, { Settings.TestNG_INCLUDES_EXCLUDES } } ); } @Override protected Settings getSettings() { return settings; } @Override protected SurefireLauncher unpack() { return unpack( "testng-multiple-method-patterns", "_" + settings.path() ); } } TestMultipleMethodsIT.java000066400000000000000000000045161330756104600362330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Test project using -Dtest=mtClass#myMethod+myMethod2,secondClass#testMethod * * @author rainLee */ public class TestMultipleMethodsIT extends SurefireJUnit4IntegrationTestCase { private static final String RUNNING_WITH_PROVIDER47 = "parallel='none', perCoreThreadCount=true, threadCount=0"; public OutputValidator multipleMethod( String projectName, String... goals ) throws Exception { SurefireLauncher launcher = unpack( projectName ); for ( String goal : goals ) { launcher.addGoal( goal ); } return launcher.showErrorStackTraces().debugLogging() .executeTest() .verifyErrorFreeLog().assertTestSuiteResults( 3, 0, 0, 0 ); } @Test public void testJunit44() throws Exception { multipleMethod( "junit44-multiple-methods" ); } @Test public void testJunit48Provider4() throws Exception { multipleMethod( "junit48-multiple-methods", "-P surefire-junit4" ); } @Test public void testJunit48Provider47() throws Exception { multipleMethod( "junit48-multiple-methods", "-P surefire-junit47" ) .verifyTextInLog( RUNNING_WITH_PROVIDER47 ); } } TestNgGroupsIT.java000066400000000000000000000036531330756104600346610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Test the group filter for TestNG * */ public class TestNgGroupsIT extends SurefireJUnit4IntegrationTestCase { @Test public void testExclusion() { unpack().setExcludedGroups( "notincluded" ).executeTest().verifyErrorFree( 5 ); } @Test public void testOnlyGroups() { unpack().setGroups( "functional" ).executeTest().verifyErrorFree( 2 ); } @Test public void testGroupsAndExclusion() { unpack().setGroups( "functional" ).setExcludedGroups( "notincluded" ).executeTest().verifyErrorFree( 1 ); } @Test public void groupsWithDash() { unpack().setGroups( "abc-def" ).executeTest().verifyErrorFree( 1 ); } @Test public void groupsBySimpleRegex() { unpack().setGroups( "foo\\..*" ).executeTest().verifyErrorFree( 2 ); } public SurefireLauncher unpack() { return unpack( "/testng-groups" ); } } TestNgParallelWithAnnotationsIT.java000066400000000000000000000025351330756104600402060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test that TestNG's @Test(threadPoolSize = n, invocationCount=n) causes tests to be run in parallel. * * @author Haikal Saadh */ public class TestNgParallelWithAnnotationsIT extends SurefireJUnit4IntegrationTestCase { @Test public void testTestNgGroupThreadParallel() { executeErrorFreeTest( "/testng-parallel-with-annotations", 3 ); } } TestNgSuccessPercentageIT.java000066400000000000000000000034101330756104600367770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test that TestNG's @Test(successPercentage = n, invocationCount=n) passes so long as successPercentage tests * have passed. * * @author Jon Todd * @author Andreas Gudian */ public class TestNgSuccessPercentageIT extends SurefireJUnit4IntegrationTestCase { @Test public void testPassesWhenFailuresLessThanSuccessPercentage() { OutputValidator validator = unpack("/testng-succes-percentage") .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .mavenTestFailureIgnore( true ) .executeTest(); validator.assertTestSuiteResults(8, 0, 1, 0); } }TestSingleMethodIT.java000066400000000000000000000107161330756104600354750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import java.util.Collections; import java.util.HashMap; import java.util.Map; /** * Test project using -Dtest=mtClass#myMethod * * @author Olivier Lamy */ public class TestSingleMethodIT extends SurefireJUnit4IntegrationTestCase { private static final String RUNNING_WITH_PROVIDER47 = "parallel='none', perCoreThreadCount=true, threadCount=0"; public OutputValidator singleMethod( String projectName, Map props, String testToRun, String... goals ) throws Exception { SurefireLauncher launcher = unpack( projectName ); for ( Map.Entry entry : props.entrySet() ) { launcher.sysProp( entry.getKey(), entry.getValue() ); } for ( String goal : goals ) { launcher.addGoal( goal ); } launcher.showErrorStackTraces().debugLogging(); if ( testToRun != null ) { launcher.setTestToRun( testToRun ); } return launcher.executeTest() .verifyErrorFreeLog() .assertTestSuiteResults( 1, 0, 0, 0 ); } @Test public void testJunit44() throws Exception { singleMethod( "junit44-single-method", Collections.emptyMap(), null ); } @Test public void testJunit48Provider4() throws Exception { singleMethod( "junit48-single-method", Collections.emptyMap(), null, "-P surefire-junit4" ); } @Test public void testJunit48Provider47() throws Exception { singleMethod( "junit48-single-method", Collections.emptyMap(), null, "-P surefire-junit47" ) .verifyTextInLog( RUNNING_WITH_PROVIDER47 ); } @Test public void testJunit48parallel() throws Exception { unpack( "junit48-single-method" ) .parallel( "all" ) .useUnlimitedThreads() .executeTest() .verifyErrorFreeLog() .assertTestSuiteResults( 1, 0, 0, 0 ); } @Test public void testTestNg() throws Exception { Map props = new HashMap(); props.put( "testNgVersion", "5.7" ); props.put( "testNgClassifier", "jdk15" ); singleMethod( "testng-single-method", props, null ); } @Test public void testTestNg5149() throws Exception { singleMethod( "/testng-single-method-5-14-9", Collections.emptyMap(), null ); } @Test public void fullyQualifiedJunit48Provider4() throws Exception { singleMethod( "junit48-single-method", Collections.emptyMap(), "junit4.BasicTest#testSuccessOne", "-P surefire-junit4" ); } @Test public void fullyQualifiedJunit48Provider47() throws Exception { singleMethod("junit48-single-method", Collections.emptyMap(), "junit4.BasicTest#testSuccessOne", "-P surefire-junit47"); } @Test public void fullyQualifiedTestNg() throws Exception { Map props = new HashMap(); props.put( "testNgVersion", "5.7" ); props.put( "testNgClassifier", "jdk15" ); singleMethod( "testng-single-method", props, "testng.BasicTest#testSuccessOne" ); } } TimeoutForkedTestIT.java000066400000000000000000000031161330756104600356700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test * * @author Dan Fabulich */ public class TimeoutForkedTestIT extends SurefireJUnit4IntegrationTestCase { @Test public void testTimeoutForked() throws Exception { unpack( "/timeout-forked" ).addGoal( "-DsleepLength=10000" ).addGoal( "-DforkTimeout=1" ).maven().withFailure().executeTest(); // SUREFIRE-468 test that had to be reverted due to SUREFIRE-705 //assertFalse( getSurefireReportsFile( "TEST-timeoutForked.BasicTest.xml" ).exists() ); // assertFalse( getSurefireReportsFile( "timeoutForked.BasicTest.txt" ).exists() ); } } TwoTestCasesIT.java000066400000000000000000000125261330756104600346440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.maven.plugins.surefire.report.ReportTestSuite; import org.apache.maven.surefire.its.fixture.*; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; /** * Test running two test cases; confirms reporting works correctly * * @author Dan Fabulich */ public class TwoTestCasesIT extends SurefireJUnit4IntegrationTestCase { @Test public void testTwoTestCases() throws Exception { unpack( "junit-twoTestCases" ) .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .executeTest() .verifyErrorFreeLog() .assertTestSuiteResults( 2, 0, 0, 0 ); } /** * Runs two tests encapsulated in a suite */ @Test public void testTwoTestCaseSuite() throws Exception { final OutputValidator outputValidator = unpack( "junit-twoTestCaseSuite" ) .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .executeTest(); outputValidator.verifyErrorFreeLog().assertTestSuiteResults( 2, 0, 0, 0 ); List reports = HelperAssertions.extractReports( outputValidator.getBaseDir() ); Set classNames = extractClassNames( reports ); assertContains( classNames, "junit.twoTestCaseSuite.BasicTest" ); assertContains( classNames, "junit.twoTestCaseSuite.TestTwo" ); assertEquals( "wrong number of classes", 2, classNames.size() ); IntegrationTestSuiteResults results = HelperAssertions.parseReportList( reports ); HelperAssertions.assertTestSuiteResults( 2, 0, 0, 0, results ); } private void assertContains( Set set, String expected ) { if ( set.contains( expected ) ) { return; } fail( "Set didn't contain " + expected ); } private Set extractClassNames( List reports ) { HashSet classNames = new HashSet(); for ( ReportTestSuite suite : reports ) { classNames.add( suite.getFullClassName() ); } return classNames; } @Test public void testJunit4Suite() throws Exception { final OutputValidator outputValidator = unpack( "junit4-twoTestCaseSuite" ) .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .executeTest(); outputValidator.verifyErrorFreeLog().assertTestSuiteResults( 2, 0, 0, 0 ); List reports = HelperAssertions.extractReports( outputValidator.getBaseDir() ); Set classNames = extractClassNames( reports ); assertContains( classNames, "twoTestCaseSuite.BasicTest" ); assertContains( classNames, "twoTestCaseSuite.Junit4TestTwo" ); assertEquals( "wrong number of classes", 2, classNames.size() ); IntegrationTestSuiteResults results = HelperAssertions.parseReportList( reports ); HelperAssertions.assertTestSuiteResults( 2, 0, 0, 0, results ); } @Test public void testTestNGSuite() throws Exception { final OutputValidator outputValidator = unpack( "testng-twoTestCaseSuite" ) .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .executeTest(); outputValidator.verifyErrorFreeLog().assertTestSuiteResults( 2, 0, 0, 0 ); List reports = HelperAssertions.extractReports( outputValidator.getBaseDir() ); Set classNames = extractClassNames( reports ); assertContains( classNames, "testng.two.TestNGTestTwo" ); assertContains( classNames, "testng.two.TestNGSuiteTest" ); assertEquals( "wrong number of classes", 2, classNames.size() ); IntegrationTestSuiteResults results = HelperAssertions.parseReportList( reports ); HelperAssertions.assertTestSuiteResults( 2, 0, 0, 0, results ); } } UmlautDirIT.java000066400000000000000000000043011330756104600341520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.MavenLauncher; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import java.io.File; import java.io.IOException; /** * Test a directory with an umlaut * * @author Dan Fabulich */ public class UmlautDirIT extends SurefireJUnit4IntegrationTestCase { @Test public void testUmlaut() throws Exception { specialUnpack( "1" ) .executeTest() .verifyErrorFreeLog() .assertTestSuiteResults( 1, 0, 0, 0 ); } @Test public void testUmlautIsolatedClassLoader() throws Exception { specialUnpack( "2" ) .useSystemClassLoader( false ) .executeTest() .assertTestSuiteResults( 1, 0, 0, 0 ); } SurefireLauncher specialUnpack( String postfix ) throws IOException { SurefireLauncher unpack = unpack( "junit-pathWithUmlaut" ); MavenLauncher maven = unpack.maven(); File dest = new File( maven.getUnpackedAt().getParentFile().getPath(), "/junit-pathWith\u00DCmlaut_" + postfix ); maven.moveUnpackTo( dest ); return unpack; } } UnicodeTestNamesIT.java000066400000000000000000000067051330756104600354700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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 LicenseUni. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.apache.maven.surefire.its.fixture.TestFile; import org.junit.Test; import java.io.File; import static org.apache.commons.io.Charsets.UTF_8; import static org.apache.maven.surefire.its.fixture.HelperAssertions.convertUnicodeToUTF8; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeFalse; /** * Verifies unicode filenames pass through correctly. */ public class UnicodeTestNamesIT extends SurefireJUnit4IntegrationTestCase { private static final String REPORT_FILE_CONTENT = "junit.twoTestCases.\u800C\u7D22\u5176\u60C5Test"; private static final String TXT_REPORT = "junit.twoTestCases.\u800C\u7D22\u5176\u60C5Test.txt"; private static final String XML_REPORT = "TEST-junit.twoTestCases.\u800C\u7D22\u5176\u60C5Test.xml"; @Test public void checkFileNamesWithUnicode() { SurefireLauncher unpacked = unpack( "unicode-testnames" ); File basedir = unpacked.getUnpackedAt(); unpacked.execute( "clean" ); File xxyz = new File( basedir, "src/test/java/junit/twoTestCases/XXYZTest.java" ); File dest = new File( basedir, "src/test/java/junit/twoTestCases/\u800C\u7D22\u5176\u60C5Test.java" ); //noinspection ResultOfMethodCallIgnored dest.delete(); assertTrue( xxyz.renameTo( dest ) ); assertTrue( dest.exists() ); assumeFalse( new File( basedir, "src/test/java/junit/twoTestCases/????Test.java" ).exists() ); OutputValidator outputValidator = unpacked.executeTest() .assertTestSuiteResults( 2, 0, 0, 0 ); TestFile surefireReportFile = outputValidator.getSurefireReportsFile( TXT_REPORT, UTF_8 ); assertTrue( surefireReportFile.exists() ); // See src/test/resources/unicode-testnames/pom.xml and property project.build.sourceEncoding set to UTF-8. surefireReportFile.assertContainsText( convertUnicodeToUTF8( REPORT_FILE_CONTENT ) ); TestFile surefireXmlReportFile = outputValidator.getSurefireReportsXmlFile( XML_REPORT ); assertTrue( surefireXmlReportFile.exists() ); assertFalse( surefireXmlReportFile.readFileToString().isEmpty() ); // See src/test/resources/unicode-testnames/pom.xml and property project.build.sourceEncoding set to UTF-8. surefireXmlReportFile.assertContainsText( convertUnicodeToUTF8( REPORT_FILE_CONTENT ) ); } } UseIsolatedClassLoaderIT.java000066400000000000000000000024011330756104600366010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test useSystemClassLoader option * * @author Dan Fabulich */ public class UseIsolatedClassLoaderIT extends SurefireJUnit4IntegrationTestCase { @Test public void testUseSystemClassLoader() { executeErrorFreeTest( "/isolated-classloader", 1 ); } } WorkingDirectoryIT.java000066400000000000000000000112451330756104600355560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.*; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; /** * Test working directory configuration, SUREFIRE-416 * * @author Dan Fabulich * @author Kristian Rosenvold */ public class WorkingDirectoryIT extends SurefireJUnit4IntegrationTestCase { @Test public void testWorkingDirectory() throws Exception { final SurefireLauncher unpack = getUnpacked(); final OutputValidator child = getPreparedChild( unpack ); unpack.executeTest().verifyErrorFreeLog(); child.assertTestSuiteResults( 1, 0, 0, 0 ); verifyOutputDirectory( child ); } @Test public void testWorkingDirectoryNoFork() throws Exception { final SurefireLauncher unpack = getUnpacked(); final OutputValidator child = getPreparedChild( unpack ); unpack.forkNever().executeTest().verifyErrorFreeLog(); child.assertTestSuiteResults( 1, 0, 0, 0 ); verifyOutputDirectory( child ); } @Test public void testWorkingDirectoryChildOnly() throws Exception { final SurefireLauncher unpack = getUnpacked(); final SurefireLauncher child = unpack.getSubProjectLauncher( "child" ); //child.getTargetFile( "out.txt" ).delete(); final OutputValidator outputValidator = child.executeTest().assertTestSuiteResults( 1, 0, 0, 0 ); verifyOutputDirectory( outputValidator ); } @Test public void testWorkingDirectoryChildOnlyNoFork() throws Exception { final SurefireLauncher unpack = getUnpacked(); final SurefireLauncher child = unpack.getSubProjectLauncher( "child" ); //child.getTargetFile( "out.txt" ).delete(); final OutputValidator outputValidator = child.forkNever().executeTest().assertTestSuiteResults( 1, 0, 0, 0 ); verifyOutputDirectory( outputValidator ); } private SurefireLauncher getUnpacked() throws VerificationException, IOException { return unpack( "working-directory" ); } private OutputValidator getPreparedChild( SurefireLauncher unpack ) throws VerificationException { final OutputValidator child = unpack.getSubProjectValidator( "child" ); getOutFile( child ).delete(); return child; } private TestFile getOutFile( OutputValidator child ) { return child.getTargetFile( "out.txt" ); } public void verifyOutputDirectory( OutputValidator childTestDir ) throws IOException { final TestFile outFile = getOutFile( childTestDir ); assertTrue( "out.txt doesn't exist: " + outFile.getAbsolutePath(), outFile.exists() ); Properties p = new Properties(); FileInputStream is = outFile.getFileInputStream(); p.load( is ); is.close(); String userDirPath = p.getProperty( "user.dir" ); assertNotNull( "user.dir was null in property file", userDirPath ); File userDir = new File( userDirPath ); // test if not a symlink if ( childTestDir.getBaseDir().getCanonicalFile().equals( childTestDir.getBaseDir().getAbsoluteFile() ) ) { assertTrue( "wrong user.dir ! symlink ", childTestDir.getBaseDir().getAbsolutePath().equalsIgnoreCase( userDir.getAbsolutePath() ) ); } else { assertEquals( "wrong user.dir symlink ", childTestDir.getBaseDir().getCanonicalPath(), userDir.getCanonicalPath() ); } } } WorkingDirectoryIsInvalidPropertyIT.java000066400000000000000000000026711330756104600411310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test when the configured working directory is an invalid property, SUREFIRE-715 * * @author Kristian Rosenvold */ public class WorkingDirectoryIsInvalidPropertyIT extends SurefireJUnit4IntegrationTestCase { @Test public void testWorkingDirectory() throws Exception { unpack( "working-directory-is-invalid-property" ).maven().withFailure().executeTest().verifyTextInLog( "workingDirectory cannot be null" ); } }WorkingDirectoryMissingIT.java000066400000000000000000000024771330756104600371170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test when the configured working directory does not exist, SUREFIRE-607 * * @author Stephen Connolly */ public class WorkingDirectoryMissingIT extends SurefireJUnit4IntegrationTestCase { @Test public void testWorkingDirectory() { unpack( "working-directory-missing" ).executeTest().verifyErrorFreeLog(); } } XmlReporterRunTimeIT.java000066400000000000000000000057241330756104600360450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import org.apache.maven.plugins.surefire.report.ReportTestSuite; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; import static org.apache.maven.surefire.its.fixture.HelperAssertions.extractReports; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.lessThan; /** * Test reported runtime * * @author Kristian Rosenvold */ public class XmlReporterRunTimeIT extends SurefireJUnit4IntegrationTestCase { @Test public void testForkModeAlways() throws Exception { // just generate .surefire- in order to apply runOrder unpack( "/runorder-parallel" ) .executeTest() .verifyErrorFree( 9 ); // now assert test results match expected values OutputValidator outputValidator = unpack( "/runorder-parallel" ) .executeTest() .verifyErrorFree( 9 ); for ( ReportTestSuite report : extractReports( outputValidator.getBaseDir() ) ) { if ( "runorder.parallel.Test1".equals( report.getFullClassName() ) ) { // should be 6f but because of having Windows sleep discrepancy it is 5.95f assertThat( "runorder.parallel.Test1 report.getTimeElapsed found:" + report.getTimeElapsed(), report.getTimeElapsed(), allOf( greaterThanOrEqualTo( 5.95f ), lessThan( 7f ) ) ); } else if ( "runorder.parallel.Test2".equals( report.getFullClassName() ) ) { // should be 5f but because of having Windows sleep discrepancy it is 4.95f assertThat( "runorder.parallel.Test2 report.getTimeElapsed found:" + report.getTimeElapsed(), report.getTimeElapsed(), allOf( greaterThanOrEqualTo( 4.95f ), lessThan( 6f ) ) ); } else { System.out.println( "report = " + report ); } } } } maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/000077500000000000000000000000001330756104600327135ustar00rootroot00000000000000Configuration.java000066400000000000000000000020531330756104600363060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ /** * @author Tibor Digana (tibor17) * @since 2.19 */ public enum Configuration { TEST, INCLUDES, INCLUDES_FILE, INCLUDES_EXCLUDES, INCLUDES_EXCLUDES_FILE } FailsafeOutputValidator.java000066400000000000000000000026601330756104600403040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ import org.apache.maven.it.VerificationException; public class FailsafeOutputValidator extends OutputValidator { public FailsafeOutputValidator( OutputValidator source ) { super( source.verifier ); } @Override public OutputValidator verifyErrorFree( int total ) { try { verifier.verifyErrorFreeLog(); this.assertIntegrationTestSuiteResults( total, 0, 0, 0 ); return this; } catch ( VerificationException e ) { throw new SurefireVerifierException( e ); } } } HelperAssertions.java000066400000000000000000000164361330756104600370030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.log.api.PrintStreamLogger; import org.apache.maven.plugins.surefire.report.ReportTestSuite; import org.apache.maven.plugins.surefire.report.SurefireReportParser; import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Locale; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; import static org.apache.commons.io.Charsets.UTF_8; import static org.junit.Assume.assumeTrue; @SuppressWarnings( { "JavaDoc" } ) public class HelperAssertions { /** * assert that the reports in the specified testDir have the right summary statistics */ public static void assertTestSuiteResults( int total, int errors, int failures, int skipped, File testDir ) { IntegrationTestSuiteResults suite = parseTestResults( testDir ); assertTestSuiteResults( total, errors, failures, skipped, suite ); } public static void assertTestSuiteResults( int total, int errors, int failures, int skipped, int flakes, File testDir ) { IntegrationTestSuiteResults suite = parseTestResults( testDir ); assertTestSuiteResults( total, errors, failures, skipped, flakes, suite ); } public static void assertTestSuiteResults( int total, File testDir ) { IntegrationTestSuiteResults suite = parseTestResults( testDir ); assertTestSuiteResults( total, suite ); } /** * assert that the reports in the specified testDir have the right summary statistics */ public static void assertIntegrationTestSuiteResults( int total, int errors, int failures, int skipped, File testDir ) { IntegrationTestSuiteResults suite = parseIntegrationTestResults( testDir ); assertTestSuiteResults( total, errors, failures, skipped, suite ); } public static void assertIntegrationTestSuiteResults( int total, File testDir ) { IntegrationTestSuiteResults suite = parseIntegrationTestResults( testDir ); assertTestSuiteResults( total, suite ); } public static void assertTestSuiteResults( int total, int errors, int failures, int skipped, IntegrationTestSuiteResults actualSuite ) { assertEquals( "wrong number of tests", total, actualSuite.getTotal() ); assertEquals( "wrong number of errors", errors, actualSuite.getErrors() ); assertEquals( "wrong number of failures", failures, actualSuite.getFailures() ); assertEquals( "wrong number of skipped", skipped, actualSuite.getSkipped() ); } public static void assertTestSuiteResults( int total, IntegrationTestSuiteResults actualSuite ) { assertEquals( "wrong number of tests", total, actualSuite.getTotal() ); } public static void assertTestSuiteResults( int total, int errors, int failures, int skipped, int flakes, IntegrationTestSuiteResults actualSuite ) { assertTestSuiteResults(total, errors, failures, skipped, actualSuite); assertEquals( "wrong number of flaky tests", flakes, actualSuite.getFlakes() ); } public static IntegrationTestSuiteResults parseTestResults( File... testDirs ) { List reports = extractReports( testDirs ); return parseReportList( reports ); } private static IntegrationTestSuiteResults parseIntegrationTestResults( File... testDirs ) { List reports = extractITReports( testDirs ); return parseReportList( reports ); } /** * Converts a list of ReportTestSuites into an IntegrationTestSuiteResults object, suitable for summary assertions */ public static IntegrationTestSuiteResults parseReportList( List reports ) { assertTrue( "No reports!", !reports.isEmpty() ); int total = 0, errors = 0, failures = 0, skipped = 0, flakes = 0; for ( ReportTestSuite report : reports ) { total += report.getNumberOfTests(); errors += report.getNumberOfErrors(); failures += report.getNumberOfFailures(); skipped += report.getNumberOfSkipped(); flakes += report.getNumberOfFlakes(); } return new IntegrationTestSuiteResults( total, errors, failures, skipped, flakes ); } public static List extractReports( File... testDirs ) { List reportsDirs = new ArrayList(); for ( File testDir : testDirs ) { File reportsDir = new File( testDir, "target/surefire-reports" ); assertTrue( "Reports directory is missing: " + reportsDir.getAbsolutePath(), reportsDir.exists() ); reportsDirs.add( reportsDir ); } ConsoleLogger logger = new PrintStreamLogger( System.out ); SurefireReportParser parser = new SurefireReportParser( reportsDirs, Locale.getDefault(), logger ); try { return parser.parseXMLReportFiles(); } catch ( Exception e ) { throw new RuntimeException( "Couldn't parse XML reports", e ); } } private static List extractITReports( File... testDirs ) { List reportsDirs = new ArrayList(); for ( File testDir : testDirs ) { File reportsDir = new File( testDir, "target/failsafe-reports" ); assertTrue( "Reports directory is missing: " + reportsDir.getAbsolutePath(), reportsDir.exists() ); reportsDirs.add( reportsDir ); } ConsoleLogger logger = new PrintStreamLogger( System.out ); SurefireReportParser parser = new SurefireReportParser( reportsDirs, Locale.getDefault(), logger ); try { return parser.parseXMLReportFiles(); } catch ( Exception e ) { throw new RuntimeException( "Couldn't parse XML reports", e ); } } public static void assumeJavaVersion( double expectedVersion ) { String thisVersion = System.getProperty( "java.specification.version" ); assumeTrue( "java.specification.version: " + thisVersion, Double.valueOf( thisVersion ) >= expectedVersion ); } public static String convertUnicodeToUTF8( String unicode ) { return new String( unicode.getBytes( UTF_8 ), UTF_8 ); } } IntegrationTestSuiteResults.java000066400000000000000000000041201330756104600412130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ public class IntegrationTestSuiteResults { private int total, errors, failures, skipped, flakes; public IntegrationTestSuiteResults( int total, int errors, int failures, int skipped ) { this.total = total; this.errors = errors; this.failures = failures; this.skipped = skipped; } public IntegrationTestSuiteResults( int total, int errors, int failures, int skipped, int flakes ) { this(total, errors, failures, skipped); this.flakes = flakes; } public int getTotal() { return total; } public void setTotal( int total ) { this.total = total; } public int getErrors() { return errors; } public void setErrors( int errors ) { this.errors = errors; } public int getFailures() { return failures; } public void setFailures( int failures ) { this.failures = failures; } public int getSkipped() { return skipped; } public void setSkipped( int skipped ) { this.skipped = skipped; } public int getFlakes() { return flakes; } public void setFlakes( int flakes ) { this.flakes = flakes; } } JUnit4SuiteTest.java000066400000000000000000000025631330756104600364740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ import junit.framework.JUnit4TestAdapter; import junit.framework.Test; import org.junit.runner.RunWith; import org.junit.runners.Suite; /** * Adapt the JUnit4 tests which use only annotations to the JUnit3 test suite. * * @author Tibor Digana (tibor17) * @since 2.21.0 */ @Suite.SuiteClasses( { MavenLauncherTest.class, SurefireLauncherTest.class } ) @RunWith( Suite.class ) public class JUnit4SuiteTest { public static Test suite() { return new JUnit4TestAdapter( JUnit4SuiteTest.class ); } } MavenLauncher.java000077500000000000000000000335311330756104600362370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ import org.apache.commons.lang.text.StrSubstitutor; import org.apache.maven.it.VerificationException; import org.apache.maven.it.Verifier; import org.apache.maven.it.util.ResourceExtractor; import org.apache.maven.shared.utils.io.FileUtils; import java.io.File; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.ListIterator; import java.util.Map; import static java.util.Collections.unmodifiableList; /** * Encapsulate all needed features to start a maven run *
* * @author Kristian Rosenvold */ public class MavenLauncher { private final List cliOptions = new ArrayList(); private final List goals = new ArrayList(); private final Map envvars = new HashMap(); private File unpackedAt; private Verifier verifier; private OutputValidator validator; private final Class testCaseBeingRun; private final String resourceName; private final String suffix; private final String[] cli; private boolean expectFailure; public MavenLauncher( Class testClass, String resourceName, String suffix, String[] cli ) { this.testCaseBeingRun = testClass; this.resourceName = resourceName; this.suffix = suffix != null ? suffix : ""; this.cli = cli == null ? null : cli.clone(); resetGoals(); resetCliOptions(); } public MavenLauncher( Class testClass, String resourceName, String suffix ) { this( testClass, resourceName, suffix, null ); } public File getUnpackedAt() { return ensureUnpacked(); } private File ensureUnpacked() { if ( unpackedAt == null ) { unpackedAt = simpleExtractResources( testCaseBeingRun, resourceName ); } return unpackedAt; } public void moveUnpackTo( File dest ) throws IOException { FileUtils.deleteDirectory( dest ); //noinspection ResultOfMethodCallIgnored getUnpackedAt().renameTo( dest ); unpackedAt = dest; } public void resetGoals() { goals.clear(); } void addCliOption( String cliOption ) { cliOptions.add( cliOption ); } private StackTraceElement findTopElemenent( StackTraceElement[] stackTrace, Class testClassToLookFor ) { StackTraceElement bestmatch = null; for ( StackTraceElement stackTraceElement : stackTrace ) { if ( stackTraceElement.getClassName().equals( testClassToLookFor.getName() ) ) { bestmatch = stackTraceElement; } } return bestmatch; } StackTraceElement[] getStackTraceElements() { try { throw new RuntimeException(); } catch ( RuntimeException e ) { return e.getStackTrace(); } } public void reset() { resetGoals(); resetCliOptions(); } private void resetCliOptions() { cliOptions.clear(); } public MavenLauncher getSubProjectLauncher( String subProject ) throws VerificationException { MavenLauncher mavenLauncher = new MavenLauncher( testCaseBeingRun, resourceName + File.separator + subProject, suffix, cli ); mavenLauncher.unpackedAt = new File( ensureUnpacked(), subProject ); return mavenLauncher; } public OutputValidator getSubProjectValidator( String subProject ) throws VerificationException { final File subFile = getValidator().getSubFile( subProject ); return new OutputValidator( new Verifier( subFile.getAbsolutePath() ) ); } public MavenLauncher addEnvVar( String key, String value ) { envvars.put( key, value ); return this; } public MavenLauncher assertNotPresent( String subFile ) { getVerifier().assertFileNotPresent( getValidator().getSubFile( subFile ).getAbsolutePath() ); return this; } public MavenLauncher showErrorStackTraces() { addCliOption( "-e" ); return this; } public MavenLauncher debugLogging() { addCliOption( "-X" ); return this; } public MavenLauncher failNever() { addCliOption( "-fn" ); return this; } public MavenLauncher offline() { addCliOption( "-o" ); return this; } public MavenLauncher skipClean() { writeGoal( "-Dclean.skip=true" ); return this; } public MavenLauncher addGoal( String goal ) { writeGoal( goal ); return this; } public FailsafeOutputValidator executeVerify() { return new FailsafeOutputValidator( conditionalExec( "verify" ) ); } public OutputValidator executeTest() { return conditionalExec( "test" ); } List getGoals() { return unmodifiableList( goals ); } private void writeGoal( String newGoal ) { if ( newGoal != null && newGoal.startsWith( "-D" ) ) { final String sysPropKey = newGoal.contains( "=" ) ? newGoal.substring( 0, newGoal.indexOf( '=' ) ) : newGoal; final String sysPropStarter = sysPropKey + "="; for ( ListIterator it = goals.listIterator(); it.hasNext(); ) { String goal = it.next(); if ( goal.equals( sysPropKey ) || goal.startsWith( sysPropStarter ) ) { System.out.printf( "[WARNING] System property already exists '%s'. Overriding to '%s'.\n", goal, newGoal ); it.set( newGoal ); return; } } } goals.add( newGoal ); } private OutputValidator conditionalExec(String goal) { OutputValidator verify; try { verify = execute( goal ); } catch ( SurefireVerifierException exc ) { if ( expectFailure ) { return getValidator(); } else { throw exc; } } if ( expectFailure ) { throw new RuntimeException( "Expecting build failure, got none!" ); } return verify; } public MavenLauncher withFailure() { this.expectFailure = true; return this; } public OutputValidator execute( String goal ) { addGoal( goal ); return executeCurrentGoals(); } public OutputValidator executeCurrentGoals() { String userLocalRepo = System.getProperty( "user.localRepository" ); String testBuildDirectory = System.getProperty( "testBuildDirectory" ); boolean useInterpolatedSettings = Boolean.getBoolean( "useInterpolatedSettings" ); try { if ( useInterpolatedSettings ) { File interpolatedSettings = new File( testBuildDirectory, "interpolated-settings" ); if ( !interpolatedSettings.exists() ) { // hack "a la" invoker plugin to download dependencies from local repo // and not download from central Map values = new HashMap( 1 ); values.put( "localRepositoryUrl", toUrl( userLocalRepo ) ); StrSubstitutor strSubstitutor = new StrSubstitutor( values ); String fileContent = FileUtils.fileRead( new File( testBuildDirectory, "settings.xml" ) ); String filtered = strSubstitutor.replace( fileContent ); FileUtils.fileWrite( interpolatedSettings.getAbsolutePath(), filtered ); } addCliOption( "-s " + interpolatedSettings.getCanonicalPath() ); } getVerifier().setCliOptions( cliOptions ); getVerifier().executeGoals( goals, envvars ); return getValidator(); } catch ( IOException e ) { throw new SurefireVerifierException( e.getMessage(), e ); } catch ( VerificationException e ) { throw new SurefireVerifierException( e.getMessage(), e ); } finally { getVerifier().resetStreams(); } } private static String toUrl( String filename ) { /* * NOTE: Maven fails to properly handle percent-encoded "file:" URLs (WAGON-111) so don't use File.toURI() here * as-is but use the decoded path component in the URL. */ String url = "file://" + new File( filename ).toURI().getPath(); if ( url.endsWith( "/" ) ) { url = url.substring( 0, url.length() - 1 ); } return url; } public MavenLauncher activateProfile( String profile ) { return addGoal( "-P" + profile ); } public MavenLauncher sysProp( String variable, String value ) { return addGoal( "-D" + variable + "=" + value ); } public MavenLauncher sysProp( Map properties ) { for ( Map.Entry property : properties.entrySet() ) { sysProp( property.getKey(), property.getValue() ); } return this; } public MavenLauncher sysProp( String variable, boolean value ) { return addGoal( "-D" + variable + "=" + value ); } public MavenLauncher sysProp( String variable, int value ) { return addGoal( "-D" + variable + "=" + value ); } public MavenLauncher sysProp( String variable, double value ) { return addGoal( "-D" + variable + "=" + value ); } public MavenLauncher showExceptionMessages() { addCliOption( "-e" ); return this; } public MavenLauncher deleteSiteDir() { try { FileUtils.deleteDirectory( getValidator().getSubFile( "site" ) ); } catch ( IOException e ) { throw new SurefireVerifierException( e ); } return this; } public OutputValidator getValidator() { if ( validator == null ) { this.validator = new OutputValidator( getVerifier() ); } return validator; } public void setForkJvm( boolean forkJvm ) { getVerifier().setForkJvm( forkJvm ); } private Verifier getVerifier() { if ( verifier == null ) { try { verifier = cli == null ? new Verifier( ensureUnpacked().getAbsolutePath(), null, false ) : new Verifier( ensureUnpacked().getAbsolutePath(), null, false, cli ); } catch ( VerificationException e ) { throw new RuntimeException( e ); } } return verifier; } private File simpleExtractResources( Class cl, String resourcePath ) { if ( !resourcePath.startsWith( "/" ) ) { resourcePath = "/" + resourcePath; } File tempDir = getUnpackDir(); File testDir = new File( tempDir, resourcePath ); try { File parentPom = new File( tempDir.getParentFile(), "pom.xml" ); if (!parentPom.exists()){ URL resource = cl.getResource( "/pom.xml" ); FileUtils.copyURLToFile( resource, parentPom ); } FileUtils.deleteDirectory( testDir ); File file = ResourceExtractor.extractResourceToDestination( cl, resourcePath, tempDir, true ); return file.getCanonicalFile(); } catch ( IOException e ) { throw new RuntimeException( e ); } } File getUnpackDir() { String tempDirPath = System.getProperty( "maven.test.tmpdir", System.getProperty( "java.io.tmpdir" ) ); return new File( tempDirPath, testCaseBeingRun.getSimpleName() + "_" + getTestMethodName() + suffix ); } public File getArtifactPath( String gid, String aid, String version, String ext ) { return new File( verifier.getArtifactPath( gid, aid, version, ext ) ); } String getTestMethodName() { // dirty. Im sure we can use junit4 rules to attach testname to thread instead StackTraceElement[] stackTrace = getStackTraceElements(); StackTraceElement topInTestClass; topInTestClass = findTopElemenent( stackTrace, testCaseBeingRun ); if ( topInTestClass == null ) { // Look in superclass... topInTestClass = findTopElemenent( stackTrace, testCaseBeingRun.getSuperclass() ); } if ( topInTestClass != null ) { return topInTestClass.getMethodName(); } throw new IllegalStateException( "Cannot find " + testCaseBeingRun.getName() + "in stacktrace" ); } } MavenLauncherTest.java000066400000000000000000000032461330756104600370740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import static org.hamcrest.CoreMatchers.hasItems; /** * @author Tibor Digana (tibor17) * @since 2.20 */ public class MavenLauncherTest { @Test public void shouldNotDuplicateSystemProperties() { MavenLauncher launcher = new MavenLauncher( getClass(), "", "" ) .addGoal( "-DskipTests" ) .addGoal( "-Dx=a" ) .addGoal( "-DskipTests" ) .addGoal( "-Dx=b" ); assertThat( launcher.getGoals(), hasItems( "-Dx=b", "-DskipTests" ) ); assertThat( launcher.getGoals().size(), is( 2 ) ); } } OutputValidator.java000066400000000000000000000150071330756104600366500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ import java.io.File; import java.io.IOException; import java.nio.charset.Charset; import java.util.Collection; import java.util.List; import org.apache.commons.io.FileUtils; import org.apache.maven.it.VerificationException; import org.apache.maven.it.Verifier; import org.hamcrest.Matcher; import static org.hamcrest.MatcherAssert.assertThat; /** * A specialized verifier that enforces a standard use case for surefire IT's * * @author Kristian Rosenvold */ public class OutputValidator { protected final Verifier verifier; protected final File baseDir; public OutputValidator( Verifier verifier ) { this.verifier = verifier; this.baseDir = new File( verifier.getBasedir() ); } public OutputValidator verifyTextInLog( String text ) { try { verifier.verifyTextInLog( text ); } catch ( VerificationException e ) { throw new SurefireVerifierException( e ); } return this; } public OutputValidator verifyErrorFreeLog() { try { verifier.verifyErrorFreeLog(); } catch ( VerificationException e ) { throw new SurefireVerifierException( e ); } return this; } public OutputValidator verifyErrorFree( int total ) { try { verifier.verifyErrorFreeLog(); this.assertTestSuiteResults( total, 0, 0, 0 ); return this; } catch ( VerificationException e ) { throw new SurefireVerifierException( e ); } } public OutputValidator assertThatLogLine( Matcher line, Matcher nTimes ) throws VerificationException { int counter = 0; for ( String log : loadLogLines() ) { if ( line.matches( log ) ) { counter++; } } assertThat( "log pattern does not match nTimes", counter, nTimes ); return this; } public Collection loadLogLines() throws VerificationException { return verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false ); } public List loadFile( File file, Charset charset ) { //noinspection unchecked try { return FileUtils.readLines( file, charset.name() ); } catch ( IOException e ) { throw new SurefireVerifierException( e ); } } public String getBasedir() { return verifier.getBasedir(); } /** * Returns a file, referenced from the extracted root (where pom.xml is located) * * @param path The subdirectory under basedir * @return A file */ public File getSubFile( String path ) { return new File( getBasedir(), path ); } public OutputValidator assertTestSuiteResults( int total, int errors, int failures, int skipped ) { HelperAssertions.assertTestSuiteResults( total, errors, failures, skipped, baseDir ); return this; } public OutputValidator assertTestSuiteResults( int total, int errors, int failures, int skipped, int flakes ) { HelperAssertions.assertTestSuiteResults( total, errors, failures, skipped, flakes, baseDir ); return this; } public OutputValidator assertTestSuiteResults( int total ) { HelperAssertions.assertTestSuiteResults( total, baseDir ); return this; } public OutputValidator assertIntegrationTestSuiteResults( int total, int errors, int failures, int skipped ) { HelperAssertions.assertIntegrationTestSuiteResults( total, errors, failures, skipped, baseDir ); return this; } public OutputValidator assertIntegrationTestSuiteResults( int total ) { HelperAssertions.assertIntegrationTestSuiteResults( total, baseDir ); return this; } public TestFile getTargetFile( String modulePath, String fileName ) { File targetDir = getSubFile( modulePath + "/target" ); return new TestFile( new File( targetDir, fileName ), this ); } public TestFile getTargetFile( String fileName ) { File targetDir = getSubFile( "target" ); return new TestFile( new File( targetDir, fileName ), this ); } public TestFile getSurefireReportsFile( String fileName, Charset charset ) { File targetDir = getSurefireReportsDirectory(); return new TestFile( new File( targetDir, fileName ), charset, this ); } public TestFile getSurefireReportsFile( String fileName ) { return getSurefireReportsFile( fileName, null ); } public TestFile getSurefireReportsXmlFile( String fileName ) { File targetDir = getSurefireReportsDirectory(); return new TestFile( new File( targetDir, fileName ), Charset.forName( "UTF-8" ), this ); } public File getSurefireReportsDirectory() { return getSubFile( "target/surefire-reports" ); } public TestFile getSiteFile( String fileName ) { File targetDir = getSubFile( "target/site" ); return new TestFile( new File( targetDir, fileName ), this ); } public File getBaseDir() { return baseDir; } public boolean stringsAppearInSpecificOrderInLog( String[] strings ) throws VerificationException { int i = 0; for ( String line : loadLogLines() ) { if ( line.startsWith( strings[i] ) ) { if ( i == strings.length - 1 ) { return true; } ++i; } } return false; } } Settings.java000066400000000000000000000053001330756104600352750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ /** * @author Tibor Digana (tibor17) * @since 2.19 */ public enum Settings { JUNIT4_TEST( TestFramework.JUNIT4, Configuration.TEST ), JUNIT47_TEST( TestFramework.JUNIT47, Configuration.TEST ), JUNIT4_INCLUDES( TestFramework.JUNIT4, Configuration.INCLUDES ), JUNIT47_INCLUDES( TestFramework.JUNIT47, Configuration.INCLUDES ), JUNIT4_INCLUDES_EXCLUDES( TestFramework.JUNIT4, Configuration.INCLUDES_EXCLUDES ), JUNIT47_INCLUDES_EXCLUDES( TestFramework.JUNIT47, Configuration.INCLUDES_EXCLUDES ), JUNIT4_INCLUDES_FILE( TestFramework.JUNIT4, Configuration.INCLUDES_FILE ), JUNIT47_INCLUDES_FILE( TestFramework.JUNIT47, Configuration.INCLUDES_FILE ), JUNIT4_INCLUDES_EXCLUDES_FILE( TestFramework.JUNIT4, Configuration.INCLUDES_EXCLUDES_FILE ), JUNIT47_INCLUDES_EXCLUDES_FILE( TestFramework.JUNIT47, Configuration.INCLUDES_EXCLUDES_FILE ), TestNG_TEST( TestFramework.TestNG, Configuration.TEST ), TestNG_INCLUDES( TestFramework.TestNG, Configuration.INCLUDES ), TestNG_INCLUDES_EXCLUDES( TestFramework.TestNG, Configuration.INCLUDES_EXCLUDES ), TestNG_INCLUDES_FILE( TestFramework.TestNG, Configuration.INCLUDES_FILE ), TestNG_INCLUDES_EXCLUDES_FILE( TestFramework.TestNG, Configuration.INCLUDES_EXCLUDES_FILE ); private final TestFramework framework; private final Configuration configuration; Settings( TestFramework framework, Configuration configuration ) { this.framework = framework; this.configuration = configuration; } public String path() { return name().replace( '_', '-' ).toLowerCase(); } public String profile() { return path(); } public TestFramework getFramework() { return framework; } public Configuration getConfiguration() { return configuration; } } SurefireJUnit4IntegrationTestCase.java000066400000000000000000000040671330756104600421700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ /** * Contains commonly used features for most tests, encapsulating * common use cases. *
* Also includes thread-safe access to the extracted resource * files, which AbstractSurefireIntegrationTestClass does not. * Thread safe only for running in "classes" mode. * * @author Kristian Rosenvold */ public abstract class SurefireJUnit4IntegrationTestCase { public OutputValidator executeErrorFreeTest( String sourceName, int total ) { return unpack( sourceName ).executeTest().verifyErrorFree( total ); } public SurefireLauncher unpack( String sourceName ) { return unpack( getClass(), sourceName, "" ); } public SurefireLauncher unpack( String sourceName, String suffix ) { return unpack( getClass(), sourceName, suffix ); } public static SurefireLauncher unpack( Class testClass, String sourceName, String suffix, String[] cli ) { MavenLauncher mavenLauncher = new MavenLauncher( testClass, sourceName, suffix, cli ); return new SurefireLauncher( mavenLauncher ); } public static SurefireLauncher unpack( Class testClass, String sourceName, String suffix ) { return unpack( testClass, sourceName, suffix, null ); } } SurefireLauncher.java000077500000000000000000000302721330756104600367540ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ import org.apache.maven.it.VerificationException; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import static org.apache.commons.lang3.StringUtils.isBlank; /** * Encapsulate all needed features to start a surefire run *
* Also includes thread-safe access to the extracted resource * files * * @author Kristian Rosenvold - */ public final class SurefireLauncher { public static final String EXT_JDK_HOME_KEY = "jdk.home"; public static final String EXT_JDK_HOME = System.getProperty( EXT_JDK_HOME_KEY ); private static final File JAVA_HOME = javaHome(); private final MavenLauncher mavenLauncher; private final String surefireVersion = System.getProperty( "surefire.version" ); public SurefireLauncher( MavenLauncher mavenLauncher ) { this.mavenLauncher = mavenLauncher; reset(); } public MavenLauncher maven() { return mavenLauncher; } String getTestMethodName() { return mavenLauncher.getTestMethodName(); } public void reset() { mavenLauncher.reset(); for ( String s : getInitialGoals() ) { mavenLauncher.addGoal( s ); } setInProcessJavaHome(); } private static File javaHome() { String javaHome = isBlank( EXT_JDK_HOME ) ? System.getenv( "JAVA_HOME" ) : EXT_JDK_HOME; if ( isBlank( javaHome ) ) { javaHome = System.getProperty( "java.home" ); File jre = new File( javaHome ); if ( "jre".equals( jre.getName() ) ) { javaHome = jre.getParent(); } } try { File javaHomeAsDir = new File( javaHome ).getCanonicalFile(); if ( !javaHomeAsDir.isDirectory() ) { throw new RuntimeException( javaHomeAsDir.getAbsolutePath() + " is not a JAVA_HOME directory." ); } System.out.println( "Using JAVA_HOME=" + javaHomeAsDir.getAbsolutePath() + " in forked launcher." ); return javaHomeAsDir; } catch ( IOException e ) { throw new RuntimeException( e ); } } private void setInProcessJavaHome() { setLauncherJavaHome( JAVA_HOME.getPath() ); } public SurefireLauncher setLauncherJavaHome( String javaHome ) { mavenLauncher.addEnvVar( "JAVA_HOME", javaHome ); return this; } public SurefireLauncher getSubProjectLauncher( String subProject ) throws VerificationException { return new SurefireLauncher( mavenLauncher.getSubProjectLauncher( subProject ) ); } public OutputValidator getSubProjectValidator( String subProject ) throws VerificationException { return mavenLauncher.getSubProjectValidator( subProject ); } public SurefireLauncher addEnvVar( String key, String value ) { mavenLauncher.addEnvVar( key, value ); return this; } public SurefireLauncher setMavenOpts(String opts){ addEnvVar( "MAVEN_OPTS", opts ); return this; } private List getInitialGoals() { List goals = new ArrayList(); goals.add( "-Dsurefire.version=" + surefireVersion ); String jacocoAgent = System.getProperty( "jacoco.agent", "" ); goals.add( "-Djacoco.agent=" + jacocoAgent ); return goals; } public SurefireLauncher showErrorStackTraces() { mavenLauncher.showErrorStackTraces(); return this; } public SurefireLauncher debugLogging() { mavenLauncher.debugLogging(); return this; } @SuppressWarnings( "UnusedDeclaration" ) public SurefireLauncher debugSurefireFork() { mavenLauncher.sysProp( "maven.surefire.debug", "true" ); return this; } public SurefireLauncher failNever() { mavenLauncher.failNever(); return this; } public SurefireLauncher groups( String groups ) { mavenLauncher.sysProp( "groups", groups ); return this; } public SurefireLauncher addGoal( String goal ) { mavenLauncher.addGoal( goal ); return this; } public OutputValidator executeTest() { return mavenLauncher.execute( "test" ); } public OutputValidator executeInstall() throws VerificationException { return mavenLauncher.execute( "install" ); } public FailsafeOutputValidator executeVerify() { OutputValidator verify = execute( "verify" ); return new FailsafeOutputValidator( verify ); } public OutputValidator execute( String goal ) { return mavenLauncher.execute( goal ); } public OutputValidator executeSurefireReport() { return mavenLauncher.execute( "surefire-report:report" ); } public OutputValidator executeCurrentGoals() { return mavenLauncher.executeCurrentGoals(); } public SurefireLauncher printSummary( boolean printsummary ) { mavenLauncher.sysProp( "printSummary", printsummary ); return this; } public SurefireLauncher redirectToFile( boolean redirect ) { mavenLauncher.sysProp( "maven.test.redirectTestOutputToFile", redirect ); return this; } public SurefireLauncher forkOnce() { return forkMode( "once" ); } public SurefireLauncher forkNever() { return forkMode( "never" ); } public SurefireLauncher forkAlways() { return forkMode( "always" ); } public SurefireLauncher forkPerTest() { return forkMode( "pertest" ); } public SurefireLauncher forkPerThread() { return forkMode( "perthread" ); } public SurefireLauncher threadCount( int threadCount ) { mavenLauncher.sysProp( "threadCount", threadCount ); return this; } public SurefireLauncher forkCount( int forkCount ) { mavenLauncher.sysProp( "forkCount", forkCount ); return this; } public SurefireLauncher reuseForks( boolean reuseForks ) { mavenLauncher.sysProp( "reuseForks", reuseForks ); return this; } public SurefireLauncher forkMode( String forkMode ) { mavenLauncher.sysProp( "forkMode", forkMode ); return this; } public SurefireLauncher runOrder( String runOrder ) { mavenLauncher.sysProp( "surefire.runOrder", runOrder ); return this; } public SurefireLauncher failIfNoTests( boolean fail ) { mavenLauncher.sysProp( "failIfNoTests", fail ); return this; } public SurefireLauncher mavenTestFailureIgnore( boolean fail ) { mavenLauncher.sysProp( "maven.test.failure.ignore", fail ); return this; } public SurefireLauncher failIfNoSpecifiedTests( boolean fail ) { mavenLauncher.sysProp( "surefire.failIfNoSpecifiedTests", fail ); return this; } public SurefireLauncher useSystemClassLoader( boolean useSystemClassLoader ) { mavenLauncher.sysProp( "useSystemClassLoader", useSystemClassLoader ); return this; } public SurefireLauncher activateProfile( String profile ) { mavenLauncher.activateProfile( profile ); return this; } protected String getSurefireVersion() { return surefireVersion; } public SurefireLauncher disablePerCoreThreadCount() { mavenLauncher.sysProp( "perCoreThreadCount", false ); return this; } public SurefireLauncher disableParallelOptimization() { mavenLauncher.sysProp( "parallelOptimized", "false" ); return this; } public SurefireLauncher parallel( String parallel ) { mavenLauncher.sysProp( "parallel", parallel ); return this; } public SurefireLauncher parallelSuites() { return parallel( "suites" ); } public SurefireLauncher parallelClasses() { return parallel( "classes" ); } public SurefireLauncher parallelMethods() { return parallel( "methods" ); } public SurefireLauncher parallelBoth() { return parallel( "both" ); } public SurefireLauncher parallelSuitesAndClasses() { return parallel( "suitesAndClasses" ); } public SurefireLauncher parallelSuitesAndMethods() { return parallel( "suitesAndMethods" ); } public SurefireLauncher parallelClassesAndMethods() { return parallel( "classesAndMethods" ); } public SurefireLauncher parallelAll() { return parallel( "all" ); } public SurefireLauncher useUnlimitedThreads() { mavenLauncher.sysProp( "useUnlimitedThreads", true ); return this; } public SurefireLauncher threadCountSuites( int count ) { mavenLauncher.sysProp( "threadCountSuites", count ); return this; } public SurefireLauncher threadCountClasses( int count ) { mavenLauncher.sysProp( "threadCountClasses", count ); return this; } public SurefireLauncher threadCountMethods( int count ) { mavenLauncher.sysProp( "threadCountMethods", count ); return this; } public SurefireLauncher parallelTestsTimeoutInSeconds( double timeout ) { mavenLauncher.sysProp( "surefire.parallel.timeout", timeout ); return this; } public SurefireLauncher parallelTestsTimeoutForcedInSeconds( double timeout ) { mavenLauncher.sysProp( "surefire.parallel.forcedTimeout", timeout ); return this; } public SurefireLauncher argLine( String value ) { mavenLauncher.sysProp( "argLine", value ); return this; } public SurefireLauncher sysProp( String variable, String value ) { mavenLauncher.sysProp( variable, value ); return this; } public SurefireLauncher setJUnitVersion( String version ) { mavenLauncher.sysProp( "junit.version", version ); return this; } public SurefireLauncher setGroups( String groups ) { mavenLauncher.sysProp( "groups", groups ); return this; } public SurefireLauncher setExcludedGroups( String excludedGroups ) { mavenLauncher.sysProp( "excludedGroups", excludedGroups ); return this; } public File getUnpackedAt() { return mavenLauncher.getUnpackedAt(); } public SurefireLauncher addFailsafeReportOnlyGoal() { mavenLauncher.addGoal( getReportPluginGoal( ":failsafe-report-only" ) ); return this; } public SurefireLauncher addSurefireReportGoal() { mavenLauncher.addGoal( getReportPluginGoal( "report" ) ); return this; } public SurefireLauncher addSurefireReportOnlyGoal() { mavenLauncher.addGoal( getReportPluginGoal( "report-only" ) ); return this; } private String getReportPluginGoal( String goal ) { return "org.apache.maven.plugins:maven-surefire-report-plugin:" + getSurefireVersion() + ":" + goal; } public SurefireLauncher setTestToRun( String basicTest ) { mavenLauncher.sysProp( "test", basicTest ); return this; } public SurefireLauncher setForkJvm() { mavenLauncher.setForkJvm( true ); return this; } } SurefireLauncherTest.java000066400000000000000000000024501330756104600376060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ import org.junit.Test; import static org.junit.Assert.assertEquals; /** * @author Kristian Rosenvold */ public class SurefireLauncherTest { @Test public void launcherGetsProperMethodName() { MavenLauncher mavenLauncher = new MavenLauncher( SurefireLauncherTest.class, "foo", "" ); String method = new SurefireLauncher( mavenLauncher ).getTestMethodName(); assertEquals( "launcherGetsProperMethodName", method ); } } SurefireVerifierException.java000066400000000000000000000022331330756104600406360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ /** * @author Kristian Rosenvold */ public class SurefireVerifierException extends RuntimeException { public SurefireVerifierException( String message, Throwable cause ) { super( message, cause ); } public SurefireVerifierException( Throwable cause ) { super( cause ); } } TestFile.java000066400000000000000000000075711330756104600352300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.net.URI; import java.nio.charset.Charset; import java.util.List; import org.apache.commons.io.FileUtils; import junit.framework.Assert; import static junit.framework.Assert.assertTrue; /** * @author Kristian Rosenvold */ public class TestFile { private final File file; private final Charset encoding; private final OutputValidator surefireVerifier; public TestFile( File file, OutputValidator surefireVerifier ) { this( file, Charset.defaultCharset(), surefireVerifier); } public TestFile( File file, Charset charset, OutputValidator surefireVerifier ) { this.file = file; this.encoding = charset == null ? Charset.defaultCharset() : charset; this.surefireVerifier = surefireVerifier; } public OutputValidator assertFileExists() { assertTrue( "File doesn't exist: " + file.getAbsolutePath(), file.exists() ); return surefireVerifier; } public OutputValidator assertFileNotExists() { assertTrue( "File doesn't exist: " + file.getAbsolutePath(), !file.exists() ); return surefireVerifier; } public void delete() { //noinspection ResultOfMethodCallIgnored file.delete(); } public String getAbsolutePath() { return file.getAbsolutePath(); } public boolean exists() { return file.exists(); } public FileInputStream getFileInputStream() throws FileNotFoundException { return new FileInputStream( file ); } public String slurpFile() { try { StringBuilder sb = new StringBuilder(); BufferedReader reader; reader = new BufferedReader( new FileReader( file ) ); for ( String line = reader.readLine(); line != null; line = reader.readLine() ) { sb.append( line ); } reader.close(); return sb.toString(); } catch ( IOException e ) { throw new SurefireVerifierException( e ); } } public String readFileToString() { try { return FileUtils.readFileToString( file ); } catch ( IOException e ) { throw new SurefireVerifierException( e ); } } public boolean isFile() { return file.isFile(); } public TestFile assertContainsText( String text ) { final List list = surefireVerifier.loadFile( file, encoding ); for ( String line : list ) { if ( line.contains( text ) ) { return this; } } Assert.fail( "Did not find expected message in log" ); return null; } public URI toURI() { return file.toURI(); } public File getFile() { return file; } } TestFramework.java000066400000000000000000000017721330756104600363030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/fixturepackage org.apache.maven.surefire.its.fixture; /* * 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. */ /** * @author Tibor Digana (tibor17) * @since 2.19 */ public enum TestFramework { JUNIT4, JUNIT47, TestNG } maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/000077500000000000000000000000001330756104600323355ustar00rootroot00000000000000Surefire1024VerifyFailsafeIfTestedIT.java000066400000000000000000000034661330756104600417320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * "verify" goal ignores "dependenciesToScan" parameter when checking tests existence *

* Found in Surefire 2.16. * * @author Tibor Digana (tibor17) * @see SUREFIRE-1024 * @since 2.19 */ public class Surefire1024VerifyFailsafeIfTestedIT extends SurefireJUnit4IntegrationTestCase { @Test public void shouldScanAndRunTestsInDependencyJars() throws Exception { SurefireLauncher launcher = unpack( "surefire-1024" ); launcher.executeVerify() .verifyTextInLog( "class jiras.surefire1024.A1IT#test() dependency to scan" ); launcher.getSubProjectValidator( "jiras-surefire-1024-it" ) .assertIntegrationTestSuiteResults( 1, 0, 0, 0 ); } } Surefire1028UnableToRunSingleIT.java000066400000000000000000000037151330756104600407440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Plugin Configuration: parallel=classes *
* With Surefire 2.15 * {@code $ mvn test -Dtest=MyTest#testFoo} * Results: * Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 *
* With Surefire 2.16 * {@code $ mvn test -Dtest=MyTest#testFoo} *
* Results: * Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 * * @author Tibor Digana (tibor17) * @see SUREFIRE-1028 * @since 2.18 */ public class Surefire1028UnableToRunSingleIT extends SurefireJUnit4IntegrationTestCase { @Test public void methodFilteringParallelExecution() { unpack().setTestToRun( "SomeTest#test" ).parallelClasses().useUnlimitedThreads() .executeTest().verifyErrorFree( 1 ).verifyTextInLog( "OK!" ); } private SurefireLauncher unpack() { return unpack( "surefire-1028-unable-to-run-single-test" ); } } Surefire1036NonFilterableJUnitRunnerWithCategoriesIT.java000066400000000000000000000054321330756104600451330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.shared.utils.xml.Xpp3Dom; import org.apache.maven.shared.utils.xml.Xpp3DomBuilder; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.apache.maven.surefire.its.fixture.TestFile; import org.junit.Test; import java.io.FileNotFoundException; import static org.junit.Assert.*; /** * @author Tibor Digana (tibor17) * @see SUREFIRE-1036 * @since 2.18 */ public class Surefire1036NonFilterableJUnitRunnerWithCategoriesIT extends SurefireJUnit4IntegrationTestCase { @Test public void test() throws VerificationException, FileNotFoundException { OutputValidator validator = unpack().maven().executeTest(); validator.assertTestSuiteResults( 1, 0, 0, 0 ); assertFalse( validator.getSurefireReportsXmlFile( "TEST-jiras.surefire1036.TestSomethingWithMockitoRunner.xml" ).exists() ); assertFalse( validator.getSurefireReportsXmlFile( "TEST-jiras.surefire1036.TestSomeUnit.xml" ).exists() ); TestFile reportFile = validator.getSurefireReportsXmlFile( "TEST-jiras.surefire1036.TestSomeIntegration.xml" ); assertTestCount( reportFile, 1 ); } private SurefireLauncher unpack() { return unpack( "surefire-1036-NonFilterableJUnitRunnerWithCategories" ); } private void assertTestCount( TestFile reportFile, int tests ) throws FileNotFoundException { assertTrue( reportFile.exists() ); Xpp3Dom testResult = Xpp3DomBuilder.build( reportFile.getFileInputStream(), "UTF-8" ); Xpp3Dom[] children = testResult.getChildren( "testcase" ); assertEquals( tests, children.length ); } }Surefire1041FailingJUnitRunnerIT.java000066400000000000000000000025661330756104600411170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-1041: An error in a JUnit runner should not lead to an error in Surefire * * @author Andreas Gudian */ public class Surefire1041FailingJUnitRunnerIT extends SurefireJUnit4IntegrationTestCase { @Test public void reportErrorInJUnitRunnerAsTestError() { unpack( "surefire-1041-exception-in-junit-runner" ).mavenTestFailureIgnore( true ).executeTest().assertTestSuiteResults( 1, 1, 0, 0 ); } } Surefire1053SystemPropertiesIT.java000066400000000000000000000055301330756104600407400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import static org.junit.Assert.assertFalse; /** * @author Tibor Digana (tibor17) * @see SUREFIRE-1053 * @since 2.18 */ public class Surefire1053SystemPropertiesIT extends SurefireJUnit4IntegrationTestCase { @Test public void checkWarningsFileEncoding() { unpack().sysProp( "file.encoding", "ISO-8859-1" ) .executeTest() .verifyErrorFree( 1 ) .verifyTextInLog( "file.encoding cannot be set as system property, use -D" + "file.encoding=... instead" ); } @Test public void checkWarningsSysPropTwice() throws Exception { OutputValidator validator = unpack() .argLine( "-DmyArg=myVal2 -Dfile.encoding=ISO-8859-1" ) .sysProp( "file.encoding", "ISO-8859-1" ) .executeTest() .verifyErrorFree( 1 ) .verifyTextInLog( "The system property myArg is configured twice! " + "The property appears in and any of , " + " or user property." ); for ( String line : validator.loadLogLines() ) { assertFalse( "no warning for file.encoding not in argLine", line.contains( "file.encoding cannot be set as system property, use " ) ); assertFalse( "no warning for double definition of file.encoding", line.contains( "The system property file.encoding is configured twice!" ) ); } } private SurefireLauncher unpack() { return unpack( "surefire-1053-system-properties" ); } } Surefire1055CorrectConcurrentTestCountIT.java000066400000000000000000000026621330756104600427210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-1055 Correct test count in parallel run mode. * * @author Kristian Rosenvold */ public class Surefire1055CorrectConcurrentTestCountIT extends SurefireJUnit4IntegrationTestCase { @Test public void testTestNgAndJUnitTogether() { OutputValidator outputValidator = unpack( "surefire-1055-parallelTestCount" ).executeTest(); outputValidator.assertTestSuiteResults( 21, 0, 0, 0 ); } } Surefire1080ParallelForkDoubleTestIT.java000066400000000000000000000037721330756104600417560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Description of SUREFIRE-1080:
*
* There are 9 tests in total in the attached project, and mvn test will show 9 tests run. * When I use the command " mvn test -Dparallel=classes -DforkCount=2 -DuseUnlimitedThreads=true", it shows 13 tests * run (and sometimes 16), and some tests are run more than once. * If I remove forkCount, or parallel, everything will be fine. But it is problematic when combining together. * Apache Maven 3.2.2-SNAPSHOT * Surefire 2.18-SNAPSHOT * JUnit 4.11 * * @author Tibor Digana (tibor17) * @see SUREFIRE-1080 * @since 2.18 */ public class Surefire1080ParallelForkDoubleTestIT extends SurefireJUnit4IntegrationTestCase { @Test public void test() { unpack().executeTest().assertTestSuiteResults( 9 ); } private SurefireLauncher unpack() { return unpack( "surefire-1080-parallel-fork-double-test" ); } } Surefire1082ParallelJUnitParameterizedIT.java000066400000000000000000000176161330756104600426340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.apache.maven.surefire.its.fixture.TestFile; import org.hamcrest.BaseMatcher; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.junit.Test; import java.nio.charset.Charset; import java.util.Collection; import java.util.Iterator; import java.util.Set; import java.util.TreeSet; import static org.hamcrest.core.AnyOf.anyOf; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.StringContains.containsString; import static org.junit.Assert.assertThat; /** * @author Tibor Digana (tibor17) * @see SUREFIRE-1082 * @since 2.18 */ public class Surefire1082ParallelJUnitParameterizedIT extends SurefireJUnit4IntegrationTestCase { private static Set printOnlyTestLinesFromConsole( OutputValidator validator ) throws VerificationException { return printOnlyTestLines( validator.loadLogLines() ); } private static Set printOnlyTestLinesFromOutFile( OutputValidator validator ) throws VerificationException { TestFile report = validator.getSurefireReportsFile( "jiras.surefire1082.Jira1082Test-output.txt" ); report.assertFileExists(); return printOnlyTestLines( validator.loadFile( report.getFile(), Charset.forName( "UTF-8" ) ) ); } private static Set printOnlyTestLines( Collection logs ) throws VerificationException { Set log = new TreeSet(); for ( String line : logs ) { if ( line.startsWith( "class jiras.surefire1082." ) ) { log.add( line ); } } return log; } private static Matcher> regex( Set r ) { return new IsRegex( r ); } private static void assertParallelRun( Set log ) { assertThat( log.size(), is( 4 ) ); Set expectedLogs1 = new TreeSet(); expectedLogs1.add( "class jiras.surefire1082.Jira1082Test a 0 pool-[\\d]+-thread-1" ); expectedLogs1.add( "class jiras.surefire1082.Jira1082Test b 0 pool-[\\d]+-thread-1" ); expectedLogs1.add( "class jiras.surefire1082.Jira1082Test a 1 pool-[\\d]+-thread-2" ); expectedLogs1.add( "class jiras.surefire1082.Jira1082Test b 1 pool-[\\d]+-thread-2" ); Set expectedLogs2 = new TreeSet(); expectedLogs2.add( "class jiras.surefire1082.Jira1082Test a 1 pool-[\\d]+-thread-1" ); expectedLogs2.add( "class jiras.surefire1082.Jira1082Test b 1 pool-[\\d]+-thread-1" ); expectedLogs2.add( "class jiras.surefire1082.Jira1082Test a 0 pool-[\\d]+-thread-2" ); expectedLogs2.add( "class jiras.surefire1082.Jira1082Test b 0 pool-[\\d]+-thread-2" ); assertThat( log, anyOf( regex( expectedLogs1 ), regex( expectedLogs2 ) ) ); } @Test public void checkClassesRunParallel() throws VerificationException { OutputValidator validator = unpack().setTestToRun( "Jira1082Test" ) .parallelClasses() .useUnlimitedThreads() .executeTest() .verifyErrorFree( 4 ); validator.getSurefireReportsXmlFile( "TEST-jiras.surefire1082.Jira1082Test.xml" ) .assertFileExists(); validator.assertThatLogLine( containsString( "Running jiras.surefire1082.Jira1082Test" ), is( 1 ) ); Set log = printOnlyTestLinesFromConsole( validator ); assertParallelRun( log ); } @Test public void checkOutFileClassesRunParallel() throws VerificationException { OutputValidator validator = unpack().redirectToFile( true ) .setTestToRun( "Jira1082Test" ) .parallelClasses() .useUnlimitedThreads() .executeTest() .verifyErrorFree( 4 ); validator.getSurefireReportsXmlFile( "TEST-jiras.surefire1082.Jira1082Test.xml" ) .assertFileExists(); validator.assertThatLogLine( containsString( "Running jiras.surefire1082.Jira1082Test" ), is( 1 ) ); Set log = printOnlyTestLinesFromOutFile( validator ); assertParallelRun( log ); } @Test public void shouldRunTwo() throws VerificationException { OutputValidator validator = unpack().redirectToFile( true ) .parallelClasses() .useUnlimitedThreads() .executeTest() .verifyErrorFree( 8 ); validator.getSurefireReportsXmlFile( "TEST-jiras.surefire1082.Jira1082Test.xml" ) .assertFileExists(); validator.getSurefireReportsXmlFile( "TEST-jiras.surefire1082.Jira1264Test.xml" ) .assertFileExists(); validator.getSurefireReportsFile( "jiras.surefire1082.Jira1082Test-output.txt" ) .assertFileExists(); validator.getSurefireReportsFile( "jiras.surefire1082.Jira1264Test-output.txt" ) .assertFileExists(); validator.assertThatLogLine( containsString( "Running jiras.surefire1082.Jira1082Test" ), is( 1 ) ); validator.assertThatLogLine( containsString( "Running jiras.surefire1082.Jira1264Test" ), is( 1 ) ); } private SurefireLauncher unpack() { return unpack( "surefire-1082-parallel-junit-parameterized" ); } private static class IsRegex extends BaseMatcher> { private final Set expectedRegex; IsRegex( Set expectedRegex ) { this.expectedRegex = expectedRegex; } @Override public boolean matches( Object o ) { if ( o != null && o instanceof Set ) { Set actual = (Set) o; boolean matches = actual.size() == expectedRegex.size(); Iterator regex = expectedRegex.iterator(); for ( String s : actual ) { if ( s == null || !regex.hasNext() || !s.matches( regex.next() ) ) { matches = false; } } return matches; } else { return false; } } @Override public void describeTo( Description description ) { description.appendValue( expectedRegex ); } } } Surefire1095NpeInRunListener.java000066400000000000000000000066141330756104600403600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; @SuppressWarnings( { "javadoc", "checkstyle:javadoctype" } ) /** * * In the surefire plugin, it is possible to specify one or more RunListener when running tests with JUnit. * However, it does not look like the listener is properly called by the plugin. In particular, there is a problem * with the method: *

 * public void testRunStarted(Description description)
 * 
* it's javadoc at * * states: * "Parameters: * description - describes the tests to be run " * however, in all maven projects I tried ("mvn test"), the surefire plugin seems like passing a null reference instead * of a Description instance that "describes the tests to be run " * Note: other methods in the RunListener I tested seems fine (i.e., they get a valid Description object as input) * * @author Tibor Digana (tibor17) * @see * @since 2.18 */ public final class Surefire1095NpeInRunListener extends SurefireJUnit4IntegrationTestCase { /** * Method Request.classes( String, Class[] ); exists in JUnit 4.0 - 4.4 * See JUnit4Reflector. */ @Test public void testRunStartedWithJUnit40() { unpack().setJUnitVersion( "4.0" ) .executeTest() .verifyErrorFree( 1 ) .verifyTextInLog( "Running JUnit 4.0" ) .verifyTextInLog( "testRunStarted [jiras.surefire1095.SomeTest]" ); } /** * Method Request.classes( Class[] ); Since of JUnit 4.5 * See JUnit4Reflector. */ @Test public void testRunStartedWithJUnit45() { unpack().setJUnitVersion( "4.5" ) .executeTest() .verifyErrorFree( 1 ) .verifyTextInLog( "Running JUnit 4.5" ) .verifyTextInLog( "testRunStarted [jiras.surefire1095.SomeTest]" ); } @Test public void testRunStartedWithJUnit47() { unpack().setJUnitVersion( "4.7" ) .executeTest() .verifyErrorFree( 1 ) .verifyTextInLog( "Running JUnit 4.7" ) .verifyTextInLog( "testRunStarted [jiras.surefire1095.SomeTest]" ); } private SurefireLauncher unpack() { return unpack( "surefire-1095-npe-in-runlistener" ); } } Surefire1098BalancedRunOrderIT.java000066400000000000000000000112621330756104600405610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import static org.junit.Assert.assertThat; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.AnyOf.anyOf; /** * The purpose of this IT is to assert that the run order of test classes is according to the settings:
* * runOrder=balanced
* parallel=classes
* threadCount=2
* perCoreThreadCount=false
*
* The list of tests should be reordered to (DTest, CTest, BTest, ATest) in the second run. * * @author
Tibor Digana (tibor17) * @see SUREFIRE-1098 * @since 2.18 */ public class Surefire1098BalancedRunOrderIT extends SurefireJUnit4IntegrationTestCase { @Test public void reorderedParallelClasses() throws VerificationException { SurefireLauncher launcher = unpack(); launcher // .runOrder( "balanced" ) call it in 3.x and remove it in surefire-1098-balanced-runorder/pom.xml // as soon as there is prefix available "failsafe" and "surefire" in system property for this parameter. .parallelClasses().threadCount( 2 ).disablePerCoreThreadCount() .executeTest().verifyErrorFree( 4 ); OutputValidator validator = launcher // .runOrder( "balanced" ) call it in 3.x and remove it in surefire-1098-balanced-runorder/pom.xml // as soon as there is prefix available "failsafe" and "surefire" in system property for this parameter. .parallelClasses().threadCount( 2 ).disablePerCoreThreadCount() .executeTest().verifyErrorFree( 4 ); List log = printOnlyTestLines( validator ); assertThat( log.size(), is( 4 ) ); Collections.sort( log ); final int[] threadPoolIdsOfLongestTest = extractThreadPoolIds( log.get( 3 ) ); final int pool = threadPoolIdsOfLongestTest[0]; int thread = threadPoolIdsOfLongestTest[1]; assertThat( thread, anyOf( is( 1 ), is( 2 ) ) ); thread = thread == 1 ? 2 : 1; // If the longest test class DTest is running in pool-2-thread-1, the others should run in pool-2-thread-2 // and vice versa. assertThat( log.get( 0 ), is( testLine( "A", pool, thread ) ) ); assertThat( log.get( 1 ), is( testLine( "B", pool, thread ) ) ); assertThat( log.get( 2 ), is( testLine( "C", pool, thread ) ) ); } private SurefireLauncher unpack() { return unpack( "surefire-1098-balanced-runorder" ); } private static List printOnlyTestLines( OutputValidator validator ) throws VerificationException { List log = new ArrayList( validator.loadLogLines() ); for ( Iterator it = log.iterator(); it.hasNext(); ) { String line = it.next(); if ( !line.startsWith( "class jiras.surefire1098." ) ) { it.remove(); } } return log; } private static int[] extractThreadPoolIds(String logLine) { //Example to parse "class jiras.surefire1098.DTest pool-2-thread-1" into {2, 1}. String t = logLine.split( " " )[2]; String[] ids = t.split( "-" ); return new int[]{ Integer.parseInt( ids[1] ), Integer.parseInt( ids[3] )}; } private String testLine(String test, int pool, int thread) { return String.format( "class jiras.surefire1098.%sTest pool-%d-thread-%d", test, pool, thread ); } } Surefire1122ParallelAndFlakyTestsIT.java000066400000000000000000000031461330756104600415660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * @author agudian * @see SUREFIRE-1122 */ public class Surefire1122ParallelAndFlakyTestsIT extends SurefireJUnit4IntegrationTestCase { @Test public void nonParallelCreatesCorrectReport() { unpack( "surefire-1122-parallel-and-flakyTests" ) .executeTest() .assertTestSuiteResults( 2, 0, 0, 0, 1 ); } @Test public void parallelCreatesCorrectReport() { unpack( "surefire-1122-parallel-and-flakyTests" ) .activateProfile( "parallel" ) .executeTest() .assertTestSuiteResults( 2, 0, 0, 0, 1 ); } } Surefire1135ImproveIgnoreMessageForTestNGIT.java000066400000000000000000000127401330756104600432270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import static org.apache.maven.shared.utils.xml.Xpp3DomBuilder.build; import static org.hamcrest.Matchers.*; import static org.junit.Assert.assertThat; import java.io.FileNotFoundException; import org.apache.maven.shared.utils.xml.Xpp3Dom; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Test surefire-report on TestNG test * * @author Michal Bocek */ public class Surefire1135ImproveIgnoreMessageForTestNGIT extends SurefireJUnit4IntegrationTestCase { private enum ResultType { SKIPPED( "skipped" ), FAILURE( "failure" ); private final String type; ResultType(String type) { this.type = type; } public String getType() { return type; } } @Test public void testNgReport688() throws Exception { testNgReport( "6.8.8", null, ResultType.SKIPPED, "Skip test", /*"org.testng.SkipException"*/ null, /*"SkipExceptionReportTest.java:30"*/ null ); } @Test public void testNgReport57() throws Exception { testNgReport( "5.7", "jdk15", ResultType.SKIPPED, "Skip test", /*"org.testng.SkipException"*/ null, /*"SkipExceptionReportTest.java:30"*/ null ); } private void testNgReport( String version, String classifier, ResultType resultType, String message, String type, String stackTrace ) throws Exception { OutputValidator outputValidator = runTest( version, classifier, resultType, "/surefire-1135-improve-ignore-message-for-testng" ); Xpp3Dom[] children = readTests( outputValidator, "testng.SkipExceptionReportTest" ); assertThat( "Report should contains only one test case", children.length, is( 1 ) ); Xpp3Dom test = children[0]; assertThat( "Not expected classname", test.getAttribute( "classname" ), is( "testng.SkipExceptionReportTest" ) ); assertThat( "Not expected test name", test.getAttribute( "name" ), is( "testSkipException" ) ); children = test.getChildren( resultType.getType() ); assertThat( "Test should contains only one " + resultType.getType() + " element", children, is( arrayWithSize( 1 ) ) ); Xpp3Dom result = children[0]; if ( message == null ) { assertThat( "Subelement message attribute must be null", result.getAttribute( "message" ), is( nullValue() ) ); } else { assertThat( "Subelement should contains message attribute", result.getAttribute( "message" ), is( message ) ); } if ( type == null ) { assertThat( "Subelement type attribute must be null", result.getAttribute( "type" ), is( nullValue() ) ); } else { assertThat( "Subelement should contains type attribute", result.getAttribute( "type" ), is( type ) ); } if ( stackTrace == null ) { assertThat( "Element body must be null", result.getValue() , isEmptyOrNullString() ); } else { assertThat( "Element body must contains", result.getValue(), containsString( stackTrace ) ); } } private OutputValidator runTest( String version, String classifier, ResultType resultType, String resource ) { int skipped = ResultType.SKIPPED.equals( resultType ) ? 1 : 0; int failure = ResultType.FAILURE.equals( resultType ) ? 1 : 0; SurefireLauncher launcher = unpack( resource ).sysProp( "testNgVersion", version ); if ( classifier != null ) { launcher.sysProp( "testNgClassifier", classifier ); } return launcher.addSurefireReportGoal() .executeCurrentGoals() .assertTestSuiteResults( 1, 0, failure, skipped ); } private static Xpp3Dom[] readTests( OutputValidator validator, String className ) throws FileNotFoundException { Xpp3Dom testResult = build( validator.getSurefireReportsXmlFile( "TEST-" + className + ".xml" ).getFileInputStream(), "UTF-8" ); return testResult.getChildren( "testcase" ); } } Surefire1136CwdPropagationInForkedModeIT.java000066400000000000000000000031631330756104600425510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-1136 Correct current working directory propagation in forked mode * * Note: variables expansion behaves differently on MVN 2.x since not existing variables * are resolved to 'null' value so that ${surefire.forkNumber} cannot work. * * @author Norbert Wnuk */ public class Surefire1136CwdPropagationInForkedModeIT extends SurefireJUnit4IntegrationTestCase { @Test public void testTestNgAndJUnitTogether() { OutputValidator outputValidator = unpack( "surefire-1136-cwd-propagation-in-forked-mode" ).executeTest(); outputValidator.assertTestSuiteResults( 1, 0, 0, 0 ); } } Surefire1144XmlRunTimeIT.java000066400000000000000000000043051330756104600374430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.plugins.surefire.report.ReportTestSuite; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; import java.util.List; import static org.apache.maven.surefire.its.fixture.HelperAssertions.extractReports; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; /** * Test that runtime reported on console matches runtime in XML * * @author Lamyaa Eloussi */ public class Surefire1144XmlRunTimeIT extends SurefireJUnit4IntegrationTestCase { @Test public void testXmlRunTime() throws Exception { OutputValidator outputValidator = unpack( "/surefire-1144-xml-runtime" ).forkOnce().executeTest(); List reports = extractReports( outputValidator.getBaseDir() ); assertThat( reports, hasSize( 1 ) ); ReportTestSuite report = reports.get( 0 ); float xmlTime = report.getTimeElapsed(); assertThat( xmlTime, is(greaterThanOrEqualTo( 1.6f ) ) ); //include beforeClass and afterClass outputValidator.verifyTextInLog( Float.toString( xmlTime ) ); //same time in console } } Surefire1146RerunFailedAndParameterized.java000066400000000000000000000077761330756104600425230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * @see SUREFIRE-1146 */ public class Surefire1146RerunFailedAndParameterized extends SurefireJUnit4IntegrationTestCase { @Test public void testsAreRerun() { OutputValidator outputValidator = unpack( "surefire-1146-rerunFailingTests-with-Parameterized" ).executeTest(); verify(outputValidator, 8, 0, 0, 0, 5); } private void verify( OutputValidator outputValidator, int run, int failures, int errors, int skipped, int flakes ) { outputValidator.verifyTextInLog( "Flakes:" ); outputValidator.verifyTextInLog( "jiras.surefire1146.CustomDescriptionParameterizedTest.flakyTest[0: (Test11); Test12; Test13;](jiras.surefire1146.CustomDescriptionParameterizedTest)" ); outputValidator.verifyTextInLog( "Run 1: CustomDescriptionParameterizedTest.flakyTest:" ); outputValidator.verifyTextInLog( "Run 2: CustomDescriptionParameterizedTest.flakyTest:" ); outputValidator.verifyTextInLog( "Run 3: PASS" ); outputValidator.verifyTextInLog( "jiras.surefire1146.CustomDescriptionWithCommaParameterizedTest.flakyTest[0: (Test11), Test12, Test13;](jiras.surefire1146.CustomDescriptionWithCommaParameterizedTest)" ); outputValidator.verifyTextInLog( "Run 1: CustomDescriptionWithCommaParameterizedTest.flakyTest:" ); outputValidator.verifyTextInLog( "Run 2: CustomDescriptionWithCommaParameterizedTest.flakyTest:" ); outputValidator.verifyTextInLog( "Run 3: PASS" ); outputValidator.verifyTextInLog( "jiras.surefire1146.CustomDescriptionWithCommaParameterizedTest.flakyTest[2: (Test31), Test32, Test33;](jiras.surefire1146.CustomDescriptionWithCommaParameterizedTest)" ); outputValidator.verifyTextInLog( "Run 1: CustomDescriptionWithCommaParameterizedTest.flakyTest:" ); outputValidator.verifyTextInLog( "Run 2: PASS" ); outputValidator.verifyTextInLog( "jiras.surefire1146.SimpleParameterizedTest.flakyTest[0](jiras.surefire1146.SimpleParameterizedTest)" ); outputValidator.verifyTextInLog( "Run 1: SimpleParameterizedTest.flakyTest:" ); outputValidator.verifyTextInLog( "Run 2: SimpleParameterizedTest.flakyTest:" ); outputValidator.verifyTextInLog( "Run 3: PASS" ); outputValidator.verifyTextInLog( "jiras.surefire1146.StandardTest.flakyTest(jiras.surefire1146.StandardTest)" ); outputValidator.verifyTextInLog( "Run 1: StandardTest.flakyTest:" ); outputValidator.verifyTextInLog( "Run 2: PASS" ); verifyStatistics( outputValidator, run, failures, errors, skipped, flakes ); } private void verifyStatistics( OutputValidator outputValidator, int run, int failures, int errors, int skipped, int flakes ) { outputValidator.verifyTextInLog( "Tests run: " + run + ", Failures: " + failures + ", Errors: " + errors + ", Skipped: " + skipped + ", Flakes: " + flakes ); } } Surefire1152RerunFailingTestsInSuiteIT.java000066400000000000000000000044471330756104600423160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * SUREFIRE-1152 Assert rerunFailingTestsCount works with test suites * * @author Sean Flanigan */ public class Surefire1152RerunFailingTestsInSuiteIT extends SurefireJUnit4IntegrationTestCase { private static final String RUNNING_WITH_PROVIDER47 = "Using configured provider org.apache.maven.surefire.junitcore.JUnitCoreProvider"; public OutputValidator runMethodPattern( String projectName, String... goals ) { SurefireLauncher launcher = unpack( projectName ); for ( String goal : goals ) { launcher.addGoal( goal ); } OutputValidator outputValidator = launcher.showErrorStackTraces().debugLogging().executeVerify(); outputValidator.assertTestSuiteResults( 3, 0, 0, 0, 3 ); outputValidator.assertIntegrationTestSuiteResults( 1, 0, 0, 0 ); return outputValidator; } @Test public void testJUnit48Provider4() { runMethodPattern( "surefire-1152-rerunFailingTestsCount-suite", "-P surefire-junit4" ); } @Test public void testJUnit48Provider47() { runMethodPattern( "surefire-1152-rerunFailingTestsCount-suite", "-P surefire-junit47" ) .verifyTextInLog( RUNNING_WITH_PROVIDER47 ); } } Surefire1153IncludesAndSpecifiedTestIT.java000066400000000000000000000030051330756104600422400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; public class Surefire1153IncludesAndSpecifiedTestIT extends SurefireJUnit4IntegrationTestCase { @Test public void testSpecifiedTestInIncludes() { unpack( "/surefire-1153-includesAndSpecifiedTest" ) .setTestToRun( "#testIncluded" ) .executeTest() .verifyErrorFree( 1 ); } @Test public void testSpecifiedTestNotInIncludes() { unpack( "/surefire-1153-includesAndSpecifiedTest" ) .setTestToRun( "#testNotIncluded" ) .executeTest() .verifyErrorFree( 1 ); } } Surefire1158RemoveInfoLinesIT.java000066400000000000000000000114521330756104600404510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireVerifierException; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import java.util.ArrayList; import static org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase.unpack; import static org.junit.runners.Parameterized.*; import static org.junit.Assert.*; /** * * @author Tibor Digana (tibor17) * @see SUREFIRE-1158 * @since 2.19 */ @RunWith( Parameterized.class ) public class Surefire1158RemoveInfoLinesIT { @Parameters(name = "{0}") public static Iterable data() { ArrayList args = new ArrayList(); args.add( new Object[] { "junit-option-ff", "JUnitTest", "-ff", "surefire-junit47", false, true } ); args.add( new Object[] { "testng-option-ff", "TestNGSuiteTest", "-ff", "surefire-testng", false, false } ); args.add( new Object[] { "junit-option-X", "JUnitTest", "-X", "surefire-junit47", true, true } ); args.add( new Object[] { "testng-option-X", "TestNGSuiteTest", "-X", "surefire-testng", true, false } ); args.add( new Object[] { "junit-option-e", "JUnitTest", "-e", "surefire-junit47", true, true } ); args.add( new Object[] { "testng-option-e", "TestNGSuiteTest", "-e", "surefire-testng", true, false } ); return args; } @Parameter(0) public String description; @Parameter(1) public String testToRun; @Parameter(2) public String cliOption; @Parameter(3) public String provider; @Parameter(4) public boolean printsInfoLines; @Parameter(5) public boolean isJUnit; @Test public void shouldRunWithCliOption() throws Exception { OutputValidator validator = assertTest(); if ( isJUnit ) { assertJUnitTestLogs( validator ); } else { assertTestNGTestLogs( validator ); } } private OutputValidator assertTest() throws Exception { final String[] cli = {"--batch-mode"}; return unpack( getClass(), "/surefire-1158-remove-info-lines", "_" + description, cli ) .sysProp( "provider", provider ).addGoal( cliOption ).setTestToRun( testToRun ) .executeTest() .verifyErrorFreeLog().assertTestSuiteResults( 1, 0, 0, 0 ); } private void assertJUnitTestLogs( OutputValidator validator ) { try { validator.verifyTextInLog( "Surefire report directory:" ); validator.verifyTextInLog( "Using configured provider org.apache.maven.surefire.junitcore.JUnitCoreProvider" ); validator.verifyTextInLog( "parallel='none', perCoreThreadCount=true, threadCount=0, " + "useUnlimitedThreads=false, threadCountSuites=0, threadCountClasses=0, " + "threadCountMethods=0, parallelOptimized=true" ); if ( !printsInfoLines ) { fail(); } } catch ( SurefireVerifierException e ) { if ( printsInfoLines ) { fail(); } } } private void assertTestNGTestLogs( OutputValidator validator ) { try { validator.verifyTextInLog( "Surefire report directory:" ); validator.verifyTextInLog( "Using configured provider org.apache.maven.surefire.testng.TestNGProvider" ); validator.verifyTextInLog( "Configuring TestNG with: TestNGMapConfigurator" ); if ( !printsInfoLines ) { fail(); } } catch ( SurefireVerifierException e ) { if ( printsInfoLines ) { fail(); } } } } Surefire1177TestngParallelSuitesIT.java000066400000000000000000000043311330756104600415220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.startsWith; /** * IT for https://issues.apache.org/jira/browse/SUREFIRE-1177 * * @author Tibor Digana (tibor17) * @since 2.19 */ public class Surefire1177TestngParallelSuitesIT extends SurefireJUnit4IntegrationTestCase { @Test public void shouldRunTwoSuitesInParallel() throws VerificationException { assumeJavaVersion( 1.7d ); unpack().executeTest() .verifyErrorFree( 2 ) .assertThatLogLine( containsString( "ShouldNotRunTest#shouldNotRun()" ), is( 0 ) ) .assertThatLogLine( startsWith( "TestNGSuiteTest#shouldRunAndPrintItself()" ), is( 2 ) ) .assertThatLogLine( is( "TestNGSuiteTest#shouldRunAndPrintItself() 1." ), is( 1 ) ) .assertThatLogLine( is( "TestNGSuiteTest#shouldRunAndPrintItself() 2." ), is( 1 ) ); } private SurefireLauncher unpack() { return unpack( "testng-parallel-suites" ); } } Surefire1179IT.java000066400000000000000000000026441330756104600354720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Fix for TestNG parameter -dataproviderthreadcount. */ public class Surefire1179IT extends SurefireJUnit4IntegrationTestCase { @Test public void suiteXmlForkCountTwoReuse() { unpack().executeTest().verifyErrorFreeLog().verifyTextInLog( " CONCURRENCY=30." ); } private SurefireLauncher unpack() { return unpack( "surefire-1179-testng-parallel-dataprovider" ); } } Surefire1185DoNotSpawnTestsIT.java000066400000000000000000000043571330756104600404720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; /** * Surefire 2.19 spawns unnecessary tests in surefire-junit4 provider. * https://issues.apache.org/jira/browse/SUREFIRE-1185 * Example, UnlistedTest is the problem here because it runs with filtered out methods: * * Running pkg.UnlistedTest * Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec - in pkg.UnlistedTest * Running pkg.RunningTest * Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec - in pkg.RunningTest * * Results: * * Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 */ public class Surefire1185DoNotSpawnTestsIT extends SurefireJUnit4IntegrationTestCase { @Test public void doNotSpawnUnwantedTests() throws VerificationException { unpack().setTestToRun( "RunningTest#test" ) .executeTest() .assertTestSuiteResults( 1 ) .assertThatLogLine( containsString( "in pkg.RunningTest" ), is( 1 ) ) .assertThatLogLine( containsString( "in pkg.UnlistedTest" ), is( 0 ) ); } private SurefireLauncher unpack() { return unpack( "surefire-1185" ); } } Surefire1202RerunAndSkipIT.java000066400000000000000000000036151330756104600377420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Allow rerunFailingTestsCount, skipAfterFailureCount together * * @author Tibor Digana (tibor17) * @see SUREFIRE-1202 * @since 2.19.1 */ public class Surefire1202RerunAndSkipIT extends SurefireJUnit4IntegrationTestCase { @Test public void junit47() throws VerificationException { unpack().executeTest() .assertTestSuiteResults( 5, 0, 0, 3, 4 ); } @Test public void junit4() throws VerificationException { unpack().addGoal( "-Pjunit4" ) .executeTest() .assertTestSuiteResults( 5, 0, 0, 3, 4 ); } private SurefireLauncher unpack() { return unpack( "surefire-1202-rerun-and-failfast" ); } } Surefire1209RerunAndForkCountIT.java000066400000000000000000000045361330756104600407600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * @author Tibor Digana (tibor17) * @see SUREFIRE-1209 * @since 2.19 */ public class Surefire1209RerunAndForkCountIT extends SurefireJUnit4IntegrationTestCase { @Test public void reusableForksJUnit47() throws VerificationException { unpack().executeTest() .assertTestSuiteResults( 5, 0, 0, 0, 4 ); } @Test public void notReusableForksJUnit47() throws VerificationException { unpack().reuseForks( false ) .executeTest() .assertTestSuiteResults( 5, 0, 0, 0, 4 ); } @Test public void reusableForksJUnit4() throws VerificationException { unpack().addGoal( "-Pjunit4" ) .executeTest() .assertTestSuiteResults( 5, 0, 0, 0, 4 ); } @Test public void notReusableForksJUnit4() throws VerificationException { unpack().addGoal( "-Pjunit4" ) .reuseForks( false ) .executeTest() .assertTestSuiteResults( 5, 0, 0, 0, 4 ); } private SurefireLauncher unpack() { return unpack( "surefire-1209-rerun-and-forkcount" ); } } Surefire1211JUnitTestNgIT.java000066400000000000000000000036001330756104600375450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion; /** * @author Tibor Digana (tibor17) * @see SUREFIRE-1211 * @since 2.19.1 */ public class Surefire1211JUnitTestNgIT extends SurefireJUnit4IntegrationTestCase { @Test public void withJUnit() { assumeJavaVersion( 1.7d ); unpack().threadCount( 1 ) .executeTest() .verifyErrorFree( 2 ); } @Test public void withoutJUnit() { assumeJavaVersion( 1.7d ); unpack().threadCount( 1 ) .sysProp( "junit", "false" ) .executeTest() .verifyErrorFree( 1 ); } private SurefireLauncher unpack() { return unpack( "surefire-1211" ); } } Surefire1260NewTestsPattern.java000066400000000000000000000030071330756104600402510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.*; import org.junit.Test; /** * Added included pattern Tests.java. *

* Found in Surefire 2.19.1. * * @author Tibor Digana (tibor17) * @see SUREFIRE-1260 * @since 2.20 */ public class Surefire1260NewTestsPattern extends SurefireJUnit4IntegrationTestCase { @Test public void defaultConfig() { unpack() .executeTest() .verifyErrorFree( 5 ); } private SurefireLauncher unpack() { return unpack( "/surefire-1260-new-tests-pattern" ); } } Surefire1264IT.java000066400000000000000000000036101330756104600354570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * @author Tibor Digana (tibor17) * @see SUREFIRE-1264 * @since 2.20.1 */ public class Surefire1264IT extends SurefireJUnit4IntegrationTestCase { @Test public void positiveTests() { unpack( "surefire-1264" ) .setForkJvm() .parallelAll() .useUnlimitedThreads() .sysProp( "canFail", "false" ) .executeTest() .assertTestSuiteResults( 16, 0, 0, 0 ); } @Test public void negativeTests() { unpack( "surefire-1264" ) .setForkJvm() .parallelAll() .useUnlimitedThreads() .sysProp( "canFail", "true" ) .mavenTestFailureIgnore( true ) .executeTest() .assertTestSuiteResults( 16, 0, 16, 0 ); } } Surefire1265Java9IT.java000066400000000000000000000040461330756104600363570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.AbstractJigsawIT; import org.junit.Test; import java.io.IOException; @SuppressWarnings( { "javadoc", "checkstyle:javadoctype" } ) /** * IsolatedClassLoader should take platform ClassLoader as a parent ClassLoader if running on the top of JDK9. * The IsolatedClassLoader should not fail like this: * * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project * maven-surefire-plugin-example: Execution default-test of goal * org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: * java.lang.NoClassDefFoundError: java/sql/SQLException: java.sql.SQLException -> [Help 1] * * @author Tibor Digana (tibor17) * @see SUREFIRE-1265 * @since 2.20.1 */ public class Surefire1265Java9IT extends AbstractJigsawIT { @Test public void shouldRunInPluginJava9() throws IOException { assumeJigsaw() .executeTest() .verifyErrorFree( 2 ); } @Override protected String getProjectDirectoryName() { return "/surefire-1265"; } } Surefire1278GroupNameEndingIT.java000066400000000000000000000025751330756104600404400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Test the group filter for TestNG * */ public class Surefire1278GroupNameEndingIT extends SurefireJUnit4IntegrationTestCase { @Test public void testOnlyGroups() { unpack().setGroups( "group" ).executeTest().verifyErrorFree( 1 ); } public SurefireLauncher unpack() { return unpack( "/surefire-1278-group-name-ending" ); } } Surefire1295AttributeJvmCrashesToTestsIT.java000066400000000000000000000125371330756104600426730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; import java.util.Iterator; import static java.util.Arrays.asList; import static java.util.concurrent.TimeUnit.SECONDS; import static org.apache.commons.lang3.SystemUtils.IS_OS_LINUX; import static org.apache.commons.lang3.SystemUtils.IS_OS_MAC_OSX; import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS_7; import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS_8; import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS_10; import static org.apache.maven.surefire.its.jiras.Surefire1295AttributeJvmCrashesToTestsIT.ForkMode.DEFAULT; import static org.apache.maven.surefire.its.jiras.Surefire1295AttributeJvmCrashesToTestsIT.ForkMode.ONE_FORK_NO_REUSE; import static org.apache.maven.surefire.its.jiras.Surefire1295AttributeJvmCrashesToTestsIT.ForkMode.ONE_FORK_REUSE; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.fail; import static org.junit.Assume.assumeTrue; /** * https://issues.apache.org/jira/browse/SUREFIRE-1295 * https://github.com/apache/maven-surefire/pull/136 * * @author michaeltandy * @since 2.20 */ @RunWith( Parameterized.class ) public class Surefire1295AttributeJvmCrashesToTestsIT extends SurefireJUnit4IntegrationTestCase { public enum ForkMode { DEFAULT, ONE_FORK_NO_REUSE, ONE_FORK_REUSE } @Parameters public static Iterable parameters() { return asList(new Object[][] { // unused, exit() does not stop all Threads immediately, // see https://github.com/michaeltandy/crashjvm/issues/1 // { "exit", DEFAULT }, // { "exit", ONE_FORK_NO_REUSE }, // { "exit", ONE_FORK_REUSE }, { "abort", DEFAULT }, { "abort", ONE_FORK_NO_REUSE }, { "abort", ONE_FORK_REUSE }, { "segfault", DEFAULT }, { "segfault", ONE_FORK_NO_REUSE }, { "segfault", ONE_FORK_REUSE } }); } @Parameter( 0 ) public static String crashStyle; @Parameter( 1 ) public static ForkMode forkStyle; @Test public void test() throws Exception { assumeTrue( IS_OS_LINUX || IS_OS_MAC_OSX || IS_OS_WINDOWS_7 || IS_OS_WINDOWS_8 || IS_OS_WINDOWS_10 ); SurefireLauncher launcher = unpack( "crash-during-test", "_" + crashStyle + "_" + forkStyle.ordinal() ) .setForkJvm(); switch ( forkStyle ) { case DEFAULT: break; case ONE_FORK_NO_REUSE: launcher.forkCount( 1 ) .reuseForks( false ); break; case ONE_FORK_REUSE: launcher.forkPerThread() .reuseForks( true ) .threadCount( 1 ); break; default: fail(); } checkCrash( launcher.addGoal( "-DcrashType=" + crashStyle ) ); } private static void checkCrash( SurefireLauncher launcher ) throws Exception { OutputValidator validator = launcher.maven() .withFailure() .executeTest() .verifyTextInLog( "The forked VM terminated without properly saying " + "goodbye. VM crash or System.exit called?" ) .verifyTextInLog( "Crashed tests:" ); // Cannot flush log.txt stream because it is consumed internally by Verifier. // Waiting for the stream to become flushed on disk. SECONDS.sleep( 1L ); for ( Iterator it = validator.loadLogLines().iterator(); it.hasNext(); ) { String line = it.next(); if ( line.contains( "Crashed tests:" ) ) { line = it.next(); if ( it.hasNext() ) { assertThat( line ) .contains( "junit44.environment.Test1CrashedTest" ); } else { fail( "Could not find any line after 'Crashed tests:'." ); } } } } } Surefire1364SystemPropertiesIT.java000066400000000000000000000214671330756104600407540ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * Report XML should contain system properties of forked JVM. * * @author Tibor Digana (tibor17) * @since 2.20.1 */ public class Surefire1364SystemPropertiesIT extends SurefireJUnit4IntegrationTestCase { @Test public void junit3Forked() { SurefireLauncher launcher = unpack( "surefire-1364" ); OutputValidator validator = launcher.setForkJvm() .activateProfile( "junit3" ) .forkMode( "once" ) .executeTest() .verifyErrorFree( 2 ); validator.getSurefireReportsXmlFile( "TEST-FirstTest.xml" ) .assertContainsText( "" ); validator.getSurefireReportsXmlFile( "TEST-SecondTest.xml" ) .assertContainsText( "" ); } @Test public void junit3InProcess() { SurefireLauncher launcher = unpack( "surefire-1364" ); OutputValidator validator = launcher.setForkJvm() .activateProfile( "junit3" ) .forkMode( "never" ) .executeTest() .verifyErrorFree( 2 ); validator.getSurefireReportsXmlFile( "TEST-FirstTest.xml" ) .assertContainsText( "" ); validator.getSurefireReportsXmlFile( "TEST-SecondTest.xml" ) .assertContainsText( "" ); } @Test public void junit4Forked() { SurefireLauncher launcher = unpack( "surefire-1364" ); OutputValidator validator = launcher.setForkJvm() .forkMode( "once" ) .executeTest() .verifyErrorFree( 2 ); validator.getSurefireReportsXmlFile( "TEST-FirstTest.xml" ) .assertContainsText( "" ); validator.getSurefireReportsXmlFile( "TEST-SecondTest.xml" ) .assertContainsText( "" ); } @Test public void junit4InProcess() { SurefireLauncher launcher = unpack( "surefire-1364" ); OutputValidator validator = launcher.setForkJvm() .forkMode( "never" ) .executeTest() .verifyErrorFree( 2 ); validator.getSurefireReportsXmlFile( "TEST-FirstTest.xml" ) .assertContainsText( "" ); validator.getSurefireReportsXmlFile( "TEST-SecondTest.xml" ) .assertContainsText( "" ); } @Test public void junit47Forked() { SurefireLauncher launcher = unpack( "surefire-1364" ); OutputValidator validator = launcher.setForkJvm() .activateProfile( "junit47" ) .forkMode( "once" ) .executeTest() .verifyErrorFree( 2 ); validator.getSurefireReportsXmlFile( "TEST-FirstTest.xml" ) .assertContainsText( "" ); validator.getSurefireReportsXmlFile( "TEST-SecondTest.xml" ) .assertContainsText( "" ); } @Test public void junit47InProcess() { SurefireLauncher launcher = unpack( "surefire-1364" ); OutputValidator validator = launcher.setForkJvm() .activateProfile( "junit47" ) .forkMode( "never" ) .executeTest() .verifyErrorFree( 2 ); validator.getSurefireReportsXmlFile( "TEST-FirstTest.xml" ) .assertContainsText( "" ); validator.getSurefireReportsXmlFile( "TEST-SecondTest.xml" ) .assertContainsText( "" ); } @Test public void junit47ForkedParallel() { SurefireLauncher launcher = unpack( "surefire-1364" ); OutputValidator validator = launcher.setForkJvm() .activateProfile( "junit47" ) .forkMode( "once" ) .parallelClasses() .threadCount( 2 ) .disablePerCoreThreadCount() .executeTest() .verifyErrorFree( 2 ); validator.getSurefireReportsXmlFile( "TEST-FirstTest.xml" ) .assertContainsText( "" ); validator.getSurefireReportsXmlFile( "TEST-SecondTest.xml" ) .assertContainsText( "" ); } @Test public void junit47InProcessParallel() { SurefireLauncher launcher = unpack( "surefire-1364" ); OutputValidator validator = launcher.setForkJvm() .activateProfile( "junit47" ) .forkMode( "never" ) .parallelClasses() .threadCount( 2 ) .disablePerCoreThreadCount() .executeTest() .verifyErrorFree( 2 ); validator.getSurefireReportsXmlFile( "TEST-FirstTest.xml" ) .assertContainsText( "" ); validator.getSurefireReportsXmlFile( "TEST-SecondTest.xml" ) .assertContainsText( "" ); } @Test public void testNg() { SurefireLauncher launcher = unpack( "surefire-1364" ); OutputValidator validator = launcher.setForkJvm() .activateProfile( "testng" ) .forkMode( "once" ) .executeTest() .verifyErrorFree( 3 ); validator.getSurefireReportsXmlFile( "TEST-TestSuite.xml" ) .assertContainsText( "" ); } @Test public void testNgInProcess() { SurefireLauncher launcher = unpack( "surefire-1364" ); OutputValidator validator = launcher.setForkJvm() .activateProfile( "testng" ) .forkMode( "never" ) .executeTest() .verifyErrorFree( 3 ); validator.getSurefireReportsXmlFile( "TEST-TestSuite.xml" ) .assertContainsText( "" ); } } Surefire1367AssumptionLogsIT.java000066400000000000000000000137541330756104600404050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import static org.fest.assertions.Assertions.assertThat; /** * @author Tibor Digana (tibor17) * @see SUREFIRE-1367 * @since 2.20.1 */ public class Surefire1367AssumptionLogsIT extends SurefireJUnit4IntegrationTestCase { private static final String NL = System.getProperty( "line.separator" ); @Test public void shouldSeeLogsParallelForked() { OutputValidator outputValidator = unpack().setForkJvm() .forkMode( "once" ) .parallelClassesAndMethods() .disablePerCoreThreadCount() .threadCountClasses( 2 ) .threadCountMethods( 2 ) .executeTest() .assertTestSuiteResults( 2, 0, 0, 2 ); verifyReportA( outputValidator ); verifyReportB( outputValidator ); } @Test public void shouldSeeLogsParallelInPlugin() { OutputValidator outputValidator = unpack().setForkJvm() .forkMode( "never" ) .parallelClassesAndMethods() .disablePerCoreThreadCount() .threadCountClasses( 2 ) .threadCountMethods( 2 ) .executeTest() .assertTestSuiteResults( 2, 0, 0, 2 ); verifyReportA( outputValidator ); verifyReportB( outputValidator ); } @Test public void shouldSeeLogsForked() { OutputValidator outputValidator = unpack().setForkJvm() .forkMode( "once" ) .executeTest() .assertTestSuiteResults( 2, 0, 0, 2 ); verifyReportA( outputValidator ); verifyReportB( outputValidator ); } @Test public void shouldSeeLogsInPlugin() { OutputValidator outputValidator = unpack().setForkJvm() .forkMode( "never" ) .executeTest() .assertTestSuiteResults( 2, 0, 0, 2 ); verifyReportA( outputValidator ); verifyReportB( outputValidator ); } private SurefireLauncher unpack() { return unpack( "/surefire-1367" ); } private void verifyReportA( OutputValidator outputValidator ) { String xmlReport = outputValidator.getSurefireReportsXmlFile( "TEST-ATest.xml" ) .readFileToString(); String outputCData = "" + NL + " "; assertThat( xmlReport ) .contains( outputCData ); String output = outputValidator.getSurefireReportsFile( "ATest-output.txt" ) .readFileToString(); String outputExpected = "Hi" + NL + NL + "There!" + NL + "Hello" + NL + NL + "What's up!" + NL; assertThat( output ) .isEqualTo( outputExpected ); } private void verifyReportB( OutputValidator outputValidator ) { String xmlReport = outputValidator.getSurefireReportsXmlFile( "TEST-BTest.xml" ) .readFileToString(); String outputCData = ""; assertThat( xmlReport ) .contains( outputCData ); String output = outputValidator.getSurefireReportsFile( "BTest-output.txt" ) .readFileToString(); String outputExpected = "Hey" + NL + NL + "you!" + NL; assertThat( output ) .isEqualTo( outputExpected ); } } Surefire1383ScanSessionDependenciesIT.java000066400000000000000000000031571330756104600421470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * @author Owen Farrell (owenfarrell) * @see SUREFIRE-1383 * @since 2.22.0 */ public class Surefire1383ScanSessionDependenciesIT extends SurefireJUnit4IntegrationTestCase { @Test public void test() throws VerificationException { SurefireLauncher launcher = unpack( "surefire-1383" ); launcher.executeTest(); launcher.getSubProjectValidator( "sut" ) .assertTestSuiteResults( 1, 0, 0, 0 ); } } Surefire1396CustomProviderClassPathIT.java000066400000000000000000000033501330756104600421770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.BeforeClass; import org.junit.Test; /** * @author Jonathan Bell */ public class Surefire1396CustomProviderClassPathIT extends SurefireJUnit4IntegrationTestCase { @BeforeClass public static void installProvider() throws VerificationException { unpack( Surefire1396CustomProviderClassPathIT.class, "surefire-1396-pluggableproviders-classpath-provider", "prov" ).executeInstall(); } @Test public void pluggableProviderClasspathCorrect() throws Exception { unpack( "surefire-1396-pluggableproviders-classpath" ) .setForkJvm() .maven() .showExceptionMessages() .debugLogging() .executeVerify() .verifyErrorFreeLog(); } } Surefire141PluggableProvidersIT.java000066400000000000000000000143321330756104600411140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireVerifierException; import org.junit.BeforeClass; import org.junit.Test; import java.io.File; import java.io.FilenameFilter; import static org.fest.assertions.Assertions.assertThat; /** * SUREFIRE-613 Asserts proper test counts when running in parallel * * @author Kristian Rosenvold */ public class Surefire141PluggableProvidersIT extends SurefireJUnit4IntegrationTestCase { @BeforeClass public static void installProvider() throws VerificationException { unpack( Surefire141PluggableProvidersIT.class, "surefire-141-pluggableproviders-provider", "prov" ) .executeInstall(); } @Test public void pluggableProviderPresent() throws Exception { unpack( "surefire-141-pluggableproviders" ) .setForkJvm() .maven() .showExceptionMessages() .debugLogging() .executeTest() .verifyTextInLog( "Using configured provider org.apache.maven.surefire.testprovider.TestProvider" ) .verifyTextInLog( "Using configured provider org.apache.maven.surefire.junit.JUnit3Provider" ) .verifyErrorFreeLog(); } @Test public void invokeRuntimeException() throws Exception { final String errorText = "Let's fail with a runtimeException"; OutputValidator validator = unpack( "surefire-141-pluggableproviders" ) .setForkJvm() .sysProp( "invokeCrash", "runtimeException" ) .maven() .withFailure() .executeTest(); assertErrorMessage( validator, errorText ); boolean hasErrorInLog = verifiedErrorInLog( validator, "There was an error in the forked process" ); boolean verifiedInLog = verifiedErrorInLog( validator, errorText ); assertThat( hasErrorInLog && verifiedInLog ) .describedAs( "'" + errorText + "' could not be verified in log.txt nor *.dump file. (" + hasErrorInLog + ", " + verifiedInLog + ")" ) .isTrue(); } @Test public void invokeReporterException() throws Exception { final String errorText = "Let's fail with a reporterexception"; OutputValidator validator = unpack( "surefire-141-pluggableproviders" ) .setForkJvm() .sysProp( "invokeCrash", "reporterException" ) .maven() .withFailure() .executeTest(); assertErrorMessage( validator, errorText ); boolean hasErrorInLog = verifiedErrorInLog( validator, "There was an error in the forked process" ); boolean verifiedInLog = verifiedErrorInLog( validator, errorText ); assertThat( hasErrorInLog && verifiedInLog ) .describedAs( "'" + errorText + "' could not be verified in log.txt nor *.dump file. (" + hasErrorInLog + ", " + verifiedInLog + ")" ) .isTrue(); } @Test public void constructorRuntimeException() throws Exception { final String errorText = "Let's fail with a runtimeException"; OutputValidator validator = unpack( "surefire-141-pluggableproviders" ) .setForkJvm() .sysProp( "constructorCrash", "runtimeException" ) .maven() .withFailure() .executeTest(); assertErrorMessage( validator, errorText ); boolean hasErrorInLog = verifiedErrorInLog( validator, "There was an error in the forked process" ); boolean verifiedInLog = verifiedErrorInLog( validator, errorText ); assertThat( hasErrorInLog && verifiedInLog ) .describedAs( "'" + errorText + "' could not be verified in log.txt nor *.dump file. (" + hasErrorInLog + ", " + verifiedInLog + ")" ) .isTrue(); } private static void assertErrorMessage( OutputValidator validator, String message ) { File reportDir = validator.getSurefireReportsDirectory(); String[] dumpFiles = reportDir.list( new FilenameFilter() { @Override public boolean accept( File dir, String name ) { return name.endsWith( ".dump" ); } }); assertThat( dumpFiles ).isNotEmpty(); for ( String dump : dumpFiles ) { validator.getSurefireReportsFile( dump ) .assertContainsText( message ); } } private static boolean verifiedErrorInLog( OutputValidator validator, String errorText ) { try { validator.verifyTextInLog( errorText ); return true; } catch ( SurefireVerifierException e ) { return false; } } } Surefire146ForkPerTestNoSetupIT.java000066400000000000000000000024561330756104600410530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test Surefire-146 (forkMode=pertest fails to call setUp) * * @author Dan Fabulich */ public class Surefire146ForkPerTestNoSetupIT extends SurefireJUnit4IntegrationTestCase { @Test public void testForkPerTestNoSetup() { executeErrorFreeTest( "surefire-146-forkPerTestNoSetup", 1 ); } } Surefire1490ReportTitleDescriptionIT.java000066400000000000000000000072051330756104600420660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * @author Tibor Digana (tibor17) * @see SUREFIRE-1490 * @since 3.0.0-M1 */ public class Surefire1490ReportTitleDescriptionIT extends SurefireJUnit4IntegrationTestCase { @Test public void shouldHaveDefaultReportTitleAndDescription() { OutputValidator validator = unpack() .addGoal( "verify" ) .execute( "site" ) .verifyErrorFreeLog(); validator.getSiteFile( "project-reports.html" ) .assertContainsText( "Surefire Report" ) .assertContainsText( "Report on the test results of the project." ) .assertContainsText( "Failsafe Report" ) .assertContainsText( "Report on the integration test results of the project." ); validator.getSiteFile( "failsafe-report.html" ) .assertContainsText( "Failsafe Report" ) .assertContainsText( "Surefire1490IT" ); validator.getSiteFile( "surefire-report.html" ) .assertContainsText( "Surefire Report" ) .assertContainsText( "Surefire1490Test" ); } @Test public void shouldHaveCustomizedReportTitleAndDescription() { OutputValidator validator = unpack() .sysProp( "failsafe.report.title", "failsafe title" ) .sysProp( "failsafe.report.description", "failsafe desc" ) .sysProp( "surefire.report.title", "surefire title" ) .sysProp( "surefire.report.description", "surefire desc" ) .addGoal( "verify" ) .execute( "site" ) .verifyErrorFreeLog(); validator.getSiteFile( "project-reports.html" ) .assertContainsText( "surefire title" ) .assertContainsText( "surefire desc" ) .assertContainsText( "failsafe title" ) .assertContainsText( "failsafe desc" ); validator.getSiteFile( "failsafe-report.html" ) .assertContainsText( "failsafe title" ) .assertContainsText( "Surefire1490IT" ); validator.getSiteFile( "surefire-report.html" ) .assertContainsText( "surefire title" ) .assertContainsText( "Surefire1490Test" ); } public SurefireLauncher unpack() { SurefireLauncher unpack = unpack( "surefire-1490" ); unpack.sysProp( "user.language", "en" ) .maven() .execute( "clean" ); return unpack; } } Surefire162CharsetProviderIT.java000066400000000000000000000037441330756104600404300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import java.io.File; import org.apache.maven.surefire.its.fixture.*; import org.codehaus.plexus.util.FileUtils; import org.junit.Test; /** * Test charset provider (SUREFIRE-162) * * @author Dan Fabulich */ public class Surefire162CharsetProviderIT extends SurefireJUnit4IntegrationTestCase { @SuppressWarnings( { "ResultOfMethodCallIgnored" } ) @Test public void testCharsetProvider() throws Exception { SurefireLauncher unpack = unpack( "/surefire-162-charsetProvider" ); MavenLauncher maven = unpack.maven(); OutputValidator verifier = maven.getValidator(); File jarFile = maven.getArtifactPath( "jcharset", "jcharset", "1.2.1", "jar" ); File pomFile = maven.getArtifactPath( "jcharset", "jcharset", "1.2.1", "pom" ); jarFile.getParentFile().mkdirs(); FileUtils.copyFile( verifier.getSubFile( "repo/jcharset/jcharset/1.2.1/jcharset-1.2.1.jar" ), jarFile ); FileUtils.copyFile( verifier.getSubFile( "repo/jcharset/jcharset/1.2.1/jcharset-1.2.1.pom" ), pomFile ); unpack.executeTest().verifyErrorFree( 1 ); } } Surefire224WellFormedXmlFailuresIT.java000066400000000000000000000062511330756104600415330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.plugins.surefire.report.ReportTestCase; import org.apache.maven.plugins.surefire.report.ReportTestSuite; import org.apache.maven.surefire.its.fixture.HelperAssertions; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; import java.util.List; import static org.junit.Assert.assertEquals; /** * Test Surefire-224 (XML test reports are not well-formed when failure message contains quotes) * * @author Dan Fabulich */ public class Surefire224WellFormedXmlFailuresIT extends SurefireJUnit4IntegrationTestCase { @SuppressWarnings("ConstantConditions") @Test public void testWellFormedXmlFailures() { OutputValidator outputValidator = unpack( "/surefire-224-wellFormedXmlFailures" ).executeTest(); outputValidator.assertTestSuiteResults( 4, 0, 4, 0 ); ReportTestSuite suite = HelperAssertions.extractReports( outputValidator.getBaseDir() ).get( 0 ); List testCases = suite.getTestCases(); assertEquals( "Wrong number of test case objects", 4, testCases.size() ); ReportTestCase testQuote = null, testLower = null, testGreater = null, testU0000 = null; for ( ReportTestCase current : testCases ) { if ( "testQuote".equals( current.getName() ) ) { testQuote = current; } else if ( "testLower".equals( current.getName() ) ) { testLower = current; } else if ( "testGreater".equals( current.getName() ) ) { testGreater = current; } else if ( "testU0000".equals( current.getName() ) ) { testU0000 = current; } } assertEquals( "Wrong error message", "\"", testQuote.getFailureMessage() ); assertEquals( "Wrong error message", "<", testLower.getFailureMessage() ); assertEquals( "Wrong error message", ">", testGreater.getFailureMessage() ); // SUREFIRE-456 we have to doubly-escape non-visible control characters like \u0000 assertEquals( "Wrong error message", "�", testU0000.getFailureMessage() ); } } Surefire257NotRerunningTestsIT.java000066400000000000000000000027431330756104600410020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test Surefire-257 Verifies that surefire does not re-run tests in site build * * @author Kristian Rosenvold */ public class Surefire257NotRerunningTestsIT extends SurefireJUnit4IntegrationTestCase { @Test public void shouldNotRerun() throws Exception { unpack( "/surefire-257-rerunningTests" ).addSurefireReportGoal().addSurefireReportGoal().executeCurrentGoals().verifyTextInLog( "Skipping execution of surefire because it has already been run for this configuration" ); } } Surefire260TestWithIdenticalNamesIT.java000066400000000000000000000052131330756104600416700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import java.io.IOException; import java.net.URI; import org.apache.maven.surefire.its.fixture.*; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlAnchor; import com.gargoylesoftware.htmlunit.html.HtmlDivision; import com.gargoylesoftware.htmlunit.html.HtmlPage; import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; /** * Test Surefire-570 Multiple report directories * * @author Kristian Rosenvold */ public class Surefire260TestWithIdenticalNamesIT extends SurefireJUnit4IntegrationTestCase { @Test public void testWithIdenticalNames() throws IOException { SurefireLauncher surefireLauncher = unpack( "surefire-260-testWithIdenticalNames" ).failNever(); surefireLauncher.executeTest(); surefireLauncher.reset(); OutputValidator validator = surefireLauncher.addSurefireReportGoal().executeCurrentGoals(); TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); final URI uri = siteFile.toURI(); final WebClient webClient = new WebClient(); webClient.setJavaScriptEnabled( true ); final HtmlPage page = webClient.getPage( uri.toURL() ); final HtmlAnchor a = (HtmlAnchor) page.getByXPath( "//a[@href = \"javascript:toggleDisplay('surefire260.TestB.testDup');\"]" ) .get( 0 ); final HtmlDivision content = (HtmlDivision) page.getElementById( "surefire260.TestB.testDup-failure" ); assertNotNull( content ); assertTrue( content.getAttribute( "style" ).contains( "none" ) ); a.click(); assertFalse( content.getAttribute( "style" ).contains( "none" ) ); webClient.closeAllWindows(); } } Surefire34SecurityManagerIT.java000066400000000000000000000032621330756104600403370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * SUREFIRE-621 Asserts proper test counts when running junit 3 tests in parallel * * @author Kristian Rosenvold */ public class Surefire34SecurityManagerIT extends SurefireJUnit4IntegrationTestCase { @Test public void testSecurityManager() { SurefireLauncher surefireLauncher = unpack( "surefire-34-securityManager" ).failNever(); surefireLauncher.executeTest().assertTestSuiteResults( 2, 1, 0, 0 ); } @Test public void testSecurityManagerSuccessful() { SurefireLauncher surefireLauncher = unpack( "surefire-34-securityManager-success" ); surefireLauncher.executeTest().assertTestSuiteResults( 2, 0, 0, 0 ); } } Surefire376TestNgAfterSuiteFailureIT.java000066400000000000000000000030261330756104600420340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test Surefire-376 (TestNG @AfterSuite failures are ignored) * * @author Dan Fabulich */ public class Surefire376TestNgAfterSuiteFailureIT extends SurefireJUnit4IntegrationTestCase { @Test public void testAfterSuiteFailure() { unpack( "/testng-afterSuiteFailure" ) .maven() .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .withFailure() .executeTest() .assertTestSuiteResults( 2, 0, 1, 0 ); } } Surefire377TestNgAndJUnitTogetherIT.java000066400000000000000000000034141330756104600416310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-377 (When JUnit and TestNG tests are in same project, only one set gets run). * * @author Dan Fabulich */ public class Surefire377TestNgAndJUnitTogetherIT extends SurefireJUnit4IntegrationTestCase { @Test public void testTestNgAndJUnitTogether() { unpack( "/testng-junit-together" ) .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .executeTest() .verifyErrorFree( 2 ); } @Test public void testTestNgAndJUnit4Together() { unpack( "/testng-junit4-together" ) .sysProp( "testNgVersion", "5.7" ) .sysProp( "testNgClassifier", "jdk15" ) .executeTest() .verifyErrorFree( 3 ); } } Surefire408ManualProviderSelectionIT.java000066400000000000000000000027311330756104600421200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-613 Asserts proper test counts when running in parallel * * @author Kristian Rosenvold */ public class Surefire408ManualProviderSelectionIT extends SurefireJUnit4IntegrationTestCase { @Test public void testParallelBuildResultCount() { unpack( "/surefire-408-manual-provider-selection" ) .showErrorStackTraces() .debugLogging() .executeTest() .verifyTextInLog( "Using configured provider org.apache.maven.surefire.junit.JUnit3Provider" ); } }Surefire42NotExtendingTestCaseIT.java000066400000000000000000000024251330756104600412760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test JUnit test that contains inner classes * * @author Dan Fabulich */ public class Surefire42NotExtendingTestCaseIT extends SurefireJUnit4IntegrationTestCase { @Test public void testInnerClass() { executeErrorFreeTest( "junit-notExtendingTestCase", 1 ); } } Surefire44InnerClassTestIT.java000066400000000000000000000024061330756104600401360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test JUnit test that contains inner classes * * @author Dan Fabulich */ public class Surefire44InnerClassTestIT extends SurefireJUnit4IntegrationTestCase { @Test public void testInnerClass() { executeErrorFreeTest( "/junit-innerClass", 1 ); } } Surefire500PuzzlingErrorIT.java000066400000000000000000000032241330756104600401450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.TestFile; import org.junit.Test; /** * SUREFIRE-500 Asserts correct error handling for the "odd" surefire-500 (and 625) issues. * * @author Kristian Rosenvold */ public class Surefire500PuzzlingErrorIT extends SurefireJUnit4IntegrationTestCase { @Test public void testBuildFailingWhenErrors() { OutputValidator outputValidator = unpack( "/surefire-500-puzzling-error" ).failNever().executeTest(); TestFile surefireReportsFile = outputValidator.getSurefireReportsFile( "surefire500.ExplodingTest.txt" ); surefireReportsFile.assertContainsText( "java.lang.NoClassDefFoundError: whoops!" ); } }Surefire510TestClassPathForkModesIT.java000066400000000000000000000031501330756104600416440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * SUREFIRE-621 Asserts proper test counts when running junit 3 tests in parallel * * @author Kristian Rosenvold */ public class Surefire510TestClassPathForkModesIT extends SurefireJUnit4IntegrationTestCase { @Test public void testForkAlways() { unpack().forkAlways().executeTest(). verifyTextInLog( "tcp is set" ); } @Test public void testForkOnce() { unpack().forkOnce().executeTest(). verifyTextInLog( "tcp is set" ); } public SurefireLauncher unpack() { return unpack( "/surefire-510-testClassPath" ); } } Surefire569RunTestFromDependencyJarsIT.java000066400000000000000000000031701330756104600423770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * SUREFIRE-569 Add support for scanning Dependencies for TestClasses * * @author Aslak Knutsen */ public class Surefire569RunTestFromDependencyJarsIT extends SurefireJUnit4IntegrationTestCase { @Test public void shouldScanAndRunTestsInDependencyJars() throws Exception { SurefireLauncher launcher = unpack( "surefire-569-RunTestFromDependencyJars" ); launcher.addGoal("test").addGoal("install"); launcher.executeCurrentGoals(); OutputValidator module1 = launcher.getSubProjectValidator("module1"); module1.assertTestSuiteResults(1, 0, 0, 0); } } Surefire570MultipleReportDirectoriesIT.java000066400000000000000000000045411330756104600425070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.*; import org.junit.Test; /** * Test Surefire-570 Multiple report directories * * @author Kristian Rosenvold */ public class Surefire570MultipleReportDirectoriesIT extends SurefireJUnit4IntegrationTestCase { @Test public void testReportWithAggregate() throws Exception { SurefireLauncher surefireLauncher = unpack().failNever(); surefireLauncher.executeTest(); surefireLauncher.addGoal( "-Daggregate=true" ); OutputValidator validator = surefireLauncher.executeSurefireReport( ); TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); siteFile.assertContainsText( "MyModule1ClassTest" ); siteFile.assertContainsText( "MyModule2ClassTest" ); siteFile.assertContainsText( "MyDummyClassM1Test" ); } @Test public void testReportWithoutAggregate() throws Exception { SurefireLauncher surefireLauncher = unpack().failNever(); surefireLauncher.executeTest(); surefireLauncher.reset(); surefireLauncher.executeSurefireReport( ); OutputValidator module1 = surefireLauncher.getSubProjectValidator( "module1" ); TestFile siteFile = module1.getSiteFile( "surefire-report.html" ); siteFile.assertContainsText( "MyModule1ClassTest" ); siteFile.assertContainsText( "MyDummyClassM1Test" ); } public SurefireLauncher unpack() { return unpack( "/surefire-570-multipleReportDirectories" ); } } Surefire613TestCountInParallelIT.java000066400000000000000000000032751330756104600412200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-613 Asserts proper test counts when running in parallel * * @author Kristian Rosenvold */ public class Surefire613TestCountInParallelIT extends SurefireJUnit4IntegrationTestCase { @Test public void testParallelBuildResultCount() { OutputValidator validator = unpack( "/surefire-613-testCount-in-parallel" ).failNever().executeTest(); validator.verifyTextInLog( "testAllok to stdout" ); validator.verifyTextInLog( "testAllok to stderr" ); validator.verifyTextInLog( "testWithException1 to stdout" ); validator.verifyTextInLog( "testWithException1 to stderr" ); validator.assertTestSuiteResults( 30, 8, 4, 17 ); } } Surefire621TestCountingJunit3InParallelIT.java000066400000000000000000000063671330756104600430170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-621 Asserts proper test counts when running junit 3 tests in parallel
* SUREFIRE-1264 Some tests can be lost when running in parallel with parameterized tests
*
* Removed decision making with JUnit3 in {@code TestSet} class during Jira activity of SUREFIRE-1264 * which results in one hot spot where the test class is determined (see JUnitCoreRunListener#fillTestCountMap()). * * @author Kristian Rosenvold * @author Tibor Digana (tibor17) */ public class Surefire621TestCountingJunit3InParallelIT extends SurefireJUnit4IntegrationTestCase { /** * SUREFIRE-1264 */ @Test public void testJunit3AllParallelBuildResultCount() { unpack( "surefire-621-testCounting-junit3-in-parallel" ) .activateProfile( "all-parallel-junit3-testcases" ) .execute( "integration-test" ) .assertTestSuiteResults( 6, 0, 0, 0 ); } /** * SUREFIRE-621 */ @Test public void testJunit3ParallelBuildResultCount() { unpack( "surefire-621-testCounting-junit3-in-parallel" ) .failNever() .activateProfile( "parallel-junit3-testcases" ) .execute( "install" ) .assertTestSuiteResults( 6, 0, 0, 0 ); } /** * SUREFIRE-1264 */ @Test public void testJunit3BuildResultCount() { unpack( "surefire-621-testCounting-junit3-in-parallel" ) .activateProfile( "junit3-testcases" ) .execute( "integration-test" ) .assertTestSuiteResults( 6, 0, 0, 0 ); } /** * SUREFIRE-1264 */ @Test public void testJunit3ParallelSuiteBuildResultCount() { unpack( "surefire-621-testCounting-junit3-in-parallel" ) .activateProfile( "parallel-junit3-testsuite" ) .execute( "integration-test" ) .assertTestSuiteResults( 6, 0, 0, 0 ); } /** * SUREFIRE-1264 */ @Test public void testJunit3SuiteBuildResultCount() { unpack( "surefire-621-testCounting-junit3-in-parallel" ) .activateProfile( "junit3-testsuite" ) .execute( "integration-test" ) .assertTestSuiteResults( 6, 0, 0, 0 ); } }Surefire628ConsoleOutputBeforeAndAfterClassIT.java000066400000000000000000000034201330756104600436630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Asserts that console output always goes somewhere ;) * * @author Kristian Rosenvold assertContainsText */ public class Surefire628ConsoleOutputBeforeAndAfterClassIT extends SurefireJUnit4IntegrationTestCase { @Test public void testJunit3ParallelBuildResultCount() { OutputValidator validator = unpack( "surefire-628-consoleoutputbeforeandafterclass" ).failNever().parallelMethods().executeTest(); validator.verifyTextInLog( "628Test1" ); validator.verifyTextInLog( "Before628Test1" ); validator.verifyTextInLog( "After628Test1" ); validator.verifyTextInLog( "628Test2" ); validator.verifyTextInLog( "BeforeClass628Test2" ); validator.verifyTextInLog( "AfterClass628Test2" ); } } Surefire634UnsettableSystemPropertiesWarningIT.java000066400000000000000000000026061330756104600442420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-634 Verifies error message on unsettable system properties * * @author Kristian Rosenvold */ public class Surefire634UnsettableSystemPropertiesWarningIT extends SurefireJUnit4IntegrationTestCase { @Test public void testJunit3ParallelBuildResultCount() { unpack( "/surefire-634-systemPropertiesWarning" ).executeTest().verifyTextInLog( "java.library.path cannot be set as system property" ); } }Surefire649EmptyStringSystemPropertiesIT.java000066400000000000000000000051111330756104600430730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import static org.junit.Assert.fail; /** * @author Tibor Digana (tibor17) * @see SUREFIRE-649 * @since 2.18 */ public class Surefire649EmptyStringSystemPropertiesIT extends SurefireJUnit4IntegrationTestCase { @Test public void systemProperties() throws VerificationException { SurefireLauncher launcher = unpack1(); OutputValidator validator = launcher.executeTest().verifyErrorFree( 1 ); for ( String line : validator.loadLogLines() ) { if ( "emptyProperty=''".equals( line ) ) { return; } } fail("Could not find text in log: emptyProperty=''"); } @Test public void systemPropertyVariables() throws VerificationException { SurefireLauncher launcher = unpack2(); OutputValidator validator = launcher.executeTest().verifyErrorFree( 1 ); for ( String line : validator.loadLogLines() ) { if ( "emptyProperty=''".equals( line ) ) { return; } } fail("Could not find text in log: emptyProperty=''"); } private SurefireLauncher unpack1() { return unpack( "surefire-649-systemProperties" ); } private SurefireLauncher unpack2() { return unpack( "surefire-649-systemPropertyVariables" ); } } Surefire673MockitoIT.java000066400000000000000000000024611330756104600367330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-673 Asserts that a given mockito build works as it should (classloader problem in 2.7) * * @author Kristian Rosenvold */ public class Surefire673MockitoIT extends SurefireJUnit4IntegrationTestCase { @Test public void testBuildFailingWhenErrors() { unpack( "/surefire-673-mockito" ).executeTest().verifyErrorFreeLog(); } }Surefire674BuildFailingWhenErrorsIT.java000066400000000000000000000025401330756104600416750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-674 Asserts that the build fails when tests have errors * * @author Kristian Rosenvold */ public class Surefire674BuildFailingWhenErrorsIT extends SurefireJUnit4IntegrationTestCase { @Test public void testBuildFailingWhenErrors() { unpack( "/surefire-674-buildFailingWhenErrors" ).maven().withFailure().executeTest().verifyTextInLog( "BUILD FAILURE" ); } }Surefire674BuildFailingWhenFailsafeErrorsIT.java000066400000000000000000000025151330756104600433320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-674 Asserts that the build fails when tests have errors * * @author Kristian Rosenvold */ public class Surefire674BuildFailingWhenFailsafeErrorsIT extends SurefireJUnit4IntegrationTestCase { @Test public void testBuildFailingWhenErrors() { unpack( "/failsafe-buildfail" ).maven().withFailure().executeVerify().verifyTextInLog( "BUILD FAILURE" ); } }Surefire685CommaSeparatedIncludesIT.java000066400000000000000000000024671330756104600417130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-685 Asserts that only the specified tests are run with comma separated includes * * @author Kristian Rosenvold */ public class Surefire685CommaSeparatedIncludesIT extends SurefireJUnit4IntegrationTestCase { @Test public void testBuildFailingWhenErrors() { executeErrorFreeTest( "/surefire-685-commaseparatedIncludes", 2 ); } } Surefire697NiceSummaryIT.java000066400000000000000000000026601330756104600375710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-697 Asserts proper truncation of long exception messages Some say testing this is a bit over the top. * * @author Kristian Rosenvold */ public class Surefire697NiceSummaryIT extends SurefireJUnit4IntegrationTestCase { @Test public void testBuildFailingWhenErrors() { unpack( "/surefire-697-niceSummary" ).failNever().executeTest().verifyTextInLog( "junit.surefire697.BasicTest#testShortMultiline RuntimeException A very short m" ); } } Surefire705ParallelForkTimeoutIT.java000066400000000000000000000026441330756104600412520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test * * @author Kristian Rosenvold */ public class Surefire705ParallelForkTimeoutIT extends SurefireJUnit4IntegrationTestCase { @Test public void testTimeoutForked() { unpack( "/fork-timeout" ).setJUnitVersion( "4.8.1" ).addGoal( "-Djunit.version=4.8.1" ).addGoal( "-Djunit.parallel=classes" ).addGoal( "-DtimeOut=1" ).maven().withFailure().executeTest() .verifyTextInLog( "There was a timeout or other error in the fork" ); } } Surefire733AllOverrridesCapturedIT.java000066400000000000000000000023351330756104600415700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * @author Kristian Rosenvold */ public class Surefire733AllOverrridesCapturedIT extends SurefireJUnit4IntegrationTestCase { @Test public void testLogOutput() { unpack( "surefire-733-allOverridesCaptured" ).executeTest().verifyTextInLog( "abc" ); } } Surefire735ForkFailWithRedirectConsoleOutputIT.java000066400000000000000000000053711330756104600441070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; import java.io.File; import java.io.FilenameFilter; import static org.fest.assertions.Assertions.assertThat; /** * @author Kristian Rosenvold */ public class Surefire735ForkFailWithRedirectConsoleOutputIT extends SurefireJUnit4IntegrationTestCase { @Test public void vmStartFail() throws Exception { OutputValidator outputValidator = unpack().failNever().executeTest(); assertJvmCrashed( outputValidator ); } @Test public void vmStartFailShouldFailBuildk() throws Exception { OutputValidator outputValidator = unpack().maven().withFailure().executeTest(); assertJvmCrashed( outputValidator ); } private SurefireLauncher unpack() { return unpack( "fork-fail" ); } private static void assertJvmCrashed( OutputValidator outputValidator ) { File reportDir = outputValidator.getSurefireReportsDirectory(); String[] dumpFiles = reportDir.list( new FilenameFilter() { @Override public boolean accept( File dir, String name ) { return name.endsWith( ".dumpstream" ); } } ); assertThat( dumpFiles ).isNotEmpty(); for ( String dump : dumpFiles ) { outputValidator.getSurefireReportsFile( dump ) .assertContainsText( "Invalid maximum heap size: -Xmxxxx712743m" ); } } } Surefire740TruncatedCommaIT.java000066400000000000000000000035311330756104600402260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.TestFile; import org.junit.Test; import static org.junit.Assert.assertTrue; /** * Test Surefire-740 Truncated comma with non us locale * * @author Kristian Rosenvold */ public class Surefire740TruncatedCommaIT extends SurefireJUnit4IntegrationTestCase { @Test public void testRussianLocaleReport() { OutputValidator validator = unpack( "/surefire-740-comma-truncated" ).setMavenOpts( "-Duser.language=ru -Duser.country=RU" ).failNever().addSurefireReportGoal().executeCurrentGoals(); TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); assertTrue( "Expecting file", siteFile.exists() ); siteFile.assertContainsText( "027" ); // Avoid asserting with the "," or "." ;) } } Surefire747MethodParallelWithSuiteCountIT.java000066400000000000000000000156321330756104600431100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Before; import org.junit.Test; import java.text.Format; import java.text.NumberFormat; import java.util.Iterator; import java.util.Set; import java.util.TreeSet; import static java.lang.String.format; import static java.math.RoundingMode.DOWN; import static java.util.Locale.ROOT; import static org.hamcrest.CoreMatchers.anyOf; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.endsWith; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; /** * @author Kristian Rosenvold */ public class Surefire747MethodParallelWithSuiteCountIT extends SurefireJUnit4IntegrationTestCase { // if you want to change his constant, change it in SuiteTest1.java and SuiteTest2.java as well private static final int PERFORMANCE_TEST_MULTIPLICATION_FACTOR = 4; private Format lowerScaleFormatter, noFractionalDigitsFormatter; private static Set printTestLines( OutputValidator validator, String pattern ) throws VerificationException { Set log = new TreeSet( validator.loadLogLines() ); for ( Iterator it = log.iterator(); it.hasNext(); ) { String line = it.next(); if ( !line.contains( pattern ) ) { it.remove(); } } return log; } private static long duration( String logLine ) { return Integer.decode( logLine.split( "=" )[1] ); } @Before public void init() { NumberFormat lowScaleFormatter = NumberFormat.getInstance( ROOT ); lowScaleFormatter.setRoundingMode( DOWN ); lowScaleFormatter.setMinimumFractionDigits( 1 ); lowScaleFormatter.setMaximumFractionDigits( 1 ); this.lowerScaleFormatter = lowScaleFormatter; NumberFormat noFractionalDigitsFormatter = NumberFormat.getInstance( ROOT ); noFractionalDigitsFormatter.setRoundingMode( DOWN ); noFractionalDigitsFormatter.setMinimumFractionDigits( 0 ); noFractionalDigitsFormatter.setMaximumFractionDigits( 0 ); this.noFractionalDigitsFormatter = noFractionalDigitsFormatter; } @Test public void testMethodsParallelWithSuite() throws VerificationException { OutputValidator validator = unpack().executeTest().verifyErrorFree( 6 ); Set testLines = printTestLines( validator, "test finished after duration=" ); assertThat( testLines.size(), is( 2 ) ); for ( String testLine : testLines ) { long duration = duration( testLine ); long min = 250 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; long max = 750 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; assertTrue( format( "duration %d should be between %d and %d ms", duration, min, max ), duration > min && duration < max ); } Set suiteLines = printTestLines( validator, "suite finished after duration=" ); assertThat( suiteLines.size(), is( 1 ) ); long duration = duration( suiteLines.iterator().next() ); long min = 750 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; long max = 1250 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; assertTrue( format( "duration %d should be between %d and %d ms", duration, min, max ), duration > min && duration < max ); String delayMin = lowerScaleFormatter.format( 0.98 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR * 0.5 ); String delayMax = noFractionalDigitsFormatter.format( PERFORMANCE_TEST_MULTIPLICATION_FACTOR * 0.5 ) + "."; for ( String line : validator.loadLogLines() ) { if ( line.startsWith( "Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:" ) ) { assertThat( line, anyOf( // 1.9xx to 2.xxx can vary depending on CI jobs containsString( "Time elapsed: " + delayMin ), containsString( "Time elapsed: " + delayMax ) ) ); assertThat( line, anyOf( endsWith( " s - in surefire747.SuiteTest1" ), endsWith( " s - in surefire747.SuiteTest2" ) ) ); } } } @Test public void testClassesParallelWithSuite() throws VerificationException { OutputValidator validator = unpack().parallelClasses().executeTest().verifyErrorFree( 6 ); Set testLines = printTestLines( validator, "test finished after duration=" ); assertThat( testLines.size(), is( 2 ) ); for ( String testLine : testLines ) { long duration = duration( testLine ); long min = 1450 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; long max = 1750 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; assertTrue( format( "duration %d should be between %d and %d ms", duration, min, max ), duration > min && duration < max ); } Set suiteLines = printTestLines( validator, "suite finished after duration=" ); assertThat( suiteLines.size(), is( 1 ) ); long duration = duration( suiteLines.iterator().next() ); long min = 1450 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; long max = 1750 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR; assertTrue( format( "duration %d should be between %d and %d ms", duration, min, max ), duration > min && duration < max ); } public SurefireLauncher unpack() { return unpack( "junit47-parallel-with-suite" ); } } Surefire772BothReportsIT.java000066400000000000000000000061071330756104600376020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.*; import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** * Test Surefire-740 Truncated comma with non us locale * * @author Kristian Rosenvold */ public class Surefire772BothReportsIT extends SurefireJUnit4IntegrationTestCase { public SurefireLauncher unpack() { SurefireLauncher unpack = unpack( "/surefire-772-both-reports" ); unpack.maven().deleteSiteDir().skipClean().failNever(); return unpack; } @Test public void testReportGeneration() throws Exception { OutputValidator outputValidator = unpack().addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); TestFile siteFile = outputValidator.getSiteFile( "surefire-report.html" ); assertTrue( "Expecting surefire report file", siteFile.isFile() ); siteFile = outputValidator.getSiteFile( "failsafe-report.html" ); assertTrue( "Expecting failsafe report file", siteFile.isFile() ); } @Test public void testSkippedFailsafeReportGeneration() throws Exception { OutputValidator validator = unpack(). activateProfile( "skipFailsafe" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); assertTrue( "Expecting surefire report file", siteFile.isFile() ); siteFile = validator.getSiteFile( "failsafe-report.html" ); assertFalse( "Expecting no failsafe report file", siteFile.isFile() ); } @Test public void testSkippedSurefireReportGeneration() throws Exception { OutputValidator validator = unpack().failNever(). activateProfile( "skipSurefire" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); assertFalse( "Expecting no surefire report file", siteFile.isFile() ); siteFile = validator.getSiteFile( "failsafe-report.html" ); assertTrue( "Expecting failsafe report file", siteFile.isFile() ); } } Surefire772NoFailsafeReportsIT.java000066400000000000000000000072311330756104600407140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import java.io.IOException; import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.*; import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** * Test Surefire-740 Truncated comma with non us locale * * @author Kristian Rosenvold */ public class Surefire772NoFailsafeReportsIT extends SurefireJUnit4IntegrationTestCase { @Test public void testReportGeneration() throws Exception { final OutputValidator site = unpack().addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); assertSurefireReportPresent( site ); assertNoFailsefeReport( site ); } @Test public void testSkippedFailsafeReportGeneration() throws Exception { final OutputValidator validator = unpack().activateProfile( "skipFailsafe" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); assertSurefireReportPresent( validator ); assertNoFailsefeReport( validator ); } @Test public void testForcedFailsafeReportGeneration() throws Exception { final OutputValidator validator = unpack().activateProfile( "forceFailsafe" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); assertSurefireReportPresent( validator ); assertFailsafeReport( validator ); } @Test public void testSkipForcedFailsafeReportGeneration() throws Exception { final OutputValidator validator = unpack().activateProfile( "forceFailsafe" ).activateProfile( "skipFailsafe" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); assertSurefireReportPresent( validator ); assertNoFailsefeReport( validator ); } private void assertNoFailsefeReport( OutputValidator site ) { TestFile siteFile = site.getSiteFile( "failsafe-report.html" ); assertFalse( "Expecting no failsafe report file", siteFile.isFile() ); } private void assertFailsafeReport( OutputValidator site ) { TestFile siteFile = site.getSiteFile( "failsafe-report.html" ); assertTrue( "Expecting no failsafe report file", siteFile.isFile() ); } private void assertSurefireReportPresent( OutputValidator site ) { TestFile siteFile = site.getSiteFile( "surefire-report.html" ); assertTrue( "Expecting surefire report file", siteFile.isFile() ); } private SurefireLauncher unpack() throws VerificationException, IOException { final SurefireLauncher unpack = unpack( "surefire-772-no-failsafe-reports" ); unpack.maven().deleteSiteDir().skipClean().failNever().assertNotPresent( "site" ); return unpack; } } Surefire772NoSurefireReportsIT.java000066400000000000000000000073631330756104600407740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.apache.maven.surefire.its.fixture.TestFile; import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** * Test Surefire-740 Truncated comma with non us locale * * @author Kristian Rosenvold */ public class Surefire772NoSurefireReportsIT extends SurefireJUnit4IntegrationTestCase { @Test public void testReportGeneration() { OutputValidator validator = unpack().addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); assertTrue( "Expecting surefire report file", siteFile.isFile() ); siteFile = validator.getSiteFile( "failsafe-report.html" ); assertTrue( "Expecting failsafe report file", siteFile.isFile() ); } @Test public void testSkippedSurefireReportGeneration() { OutputValidator validator = unpack().activateProfile( "skipSurefire" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); assertFalse( "Expecting no surefire report file", siteFile.isFile() ); siteFile = validator.getSiteFile( "failsafe-report.html" ); assertTrue( "Expecting failsafe report file", siteFile.isFile() ); } @Test public void testOptionalSurefireReportGeneration() { OutputValidator validator = unpack().activateProfile( "optionalSurefire" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); assertFalse( "Expecting no surefire report file", siteFile.isFile() ); siteFile = validator.getSiteFile( "failsafe-report.html" ); assertTrue( "Expecting failsafe report file", siteFile.isFile() ); } @Test public void testSkipOptionalSurefireReportGeneration() { OutputValidator validator = unpack().activateProfile( "optionalSurefire" ).activateProfile( "skipSurefire" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); assertFalse( "Expecting no surefire report file", siteFile.isFile() ); siteFile = validator.getSiteFile( "failsafe-report.html" ); assertTrue( "Expecting failsafe report file", siteFile.isFile() ); } public SurefireLauncher unpack() { SurefireLauncher unpack = unpack( "/surefire-772-no-surefire-reports" ); unpack.maven().failNever().deleteSiteDir().skipClean( ); return unpack; } } Surefire772SpecifiedReportsIT.java000066400000000000000000000057061330756104600406050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.*; import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** * Test Surefire-740 Truncated comma with non us locale * * @author Kristian Rosenvold */ public class Surefire772SpecifiedReportsIT extends SurefireJUnit4IntegrationTestCase { @Test public void testReportGeneration() { OutputValidator validator = unpack().addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); assertTrue( "Expecting surefire report file", siteFile.isFile() ); siteFile = validator.getSiteFile( "failsafe-report.html" ); assertTrue( "Expecting failsafe report file", siteFile.isFile() ); } @Test public void testSkippedFailsafeReportGeneration() { OutputValidator validator = unpack().activateProfile( "skipFailsafe" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); assertTrue( "Expecting surefire report file", siteFile.isFile() ); siteFile = validator.getSiteFile( "failsafe-report.html" ); assertFalse( "Expecting no failsafe report file", siteFile.isFile() ); } @Test public void testSkippedSurefireReportGeneration() { OutputValidator validator = unpack().activateProfile( "skipSurefire" ).addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals(); TestFile siteFile = validator.getSiteFile( "surefire-report.html" ); assertFalse( "Expecting no surefire report file", siteFile.isFile() ); siteFile = validator.getSiteFile( "failsafe-report.html" ); assertTrue( "Expecting failsafe report file", siteFile.isFile() ); } public SurefireLauncher unpack() { SurefireLauncher unpack = unpack( "/surefire-772-specified-reports" ); unpack.maven().deleteSiteDir().skipClean().failNever(); return unpack; } } Surefire801ForkModeNoneClassLoaderIT.java000066400000000000000000000023441330756104600417620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Test * * @author Kristian Rosenvold */ public class Surefire801ForkModeNoneClassLoaderIT extends SurefireJUnit4IntegrationTestCase { @Test public void testSHouldBeOkWithForkNever() { unpack( "fork-mode-resource-loading" ).forkNever().executeTest(); } } Surefire803MultiFailsafeExecsIT.java000066400000000000000000000034601330756104600410360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; public class Surefire803MultiFailsafeExecsIT extends SurefireJUnit4IntegrationTestCase { @Test public void testSecondExecutionRunsAfterFirstExecutionFails() { unpack( "/surefire-803-multiFailsafeExec-failureInFirst" ).maven().withFailure().executeVerify().assertIntegrationTestSuiteResults( 4, 0, 2, 0 ); } @Test public void testOneExecutionRunInTwoBuilds() { SurefireLauncher launcher = unpack( "/surefire-803-multiFailsafeExec-rebuildOverwrites" ); launcher.sysProp( "success", "false" ).maven().withFailure().executeVerify().assertIntegrationTestSuiteResults( 1, 0, 1, 0 ); launcher.reset(); launcher.sysProp( "success", "true" ).executeVerify().assertIntegrationTestSuiteResults( 1, 0, 0, 0 ); } } Surefire806SpecifiedTestControlsIT.java000066400000000000000000000037761330756104600416150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Ignore; import org.junit.Test; public class Surefire806SpecifiedTestControlsIT extends SurefireJUnit4IntegrationTestCase { @Test @Ignore( "since SUREFIRE-1153 the includes/excludes are overridden by -Dtest or it.test for whatever execution" ) public void singleTestInOneExecutionOfMultiExecutionProject() { unpack( "/surefire-806-specifiedTests-multi" ).setTestToRun( "FirstTest" ).failIfNoSpecifiedTests( false ).executeTest().verifyErrorFree( 1 ); } @Test @Ignore( "since SUREFIRE-1153 the includes/excludes are overridden by -Dtest or it.test for whatever execution" ) public void twoSpecifiedTestExecutionsInCorrectExecutionBlocks() { unpack( "/surefire-806-specifiedTests-multi" ).setTestToRun( "FirstTest,SecondTest" ).executeTest().verifyErrorFree( 2 ); } @Test public void singleTestInSingleExecutionProject() { unpack( "/surefire-806-specifiedTests-single" ).setTestToRun( "ThirdTest" ).failIfNoSpecifiedTests( false ).executeTest().verifyErrorFree( 1 ); } } Surefire809GroupExpressionsIT.java000077500000000000000000000103611330756104600406670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; public class Surefire809GroupExpressionsIT extends SurefireJUnit4IntegrationTestCase { @Test public void categoryAB() { OutputValidator validator = unpackJUnit().groups( "junit4.CategoryA AND junit4.CategoryB" ).executeTest(); validator.verifyErrorFreeLog(); validator.assertTestSuiteResults( 2, 0, 0, 0 ); validator.verifyTextInLog( "catA: 1" ); validator.verifyTextInLog( "catB: 1" ); validator.verifyTextInLog( "catC: 0" ); validator.verifyTextInLog( "catNone: 0" ); validator.verifyTextInLog( "mA: 1" ); validator.verifyTextInLog( "mB: 1" ); validator.verifyTextInLog( "mC: 0" ); } @Test public void incorrectJUnitVersions() { unpackJUnit().setJUnitVersion( "4.5" ).groups( "junit4.CategoryA AND junit4.CategoryB" ).maven().withFailure().executeTest(); } @Test public void testJUnitRunCategoryNotC() { OutputValidator validator = unpackJUnit().groups( "!junit4.CategoryC" ).executeTest(); validator.verifyErrorFreeLog(); validator.assertTestSuiteResults( 5, 0, 0, 0 ); validator.verifyTextInLog( "catA: 2" ); validator.verifyTextInLog( "catB: 2" ); validator.verifyTextInLog( "catC: 0" ); validator.verifyTextInLog( "catNone: 1" ); validator.verifyTextInLog( "NoCategoryTest.CatNone: 1" ); } @Test public void testExcludedGroups() { OutputValidator validator = unpackJUnit().setExcludedGroups( "junit4.CategoryC" ).executeTest(); validator.verifyErrorFreeLog(); validator.assertTestSuiteResults( 5, 0, 0, 0 ); validator.verifyTextInLog( "catA: 2" ); validator.verifyTextInLog( "catB: 2" ); validator.verifyTextInLog( "catC: 0" ); validator.verifyTextInLog( "catNone: 1" ); validator.verifyTextInLog( "NoCategoryTest.CatNone: 1" ); } @Test public void testNGRunCategoryAB() { OutputValidator validator = unpackTestNG().groups( "CategoryA AND CategoryB" ).debugLogging().executeTest(); validator.verifyErrorFreeLog(); validator.assertTestSuiteResults( 2, 0, 0, 0 ); validator.verifyTextInLog( "BasicTest.testInCategoriesAB()" ); validator.verifyTextInLog( "CategoryCTest.testInCategoriesAB()" ); } @Test public void testNGRunCategoryNotC() { OutputValidator validator = unpackTestNG().groups( "!CategoryC" ).debugLogging().executeTest(); validator.verifyErrorFreeLog(); validator.assertTestSuiteResults( 8, 0, 0, 0 ); validator.verifyTextInLog( "catA: 2" ); validator.verifyTextInLog( "catB: 2" ); validator.verifyTextInLog( "catC: 0" ); validator.verifyTextInLog( "catNone: 1" ); validator.verifyTextInLog( "mA: 2" ); validator.verifyTextInLog( "mB: 2" ); validator.verifyTextInLog( "mC: 0" ); validator.verifyTextInLog( "NoCategoryTest.CatNone: 1" ); } private SurefireLauncher unpackJUnit() { return unpack( "surefire-809-groupExpr-junit48" ); } private SurefireLauncher unpackTestNG() { return unpack( "surefire-809-groupExpr-testng" ); } } Surefire812Log4JClassLoaderIT.java000066400000000000000000000023241330756104600403530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * @author Kristian Rosenvold */ public class Surefire812Log4JClassLoaderIT extends SurefireJUnit4IntegrationTestCase { @Test public void testJunit3ParallelBuildResultCount() { executeErrorFreeTest( "surefire-812-log4j-classloader", 1 ); } } Surefire817SystemExitIT.java000066400000000000000000000031621330756104600374430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.it.VerificationException; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * @author Tibor Digana (tibor17) * @see SUREFIRE-817 * @since 2.18 */ public class Surefire817SystemExitIT extends SurefireJUnit4IntegrationTestCase { @Test public void systemExit1() throws VerificationException { unpack().maven().withFailure().executeTest().verifyTextInLog( "class jiras.surefire817.Test main" ); } private SurefireLauncher unpack() { return unpack( "surefire-817-system-exit" ); } }Surefire818NpeIgnoresTestsIT.java000066400000000000000000000026131330756104600404220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * SUREFIRE-818 * * @author Kristian Rosenvold */ public class Surefire818NpeIgnoresTestsIT extends SurefireJUnit4IntegrationTestCase { @Test public void testBuildFailingWhenErrors() { unpack( "surefire-818-ignored-tests-on-npe" ).maven().withFailure().executeTest().assertTestSuiteResults( 2, 0, 1, 0 ); } } Surefire828EmptyGroupExprIT.java000066400000000000000000000072251330756104600403050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; public class Surefire828EmptyGroupExprIT extends SurefireJUnit4IntegrationTestCase { // !CategoryC @Test public void testJUnitRunEmptyGroups() { OutputValidator validator = unpackJUnit().sysProp( "profile", "emptyGroups" ).executeTest(); validator.verifyErrorFreeLog(); validator.assertTestSuiteResults( 5, 0, 0, 0 ); validator.verifyTextInLog( "catA: 2" ); validator.verifyTextInLog( "catB: 2" ); validator.verifyTextInLog( "catC: 0" ); validator.verifyTextInLog( "catNone: 1" ); validator.verifyTextInLog( "NoCategoryTest.CatNone: 1" ); } // CategoryA && CategoryB @Test public void testJUnitRunEmptyExcludeGroups() { OutputValidator validator = unpackJUnit().sysProp( "profile", "emptyExcludedGroups" ).executeTest(); validator.verifyErrorFreeLog(); validator.assertTestSuiteResults( 2, 0, 0, 0 ); validator.verifyTextInLog( "catA: 1" ); validator.verifyTextInLog( "catB: 1" ); validator.verifyTextInLog( "catC: 0" ); validator.verifyTextInLog( "catNone: 0" ); validator.verifyTextInLog( "mA: 1" ); validator.verifyTextInLog( "mB: 1" ); validator.verifyTextInLog( "mC: 0" ); } // CategoryA && CategoryB @Test public void testTestNGRunEmptyExcludeGroups() { OutputValidator validator = unpackTestNG().sysProp( "profile", "emptyExcludedGroups" ).executeTest(); validator.verifyErrorFreeLog(); validator.assertTestSuiteResults( 2, 0, 0, 0 ); validator.verifyTextInLog( "BasicTest.testInCategoriesAB()" ); validator.verifyTextInLog( "CategoryCTest.testInCategoriesAB()" ); } // !CategoryC @Test public void testTestNGRunEmptyGroups() { OutputValidator validator = unpackTestNG().sysProp( "profile", "emptyGroups" ).executeTest(); validator.verifyErrorFreeLog(); validator.assertTestSuiteResults( 8, 0, 0, 0 ); validator.verifyTextInLog( "catA: 2" ); validator.verifyTextInLog( "catB: 2" ); validator.verifyTextInLog( "catC: 0" ); validator.verifyTextInLog( "catNone: 1" ); validator.verifyTextInLog( "mA: 2" ); validator.verifyTextInLog( "mB: 2" ); validator.verifyTextInLog( "mC: 0" ); validator.verifyTextInLog( "NoCategoryTest.CatNone: 1" ); } private SurefireLauncher unpackJUnit() { return unpack( "surefire-828-emptyGroupExpr-junit48" ); } private SurefireLauncher unpackTestNG() { return unpack( "surefire-828-emptyGroupExpr-testng" ); } } Surefire832ProviderSelectionIT.java000077500000000000000000000035571330756104600407750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; public class Surefire832ProviderSelectionIT extends SurefireJUnit4IntegrationTestCase { @Test public void testJUnitRunCategoryAB() { OutputValidator validator = unpackJUnit().groups( "junit4.CategoryA AND junit4.CategoryB" ).executeTest(); validator.verifyErrorFreeLog(); validator.assertTestSuiteResults( 2, 0, 0, 0 ); validator.verifyTextInLog( "catA: 1" ); validator.verifyTextInLog( "catB: 1" ); validator.verifyTextInLog( "catC: 0" ); validator.verifyTextInLog( "catNone: 0" ); validator.verifyTextInLog( "mA: 1" ); validator.verifyTextInLog( "mB: 1" ); validator.verifyTextInLog( "mC: 0" ); } private SurefireLauncher unpackJUnit() { return unpack( "surefire-832-provider-selection" ); } } Surefire839TestWithoutCategoriesIT.java000077500000000000000000000030101330756104600416350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; public class Surefire839TestWithoutCategoriesIT extends SurefireJUnit4IntegrationTestCase { @Test public void classWithoutCategory() { unpack( "junit48-categories" ).setJUnitVersion( "4.11" ).executeTest().verifyErrorFree( 3 ); } @Test public void classWithoutCategoryForked() { unpack( "junit48-categories" ) .setJUnitVersion( "4.11" ) .forkPerThread() .reuseForks( true ) .threadCount( 2 ) .executeTest() .verifyErrorFree( 3 ); } } Surefire847AdditionalFailureIT.java000077500000000000000000000023471330756104600407170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; public class Surefire847AdditionalFailureIT extends SurefireJUnit4IntegrationTestCase { @Test public void testJUnitRunCategoryAB() { unpack( "surefire-847-testngfail" ).setTestToRun( "org/codehaus/SomePassedTest" ).executeTest().verifyErrorFreeLog(); } } Surefire855AllowFailsafeUseArtifactFileIT.java000066400000000000000000000037571330756104600430050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * @author Tibor Digana (tibor17) * @see SUREFIRE-855 * @since 2.19 */ public class Surefire855AllowFailsafeUseArtifactFileIT extends SurefireJUnit4IntegrationTestCase { @Test public void warShouldUseClasses() { unpack( "surefire-855-failsafe-use-war" ).maven().executeVerify().verifyErrorFree( 2 ); } @Test public void jarShouldUseFile() { unpack( "surefire-855-failsafe-use-jar" ) .maven().sysProp( "forkMode", "once" ).executeVerify().assertIntegrationTestSuiteResults( 3, 0, 0, 1 ); } @Test public void jarNotForkingShouldUseFile() { unpack( "surefire-855-failsafe-use-jar" ) .maven().sysProp( "forkMode", "never" ).executeVerify().assertIntegrationTestSuiteResults( 3, 0, 0, 1 ); } @Test public void osgiBundleShouldUseFile() { unpack( "surefire-855-failsafe-use-bundle" ).maven().executeVerify().verifyErrorFree( 2 ); } }Surefire901MIssingResultfileWhenNoTestsIT.java000066400000000000000000000023431330756104600430710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * Failsafe should work with early return when no tests * s */ public class Surefire901MIssingResultfileWhenNoTestsIT extends SurefireJUnit4IntegrationTestCase { @Test public void failsafeWithNoTests() { unpack( "failsafe-notests" ).executeVerify(); } } Surefire907PerThreadWithoutThreadCountIT.java000077500000000000000000000027101330756104600427310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; public class Surefire907PerThreadWithoutThreadCountIT extends SurefireJUnit4IntegrationTestCase { @Test public void categoryAB() { OutputValidator validator = unpack( "fork-mode" ) .forkPerThread() .reuseForks( false ) .maven() .withFailure() .executeTest(); validator.verifyTextInLog( "Fork mode perthread requires a thread count" ); } } Surefire920TestFailureIgnoreWithTimeoutIT.java000077500000000000000000000033251330756104600431220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; public class Surefire920TestFailureIgnoreWithTimeoutIT extends SurefireJUnit4IntegrationTestCase { @Test public void timeoutInForkWithBuildFail() { OutputValidator validator = unpack( "fork-timeout" ).sysProp( "junit.parallel", "none" ).maven().withFailure().executeTest(); validator.verifyTextInLog( "There was a timeout or other error in the fork" ); } @Test public void timeoutInForkWithNoBuildFail() { OutputValidator validator = unpack( "fork-timeout" ).sysProp( "junit.parallel", "none" ).mavenTestFailureIgnore( true ).executeTest(); validator.verifyTextInLog( "[ERROR] There was a timeout or other error in the fork" ); } } Surefire926FailureWith2ProvidersIT.java000066400000000000000000000023441330756104600415320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /** * @author Kristian Rosenvold */ public class Surefire926FailureWith2ProvidersIT extends SurefireJUnit4IntegrationTestCase { @Test public void testBuildFailingWhenErrors() { unpack( "surefire-926-2-provider-failure" ).maven().withFailure().executeTest(); } }Surefire930TestNgSuiteXmlIT.java000066400000000000000000000023641330756104600402230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; public class Surefire930TestNgSuiteXmlIT extends SurefireJUnit4IntegrationTestCase { @Test public void suiteXmlRun() { unpack( "surefire-930-failsafe-runtests" ).maven().withFailure().executeVerify().assertIntegrationTestSuiteResults( 1, 0, 1, 0 ); } } Surefire943ReportContentIT.java000066400000000000000000000144401330756104600401340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import java.io.FileNotFoundException; import org.apache.maven.shared.utils.xml.Xpp3Dom; import org.apache.maven.shared.utils.xml.Xpp3DomBuilder; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Assert; import org.junit.Test; public class Surefire943ReportContentIT extends SurefireJUnit4IntegrationTestCase { @Test public void test_noParallel() throws Exception { doTest( "none" ); } @Test public void test_parallelBoth() throws Exception { doTest( "both" ); } private void doTest( String parallelMode ) throws Exception { OutputValidator validator = unpack( "surefire-943-report-content" ).maven() .sysProp( "parallel", parallelMode ) .sysProp( "threadCount", 4 ) .withFailure().executeTest(); validator.assertTestSuiteResults( 10, 1, 3, 3 ); validate( validator, "org.sample.module.My1Test", 1 ); validate( validator, "org.sample.module.My2Test", 1 ); validate( validator, "org.sample.module.My3Test", 0 ); validateSkipped( validator, "org.sample.module.My4Test" ); validateFailInBeforeClass( validator, "org.sample.module.My5Test" ); } private void validateFailInBeforeClass( OutputValidator validator, String className ) throws FileNotFoundException { Xpp3Dom[] children = readTests( validator, className ); Assert.assertEquals( 1, children.length ); Xpp3Dom child = children[0]; Assert.assertEquals( className, child.getAttribute( "classname" ) ); Assert.assertEquals( className, child.getAttribute( "name" ) ); Assert.assertEquals( "Expected error tag for failed BeforeClass method for " + className, 1, child.getChildren( "error" ).length ); Assert.assertTrue( "time for test failure in BeforeClass is expected to be positive", Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 0.0d ) >= 0 ); Assert.assertTrue( "time for test failure in BeforeClass is expected to be resonably low", Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 2.0d ) <= 0 ); } private void validateSkipped( OutputValidator validator, String className ) throws FileNotFoundException { Xpp3Dom[] children = readTests( validator, className ); Assert.assertEquals( 1, children.length ); Xpp3Dom child = children[0]; Assert.assertEquals( className, child.getAttribute( "classname" ) ); Assert.assertEquals( className, child.getAttribute( "name" ) ); Assert.assertEquals( "Expected skipped tag for ignored method for " + className, 1, child.getChildren( "skipped" ).length ); Assert.assertTrue( "time for ignored test is expected to be zero", Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 0.0d ) == 0 ); } private void validate( OutputValidator validator, String className, int ignored ) throws FileNotFoundException { Xpp3Dom[] children = readTests( validator, className ); Assert.assertEquals( 2 + ignored, children.length ); for ( Xpp3Dom child : children ) { Assert.assertEquals( className, child.getAttribute( "classname" ) ); if ( "alwaysSuccessful".equals( child.getAttribute( "name" ) ) ) { Assert.assertEquals( "Expected no failures for method alwaysSuccessful for " + className, 0, child.getChildCount() ); Assert.assertTrue( "time for successful test is expected to be positive", Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 0.0d ) > 0 ); } else if ( child.getAttribute( "name" ).contains( "Ignored" ) ) { Assert.assertEquals( "Expected skipped-tag for ignored method for " + className, 1, child.getChildren( "skipped" ).length ); Assert.assertTrue( "time for ignored test is expected to be zero", Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 0.0d ) == 0 ); } else { Assert.assertEquals( "Expected methods \"alwaysSuccessful\", \"*Ignored\" and \"fails\" in " + className, "fails", child.getAttribute( "name" ) ); Assert.assertEquals( "Expected failure description for method \"fails\" in " + className, 1, child.getChildren( "failure" ).length ); Assert.assertTrue( "time for failed test is expected to be positive", Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 0.0d ) > 0 ); } } } private Xpp3Dom[] readTests( OutputValidator validator, String className ) throws FileNotFoundException { Xpp3Dom testResult = Xpp3DomBuilder.build( validator.getSurefireReportsXmlFile( "TEST-" + className + ".xml" ).getFileInputStream(), "UTF-8" ); Xpp3Dom[] children = testResult.getChildren( "testcase" ); return children; } } Surefire946KillMainProcessInReusableForkIT.java000066400000000000000000000044701330756104600431660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.BeforeClass; import org.junit.Test; public class Surefire946KillMainProcessInReusableForkIT extends SurefireJUnit4IntegrationTestCase { // there are 10 test classes that each would wait 2 seconds. private static final int TEST_SLEEP_TIME = 2000; @BeforeClass public static void installSelfdestructPlugin() throws Exception { unpack( Surefire946KillMainProcessInReusableForkIT.class, "surefire-946-self-destruct-plugin", "plugin" ).executeInstall(); } @Test( timeout = 30000 ) public void testHalt() throws Exception { doTest( "halt" ); } @Test( timeout = 30000 ) public void testExit() throws Exception { doTest( "exit" ); } @Test( timeout = 30000 ) public void testInterrupt() throws Exception { doTest( "interrupt" ); } private void doTest( String method ) { unpack( "surefire-946-killMainProcessInReusableFork" ) .sysProp( "selfdestruct.timeoutInMillis", "5000" ) .sysProp( "selfdestruct.method", method ) .sysProp( "testSleepTime", String.valueOf( TEST_SLEEP_TIME ) ) .addGoal( "org.apache.maven.plugins.surefire:maven-selfdestruct-plugin:selfdestruct" ) .setForkJvm() .forkPerThread().threadCount( 1 ).reuseForks( true ).maven().withFailure().executeTest(); } } Surefire972BizarreNoClassDefIT.java000066400000000000000000000023041330756104600406240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; /* * 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. */ public class Surefire972BizarreNoClassDefIT extends SurefireJUnit4IntegrationTestCase { @Test public void testJunit3ParallelBuildResultCount() { unpack( "surefire-972-bizarre-noclassdef" ).maven().withFailure().executeVerify(); } } Surefire975DefaultVMEncodingIT.java000066400000000000000000000033541330756104600406330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; import static org.apache.maven.surefire.its.fixture.HelperAssertions.convertUnicodeToUTF8; public class Surefire975DefaultVMEncodingIT extends SurefireJUnit4IntegrationTestCase { @Test public void runWithRussian1251() throws Exception { OutputValidator outputValidator = unpack( "surefire-975-wrong-encoding" ).setMavenOpts( "-Dfile.encoding=windows-1251" ).executeTest(); outputValidator.getSurefireReportsXmlFile( "TEST-EncodingInReportTest.xml" ).assertContainsText( // see project.build.sourceEncoding=UTF-8 in src/test/resources/surefire-975-wrong-encoding/pom.xml convertUnicodeToUTF8( "\u043A\u0438\u0440\u0438\u043B\u043B\u0438\u0446\u0435" ) ); } } Surefire979WrongClassLoaderIT.java000066400000000000000000000027251330756104600405530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.junit.Test; public class Surefire979WrongClassLoaderIT extends SurefireJUnit4IntegrationTestCase { @Test public void wrongClassloaderUSedInSmartStacktraceparser() throws Exception { OutputValidator outputValidator = unpack( "surefire-979-smartStackTrace-wrongClassloader" ).failNever().executeTest(); outputValidator.verifyTextInLog( "java.lang.NoClassDefFoundError: org/apache/commons/io/input/AutoCloseInputStream" ); } } Surefire985ParameterizedRunnerAndCategoriesIT.java000066400000000000000000000050031330756104600437460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import java.io.FileNotFoundException; import org.apache.maven.shared.utils.xml.Xpp3Dom; import org.apache.maven.shared.utils.xml.Xpp3DomBuilder; import org.apache.maven.surefire.its.fixture.OutputValidator; import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.TestFile; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class Surefire985ParameterizedRunnerAndCategoriesIT extends SurefireJUnit4IntegrationTestCase { @Test public void test() throws Exception { OutputValidator validator = unpack( "surefire-985-parameterized-and-categories" ).maven().executeTest(); validator.assertTestSuiteResults( 12, 0, 0, 0 ); assertFalse( validator.getSurefireReportsXmlFile( "TEST-sample.parameterized.Parameterized01Test.xml" ).exists() ); TestFile reportFile2 = validator.getSurefireReportsXmlFile( "TEST-sample.parameterized.Parameterized02Test.xml" ); assertTestCount( reportFile2, 4 ); TestFile reportFile3 = validator.getSurefireReportsXmlFile( "TEST-sample.parameterized.Parameterized03Test.xml" ); assertTestCount( reportFile3, 8 ); } private void assertTestCount( TestFile reportFile, int tests ) throws FileNotFoundException { assertTrue( reportFile.exists() ); Xpp3Dom testResult = Xpp3DomBuilder.build( reportFile.getFileInputStream(), "UTF-8" ); Xpp3Dom[] children = testResult.getChildren( "testcase" ); assertEquals( tests, children.length ); } } Surefire995CategoryInheritanceIT.java000066400000000000000000000053041330756104600412630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/java/org/apache/maven/surefire/its/jiraspackage org.apache.maven.surefire.its.jiras; /* * 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. */ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; /** * @author Tibor Digana (tibor17) * @see SUREFIRE-995 * @since 2.18.1 */ public class Surefire995CategoryInheritanceIT extends SurefireJUnit4IntegrationTestCase { @Test public void negativeTestShouldRunAllCategories() { unpack() .setTestToRun( "Special*Test" ) .executeTest() .verifyErrorFree( 3 ); } @Test public void junit411ShouldRunExplicitCategory() { unpack() .addGoal( "-Ppositive-tests" ) .sysProp( "version.junit", "4.11" ) .executeTest() .verifyErrorFree( 1 ) .verifyTextInLog( "CategorizedTest#a" ); } @Test public void junit411ShouldExcludeExplicitCategory() { unpack() .addGoal( "-Ppositive-tests-excluded-categories" ) .sysProp( "version.junit", "4.11" ) .executeTest() .verifyErrorFree( 2 ); } @Test public void junit412ShouldRunInheritedCategory() { unpack() .setTestToRun( "Special*Test" ) .addGoal( "-Ppositive-tests" ) .executeTest() .verifyErrorFree( 2 ); } @Test public void junit412ShouldExcludeInheritedCategory() { unpack() .setTestToRun( "Special*Test" ) .addGoal( "-Ppositive-tests-excluded-categories" ) .executeTest() .verifyErrorFree( 1 ) .verifyTextInLog( "SpecialNonCategoryTest#test" ); } private SurefireLauncher unpack() { return unpack( "surefire-995-categoryInheritance" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/000077500000000000000000000000001330756104600245555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/SurefireToolchains/000077500000000000000000000000001330756104600303655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/SurefireToolchains/pom.xml000066400000000000000000000044761330756104600317150ustar00rootroot00000000000000 4.0.0 test SurefireToolchains jar 1.0-SNAPSHOT Test :: SurefireToolchains UTF-8 2.2.1 junit junit 4.8.2 test org.apache.maven.plugins maven-compiler-plugin 2.3.2 1.5 1.5 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} org.apache.maven.plugins maven-toolchains-plugin 1.0 validate toolchain 1.5 sun maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/SurefireToolchains/src/000077500000000000000000000000001330756104600311545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/SurefireToolchains/src/main/000077500000000000000000000000001330756104600321005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/SurefireToolchains/src/main/java/000077500000000000000000000000001330756104600330215ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600337215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/SurefireToolchains/src/main/javasurefiretoolchains/000077500000000000000000000000001330756104600376315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/SurefireToolchains/src/main/java/testApp.java000066400000000000000000000017201330756104600412140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/SurefireToolchains/src/main/java/test/surefiretoolchainspackage test.surefiretoolchains; /* * 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. */ public final class App { public static void main( String[] args ) { System.out.println( "Hello World!" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/SurefireToolchains/src/test/000077500000000000000000000000001330756104600321335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/SurefireToolchains/src/test/java/000077500000000000000000000000001330756104600330545ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600337545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/SurefireToolchains/src/test/javasurefiretoolchains/000077500000000000000000000000001330756104600376645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/SurefireToolchains/src/test/java/testAppTest.java000066400000000000000000000020651330756104600421120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/SurefireToolchains/src/test/java/test/surefiretoolchainspackage test.surefiretoolchains; /* * 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. */ import org.junit.Test; import static org.junit.Assert.*; public class AppTest { @Test public void testApp() { // 1.5.0_19-b02 assertEquals( "1.5.0_19", System.getProperty( "java.version" ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/additional-classpath/000077500000000000000000000000001330756104600306455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/additional-classpath/extraResource/000077500000000000000000000000001330756104600335005ustar00rootroot00000000000000test.txt000066400000000000000000000000001330756104600351270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/additional-classpath/extraResourcemaven-surefire-surefire-2.22.0/surefire-its/src/test/resources/additional-classpath/extraResource2/000077500000000000000000000000001330756104600335625ustar00rootroot00000000000000test2.txt000066400000000000000000000000001330756104600352730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/additional-classpath/extraResource2maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/additional-classpath/pom.xml000066400000000000000000000044121330756104600321630ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire additional-classpath 1.0-SNAPSHOT Test for additionalClasspathElements maven-surefire-plugin ${basedir}/extraResource ${abc}, ${basedir}/extraResource2 junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/additional-classpath/src/000077500000000000000000000000001330756104600314345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/additional-classpath/src/test/000077500000000000000000000000001330756104600324135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/additional-classpath/src/test/java/000077500000000000000000000000001330756104600333345ustar00rootroot00000000000000additionalClasspath/000077500000000000000000000000001330756104600372305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/additional-classpath/src/test/javaBasicTest.java000066400000000000000000000021501330756104600417520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/additional-classpath/src/test/java/additionalClasspathpackage additionalClasspath; /* * 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. */ import junit.framework.TestCase; public class BasicTest extends TestCase { public void testExtraResource() { assertNotNull( BasicTest.class.getResourceAsStream( "/test.txt" ) ); assertNotNull( BasicTest.class.getResourceAsStream( "/test2.txt" ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/000077500000000000000000000000001330756104600300145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/child1/000077500000000000000000000000001330756104600311605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/child1/pom.xml000066400000000000000000000033221330756104600324750ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire aggregate-report 1.0-SNAPSHOT aggregate-child1 child1 for aggregate-reports junit junit 3.8.1 test maven-surefire-report-plugin maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/child1/src/000077500000000000000000000000001330756104600317475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/child1/src/test/000077500000000000000000000000001330756104600327265ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600335705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/child1/src/testaggregateReport/000077500000000000000000000000001330756104600367125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/child1/src/test/javaFailingTest.java000066400000000000000000000017661330756104600420000ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/child1/src/test/java/aggregateReportpackage aggregateReport; /* * 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. */ import junit.framework.TestCase; public class FailingTest extends TestCase { public void testFailure() { fail( "This test is supposed to fail" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/child2/000077500000000000000000000000001330756104600311615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/child2/pom.xml000066400000000000000000000033161330756104600325010ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire aggregate-report 1.0-SNAPSHOT aggregate-child2 child2 for aggregate-reports junit junit 3.8.1 test maven-surefire-report-plugin maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/child2/src/000077500000000000000000000000001330756104600317505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/child2/src/test/000077500000000000000000000000001330756104600327275ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600335715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/child2/src/testaggregateReport/000077500000000000000000000000001330756104600367135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/child2/src/test/javaBasicTest.java000066400000000000000000000042241330756104600414410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/child2/src/test/java/aggregateReportpackage aggregateReport; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class BasicTest extends TestCase { private boolean setUpCalled = false; private static boolean tearDownCalled = false; public BasicTest( String name, String extraName ) { super( name ); } public static Test suite() { System.out.println( "suite" ); TestSuite suite = new TestSuite(); Test test = new BasicTest( "testSetUp", "dummy" ); suite.addTest( test ); return new TestSetup( suite ) { protected void setUp() { //oneTimeSetUp(); } protected void tearDown() { oneTimeTearDown(); } }; } protected void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } protected void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } public void testSetUp() { assertTrue( "setUp was not called", setUpCalled ); } public static void oneTimeTearDown() { assertTrue( "tearDown was not called", tearDownCalled ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/aggregate-report/pom.xml000066400000000000000000000042311330756104600313310ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire aggregate-report 1.0-SNAPSHOT Test for aggregate-report pom child1 child2 maven-surefire-plugin ${surefire.version} true maven-surefire-report-plugin true maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/ant-ignore/000077500000000000000000000000001330756104600266205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/ant-ignore/.gitignore000066400000000000000000000000151330756104600306040ustar00rootroot00000000000000*.jar TEST* maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/ant-ignore/build.xml000066400000000000000000000031641330756104600304450ustar00rootroot00000000000000 simple example build file maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/ant-ignore/ivy.xml000066400000000000000000000003041330756104600301460ustar00rootroot00000000000000 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/ant-ignore/pom.xml000066400000000000000000000033071330756104600301400ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire ant-ignore 1.0-SNAPSHOT Test of @Ignore annotation, can be used side-by-side with maven and ant junit junit 4.4 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/ant-ignore/src/000077500000000000000000000000001330756104600274075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/ant-ignore/src/ivy.xml000066400000000000000000000003041330756104600307350ustar00rootroot00000000000000 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/ant-ignore/src/test/000077500000000000000000000000001330756104600303665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/ant-ignore/src/test/java/000077500000000000000000000000001330756104600313075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/ant-ignore/src/test/java/antignore/000077500000000000000000000000001330756104600332755ustar00rootroot00000000000000BasicTest.java000066400000000000000000000021321330756104600357400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/ant-ignore/src/test/java/antignorepackage antignore; /* * 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. */ import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; public class BasicTest { @Test @Ignore public void testIgnorable() { Assert.fail( "you should have ignored me!" ); } @Test public void testSomethingElse() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-parameter/000077500000000000000000000000001330756104600301145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-parameter/pom.xml000066400000000000000000000040321330756104600314300ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire testArgLine 1.0-SNAPSHOT Test for argLine configuration junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-plugin once -Dfoo.property="foo foo/foo/bar/1.0" -Dbar.property="bar bar/foo/bar/2.0" maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-parameter/src/000077500000000000000000000000001330756104600307035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-parameter/src/test/000077500000000000000000000000001330756104600316625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-parameter/src/test/java/000077500000000000000000000000001330756104600326035ustar00rootroot00000000000000argLine/000077500000000000000000000000001330756104600341055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-parameter/src/test/javaTestSurefireArgLine.java000066400000000000000000000026071330756104600406430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-parameter/src/test/java/argLinepackage argLine; /* * 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. */ import junit.framework.TestCase; public class TestSurefireArgLine extends TestCase { public void testArgLine() { String fooProperty = System.getProperty( "foo.property" ); assertEquals( "incorrect foo.property; " + "Surefire should have passed this in correctly", "foo foo/foo/bar/1.0", fooProperty ); String barProperty = System.getProperty( "bar.property" ); assertEquals( "incorrect bar.property; " + "Surefire should have passed this in correctly", "bar bar/foo/bar/2.0", barProperty ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-properties/000077500000000000000000000000001330756104600303305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-properties/pom.xml000066400000000000000000000054271330756104600316550ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire testArgProperties 1.0-SNAPSHOT Test for late replacement argLine properties. from-prop-value not-override-prop-value junit junit 4.11 test org.codehaus.mojo properties-maven-plugin 1.0-alpha-2 default validate read-project-properties ${project.basedir}/src/test/resources/it.properties org.apache.maven.plugins maven-surefire-plugin once -Dp1=@{from.prop} -Dp2=@{override.prop} -Dp3=@{undefined.prop} -Dp4=@{generated.prop} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-properties/src/000077500000000000000000000000001330756104600311175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-properties/src/test/000077500000000000000000000000001330756104600320765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-properties/src/test/java/000077500000000000000000000000001330756104600330175ustar00rootroot00000000000000argLine-properties/000077500000000000000000000000001330756104600365135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-properties/src/test/javaTestSurefireArgLineProperties.java000066400000000000000000000036471330756104600453330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-properties/src/test/java/argLine-propertiespackage argLine; /* * 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. */ import org.junit.Assert; import org.junit.Test; public class TestSurefireArgLineProperties { @Test public void testFromProp() { String fromProp = System.getProperty("p1"); Assert.assertNotNull(fromProp, "incorrect arg line, no p1 present?"); Assert.assertEquals("from-prop-value", fromProp); } @Test public void testOverrideProp() { String overrideProp = System.getProperty("p2"); Assert.assertNotNull(overrideProp, "incorrect arg line, no p2 present?"); Assert.assertEquals("override-prop-value", overrideProp); } @Test public void testUndefinedProp() { String undefinedProp = System.getProperty("p3"); Assert.assertNotNull(undefinedProp, "incorrect arg line, no p3 present?"); Assert.assertEquals("@{undefined.prop}", undefinedProp); } @Test public void testGeneratedProp() { String generatedProp = System.getProperty("p4"); Assert.assertNotNull(generatedProp, "incorrect arg line, no p4 present?"); Assert.assertEquals("generated-prop-value", generatedProp); } } resources/000077500000000000000000000000001330756104600340315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-properties/src/testit.properties000066400000000000000000000015321330756104600365640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/argLine-properties/src/test/resources# 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. override.prop=override-prop-value generated.prop=generated-prop-value maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/assumpationFailureReport/000077500000000000000000000000001330756104600316245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/assumpationFailureReport/pom.xml000066400000000000000000000043311330756104600331420ustar00rootroot00000000000000 org.apache.maven.surefire it-parent 1.0 ../pom.xml 4.0.0 org.apache.maven.plugins.surefire assumpationFailure jar 1.0-SNAPSHOT assumpationFailureReportTest http://maven.apache.org junit junit 4.12 org.apache.maven.plugins maven-surefire-plugin true **/Test*.java UTF-8 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/assumpationFailureReport/src/000077500000000000000000000000001330756104600324135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/assumpationFailureReport/src/test/000077500000000000000000000000001330756104600333725ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600342345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/assumpationFailureReport/src/testassumpationFailure/000077500000000000000000000000001330756104600401075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/assumpationFailureReport/src/test/javaTest1.java000066400000000000000000000021741330756104600417560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/assumpationFailureReport/src/test/java/assumpationFailurepackage assumptionFailure; /* * 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. */ import org.junit.Test; import org.junit.Assume; import static org.junit.Assert.fail; public class Test1 { @Test public void testAssumptionFailureReport() { Assume.assumeTrue( "The test is skipped if it is false" , false ); fail( "This is not expected to test" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-filtering/000077500000000000000000000000001330756104600305205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-filtering/pom.xml000066400000000000000000000042231330756104600320360ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire classpath-dependency-filter 1.0-SNAPSHOT Test for filtering classpath dependencies maven-surefire-plugin org.apache.commons:* org.apache.commons commons-email 1.2 junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-filtering/src/000077500000000000000000000000001330756104600313075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-filtering/src/test/000077500000000000000000000000001330756104600322665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-filtering/src/test/java/000077500000000000000000000000001330756104600332075ustar00rootroot00000000000000classpathFiltering/000077500000000000000000000000001330756104600367565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-filtering/src/test/javaBasicTest.java000066400000000000000000000025661330756104600415130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-filtering/src/test/java/classpathFilteringpackage classpathFiltering; /* * 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. */ import junit.framework.TestCase; public class BasicTest extends TestCase { public void testDependencyFilter() { Class testClass = null; String testClassName = "org.apache.commons.mail.Email"; try { testClass = Class.forName( testClassName ); System.out.println( "Able to load class " + testClass ); } catch ( ClassNotFoundException e ) { System.out.println( "Couldn't load " + testClassName ); } assertNull( testClass ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-order/000077500000000000000000000000001330756104600276505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-order/pom.xml000066400000000000000000000042201330756104600311630ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire classpath-order 1.0-SNAPSHOT Test proper order of class path elements: test-classes, classes, dependencies maven-surefire-plugin true org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-order/src/000077500000000000000000000000001330756104600304375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-order/src/main/000077500000000000000000000000001330756104600313635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-order/src/main/resources/000077500000000000000000000000001330756104600333755ustar00rootroot00000000000000surefire-classpath-order.properties000066400000000000000000000001451330756104600423510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-order/src/main/resources# This file collides with the equally named file from the project's test resources Surefire: classes surefire-report.properties000066400000000000000000000001501330756104600405650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-order/src/main/resources# This file collides with the equally named i18n bundle in the Surefire Report Plugin Surefire: classes maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-order/src/test/000077500000000000000000000000001330756104600314165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-order/src/test/java/000077500000000000000000000000001330756104600323375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-order/src/test/java/it/000077500000000000000000000000001330756104600327535ustar00rootroot00000000000000BasicTest.java000066400000000000000000000034361330756104600354260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-order/src/test/java/itpackage it; /* * 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. */ import java.io.InputStream; import java.io.IOException; import java.util.Properties; import junit.framework.TestCase; public class BasicTest extends TestCase { public void testTestClassesBeforeMainClasses() { Properties props = getProperties( "/surefire-classpath-order.properties" ); assertEquals( "test-classes", props.getProperty( "Surefire" ) ); } public void testMainClassesBeforeDependencies() { Properties props = getProperties( "/surefire-report.properties" ); assertEquals( "classes", props.getProperty( "Surefire" ) ); } private Properties getProperties(String resource) { InputStream in = getClass().getResourceAsStream( resource ); assertNotNull( in ); try { Properties props = new Properties(); props.load( in ); return props; } catch (IOException e) { fail(e.toString()); return null; } } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-order/src/test/resources/000077500000000000000000000000001330756104600334305ustar00rootroot00000000000000surefire-classpath-order.properties000066400000000000000000000001521330756104600424020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-order/src/test/resources# This file collides with the equally named file from the project's main resources Surefire: test-classes maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-scope-filtering/000077500000000000000000000000001330756104600316275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-scope-filtering/pom.xml000066400000000000000000000041241330756104600331450ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire classpath-scope-filter 1.0-SNAPSHOT Test for classpath scope filter maven-surefire-plugin compile org.apache.commons commons-email 1.2 junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-scope-filtering/src/000077500000000000000000000000001330756104600324165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-scope-filtering/src/test/000077500000000000000000000000001330756104600333755ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600342375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-scope-filtering/src/testclasspathFiltering/000077500000000000000000000000001330756104600400655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-scope-filtering/src/test/javaBasicTest.java000066400000000000000000000025661330756104600426220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/classpath-scope-filtering/src/test/java/classpathFilteringpackage classpathFiltering; /* * 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. */ import junit.framework.TestCase; public class BasicTest extends TestCase { public void testDependencyFilter() { Class testClass = null; String testClassName = "org.apache.commons.mail.Email"; try { testClass = Class.forName( testClassName ); System.out.println( "Able to load class " + testClass ); } catch ( ClassNotFoundException e ) { System.out.println( "Couldn't load " + testClassName ); } assertNull( testClass ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleOutput/000077500000000000000000000000001330756104600274405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleOutput/pom.xml000066400000000000000000000027161330756104600307630ustar00rootroot00000000000000 org.apache.maven.surefire it-parent 1.0 ../pom.xml 4.0.0 org.apache.maven.plugins.surefire consoleOutputTest jar 1.0-SNAPSHOT consoleOutputTest http://maven.apache.org junit junit 4.7 org.apache.maven.plugins maven-surefire-plugin true true ${forkMode} **/Test*.java UTF-8 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleOutput/src/000077500000000000000000000000001330756104600302275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleOutput/src/test/000077500000000000000000000000001330756104600312065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleOutput/src/test/java/000077500000000000000000000000001330756104600321275ustar00rootroot00000000000000consoleOutput/000077500000000000000000000000001330756104600347335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleOutput/src/test/javaTest1.java000066400000000000000000000042771330756104600366100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleOutput/src/test/java/consoleOutputpackage consoleOutput; /* * 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. */ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.fail; public class Test1 { static { System.out.println("Printline in static block"); Runtime.getRuntime().addShutdownHook( new Thread( ){ @Override public void run() { System.out.println( "Printline in shutdown hook" ); } }); } @Override protected void finalize() throws Throwable { System.out.println( "Printline in finalizer" ); } public Test1(){ System.out.println("In constructor"); } @Test public void testStdOut() { char c = 'C'; System.out.print( "Sout" ); System.out.print( "Again" ); System.out.print( "\n" ); System.out.print( c ); System.out.println( "SoutLine" ); System.out.println( "äöüß" ); System.out.println( "" ); System.out.println( "==END==" ); fail( "failing with ü" ); } @Test public void testStdErr() { char e = 'E'; System.err.print( "Serr" ); System.err.print( "\n" ); System.err.print( e ); System.err.println( "SerrLine" ); System.err.println( "äöüß" ); System.err.println( "" ); System.err.println( "==END==" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleOutputEncoding/000077500000000000000000000000001330756104600311075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleOutputEncoding/pom.xml000066400000000000000000000046311330756104600324300ustar00rootroot00000000000000 org.apache.maven.surefire it-parent 1.0 ../pom.xml 4.0.0 org.apache.maven.plugins.surefire consoleOutputEncodingsTest jar 1.0-SNAPSHOT consoleOutputTest http://maven.apache.org junit junit ${junit.version} org.apache.maven.plugins maven-surefire-plugin ${forkMode} ${printSummary} ${reportFormat} **/Test*.java 4.8.1 once true brief maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleOutputEncoding/src/000077500000000000000000000000001330756104600316765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleOutputEncoding/src/test/000077500000000000000000000000001330756104600326555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleOutputEncoding/src/test/java/000077500000000000000000000000001330756104600335765ustar00rootroot00000000000000consoleOutput/000077500000000000000000000000001330756104600364025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleOutputEncoding/src/test/javaTest1.java000066400000000000000000000027551330756104600402560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleOutputEncoding/src/test/java/consoleOutputpackage consoleOutput; /* * 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. */ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import java.io.IOException; import java.io.PrintStream; import java.nio.charset.Charset; public class Test1 { @Test public void testSystemOut() throws IOException { PrintStream out = System.out; out.print( getS( "print" )); out.write( getS( "utf-8" ).getBytes( Charset.forName( "UTF-8" ) ) ); out.write( getS( "8859-1" ).getBytes( Charset.forName( "ISO-8859-1" ) ) ); out.write( getS( "utf-16" ).getBytes( Charset.forName( "UTF-16" ) ) ); } private String getS( String s ) { return " Hell\u00d8 " + s + "\n"; } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleoutput-noisy/000077500000000000000000000000001330756104600306375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleoutput-noisy/pom.xml000066400000000000000000000042251330756104600321570ustar00rootroot00000000000000 org.apache.maven.surefire it-parent 1.0 ../pom.xml 4.0.0 org.apache.maven.plugins.surefire fork-consoleOutput-noisy jar 1.0-SNAPSHOT consoleOutput-noisy http://maven.apache.org junit junit ${junit.version} org.apache.maven.plugins maven-surefire-plugin ${forkMode} ${printSummary} ${useFile} ${parallel} ${threadCount} ${reportFormat} ${redirect.to.file} ${trimStackTrace} **/Test*.java true 4.8.1 true once true brief true 4 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleoutput-noisy/src/000077500000000000000000000000001330756104600314265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleoutput-noisy/src/test/000077500000000000000000000000001330756104600324055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleoutput-noisy/src/test/java/000077500000000000000000000000001330756104600333265ustar00rootroot00000000000000consoleoutput_noisy/000077500000000000000000000000001330756104600374135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleoutput-noisy/src/test/javaTest1.java000066400000000000000000000040721330756104600412610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleoutput-noisy/src/test/java/consoleoutput_noisypackage consoleoutput_noisy; /* * 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. */ import org.junit.Test; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; public class Test1 { public static final int thousand = Integer.parseInt( System.getProperty( "thousand", "1000" ) ); @Test public void test1MillionBytes() { for ( int i = 0; i < ( 10 * thousand ); i++ ) { System.out.println( "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" ); } } @Test public void testHundredThousand() { printAlot(); } private static void printAlot() { for ( int i = 0; i < thousand; i++ ) { System.out.println( "AAAAAAAAAABBBBBBBBBBCCCCCCCCCCDDDDDDDDDDEEEEEEEEEEFFFFFFFFFFGGGGGGGGGGHHHHHHHHHHIIIIIIIIIIJJJJJJJJJJ" ); } } @Test public void testAnotherHundredThousand() { printAlot(); } @Before public void before() { printAlot(); } @BeforeClass public static void beforeClass() { printAlot(); } @After public void after() { printAlot(); } @AfterClass public static void afterClass() { printAlot(); } } Test2.java000066400000000000000000000033521330756104600412620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/consoleoutput-noisy/src/test/java/consoleoutput_noisypackage consoleoutput_noisy; /* * 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. */ import junit.framework.TestCase; public class Test2 extends TestCase { public void test2MillionBytes() { for ( int i = 0; i < 20 * Test1.thousand; i++ ) { System.out.println( "0-2-3-6-8-012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" ); } } public static void testHundredThousand() { for ( int i = 0; i < Test1.thousand; i++ ) { System.out.println( "A-A-3-A-A-BBBBBBBBBBCCCCCCCCCCDDDDDDDDDDEEEEEEEEEEFFFFFFFFFFGGGGGGGGGGHHHHHHHHHHIIIIIIIIIIJJJJJJJJJJ" ); } } public static void testAnotherHundredThousand() { for ( int i = 0; i < Test1.thousand; i++ ) { System.out.println( "A-A-A-3-3-ABBBBBBBBBCCCCCCCCCCDDDDDDDDDDEEEEEEEEEEFFFFFFFFFFGGGGGGGGGGHHHHHHHHHHIIIIIIIIIIJJJJJJJJJJ" ); } } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-detection/000077500000000000000000000000001330756104600276315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-detection/pom.xml000066400000000000000000000036361330756104600311560ustar00rootroot00000000000000 org.apache.maven.surefire it-parent 1.0 ../pom.xml 4.0.0 org.apache.maven.plugins.surefire crash-detection 1.0-SNAPSHOT Tests vm crash junit junit 4.4 test maven-surefire-plugin ${surefire.version} once maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-detection/src/000077500000000000000000000000001330756104600304205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-detection/src/test/000077500000000000000000000000001330756104600313775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-detection/src/test/java/000077500000000000000000000000001330756104600323205ustar00rootroot00000000000000junit44/000077500000000000000000000000001330756104600335425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-detection/src/test/javaenvironment/000077500000000000000000000000001330756104600361065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-detection/src/test/java/junit44BasicTest.java000066400000000000000000000022661330756104600406400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-detection/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class BasicTest { @Test public void testNothing() { } @AfterClass public static void killTheVm(){ if ( Boolean.getBoolean( "killHard" )) { Runtime.getRuntime().halt( 0 ); } else { System.exit( 0 ); } } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-during-test/000077500000000000000000000000001330756104600301205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-during-test/pom.xml000066400000000000000000000042441330756104600314410ustar00rootroot00000000000000 org.apache.maven.surefire it-parent 1.0 ../pom.xml 4.0.0 org.apache.maven.plugins.surefire crash-during-test 1.0-SNAPSHOT Tests vm crash while a test is in progress junit junit 4.4 test uk.me.mjt crashjvm 1.0 test jar maven-surefire-plugin ${surefire.version} once alphabetical maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-during-test/src/000077500000000000000000000000001330756104600307075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-during-test/src/test/000077500000000000000000000000001330756104600316665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-during-test/src/test/java/000077500000000000000000000000001330756104600326075ustar00rootroot00000000000000junit44/000077500000000000000000000000001330756104600340315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-during-test/src/test/javaenvironment/000077500000000000000000000000001330756104600363755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-during-test/src/test/java/junit44Test1CrashedTest.java000066400000000000000000000030051330756104600423700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-during-test/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import static org.junit.Assert.*; import org.junit.Test; import uk.me.mjt.CrashJvm; public class Test1CrashedTest { @Test public void testCrashJvm() { assertTrue(CrashJvm.loadedOk()); String crashType = System.getProperty("crashType"); assertNotNull(crashType); if ( crashType.equals( "exit" ) ) { CrashJvm.exit(); } else if ( crashType.equals( "abort" ) ) { CrashJvm.abort(); } else if (crashType.equals( "segfault" )) { CrashJvm.segfault(); } else { fail("Don't recognise crashType " + crashType); } } } Test2WaitingTest.java000066400000000000000000000021031330756104600424200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-during-test/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import org.junit.Test; import static java.util.concurrent.TimeUnit.MILLISECONDS; public class Test2WaitingTest { @Test public void nonCrashingTest() throws InterruptedException { MILLISECONDS.sleep( 1500L ); } } Test3FastTest.java000066400000000000000000000016621330756104600417250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/crash-during-test/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import org.junit.Test; public class Test3FastTest { @Test public void emptyTest() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-abstract/000077500000000000000000000000001330756104600326475ustar00rootroot00000000000000pom.xml000066400000000000000000000033111330756104600341030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-abstract 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire default-configuration-abstract 1.0-SNAPSHOT Test for default configuration with abstract classes junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-abstract/src/000077500000000000000000000000001330756104600334365ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600343365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-abstract/srcjava/000077500000000000000000000000001330756104600352575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-abstract/src/testabstractClasses/000077500000000000000000000000001330756104600404005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-abstract/src/test/javaAbstractConcreteBasicTest.java000066400000000000000000000043341330756104600462770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-abstract/src/test/java/abstractClassespackage abstractClasses; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class AbstractConcreteBasicTest // not really abstract! extends TestCase { private boolean setUpCalled = false; private static boolean tearDownCalled = false; public AbstractConcreteBasicTest( String name, String extraName ) { super( name ); } public static Test suite() { System.out.println( "suite" ); TestSuite suite = new TestSuite(); Test test = new AbstractConcreteBasicTest( "testSetUp", "dummy" ); suite.addTest( test ); return new TestSetup( suite ) { protected void setUp() { //oneTimeSetUp(); } protected void tearDown() { oneTimeTearDown(); } }; } protected void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } protected void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } public void testSetUp() { assertTrue( "setUp was not called", setUpCalled ); } public static void oneTimeTearDown() { assertTrue( "tearDown was not called", tearDownCalled ); } } NonInstantiableTest.java000066400000000000000000000016531330756104600452000ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-abstract/src/test/java/abstractClassespackage abstractClasses; /* * 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. */ import junit.framework.TestCase; public abstract class NonInstantiableTest extends TestCase { } default-configuration-classWithNoTests/000077500000000000000000000000001330756104600342465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000032711330756104600355660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-classWithNoTests 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire default-configuration-classWithNoTests 1.0-SNAPSHOT Test for class with no tests junit junit 3.8.1 test src/000077500000000000000000000000001330756104600350355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-classWithNoTeststest/000077500000000000000000000000001330756104600360145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-classWithNoTests/srcjava/000077500000000000000000000000001330756104600367355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-classWithNoTests/src/testclassWithNoTests/000077500000000000000000000000001330756104600422165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-classWithNoTests/src/test/javaNoMethodsTestCase.java000066400000000000000000000015471330756104600464240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-classWithNoTests/src/test/java/classWithNoTestspackage classWithNoTests; /* * 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. */ public class NoMethodsTestCase {}maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-noTests/000077500000000000000000000000001330756104600325035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration-noTests/pom.xml000066400000000000000000000047731330756104600340330ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire default-configuration-noTests 1.0-SNAPSHOT Test for no test directory 3.8.1 junit junit ${junit.version} test junit47 maven-surefire-plugin org.apache.maven.surefire surefire-junit47 ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration/000077500000000000000000000000001330756104600310465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration/pom.xml000066400000000000000000000032521330756104600323650ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire default-configuration 1.0-SNAPSHOT Test for default configuration junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration/src/000077500000000000000000000000001330756104600316355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration/src/test/000077500000000000000000000000001330756104600326145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration/src/test/java/000077500000000000000000000000001330756104600335355ustar00rootroot00000000000000defaultConfiguration/000077500000000000000000000000001330756104600376325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration/src/test/javaBasicTest.java000066400000000000000000000042311330756104600423560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/default-configuration/src/test/java/defaultConfigurationpackage defaultConfiguration; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class BasicTest extends TestCase { private boolean setUpCalled = false; private static boolean tearDownCalled = false; public BasicTest( String name, String extraName ) { super( name ); } public static Test suite() { System.out.println( "suite" ); TestSuite suite = new TestSuite(); Test test = new BasicTest( "testSetUp", "dummy" ); suite.addTest( test ); return new TestSetup( suite ) { protected void setUp() { //oneTimeSetUp(); } protected void tearDown() { oneTimeTearDown(); } }; } protected void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } protected void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } public void testSetUp() { assertTrue( "setUp was not called", setUpCalled ); } public static void oneTimeTearDown() { assertTrue( "tearDown was not called", tearDownCalled ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/environment-variables/000077500000000000000000000000001330756104600310675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/environment-variables/pom.xml000066400000000000000000000044121330756104600324050ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire environment-variables 1.0-SNAPSHOT Test for checking environment variables into forks always false 1.6 1.6 junit junit 4.4 test maven-surefire-plugin ${surefire.version} ${forkMode} ${useSystemClassLoader} foo maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/environment-variables/src/000077500000000000000000000000001330756104600316565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/environment-variables/src/test/000077500000000000000000000000001330756104600326355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/environment-variables/src/test/java/000077500000000000000000000000001330756104600335565ustar00rootroot00000000000000environment/000077500000000000000000000000001330756104600360435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/environment-variables/src/test/javaBasicTest.java000066400000000000000000000027411330756104600405730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/environment-variables/src/test/java/environmentpackage environment; /* * 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. */ import org.hamcrest.core.IsNull; import org.junit.Assert; import org.junit.Test; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNull.notNullValue; import static org.hamcrest.core.IsNull.nullValue; public class BasicTest { @Test public void testEnvVar() { Assert.assertThat( System.getenv( "PATH" ), notNullValue() ); Assert.assertThat( System.getenv( "DUMMY_ENV_VAR" ), is( "foo" ) ); Assert.assertThat( System.getenv( "EMPTY_VAR" ), is( "" ) ); Assert.assertThat( System.getenv( "UNSET_VAR" ), is( "" ) ); Assert.assertThat( System.getenv( "UNDEFINED_VAR" ), nullValue() ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-junit/000077500000000000000000000000001330756104600275525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-junit/pom.xml000066400000000000000000000063401330756104600310720ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 org.apache.maven.plugins.surefire jiras-surefire-580-junit 1.0 4.0 junit junit ${junit} test org.apache.maven.plugins maven-surefire-plugin alphabetical once -Xms16m -Xmx32m junit4 org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit4 ${surefire.version} junit47 4.7 org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit47 ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-junit/src/000077500000000000000000000000001330756104600303415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-junit/src/test/000077500000000000000000000000001330756104600313205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-junit/src/test/java/000077500000000000000000000000001330756104600322415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/000077500000000000000000000000001330756104600330225ustar00rootroot00000000000000ATest.java000066400000000000000000000011611330756104600346250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkgpackage pkg; import org.junit.Test; import static java.util.concurrent.TimeUnit.MILLISECONDS; public class ATest { static final int DELAY_MULTIPLIER = 3; @Test public void someMethod() throws Exception { // checking processros # due to very slow Windows Jenkins machines MILLISECONDS.sleep( DELAY_MULTIPLIER * ( Runtime.getRuntime().availableProcessors() == 1 ? 3600L : 1500L ) ); throw new RuntimeException( "assert \"foo\" == \"bar\"\n" + " |\n" + " false" ); } }BTest.java000066400000000000000000000007331330756104600346320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkgpackage pkg; import org.junit.Test; import static java.util.concurrent.TimeUnit.MILLISECONDS; import static pkg.ATest.DELAY_MULTIPLIER; public class BTest { @Test public void test() throws InterruptedException { // checking processros # due to very slow Windows Jenkins machines MILLISECONDS.sleep( DELAY_MULTIPLIER * ( Runtime.getRuntime().availableProcessors() == 1 ? 9000L : 3750L ) ); throw new RuntimeException(); } } CTest.java000066400000000000000000000006651330756104600346370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkgpackage pkg; import org.junit.Test; import static java.util.concurrent.TimeUnit.MILLISECONDS; import static pkg.ATest.DELAY_MULTIPLIER; public class CTest { @Test public void test() throws InterruptedException { // checking processros # due to very slow Windows Jenkins machines MILLISECONDS.sleep( DELAY_MULTIPLIER * ( Runtime.getRuntime().availableProcessors() == 1 ? 9000L : 3750L ) ); } } DTest.java000066400000000000000000000006651330756104600346400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkgpackage pkg; import org.junit.Test; import static java.util.concurrent.TimeUnit.MILLISECONDS; import static pkg.ATest.DELAY_MULTIPLIER; public class DTest { @Test public void test() throws InterruptedException { // checking processros # due to very slow Windows Jenkins machines MILLISECONDS.sleep( DELAY_MULTIPLIER * ( Runtime.getRuntime().availableProcessors() == 1 ? 9000L : 3750L ) ); } } ETest.java000066400000000000000000000001531330756104600346310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkgpackage pkg; import org.junit.Test; public class ETest { @Test public void test() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-testng/000077500000000000000000000000001330756104600277255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-testng/pom.xml000066400000000000000000000037601330756104600312500ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 org.apache.maven.plugins.surefire jiras-surefire-580-testng 1.0 org.testng testng 5.10 jdk15 test org.apache.maven.plugins maven-surefire-plugin alphabetical once maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-testng/src/000077500000000000000000000000001330756104600305145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-testng/src/test/000077500000000000000000000000001330756104600314735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-testng/src/test/java/000077500000000000000000000000001330756104600324145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-testng/src/test/java/pkg/000077500000000000000000000000001330756104600331755ustar00rootroot00000000000000ATest.java000066400000000000000000000010721330756104600350010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-testng/src/test/java/pkgpackage pkg; import org.testng.annotations.Test; import java.util.concurrent.TimeUnit; public class ATest { @Test public void someMethod() throws InterruptedException { // checking processros # due to very slow Windows Jenkins machines TimeUnit.MILLISECONDS.sleep( Runtime.getRuntime().availableProcessors() == 1 ? 3600 : 1500 ); throw new RuntimeException( "assert \"foo\" == \"bar\"\n" + " |\n" + " false" ); } } BTest.java000066400000000000000000000006321330756104600350030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-testng/src/test/java/pkgpackage pkg; import org.testng.annotations.Test; import java.util.concurrent.TimeUnit; public class BTest { @Test public void test() throws InterruptedException { // checking processros # due to very slow Windows Jenkins machines TimeUnit.MILLISECONDS.sleep( Runtime.getRuntime().availableProcessors() == 1 ? 9000 : 3750 ); throw new RuntimeException(); } } CTest.java000066400000000000000000000005641330756104600350100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-testng/src/test/java/pkgpackage pkg; import org.testng.annotations.Test; import java.util.concurrent.TimeUnit; public class CTest { @Test public void test() throws InterruptedException { // checking processros # due to very slow Windows Jenkins machines TimeUnit.MILLISECONDS.sleep( Runtime.getRuntime().availableProcessors() == 1 ? 9000 : 3750 ); } } DTest.java000066400000000000000000000005641330756104600350110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-testng/src/test/java/pkgpackage pkg; import org.testng.annotations.Test; import java.util.concurrent.TimeUnit; public class DTest { @Test public void test() throws InterruptedException { // checking processros # due to very slow Windows Jenkins machines TimeUnit.MILLISECONDS.sleep( Runtime.getRuntime().availableProcessors() == 1 ? 9000 : 3750 ); } } ETest.java000066400000000000000000000001701330756104600350030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fail-fast-testng/src/test/java/pkgpackage pkg; import org.testng.annotations.Test; public class ETest { @Test public void test() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failingBuilds/000077500000000000000000000000001330756104600273315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failingBuilds/pom.xml000066400000000000000000000026351330756104600306540ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire failingBuilds-test jar 1.0-SNAPSHOT failingBuilds http://maven.apache.org junit junit ${junit.version} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} **/*Test.java **/MySuiteTest1.java **/MySuiteTest2.java **/MySuiteTest3.java 4.8.1 once 1.6 1.6 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failingBuilds/src/000077500000000000000000000000001330756104600301205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failingBuilds/src/test/000077500000000000000000000000001330756104600310775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failingBuilds/src/test/java/000077500000000000000000000000001330756104600320205ustar00rootroot00000000000000failingbuilds/000077500000000000000000000000001330756104600345555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failingBuilds/src/test/javaExceptionsTest.java000066400000000000000000000025321330756104600404030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failingBuilds/src/test/java/failingbuildspackage failingbuilds; /* * 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. */ import org.junit.Test; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assume.*; import junit.framework.TestCase; public class ExceptionsTest extends TestCase { public void testWithMultiLineExceptionBeingThrown() { throw new RuntimeException( "A very very long exception message indeed, which is to demonstrate truncation. It will be truncated somewhere\nA cat\nAnd a dog\nTried to make a\nParrot swim" ); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-buildfail/000077500000000000000000000000001330756104600302605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-buildfail/invoker.properties000066400000000000000000000014631330756104600340570ustar00rootroot00000000000000# # 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. # invoker.buildResult=failure maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-buildfail/pom.xml000066400000000000000000000062771330756104600316110ustar00rootroot00000000000000 4.0.0 localhost working-directory-test 1.0 Run tests multiple times junit junit 3.8.2 test org.apache.maven.plugins maven-failsafe-plugin ${surefire.version} integration-test integration-test ${project.build.directory}/failsafe-reports/failsafe-summary-1.xml acceptance-test integration-test **/AT*.java **/*AT.java **/*ATCase.java ${project.build.directory}/failsafe-reports/failsafe-summary-2.xml verify verify ${project.build.directory}/failsafe-reports/failsafe-summary-1.xml ${project.build.directory}/failsafe-reports/failsafe-summary-2.xml maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-buildfail/src/000077500000000000000000000000001330756104600310475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-buildfail/src/test/000077500000000000000000000000001330756104600320265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-buildfail/src/test/java/000077500000000000000000000000001330756104600327475ustar00rootroot00000000000000MyAT.java000066400000000000000000000016641330756104600343540ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-buildfail/src/test/java/* * 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. */ import junit.framework.TestCase; public class MyAT extends TestCase { public void testSomething() { assertTrue(false); } } MyIT.java000066400000000000000000000016641330756104600343640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-buildfail/src/test/java/* * 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. */ import junit.framework.TestCase; public class MyIT extends TestCase { public void testSomething() { assertTrue(true); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-nofail/000077500000000000000000000000001330756104600275755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-nofail/invoker.properties000066400000000000000000000014631330756104600333740ustar00rootroot00000000000000# # 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. # invoker.buildResult=failure maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-nofail/pom.xml000066400000000000000000000062771330756104600311260ustar00rootroot00000000000000 4.0.0 localhost working-directory-test 1.0 Run tests multiple times junit junit 3.8.2 test org.apache.maven.plugins maven-failsafe-plugin ${surefire.version} integration-test integration-test ${project.build.directory}/failsafe-reports/failsafe-summary-1.xml acceptance-test integration-test **/AT*.java **/*AT.java **/*ATCase.java ${project.build.directory}/failsafe-reports/failsafe-summary-2.xml verify verify ${project.build.directory}/failsafe-reports/failsafe-summary-1.xml ${project.build.directory}/failsafe-reports/failsafe-summary-2.xml maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-nofail/src/000077500000000000000000000000001330756104600303645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-nofail/src/test/000077500000000000000000000000001330756104600313435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-nofail/src/test/java/000077500000000000000000000000001330756104600322645ustar00rootroot00000000000000MyAT.java000066400000000000000000000016631330756104600336700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-nofail/src/test/java/* * 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. */ import junit.framework.TestCase; public class MyAT extends TestCase { public void testSomething() { assertTrue(true); } } MyIT.java000066400000000000000000000016641330756104600337010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-nofail/src/test/java/* * 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. */ import junit.framework.TestCase; public class MyIT extends TestCase { public void testSomething() { assertTrue(true); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-notests/000077500000000000000000000000001330756104600300245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-notests/pom.xml000066400000000000000000000037741330756104600313540ustar00rootroot00000000000000 4.0.0 localhost failsafe-notests 1.0 failsafe-notests 1.6 1.6 junit junit 3.8.2 test org.apache.maven.plugins maven-failsafe-plugin ${surefire.version} integration-test verify maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-notests/src/000077500000000000000000000000001330756104600306135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-notests/src/test/000077500000000000000000000000001330756104600315725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-notests/src/test/java/000077500000000000000000000000001330756104600325135ustar00rootroot00000000000000AClass.java000066400000000000000000000016661330756104600344560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-notests/src/test/java/* * 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. */ import junit.framework.TestCase; public class AClass extends TestCase { public void testSomething() { assertTrue(false); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-regular/000077500000000000000000000000001330756104600277665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-regular/invoker.properties000066400000000000000000000014631330756104600335650ustar00rootroot00000000000000# # 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. # invoker.buildResult=failure maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-regular/pom.xml000066400000000000000000000063031330756104600313050ustar00rootroot00000000000000 4.0.0 localhost working-directory-test 1.0 Run tests multiple times junit junit 3.8.2 test org.apache.maven.plugins maven-failsafe-plugin ${surefire.version} integration-test integration-test ${project.build.directory}/failsafe-reports/Xfailsafe-summary-1.xml acceptance-test integration-test **/AT*.java **/*AT.java **/*ATCase.java ${project.build.directory}/failsafe-reports/Xfailsafe-summary-2.xml verify verify ${project.build.directory}/failsafe-reports/Xfailsafe-summary-1.xml ${project.build.directory}/failsafe-reports/Xfailsafe-summary-2.xml maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-regular/src/000077500000000000000000000000001330756104600305555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-regular/src/test/000077500000000000000000000000001330756104600315345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-regular/src/test/java/000077500000000000000000000000001330756104600324555ustar00rootroot00000000000000MyAT.java000066400000000000000000000016641330756104600340620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-regular/src/test/java/* * 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. */ import junit.framework.TestCase; public class MyAT extends TestCase { public void testSomething() { assertTrue(true); } } MyIT.java000066400000000000000000000016641330756104600340720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failsafe-regular/src/test/java/* * 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. */ import junit.framework.TestCase; public class MyIT extends TestCase { public void testSomething() { assertTrue(true); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failure-result-counting/000077500000000000000000000000001330756104600313445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failure-result-counting/pom.xml000066400000000000000000000024101330756104600326560ustar00rootroot00000000000000 4.0.0 maven-surefire small-result-counting jar 1.0-SNAPSHOT failure-result-counting http://maven.apache.org junit junit ${junit.version} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${forkMode} **/*.java 4.10 once 1.6 1.6 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failure-result-counting/src/000077500000000000000000000000001330756104600321335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failure-result-counting/src/test/000077500000000000000000000000001330756104600331125ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600337545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failure-result-counting/src/testfailureresultcounting/000077500000000000000000000000001330756104600404115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failure-result-counting/src/test/javaBeforeClassError.java000066400000000000000000000022701330756104600444570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failure-result-counting/src/test/java/failureresultcountingpackage failureresultcounting; /* * 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. */ import org.junit.BeforeClass; import org.junit.Test; /** * @author Kristian Rosenvold */ public class BeforeClassError { @BeforeClass public static void beforeClassError() { throw new RuntimeException( "Exception in beforeclass" ); } @Test public void ok() { System.out.println( "beforeClassError run !!" ); } }BeforeClassFailure.java000066400000000000000000000023111330756104600447510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failure-result-counting/src/test/java/failureresultcountingpackage failureresultcounting; /* * 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. */ import junit.framework.Assert; import org.junit.BeforeClass; import org.junit.Test; /** * @author Kristian Rosenvold */ public class BeforeClassFailure { @BeforeClass public static void failInBeforeClass() { Assert.fail( "Failing in @BeforeClass" ); } @Test public void ok() { System.out.println( "failInBeforeClass run !!"); } }BeforeError.java000066400000000000000000000024101330756104600434650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failure-result-counting/src/test/java/failureresultcountingpackage failureresultcounting; /* * 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. */ import org.junit.Before; import org.junit.Test; /** * @author Kristian Rosenvold */ public class BeforeError { @Before public void exceptionInBefore() { throw new RuntimeException( "Exception in @before" ); } @Test public void ok() { System.out.println( "exceptionInBefore run!!"); } /*@Test public void ok2() { System.out.println( "exceptionInBefore2 run!!"); } */ }BeforeFailure.java000066400000000000000000000022441330756104600437700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failure-result-counting/src/test/java/failureresultcountingpackage failureresultcounting; /* * 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. */ import junit.framework.Assert; import org.junit.Before; import org.junit.Test; /** * @author Kristian Rosenvold */ public class BeforeFailure { @Before public void failInBEfore() { Assert.fail( "Failing in @before" ); } @Test public void ok() { System.out.println( "failInBEfore run !!"); } }NoErrors.java000066400000000000000000000021141330756104600430230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failure-result-counting/src/test/java/failureresultcountingpackage failureresultcounting; /* * 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. */ import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; /** * @author Kristian Rosenvold */ public class NoErrors { @Test @Ignore public void allOk1() { } @Test @Ignore public void allOk2() { } }OrdinaryError.java000066400000000000000000000022041330756104600440530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failure-result-counting/src/test/java/failureresultcountingpackage failureresultcounting; /* * 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. */ import org.junit.Assert; import org.junit.Test; /** * @author Kristian Rosenvold */ public class OrdinaryError { @Test public void ordinaryEror() { throw new RuntimeException( "Exception in @before" ); } @Test public void ordinaryFailure() { Assert.fail(); } }RunTests.java000066400000000000000000000025551330756104600430520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failure-result-counting/src/test/java/failureresultcountingpackage failureresultcounting; /* * 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. */ public class RunTests { public static void main(String args[]) { org.junit.runner.JUnitCore.main(BeforeClassError.class.getName(), BeforeClassFailure.class.getName(), BeforeError.class.getName(), BeforeFailure.class.getName(), OrdinaryError.class.getName(), NoErrors.class.getName() ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failureOutput/000077500000000000000000000000001330756104600274255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failureOutput/pom.xml000066400000000000000000000033371330756104600307500ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire failureOutput jar 1.0-SNAPSHOT failureOutput http://maven.apache.org junit junit ${junit.version} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${forkMode} ${printSummary} ${userFile} ${reportFormat} ${redirect.to.file} **/Test*.java 4.8.1 true once true true brief 1.6 1.6 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failureOutput/src/000077500000000000000000000000001330756104600302145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failureOutput/src/test/000077500000000000000000000000001330756104600311735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failureOutput/src/test/java/000077500000000000000000000000001330756104600321145ustar00rootroot00000000000000forkConsoleOutput/000077500000000000000000000000001330756104600355425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failureOutput/src/test/javaTest1.java000066400000000000000000000041521330756104600374070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failureOutput/src/test/java/forkConsoleOutputpackage forkConsoleOutput; /* * 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. */ import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import java.io.File; public class Test1 { @Test public void test6281() { System.out.println( "Test1 on" + Thread.currentThread().getName()); } @Test public void nullPointerInLibrary() { new File((String)null); } @Test public void failInMethod() { innerFailure(); } @Test public void failInLibInMethod() { new File((String)null); } @Test public void failInNestedLibInMethod() { nestedLibFailure(); } @Test public void assertion1() { Assert.assertEquals("Bending maths", "123", "312"); } @Test public void assertion2() { Assert.assertFalse("True is false", true); } private void innerFailure(){ throw new NullPointerException("Fail here"); } private void nestedLibFailure(){ new File((String) null); } @BeforeClass public static void testWithFailingAssumption2() { System.out.println( "BeforeTest1 on" + Thread.currentThread().getName()); } @AfterClass public static void testWithFailingAssumption3() { System.out.println( "AfterTest1 on" + Thread.currentThread().getName()); } } Test2.java000066400000000000000000000022621330756104600374100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failureOutput/src/test/java/forkConsoleOutputpackage forkConsoleOutput; /* * 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. */ import org.junit.Test; public class Test2 { @Test public void test6281() { System.out.println( "sout: I am talking to you" ); System.out.println( "sout: Will Fail soon" ); System.err.println( "serr: And you too" ); System.err.println( "serr: Will Fail now" ); throw new RuntimeException( "FailHere" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/failureOutput/test000066400000000000000000000016541330756104600303350ustar00rootroot00000000000000[INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for org.apache.maven.plugins.surefire:failureOutput:jar:1.0-SNAPSHOT [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 20, column 17 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building failureOutput 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ failureOutput --- maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fixture/000077500000000000000000000000001330756104600262435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fixture/testsuitexmlparser/000077500000000000000000000000001330756104600322325ustar00rootroot00000000000000TEST-org.apache.maven.surefire.test.SucceedingTest.xml000066400000000000000000000126371330756104600443100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fixture/testsuitexmlparser org.apache.maven.surefire.test.FailingTest.txt000066400000000000000000000134661330756104600430530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fixture/testsuitexmlparser------------------------------------------------------------------------------- Test set: org.apache.maven.surefire.test.FailingTest ------------------------------------------------------------------------------- Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.046 sec <<< FAILURE! defaultTestValueIs_Value(org.apache.maven.surefire.test.FailingTest) Time elapsed: 0.013 sec <<< FAILURE! java.lang.AssertionError: Expected: "wrong" got: "value" at org.junit.Assert.assertThat(Assert.java:778) at org.junit.Assert.assertThat(Assert.java:736) at org.apache.maven.surefire.test.FailingTest.defaultTestValueIs_Value(FailingTest.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:262) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:151) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:122) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:128) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:88) setTestAndRetrieveValue(org.apache.maven.surefire.test.FailingTest) Time elapsed: 0.001 sec <<< FAILURE! java.lang.AssertionError: Expected: "bar" got: "foo" at org.junit.Assert.assertThat(Assert.java:778) at org.junit.Assert.assertThat(Assert.java:736) at org.apache.maven.surefire.test.FailingTest.setTestAndRetrieveValue(FailingTest.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:262) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:151) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:122) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:128) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:88) org.apache.maven.surefire.test.SucceedingTest.txt000066400000000000000000000004421330756104600435410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fixture/testsuitexmlparser------------------------------------------------------------------------------- Test set: org.apache.maven.surefire.test.SucceedingTest ------------------------------------------------------------------------------- Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.044 sec maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutput/000077500000000000000000000000001330756104600303775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutput/pom.xml000066400000000000000000000030751330756104600317210ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire fork-consoleOutput jar 1.0-SNAPSHOT fork-consoleOutput http://maven.apache.org junit junit ${junit.version} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${forkMode} ${printSummary} true ${reportFormat} **/Test*.java 4.8.1 once true brief 1.6 1.6 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutput/src/000077500000000000000000000000001330756104600311665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutput/src/test/000077500000000000000000000000001330756104600321455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutput/src/test/java/000077500000000000000000000000001330756104600330665ustar00rootroot00000000000000forkConsoleOutput/000077500000000000000000000000001330756104600365145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutput/src/test/javaTest1.java000066400000000000000000000025551330756104600403660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutput/src/test/java/forkConsoleOutputpackage forkConsoleOutput; /* * 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. */ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class Test1 { @Test public void test6281() { System.out.println( "Test1 on" + Thread.currentThread().getName()); } @BeforeClass public static void testWithFailingAssumption2() { System.out.println( "BeforeTest1 on" + Thread.currentThread().getName()); } @AfterClass public static void testWithFailingAssumption3() { System.out.println( "AfterTest1 on" + Thread.currentThread().getName()); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutputWithErrors/000077500000000000000000000000001330756104600324305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutputWithErrors/pom.xml000066400000000000000000000033511330756104600337470ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire fork-consoleOutput jar 1.0-SNAPSHOT fork-consoleOutput http://maven.apache.org junit junit ${junit.version} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${forkMode} ${printSummary} ${userFile} ${reportFormat} ${redirect.to.file} **/Test*.java 4.8.1 true once true true brief 1.6 1.6 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutputWithErrors/src/000077500000000000000000000000001330756104600332175ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600341175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutputWithErrors/srcjava/000077500000000000000000000000001330756104600350405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutputWithErrors/src/testforkConsoleOutput/000077500000000000000000000000001330756104600405455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutputWithErrors/src/test/javaTest1.java000066400000000000000000000025551330756104600424170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutputWithErrors/src/test/java/forkConsoleOutputpackage forkConsoleOutput; /* * 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. */ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class Test1 { @Test public void test6281() { System.out.println( "Test1 on" + Thread.currentThread().getName()); } @BeforeClass public static void testWithFailingAssumption2() { System.out.println( "BeforeTest1 on" + Thread.currentThread().getName()); } @AfterClass public static void testWithFailingAssumption3() { System.out.println( "AfterTest1 on" + Thread.currentThread().getName()); } } Test2.java000066400000000000000000000022621330756104600424130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-consoleOutputWithErrors/src/test/java/forkConsoleOutputpackage forkConsoleOutput; /* * 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. */ import org.junit.Test; public class Test2 { @Test public void test6281() { System.out.println( "sout: I am talking to you" ); System.out.println( "sout: Will Fail soon" ); System.err.println( "serr: And you too" ); System.err.println( "serr: Will Fail now" ); throw new RuntimeException( "FailHere" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-fail/000077500000000000000000000000001330756104600264275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-fail/pom.xml000066400000000000000000000040131330756104600277420ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire fork-fail 1.0-SNAPSHOT Test for failing fork -Xmxxxx712743m 1.6 1.6 maven-surefire-plugin ${surefire.version} once ${argLine} true junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-fail/src/000077500000000000000000000000001330756104600272165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-fail/src/test/000077500000000000000000000000001330756104600301755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-fail/src/test/java/000077500000000000000000000000001330756104600311165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-fail/src/test/java/forkMode/000077500000000000000000000000001330756104600326645ustar00rootroot00000000000000Test1.java000066400000000000000000000034361330756104600344560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-fail/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.lang.management.ManagementFactory; import junit.framework.TestCase; public class Test1 extends TestCase { public void test1() throws IOException { dumpPidFile( this ); } public static void dumpPidFile( TestCase test ) throws IOException { String fileName = test.getName() + "-pid"; File target = new File( "target" ); if ( !( target.exists() && target.isDirectory() ) ) { target = new File( "." ); } File pidFile = new File( target, fileName ); FileWriter fw = new FileWriter( pidFile ); // DGF little known trick... this is guaranteed to be unique to the PID // In fact, it usually contains the pid and the local host name! String pid = ManagementFactory.getRuntimeMXBean().getName(); fw.write( pid ); fw.flush(); fw.close(); } } Test2.java000066400000000000000000000017771330756104600344650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-fail/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.IOException; import junit.framework.TestCase; public class Test2 extends TestCase { public void test2() throws IOException { Test1.dumpPidFile(this); } } Test3.java000066400000000000000000000017771330756104600344660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-fail/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.IOException; import junit.framework.TestCase; public class Test3 extends TestCase { public void test3() throws IOException { Test1.dumpPidFile(this); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/000077500000000000000000000000001330756104600307765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-a/000077500000000000000000000000001330756104600325015ustar00rootroot00000000000000pom.xml000066400000000000000000000026461330756104600337470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-a 4.0.0 org.apache.maven.plugins.surefire fork-mode-multimodule 1.0-SNAPSHOT org.apache.maven.plugins.surefire fork-mode-multimodule.module-a Test for forkMode Module A maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-a/src/000077500000000000000000000000001330756104600332705ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600341705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-a/srcjava/000077500000000000000000000000001330756104600351115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-a/src/testforkMode/000077500000000000000000000000001330756104600366575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-a/src/test/javaTest1.java000066400000000000000000000044201330756104600405220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-a/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.lang.management.ManagementFactory; import java.util.Random; import junit.framework.TestCase; public class Test1 extends TestCase { private static final Random RANDOM = new Random(); public void test1() throws IOException, InterruptedException { int sleepLength = Integer.valueOf( System.getProperty( "sleepLength", "1500" )); Thread.sleep(sleepLength); dumpPidFile( this ); } public static void dumpPidFile( TestCase test ) throws IOException { String fileName = test.getName() + "-pid"; File target = new File( "target" ).getCanonicalFile(); // getCanonicalFile required for embedded mode if ( !( target.exists() && target.isDirectory() ) ) { target = new File( "." ); } File pidFile = new File( target, fileName ); FileWriter fw = new FileWriter( pidFile ); // DGF little known trick... this is guaranteed to be unique to the PID // In fact, it usually contains the pid and the local host name! String pid = ManagementFactory.getRuntimeMXBean().getName(); fw.write( pid ); fw.write( " " ); fw.write( System.getProperty( "testProperty", String.valueOf( RANDOM.nextLong() ) ) ); fw.flush(); fw.close(); System.out.println( "Done Writing pid file" + pidFile.getAbsolutePath() ); } } Test2.java000066400000000000000000000022211330756104600405200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-a/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.IOException; import junit.framework.TestCase; public class Test2 extends TestCase { public void test2() throws IOException, InterruptedException { int sleepLength = Integer.valueOf( System.getProperty( "sleepLength", "1500" )); Thread.sleep(sleepLength); Test1.dumpPidFile(this); } } Test3.java000066400000000000000000000017771330756104600405400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-a/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.IOException; import junit.framework.TestCase; public class Test3 extends TestCase { public void test3() throws IOException { Test1.dumpPidFile(this); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-b/000077500000000000000000000000001330756104600325025ustar00rootroot00000000000000pom.xml000066400000000000000000000026461330756104600337500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-b 4.0.0 org.apache.maven.plugins.surefire fork-mode-multimodule 1.0-SNAPSHOT org.apache.maven.plugins.surefire fork-mode-multimodule.module-b Test for forkMode Module B maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-b/src/000077500000000000000000000000001330756104600332715ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600341715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-b/srcjava/000077500000000000000000000000001330756104600351125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-b/src/testforkMode/000077500000000000000000000000001330756104600366605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-b/src/test/javaTest1.java000066400000000000000000000044201330756104600405230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-b/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.lang.management.ManagementFactory; import java.util.Random; import junit.framework.TestCase; public class Test1 extends TestCase { private static final Random RANDOM = new Random(); public void test1() throws IOException, InterruptedException { int sleepLength = Integer.valueOf( System.getProperty( "sleepLength", "1500" )); Thread.sleep(sleepLength); dumpPidFile( this ); } public static void dumpPidFile( TestCase test ) throws IOException { String fileName = test.getName() + "-pid"; File target = new File( "target" ).getCanonicalFile(); // getCanonicalFile required for embedded mode if ( !( target.exists() && target.isDirectory() ) ) { target = new File( "." ); } File pidFile = new File( target, fileName ); FileWriter fw = new FileWriter( pidFile ); // DGF little known trick... this is guaranteed to be unique to the PID // In fact, it usually contains the pid and the local host name! String pid = ManagementFactory.getRuntimeMXBean().getName(); fw.write( pid ); fw.write( " " ); fw.write( System.getProperty( "testProperty", String.valueOf( RANDOM.nextLong() ) ) ); fw.flush(); fw.close(); System.out.println( "Done Writing pid file" + pidFile.getAbsolutePath() ); } } Test2.java000066400000000000000000000022211330756104600405210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-b/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.IOException; import junit.framework.TestCase; public class Test2 extends TestCase { public void test2() throws IOException, InterruptedException { int sleepLength = Integer.valueOf( System.getProperty( "sleepLength", "1500" )); Thread.sleep(sleepLength); Test1.dumpPidFile(this); } } Test3.java000066400000000000000000000017771330756104600405410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/module-b/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.IOException; import junit.framework.TestCase; public class Test3 extends TestCase { public void test3() throws IOException { Test1.dumpPidFile(this); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-multimodule/pom.xml000066400000000000000000000041521330756104600323150ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire fork-mode-multimodule 1.0-SNAPSHOT Test for forkMode Multimodule pom 1.6 1.6 module-a module-b maven-surefire-plugin ${surefire.version} ${forkMode} ${threadCount} alphabetical junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-resource-loading/000077500000000000000000000000001330756104600317005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-resource-loading/pom.xml000066400000000000000000000034611330756104600332210ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire fork-mode-resource-loading 1.0-SNAPSHOT Test for forkMode 1.6 1.6 maven-surefire-plugin ${surefire.version} junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-resource-loading/src/000077500000000000000000000000001330756104600324675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-resource-loading/src/test/000077500000000000000000000000001330756104600334465ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600343105ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-resource-loading/src/testforkMode/000077500000000000000000000000001330756104600360565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-resource-loading/src/test/javaResourceLoadTest.java000066400000000000000000000031311330756104600421460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-resource-loading/src/test/java/forkModepackage forkMode; /* * 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. */ import junit.framework.TestCase; import java.io.IOException; import java.io.InputStream; import java.net.URL; public class ResourceLoadTest extends TestCase { public void testGetResourceUrl() throws IOException { final URL resource = this.getClass().getClassLoader().getResource( "myFile.txt" ); assertNotNull( resource ); } public void testGetResource() throws IOException { final InputStream resource = this.getClass().getClassLoader().getResourceAsStream( "myFile.txt" ); assertNotNull( resource ); } public void testGetResourceThreadLoader() throws IOException { final InputStream resource = Thread.currentThread().getContextClassLoader().getResourceAsStream( "myFile.txt" ); assertNotNull( resource ); } } resources/000077500000000000000000000000001330756104600354015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-resource-loading/src/testmyFile.txt000066400000000000000000000000071330756104600373640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-resource-loading/src/test/resourcesA file maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-testng/000077500000000000000000000000001330756104600277425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-testng/pom.xml000066400000000000000000000042561330756104600312660ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire fork-mode-testng 1.0-SNAPSHOT Test for forkMode 1.6 1.6 maven-surefire-plugin ${surefire.version} ${forkMode} ${threadCount} org.testng testng 5.7 jdk15 test junit junit maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-testng/src/000077500000000000000000000000001330756104600305315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-testng/src/test/000077500000000000000000000000001330756104600315105ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-testng/src/test/java/000077500000000000000000000000001330756104600324315ustar00rootroot00000000000000forkMode/000077500000000000000000000000001330756104600341205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-testng/src/test/javaTest1.java000066400000000000000000000041701330756104600357650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-testng/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.lang.management.ManagementFactory; import java.util.Random; import org.testng.annotations.Test; public class Test1 { private static final Random RANDOM = new Random(); @Test public void test1() throws IOException, InterruptedException { int sleepLength = Integer.valueOf( System.getProperty( "sleepLength", "750" )); Thread.sleep(sleepLength); dumpPidFile( "test1" ); } public static void dumpPidFile( String name ) throws IOException { String fileName = name + "-pid"; File target = new File( "target" ).getCanonicalFile(); if ( !( target.exists() && target.isDirectory() ) ) { target = new File( "." ); } File pidFile = new File( target, fileName ); FileWriter fw = new FileWriter( pidFile ); // DGF little known trick... this is guaranteed to be unique to the PID // In fact, it usually contains the pid and the local host name! String pid = ManagementFactory.getRuntimeMXBean().getName(); fw.write( pid ); fw.write( " " ); fw.write( System.getProperty( "testProperty", String.valueOf( RANDOM.nextLong() ) ) ); fw.flush(); fw.close(); } } Test2.java000066400000000000000000000017731330756104600357740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-testng/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.IOException; import org.testng.annotations.Test; public class Test2 { @Test public void test2() throws IOException { Test1.dumpPidFile( "test2" ); } } Test3.java000066400000000000000000000017741330756104600357760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode-testng/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.IOException; import org.testng.annotations.Test; public class Test3 { @Test public void test3() throws IOException { Test1.dumpPidFile( "test3" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode/000077500000000000000000000000001330756104600264405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode/pom.xml000066400000000000000000000037341330756104600277640ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire fork-mode 1.0-SNAPSHOT Test for forkMode 1.6 1.6 maven-surefire-plugin ${surefire.version} ${forkMode} ${threadCount} alphabetical junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode/src/000077500000000000000000000000001330756104600272275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode/src/test/000077500000000000000000000000001330756104600302065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode/src/test/java/000077500000000000000000000000001330756104600311275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode/src/test/java/forkMode/000077500000000000000000000000001330756104600326755ustar00rootroot00000000000000Test1.java000066400000000000000000000044471330756104600344720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.lang.management.ManagementFactory; import java.util.Random; import junit.framework.TestCase; public class Test1 extends TestCase { private static final Random RANDOM = new Random(); public void test1() throws Exception { int sleepLength = Integer.valueOf( System.getProperty( "sleepLength", "750" ) ); Thread.sleep( sleepLength ); dumpPidFile( this ); } public static void dumpPidFile( TestCase test ) throws IOException { String fileName = test.getName() + "-pid"; File target = new File( "target" ).getCanonicalFile(); // getCanonicalFile required for embedded mode if ( !target.exists() ) { target.mkdirs(); } File pidFile = new File( target, fileName ); if ( pidFile.exists() ) { pidFile.delete(); } FileWriter fw = new FileWriter( pidFile ); // DGF little known trick... this is guaranteed to be unique to the PID // In fact, it usually contains the pid and the local host name! String pid = ManagementFactory.getRuntimeMXBean().getName(); fw.write( pid ); fw.write( " " ); fw.write( System.getProperty( "testProperty", String.valueOf( RANDOM.nextLong() ) ) ); fw.flush(); fw.close(); System.out.println( "Done Writing pid file" + pidFile.getAbsolutePath() ); } } Test2.java000066400000000000000000000021731330756104600344650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.IOException; import junit.framework.TestCase; public class Test2 extends TestCase { public void test2() throws Exception { int sleepLength = Integer.valueOf( System.getProperty( "sleepLength", "750" ) ); Thread.sleep( sleepLength ); Test1.dumpPidFile(this); } } Test3.java000066400000000000000000000021731330756104600344660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-mode/src/test/java/forkModepackage forkMode; /* * 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. */ import java.io.IOException; import junit.framework.TestCase; public class Test3 extends TestCase { public void test3() throws Exception { int sleepLength = Integer.valueOf( System.getProperty( "sleepLength", "750" ) ); Thread.sleep( sleepLength ); Test1.dumpPidFile(this); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-timeout/000077500000000000000000000000001330756104600272025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-timeout/pom.xml000066400000000000000000000034171330756104600305240ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire fork-timeout-test jar 1.0-SNAPSHOT fork-timeout http://maven.apache.org 4.8.1 classes once 1 1.6 1.6 junit junit ${junit.version} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${forkMode} ${junit.parallel} 3 false true ${timeOut} plain true **/Test*.java maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-timeout/src/000077500000000000000000000000001330756104600277715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-timeout/src/test/000077500000000000000000000000001330756104600307505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-timeout/src/test/java/000077500000000000000000000000001330756104600316715ustar00rootroot00000000000000forktimeout/000077500000000000000000000000001330756104600341625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-timeout/src/test/javaBaseForkTimeout.java000066400000000000000000000032641330756104600400750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-timeout/src/test/java/forktimeoutpackage forktimeout; /* * 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. */ public abstract class BaseForkTimeout { protected void dumpStuff( String prefix ) { reallySleep( 990 ); for ( int i = 0; i < 200; i++ ) { System.out.println( prefix + " with lots of output " + i ); System.err.println( prefix + "e with lots of output " + i ); } System.out.println( prefix + "last line" ); System.err.println( prefix + "e last line" ); } private void reallySleep( long timeout ) { long endAt = System.currentTimeMillis() + timeout; try { Thread.sleep( timeout ); while ( System.currentTimeMillis() < endAt ) { Thread.yield(); Thread.sleep( 5 ); } } catch ( InterruptedException e ) { throw new RuntimeException( e ); } } } Test1.java000066400000000000000000000021121330756104600360210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-timeout/src/test/java/forktimeoutpackage forktimeout; /* * 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. */ import org.junit.Test; public class Test1 extends BaseForkTimeout { @Test public void test690() { dumpStuff( "test690" ); System.out.println( " with lots of output " ); System.err.println( "e with lots of output " ); } }Test2.java000066400000000000000000000017271330756104600360350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-timeout/src/test/java/forktimeoutpackage forktimeout; /* * 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. */ import org.junit.Test; public class Test2 extends BaseForkTimeout { @Test public void test690_2() { dumpStuff( "test690_2" ); } }Test3.java000066400000000000000000000017311330756104600360310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-timeout/src/test/java/forktimeoutpackage forktimeout; /* * 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. */ import org.junit.Test; public class Test3 extends BaseForkTimeout { @Test public void test690_3() { dumpStuff( "test690_3" ); } }Test4.java000066400000000000000000000017341330756104600360350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-timeout/src/test/java/forktimeoutpackage forktimeout; /* * 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. */ import org.junit.Test; public class Test4 extends BaseForkTimeout { @Test public void test690_4() { dumpStuff( "test690_4" ); } }Test5.java000066400000000000000000000017341330756104600360360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/fork-timeout/src/test/java/forktimeoutpackage forktimeout; /* * 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. */ import org.junit.Test; public class Test5 extends BaseForkTimeout { @Test public void test690_5() { dumpStuff( "test690_5" ); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file/000077500000000000000000000000001330756104600320535ustar00rootroot00000000000000common-excludes.txt000066400000000000000000000000431330756104600356340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file# common excludes **/DontRunTest.*path-includes.txt000066400000000000000000000000321330756104600352700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file# path includes */test/* maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file/pom.xml000066400000000000000000000107561330756104600334010ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire maven-it-includes-excludes 1.0-SNAPSHOT Maven Integration Test :: includes-excludes-from-file Test surefire inclusion/exclusions from files 3.8.2 1.6 1.6 junit junit ${junit.version} test maven-surefire-plugin ${surefire.version} simple maven-surefire-plugin ${project.basedir}/common-excludes.txt ${project.basedir}/simple-includes.txt simple-mixed maven-surefire-plugin ${project.basedir}/common-excludes.txt **/NotIncludedByDefault.java ${project.basedir}/simple-mixed-includes.txt regex maven-surefire-plugin ${project.basedir}/common-excludes.txt ${project.basedir}/regex-includes.txt path maven-surefire-plugin ${project.basedir}/common-excludes.txt ${project.basedir}/path-includes.txt missing-excludes-file maven-surefire-plugin ${project.basedir}/no-such-excludes-file ${project.basedir}/simple-includes.txt missing-includes-file maven-surefire-plugin ${project.basedir}/common-excludes.txt ${project.basedir}/no-such-includes-file regex-includes.txt000066400000000000000000000000521330756104600354500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file# regex includes %regex[.*Test.*|.*Not.*]simple-includes.txt000066400000000000000000000000751330756104600356340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file# simple includes **/NotIncludedByDefault.java **/*Test.javasimple-mixed-includes.txt000066400000000000000000000000461330756104600367360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file# simple-mixed includes **/*Test.javamaven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file/src/000077500000000000000000000000001330756104600326425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file/src/test/000077500000000000000000000000001330756104600336215ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600344635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file/src/testorg/000077500000000000000000000000001330756104600352525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file/src/test/javatest/000077500000000000000000000000001330756104600362315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file/src/test/java/orgDefaultTest.java000066400000000000000000000021361330756104600413220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file/src/test/java/org/testpackage org.test; /* * 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. */ import java.io.FileOutputStream; public class DefaultTest { public void testRun() throws Exception { FileOutputStream fout = new FileOutputStream( "target/defaultTestTouchFile.txt" ); fout.write( '!' ); fout.flush(); fout.close(); } } DontRunTest.java000066400000000000000000000017271330756104600413340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file/src/test/java/org/testpackage org.test; /* * 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. */ import junit.framework.TestCase; public class DontRunTest extends TestCase { public void testRun() { assertEquals(true, false); } } NotIncludedByDefault.java000066400000000000000000000021401330756104600431010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file/src/test/java/org/testpackage org.test; /* * 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. */ import java.io.FileOutputStream; public class NotIncludedByDefault { public void testRun() throws Exception { FileOutputStream fout = new FileOutputStream( "target/testTouchFile.txt" ); fout.write( '!' ); fout.flush(); fout.close(); } } aTestXmlFile.xml000066400000000000000000000015051330756104600413150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes-from-file/src/test/java/org/test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes/000077500000000000000000000000001330756104600301755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes/pom.xml000066400000000000000000000074371330756104600315250ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire maven-it-includes-excludes 1.0-SNAPSHOT Maven Integration Test :: includes-excludes Test surefire inclusion/exclusions 3.8.2 1.6 1.6 junit junit ${junit.version} test maven-surefire-plugin ${surefire.version} simple maven-surefire-plugin **/DontRunTest.* **/NotIncludedByDefault.java **/*Test.java regex maven-surefire-plugin **/DontRunTest.* %regex[.*Test.*|.*Not.*] path maven-surefire-plugin **/DontRunTest.java */test/* withXmlFile maven-surefire-plugin **/DontRunTest.java **/*.xml maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes/src/000077500000000000000000000000001330756104600307645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes/src/test/000077500000000000000000000000001330756104600317435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes/src/test/java/000077500000000000000000000000001330756104600326645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes/src/test/java/org/000077500000000000000000000000001330756104600334535ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600343535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes/src/test/java/orgDefaultTest.java000066400000000000000000000021361330756104600374440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes/src/test/java/org/testpackage org.test; /* * 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. */ import java.io.FileOutputStream; public class DefaultTest { public void testRun() throws Exception { FileOutputStream fout = new FileOutputStream( "target/defaultTestTouchFile.txt" ); fout.write( '!' ); fout.flush(); fout.close(); } } DontRunTest.java000066400000000000000000000017271330756104600374560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes/src/test/java/org/testpackage org.test; /* * 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. */ import junit.framework.TestCase; public class DontRunTest extends TestCase { public void testRun() { assertEquals(true, false); } } NotIncludedByDefault.java000066400000000000000000000021401330756104600412230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes/src/test/java/org/testpackage org.test; /* * 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. */ import java.io.FileOutputStream; public class NotIncludedByDefault { public void testRun() throws Exception { FileOutputStream fout = new FileOutputStream( "target/testTouchFile.txt" ); fout.write( '!' ); fout.flush(); fout.close(); } } aTestXmlFile.xml000066400000000000000000000015051330756104600374370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/includes-excludes/src/test/java/org/test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/isolated-classloader/000077500000000000000000000000001330756104600306535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/isolated-classloader/pom.xml000066400000000000000000000036521330756104600321760ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire isolated-classloader 1.0-SNAPSHOT Test for useSystemClassLoader=false 1.6 1.6 maven-surefire-plugin ${surefire.version} false junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/isolated-classloader/src/000077500000000000000000000000001330756104600314425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/isolated-classloader/src/test/000077500000000000000000000000001330756104600324215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/isolated-classloader/src/test/java/000077500000000000000000000000001330756104600333425ustar00rootroot00000000000000isolatedClassloader/000077500000000000000000000000001330756104600372445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/isolated-classloader/src/test/javaBasicTest.java000066400000000000000000000041611330756104600417720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/isolated-classloader/src/test/java/isolatedClassloaderpackage isolatedClassloader; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class BasicTest extends TestCase { private boolean setUpCalled = false; private static boolean tearDownCalled = false; public BasicTest( String name, String extraName ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite(); Test test = new BasicTest( "testSetUp", "dummy" ); suite.addTest( test ); return new TestSetup( suite ) { protected void setUp() { //oneTimeSetUp(); } protected void tearDown() { oneTimeTearDown(); } }; } protected void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } protected void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } public void testSetUp() { assertTrue( "setUp was not called", setUpCalled ); } public static void oneTimeTearDown() { assertTrue( "tearDown was not called", tearDownCalled ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/java9-full-api/000077500000000000000000000000001330756104600272765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/java9-full-api/pom.xml000066400000000000000000000110331330756104600306110ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml java9-full-api maven-surefire-plugin once maven-failsafe-plugin integration-test verify once junit junit 4.12 test javax.transaction javax.transaction-api 1.2 javax.xml.ws jaxws-api 2.3.0 javax.xml.bind jaxb-api 2.3.0 use-jvm-config-paramater jdk.home maven-surefire-plugin ${jdk.home}/bin/java use-toolchains org.apache.maven.plugins maven-toolchains-plugin 1.1 validate toolchain 9 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/java9-full-api/src/000077500000000000000000000000001330756104600300655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/java9-full-api/src/test/000077500000000000000000000000001330756104600310445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/java9-full-api/src/test/java/000077500000000000000000000000001330756104600317655ustar00rootroot00000000000000J9IT.java000066400000000000000000000033261330756104600332740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/java9-full-api/src/test/java/* * 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. */ import org.junit.Test; public class J9IT { @Test public void testMiscellaneousAPI() throws java.sql.SQLException { System.out.println( "loaded class " + java.sql.SQLException.class.getName() ); System.out.println( "loaded class " + javax.xml.ws.Holder.class.getName() ); System.out.println( "loaded class " + javax.xml.bind.JAXBException.class.getName() ); System.out.println( "loaded class " + javax.transaction.InvalidTransactionException.class.getName() ); System.out.println( "from classloader " + javax.transaction.InvalidTransactionException.class.getClassLoader() ); System.out.println( "loaded class " + javax.transaction.TransactionManager.class.getName() ); System.out.println( "loaded class " + javax.xml.xpath.XPath.class.getName() ); System.out.println( "java.specification.version=" + System.getProperty( "java.specification.version" ) ); } } J9Test.java000066400000000000000000000031361330756104600336760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/java9-full-api/src/test/java/* * 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. */ import org.junit.Test; public class J9Test { @Test public void testMiscellaneousAPI() throws java.sql.SQLException { System.out.println( "loaded class " + java.sql.SQLException.class.getName() ); System.out.println( "loaded class " + javax.xml.ws.Holder.class.getName() ); System.out.println( "loaded class " + javax.xml.bind.JAXBException.class.getName() ); System.out.println( "loaded class " + javax.transaction.InvalidTransactionException.class.getName() ); System.out.println( "loaded class " + javax.transaction.TransactionManager.class.getName() ); System.out.println( "loaded class " + javax.xml.xpath.XPath.class.getName() ); System.out.println( "java.specification.version=" + System.getProperty( "java.specification.version" ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-fork-mode-always/000077500000000000000000000000001330756104600310655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-fork-mode-always/pom.xml000066400000000000000000000036001330756104600324010ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire testng-fork-mode 1.0-SNAPSHOT Test for forkMode 1.6 1.6 maven-surefire-plugin ${surefire.version} ${forkMode} junit junit 4.8.2 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-fork-mode-always/src/000077500000000000000000000000001330756104600316545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-fork-mode-always/src/test/000077500000000000000000000000001330756104600326335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-fork-mode-always/src/test/java/000077500000000000000000000000001330756104600335545ustar00rootroot00000000000000junit4/000077500000000000000000000000001330756104600347125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-fork-mode-always/src/test/javaforkMode/000077500000000000000000000000001330756104600364605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-fork-mode-always/src/test/java/junit4Test1.java000066400000000000000000000034661330756104600403340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-fork-mode-always/src/test/java/junit4/forkModepackage junit4.forkMode; /* * 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. */ import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.lang.management.ManagementFactory; import org.junit.Test; public class Test1 { @Test public void test1() throws IOException { dumpPidFile( "test1" ); } public static void dumpPidFile( String name ) throws IOException { String fileName = name + "-pid"; File target = new File( "target" ); if ( !( target.exists() && target.isDirectory() ) ) { target = new File( "." ); } File pidFile = new File( target, fileName ); FileWriter fw = new FileWriter( pidFile ); // DGF little known trick... this is guaranteed to be unique to the PID // In fact, it usually contains the pid and the local host name! String pid = ManagementFactory.getRuntimeMXBean().getName(); fw.write( pid ); fw.flush(); fw.close(); System.out.println( "pid = " + pid ); } } Test2.java000066400000000000000000000020021330756104600403160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-fork-mode-always/src/test/java/junit4/forkModepackage junit4.forkMode; /* * 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. */ import java.io.IOException; import org.junit.Test; public class Test2 { @Test public void test2() throws IOException { Test1.dumpPidFile( "test2" ); } } Test3.java000066400000000000000000000020021330756104600403170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-fork-mode-always/src/test/java/junit4/forkModepackage junit4.forkMode; /* * 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. */ import java.io.IOException; import org.junit.Test; public class Test3 { @Test public void test3() throws IOException { Test1.dumpPidFile( "test3" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-ignore/000077500000000000000000000000001330756104600271675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-ignore/pom.xml000066400000000000000000000042311330756104600305040ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-ignore 1.0-SNAPSHOT Test of @Ignore annotation 4.4 3 1.6 1.6 junit junit ${junit.version} test maven-surefire-plugin ${surefire.version} ${surefire.parallel} false ${surefire.threadcount} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-ignore/src/000077500000000000000000000000001330756104600277565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-ignore/src/test/000077500000000000000000000000001330756104600307355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-ignore/src/test/java/000077500000000000000000000000001330756104600316565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-ignore/src/test/java/junit/000077500000000000000000000000001330756104600330075ustar00rootroot00000000000000ignore/000077500000000000000000000000001330756104600342135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-ignore/src/test/java/junitClassAndMethodIgnoreNothingToRunTest.java000066400000000000000000000021601330756104600442310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-ignore/src/test/java/junit/ignorepackage junit.ignore; /* * 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. */ import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; @Ignore( "ignore this test" ) public class ClassAndMethodIgnoreNothingToRunTest { @Ignore( "ignore this test" ) @Test public void testIgnorable() { Assert.fail( "you should have ignored me!" ); } } ClassLevelIgnore1WithMethodThatIsNormalTest.java000066400000000000000000000021251330756104600454630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-ignore/src/test/java/junit/ignorepackage junit.ignore; /* * 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. */ import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; @Ignore( "ignore this test" ) public class ClassLevelIgnore1WithMethodThatIsNormalTest { @Test public void testIgnorable() { Assert.fail( "you should have ignored me!" ); } } ClassLevelIgnore2WithMethodThatIsNormalTest.java000066400000000000000000000021251330756104600454640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-ignore/src/test/java/junit/ignorepackage junit.ignore; /* * 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. */ import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; @Ignore( "ignore this test" ) public class ClassLevelIgnore2WithMethodThatIsNormalTest { @Test public void testIgnorable() { Assert.fail( "you should have ignored me!" ); } } NormalClassWithThreeIgnoredMethodsAnd1AssumptionFailureTest.java000066400000000000000000000026031330756104600507140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-ignore/src/test/java/junit/ignorepackage junit.ignore; /* * 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. */ import org.junit.Assume; import org.junit.Ignore; import org.junit.Test; /** * @author Kristian Rosenvold */ public class NormalClassWithThreeIgnoredMethodsAnd1AssumptionFailureTest { @Ignore @Test public void testWithIgnore1() { } @Ignore("Ignorance is bliss2") @Test public void testWithIgnore2() { } @Ignore("Ignorance \"is\' <>bliss2") @Test public void testWithQuotesInIgnore() { } @Test public void testWithAssumptionFailure() { Assume.assumeNotNull( new Object[]{ null} ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-innerClass/000077500000000000000000000000001330756104600300055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-innerClass/pom.xml000066400000000000000000000035571330756104600313340ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-innerClass 1.0-SNAPSHOT Test JUnit classes with inner classes 1.6 1.6 junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-innerClass/src/000077500000000000000000000000001330756104600305745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-innerClass/src/test/000077500000000000000000000000001330756104600315535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-innerClass/src/test/java/000077500000000000000000000000001330756104600324745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-innerClass/src/test/java/junit/000077500000000000000000000000001330756104600336255ustar00rootroot00000000000000innerClass/000077500000000000000000000000001330756104600356475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-innerClass/src/test/java/junitBasicTest.java000066400000000000000000000020731330756104600403750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-innerClass/src/test/java/junit/innerClasspackage junit.innerClass; /* * 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. */ import junit.framework.TestCase; public class BasicTest extends TestCase { public void testFoo() { new Foo( "x", "y" ); } public class Foo { public Foo( String x, String y ) { } } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-notExtendingTestCase/000077500000000000000000000000001330756104600320065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-notExtendingTestCase/pom.xml000066400000000000000000000036031330756104600333250ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-notExtendingTestCase 1.0-SNAPSHOT Test for JUnit tests that don't extend TestCase 1.6 1.6 junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-notExtendingTestCase/src/000077500000000000000000000000001330756104600325755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-notExtendingTestCase/src/test/000077500000000000000000000000001330756104600335545ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600344165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-notExtendingTestCase/src/testjunit/000077500000000000000000000000001330756104600355475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-notExtendingTestCase/src/test/javanotExtendingTestCase/000077500000000000000000000000001330756104600416515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-notExtendingTestCase/src/test/java/junitSuiteTest.java000066400000000000000000000026331330756104600444510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-notExtendingTestCase/src/test/java/junit/notExtendingTestCasepackage junit.notExtendingTestCase; /* * 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. */ import junit.framework.Test; import junit.framework.TestResult; import junit.framework.TestSuite; public class SuiteTest extends TestSuite { public static Test suite() { SuiteTest suite = new SuiteTest(); suite.addTest( new Test() { public int countTestCases() { return 1; } public void run( TestResult result ) { result.startTest( this ); result.endTest( this ); } } ); return suite; } } TestHelper.java000066400000000000000000000016431330756104600445770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-notExtendingTestCase/src/test/java/junit/notExtendingTestCasepackage junit.notExtendingTestCase; /* * 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. */ public class TestHelper { public TestHelper(String two, String arguments) {} }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-pathWithUmlaut/000077500000000000000000000000001330756104600306645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-pathWithUmlaut/pom.xml000066400000000000000000000043221330756104600322020ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-path-with-umlaut 1.0-SNAPSHOT Test path with Ümlaut 1.6 1.6 junit junit 3.8.1 test maven-clean-plugin 3.0.0 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-pathWithUmlaut/src/000077500000000000000000000000001330756104600314535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-pathWithUmlaut/src/test/000077500000000000000000000000001330756104600324325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-pathWithUmlaut/src/test/java/000077500000000000000000000000001330756104600333535ustar00rootroot00000000000000umlautTest/000077500000000000000000000000001330756104600354435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-pathWithUmlaut/src/test/javaBasicTest.java000066400000000000000000000041511330756104600401700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-pathWithUmlaut/src/test/java/umlautTestpackage umlautTest; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class BasicTest extends TestCase { private boolean setUpCalled = false; private static boolean tearDownCalled = false; public BasicTest( String name, String extraName ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite(); Test test = new BasicTest( "testSetUp", "dummy" ); suite.addTest( test ); return new TestSetup( suite ) { protected void setUp() { //oneTimeSetUp(); } protected void tearDown() { oneTimeTearDown(); } }; } protected void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } protected void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } public void testSetUp() { assertTrue( "setUp was not called", setUpCalled ); } public static void oneTimeTearDown() { assertTrue( "tearDown was not called", tearDownCalled ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.0.0/000077500000000000000000000000001330756104600301625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.0.0/pom.xml000066400000000000000000000043771330756104600315120ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-platform-1.0.0 1.0 Test for JUnit 5: Platform 1.0.0 + Jupiter 5.0.0 1.8 1.8 org.junit.jupiter junit-jupiter-engine 5.0.0 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.0.0/src/000077500000000000000000000000001330756104600307515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.0.0/src/test/000077500000000000000000000000001330756104600317305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.0.0/src/test/java/000077500000000000000000000000001330756104600326515ustar00rootroot00000000000000junitplatform_1_0_0/000077500000000000000000000000001330756104600363465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.0.0/src/test/javaJUnitPlatform_1_0_0_Test.java000066400000000000000000000022051330756104600436230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.0.0/src/test/java/junitplatform_1_0_0package junitplatform_1_0_0; /* * 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. */ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; class JUnitPlatform_1_0_0_Test { @Test void test(TestInfo info) { assertEquals( "test(TestInfo)", info.getDisplayName(), "display name mismatch" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.1.1/000077500000000000000000000000001330756104600301645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.1.1/pom.xml000066400000000000000000000043771330756104600315140ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-platform-1.1.1 1.0 Test for JUnit 5: Platform 1.1.1 + Jupiter 5.1.1 1.8 1.8 org.junit.jupiter junit-jupiter-engine 5.1.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.1.1/src/000077500000000000000000000000001330756104600307535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.1.1/src/test/000077500000000000000000000000001330756104600317325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.1.1/src/test/java/000077500000000000000000000000001330756104600326535ustar00rootroot00000000000000junitplatform_1_1_1/000077500000000000000000000000001330756104600363525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.1.1/src/test/javaJUnitPlatform_1_1_1_Test.java000066400000000000000000000022051330756104600436310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.1.1/src/test/java/junitplatform_1_1_1package junitplatform_1_1_1; /* * 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. */ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; class JUnitPlatform_1_1_1_Test { @Test void test(TestInfo info) { assertEquals( "test(TestInfo)", info.getDisplayName(), "display name mismatch" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.2.0/000077500000000000000000000000001330756104600301645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.2.0/pom.xml000066400000000000000000000043771330756104600315140ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-platform-1.2.0 1.0 Test for JUnit 5: Platform 1.2.0 + Jupiter 5.2.0 1.8 1.8 org.junit.jupiter junit-jupiter-engine 5.2.0 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.2.0/src/000077500000000000000000000000001330756104600307535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.2.0/src/test/000077500000000000000000000000001330756104600317325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.2.0/src/test/java/000077500000000000000000000000001330756104600326535ustar00rootroot00000000000000junitplatform_1_2_0/000077500000000000000000000000001330756104600363525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.2.0/src/test/javaJUnitPlatform_1_2_0_Test.java000066400000000000000000000022051330756104600436310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-1.2.0/src/test/java/junitplatform_1_2_0package junitplatform_1_2_0; /* * 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. */ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; class JUnitPlatform_1_2_0_Test { @Test void test(TestInfo info) { assertEquals( "test(TestInfo)", info.getDisplayName(), "display name mismatch" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-jqwik/000077500000000000000000000000001330756104600321165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-jqwik/pom.xml000066400000000000000000000042411330756104600334340ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-platform-engine-jqwik 1.0 Test for JUnit 5: Platform + JQwik 1.8 1.8 net.jqwik jqwik 0.8.10 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-jqwik/src/000077500000000000000000000000001330756104600327055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-jqwik/src/test/000077500000000000000000000000001330756104600336645ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600345265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-jqwik/src/testjunitplatformenginejqwik/000077500000000000000000000000001330756104600416605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-jqwik/src/test/javaBasicJQwikTest.java000066400000000000000000000017461330756104600453620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-jqwik/src/test/java/junitplatformenginejqwikpackage junitplatformenginejqwik; /* * 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. */ import net.jqwik.api.Example; class BasicJQwikTest { @Example boolean exampleFor1Plus3Equals4() { return ( 1 + 3 ) == 4; } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-jupiter/000077500000000000000000000000001330756104600324535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-jupiter/pom.xml000066400000000000000000000050721330756104600337740ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-platform-engine-jupiter 1.0 Test for JUnit 5: Platform + Jupiter 1.8 1.8 5.2.0 org.junit.jupiter junit-jupiter-engine ${junit.jupiter.version} test org.junit.jupiter junit-jupiter-params ${junit.jupiter.version} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-jupiter/src/000077500000000000000000000000001330756104600332425ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600341425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-jupiter/srcjava/000077500000000000000000000000001330756104600350635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-jupiter/src/testjunitplatformenginejupiter/000077500000000000000000000000001330756104600425525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-jupiter/src/test/javaBasicJupiterTest.java000066400000000000000000000045241330756104600466460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-jupiter/src/test/java/junitplatformenginejupiterpackage junitplatformenginejupiter; /* * 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. */ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; class BasicJupiterTest { private boolean setUpCalled; private static boolean tearDownCalled; @BeforeEach void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @AfterEach void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test void test(TestInfo info) { assertTrue( setUpCalled, "setUp was not called" ); assertEquals( "test(TestInfo)", info.getDisplayName(), "display name mismatch" ); } @ParameterizedTest(name = "{0} + {1} = {2}") @CsvSource({ "0, 1, 1", "1, 2, 3", "49, 51, 100", "1, 100, 101" }) void add(int first, int second, int expectedResult) { assertEquals(expectedResult, first + second, () -> first + " + " + second + " should equal " + expectedResult); } @AfterAll static void oneTimeTearDown() { assertTrue( tearDownCalled ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-vintage/000077500000000000000000000000001330756104600324265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-vintage/pom.xml000066400000000000000000000043661330756104600337540ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-platform-engine-vintage 1.0 Test for JUnit 5: Platform + Vintage 1.8 1.8 org.junit.vintage junit-vintage-engine 5.2.0 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-vintage/src/000077500000000000000000000000001330756104600332155ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600341155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-vintage/srcjava/000077500000000000000000000000001330756104600350365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-vintage/src/testjunitplatformenginevintage/000077500000000000000000000000001330756104600425005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-vintage/src/test/javaBasicVintageTest.java000066400000000000000000000032161330756104600465440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-engine-vintage/src/test/java/junitplatformenginevintagepackage junitplatformenginevintage; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class BasicVintageTest { private static boolean tearDownCalled = false; private boolean setUpCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @AfterClass public static void oneTimeTearDown() { Assert.assertTrue( "tearDown was not called", tearDownCalled ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-multiple-engines/000077500000000000000000000000001330756104600330075ustar00rootroot00000000000000pom.xml000066400000000000000000000052071330756104600342510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-multiple-engines 4.0.0 org.apache.maven.plugins.surefire junit-platform-multiple-engines 1.0 Test for JUnit 5: Platform hosting multiple test engines 1.8 1.8 org.junit.jupiter junit-jupiter-engine 5.2.0 test org.junit.jupiter junit-jupiter-params 5.2.0 test org.junit.vintage junit-vintage-engine 5.2.0 test net.jqwik jqwik 0.8.10 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-multiple-engines/src/000077500000000000000000000000001330756104600335765ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600344765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-multiple-engines/srcjava/000077500000000000000000000000001330756104600354175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-multiple-engines/src/testjunitplatformenginejqwik/000077500000000000000000000000001330756104600425515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-multiple-engines/src/test/javaBasicJQwikTest.java000066400000000000000000000017461330756104600462530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-multiple-engines/src/test/java/junitplatformenginejqwikpackage junitplatformenginejqwik; /* * 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. */ import net.jqwik.api.Example; class BasicJQwikTest { @Example boolean exampleFor1Plus3Equals4() { return ( 1 + 3 ) == 4; } } junitplatformenginejupiter/000077500000000000000000000000001330756104600431065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-multiple-engines/src/test/javaBasicJupiterTest.java000066400000000000000000000045241330756104600472020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-multiple-engines/src/test/java/junitplatformenginejupiterpackage junitplatformenginejupiter; /* * 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. */ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; class BasicJupiterTest { private boolean setUpCalled; private static boolean tearDownCalled; @BeforeEach void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @AfterEach void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test void test(TestInfo info) { assertTrue( setUpCalled, "setUp was not called" ); assertEquals( "test(TestInfo)", info.getDisplayName(), "display name mismatch" ); } @ParameterizedTest(name = "{0} + {1} = {2}") @CsvSource({ "0, 1, 1", "1, 2, 3", "49, 51, 100", "1, 100, 101" }) void add(int first, int second, int expectedResult) { assertEquals(expectedResult, first + second, () -> first + " + " + second + " should equal " + expectedResult); } @AfterAll static void oneTimeTearDown() { assertTrue( tearDownCalled ); } } junitplatformenginevintage/000077500000000000000000000000001330756104600430615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-multiple-engines/src/test/javaBasicVintageTest.java000066400000000000000000000032161330756104600471250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-multiple-engines/src/test/java/junitplatformenginevintagepackage junitplatformenginevintage; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class BasicVintageTest { private static boolean tearDownCalled = false; private boolean setUpCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @AfterClass public static void oneTimeTearDown() { Assert.assertTrue( "tearDown was not called", tearDownCalled ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-tags/000077500000000000000000000000001330756104600304645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-tags/pom.xml000066400000000000000000000041611330756104600320030ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-platform-tags 1.0 1.8 1.8 org.junit.jupiter junit-jupiter-engine 5.2.0 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} run maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-tags/src/000077500000000000000000000000001330756104600312535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-tags/src/test/000077500000000000000000000000001330756104600322325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-tags/src/test/java/000077500000000000000000000000001330756104600331535ustar00rootroot00000000000000tags/000077500000000000000000000000001330756104600340325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-tags/src/test/javaJUnitPlatformWithTagsTest.java000066400000000000000000000024051330756104600417470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-platform-tags/src/test/java/tagspackage tags; /* * 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. */ import static org.junit.jupiter.api.Assertions.fail; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; class JUnitPlatformWithTagsTest { @Test @Tag("run") void run() { } @Test @Tag("don't") @Tag("run") void dontRun() { fail(); } @Test @Tag("don't") @Tag("run") @Tag("forced") void doRun() { } @Test void tagless() { fail(); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCaseSuite/000077500000000000000000000000001330756104600311635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCaseSuite/pom.xml000066400000000000000000000037311330756104600325040ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-twoTestCaseSuite 1.0-SNAPSHOT Test for single suite with two test cases 1.6 1.6 maven-surefire-plugin ${surefire.version} **/WrapperTestSuite.java junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCaseSuite/src/000077500000000000000000000000001330756104600317525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCaseSuite/src/test/000077500000000000000000000000001330756104600327315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCaseSuite/src/test/java/000077500000000000000000000000001330756104600336525ustar00rootroot00000000000000junit/000077500000000000000000000000001330756104600347245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCaseSuite/src/test/javatwoTestCaseSuite/000077500000000000000000000000001330756104600402035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCaseSuite/src/test/java/junitBasicTest.java000066400000000000000000000041641330756104600427340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCaseSuite/src/test/java/junit/twoTestCaseSuitepackage junit.twoTestCaseSuite; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class BasicTest extends TestCase { private boolean setUpCalled = false; private static boolean tearDownCalled = false; public BasicTest( String name, String extraName ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite(); Test test = new BasicTest( "testSetUp", "dummy" ); suite.addTest( test ); return new TestSetup( suite ) { protected void setUp() { //oneTimeSetUp(); } protected void tearDown() { oneTimeTearDown(); } }; } protected void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } protected void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } public void testSetUp() { assertTrue( "setUp was not called", setUpCalled ); } public static void oneTimeTearDown() { assertTrue( "tearDown was not called", tearDownCalled ); } } TestTwo.java000066400000000000000000000016721330756104600424650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCaseSuite/src/test/java/junit/twoTestCaseSuitepackage junit.twoTestCaseSuite; /* * 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. */ import junit.framework.TestCase; public class TestTwo extends TestCase { public void testTwo() {} } WrapperTestSuite.java000066400000000000000000000023771330756104600443510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCaseSuite/src/test/java/junit/twoTestCaseSuitepackage junit.twoTestCaseSuite; /* * 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. */ import junit.framework.Test; import junit.framework.TestSuite; public class WrapperTestSuite extends TestSuite { public WrapperTestSuite( String name ) { super( name ); } public static Test suite() { WrapperTestSuite suite = new WrapperTestSuite( "My Acceptance Test Suite" ); suite.addTestSuite( TestTwo.class ); suite.addTest( BasicTest.suite() ); return suite; } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCases/000077500000000000000000000000001330756104600303345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCases/pom.xml000066400000000000000000000035431330756104600316560ustar00rootroot00000000000000 4.0.0 1.6 1.6 org.apache.maven.plugins.surefire junit-twoTestCases 1.0-SNAPSHOT Test for two test cases junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCases/src/000077500000000000000000000000001330756104600311235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCases/src/test/000077500000000000000000000000001330756104600321025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCases/src/test/java/000077500000000000000000000000001330756104600330235ustar00rootroot00000000000000junit/000077500000000000000000000000001330756104600340755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCases/src/test/javatwoTestCases/000077500000000000000000000000001330756104600365255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCases/src/test/java/junitBasicTest.java000066400000000000000000000041251330756104600412530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCases/src/test/java/junit/twoTestCasespackage junit.twoTestCases; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class BasicTest extends TestCase { private boolean setUpCalled = false; private static boolean tearDownCalled = false; public BasicTest( String name ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite(); Test test = new BasicTest( "testSetUp" ); suite.addTest( test ); return new TestSetup( suite ) { protected void setUp() { //oneTimeSetUp(); } protected void tearDown() { oneTimeTearDown(); } }; } protected void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } protected void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } public void testSetUp() { assertTrue( "setUp was not called", setUpCalled ); } public static void oneTimeTearDown() { assertTrue( "tearDown was not called", tearDownCalled ); } } TestTwo.java000066400000000000000000000016661330756104600410120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit-twoTestCases/src/test/java/junit/twoTestCasespackage junit.twoTestCases; /* * 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. */ import junit.framework.TestCase; public class TestTwo extends TestCase { public void testTwo() {} } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-forkAlways-staticInit/000077500000000000000000000000001330756104600322235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-forkAlways-staticInit/pom.xml000066400000000000000000000023441330756104600335430ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire.test junit4-forkAlways-staticInit 1.0-SNAPSHOT JUnit4 ForkAlways StaticInit Pollution Test that static initializers on classes other than the one being executed in the current test-set will not be run, and cannot pollute the environment. 1.6 1.6 junit junit 4.5 test maven-surefire-plugin ${surefire.version} always maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-forkAlways-staticInit/src/000077500000000000000000000000001330756104600330125ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600337125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-forkAlways-staticInit/srcjava/000077500000000000000000000000001330756104600346335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-forkAlways-staticInit/src/testjunit4/000077500000000000000000000000001330756104600360505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-forkAlways-staticInit/src/test/javaApp2Test.java000066400000000000000000000027251330756104600403630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-forkAlways-staticInit/src/test/java/junit4package junit4; /* * 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. */ import java.util.Properties; import junit.framework.TestCase; /** * Unit test for simple App. */ public class App2Test extends TestCase { static { System.out.println( "Loading " + App2Test.class.getName() ); Properties p = System.getProperties(); p.setProperty( "Foo", "Bar2" ); System.setProperties( p ); } /** * Rigourous Test :-) */ public void testApp() { System.out.println( "Expecting: Bar2\nGot: " + System.getProperty( "Foo" ) ); assertEquals( "Expecting: Bar2\nGot: " + System.getProperty( "Foo" ), "Bar2", System.getProperty( "Foo" ) ); } } AppTest.java000066400000000000000000000027171330756104600403020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-forkAlways-staticInit/src/test/java/junit4package junit4; /* * 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. */ import java.util.Properties; import junit.framework.TestCase; /** * Unit test for simple App. */ public class AppTest extends TestCase { static { System.out.println( "Loading " + AppTest.class.getName() ); Properties p = System.getProperties(); p.setProperty( "Foo", "Bar" ); System.setProperties( p ); } /** * Rigourous Test :-) */ public void testApp() { System.out.println( "Expecting: Bar\nGot: " + System.getProperty( "Foo" ) ); assertEquals( "Expecting: Bar\nGot: " + System.getProperty( "Foo" ), "Bar", System.getProperty( "Foo" ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-rerun-failing-tests/000077500000000000000000000000001330756104600316725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-rerun-failing-tests/pom.xml000066400000000000000000000036061330756104600332140ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit4-rerun-failing-tests 1.0-SNAPSHOT Test for rerun failing tests in JUnit 4 1.6 1.6 junit junit ${junit.version} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-rerun-failing-tests/src/000077500000000000000000000000001330756104600324615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-rerun-failing-tests/src/test/000077500000000000000000000000001330756104600334405ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600343025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-rerun-failing-tests/src/testjunit4/000077500000000000000000000000001330756104600355175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-rerun-failing-tests/src/test/javaFlakyFirstTimeTest.java000066400000000000000000000033261330756104600421230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-rerun-failing-tests/src/test/java/junit4package junit4; /* * 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. */ import org.junit.Assert; import org.junit.Test; public class FlakyFirstTimeTest { private static int failingCount = 0; private static int errorCount = 0; @Test public void testFailingTestOne() { System.out.println( "Failing test" ); // This test will fail with only one retry, but will pass with two if ( failingCount < 2 ) { failingCount++; Assert.fail( "Failing test" ); } } @Test public void testErrorTestOne() throws Exception { System.out.println( "Error test" ); // This test will error out with only one retry, but will pass with two if ( errorCount < 2 ) { errorCount++; throw new IllegalArgumentException("..."); } } @Test public void testPassingTest() throws Exception { System.out.println( "Passing test" ); } } PassingTest.java000066400000000000000000000021671330756104600406340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-rerun-failing-tests/src/test/java/junit4package junit4; /* * 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. */ import org.junit.Assert; import org.junit.Test; public class PassingTest { @Test public void testPassingTestOne() { System.out.println( "Passing test one" ); } @Test public void testPassingTestTwo() throws Exception { System.out.println( "Passing test two" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-runlistener/000077500000000000000000000000001330756104600303425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-runlistener/pom.xml000066400000000000000000000047541330756104600316710ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit4-runlistener 1.0-SNAPSHOT JUnit4 RunListener test 4.4 surefire-junit4 1.6 1.6 junit junit ${junitVersion} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} listener runListener.FileWritingRunListener1,runListener.FileWritingRunListener2,runListener.EchoingRunListener org.apache.maven.surefire ${provider} ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-runlistener/src/000077500000000000000000000000001330756104600311315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-runlistener/src/test/000077500000000000000000000000001330756104600321105ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-runlistener/src/test/java/000077500000000000000000000000001330756104600330315ustar00rootroot00000000000000runListener/000077500000000000000000000000001330756104600352645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-runlistener/src/test/javaEchoingRunListener.java000066400000000000000000000045341330756104600417040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-runlistener/src/test/java/runListenerpackage runListener; /* * 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. */ import org.junit.runner.Description; import org.junit.runner.Result; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunListener; /** * {@link org.junit.runner.notification.RunListener} to generate an output file whose existence can be checked by surefire-integration. * * @author Matthew Gilliard */ public class EchoingRunListener extends RunListener { @Override public void testRunStarted( Description description ) throws Exception { System.out.println("testRunStarted " + description); } @Override public void testRunFinished( Result result ) throws Exception { System.out.println("testRunFinished " + result); } @Override public void testStarted( Description description ) throws Exception { System.out.println("testStarted " + description); } @Override public void testFinished( Description description ) throws Exception { System.out.println("testFinished " + description); } @Override public void testFailure( Failure failure ) throws Exception { System.out.println("testFailure " + failure); } @Override public void testIgnored( Description description ) throws Exception { System.out.println("testIgnored " + description); } public void testAssumptionFailure( Failure failure ) { System.out.println("testAssumptionFailure " + failure); } } FileHelper.java000066400000000000000000000026201330756104600401460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-runlistener/src/test/java/runListenerpackage runListener; /* * 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. */ import java.io.File; import java.io.FileWriter; import java.io.IOException; public class FileHelper { public static void writeFile( String fileName, String content ) { try { File target = new File( "target" ).getAbsoluteFile(); File listenerOutput = new File( target, fileName ); FileWriter out = new FileWriter( listenerOutput ); out.write( content ); out.flush(); out.close(); } catch ( IOException e ) { throw new RuntimeException( e ); } } } FileWritingRunListener1.java000066400000000000000000000025271330756104600426340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-runlistener/src/test/java/runListenerpackage runListener; /* * 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. */ import org.junit.runner.Description; import org.junit.runner.notification.RunListener; /** * {@link RunListener} to generate an output file whose existence can be checked by surefire-integration. * * @author Matthew Gilliard */ public class FileWritingRunListener1 extends RunListener { @Override public void testStarted( Description description ) { FileHelper.writeFile( "runlistener-output-1.txt", "This written by RunListener#testStarted()" ); } } FileWritingRunListener2.java000066400000000000000000000025271330756104600426350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-runlistener/src/test/java/runListenerpackage runListener; /* * 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. */ import org.junit.runner.Description; import org.junit.runner.notification.RunListener; /** * {@link RunListener} to generate an output file whose existence can be checked by surefire-integration. * * @author Matthew Gilliard */ public class FileWritingRunListener2 extends RunListener { @Override public void testStarted( Description description ) { FileHelper.writeFile( "runlistener-output-2.txt", "This written by RunListener#testStarted()" ); } } JUnit4RunListenerTest.java000066400000000000000000000017441330756104600423050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-runlistener/src/test/java/runListenerpackage runListener; /* * 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. */ import org.junit.Assert; import org.junit.Test; public class JUnit4RunListenerTest { @Test public void simpleTest() { Assert.assertEquals( 2, 1 + 1 ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-twoTestCaseSuite/000077500000000000000000000000001330756104600312475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-twoTestCaseSuite/pom.xml000066400000000000000000000041001330756104600325570ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit4-twoTestCaseSuite 1.0-SNAPSHOT Test for JUnit 4 suite with two test cases 4.4 1.6 1.6 junit junit ${junitVersion} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} **/Junit4TestSuite.java maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-twoTestCaseSuite/src/000077500000000000000000000000001330756104600320365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-twoTestCaseSuite/src/test/000077500000000000000000000000001330756104600330155ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600336575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-twoTestCaseSuite/src/testtwoTestCaseSuite/000077500000000000000000000000001330756104600371365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-twoTestCaseSuite/src/test/javaBasicTest.java000066400000000000000000000031031330756104600416570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-twoTestCaseSuite/src/test/java/twoTestCaseSuitepackage twoTestCaseSuite; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @AfterClass public static void oneTimeTearDown() { } } Junit4TestSuite.java000066400000000000000000000020121330756104600430230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-twoTestCaseSuite/src/test/java/twoTestCaseSuitepackage twoTestCaseSuite; /* * 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. */ import org.junit.runner.RunWith; import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({ BasicTest.class, Junit4TestTwo.class }) public class Junit4TestSuite { } Junit4TestTwo.java000066400000000000000000000016431330756104600425140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4-twoTestCaseSuite/src/test/java/twoTestCaseSuitepackage twoTestCaseSuite; /* * 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. */ import org.junit.Test; public class Junit4TestTwo { @Test public void secondTest() {} } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4/000077500000000000000000000000001330756104600257725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4/pom.xml000066400000000000000000000037561330756104600273220ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for JUnit 4 4.12 1.7 1.7 junit junit ${junit.version} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4/src/000077500000000000000000000000001330756104600265615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4/src/test/000077500000000000000000000000001330756104600275405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4/src/test/java/000077500000000000000000000000001330756104600304615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4/src/test/java/junit4/000077500000000000000000000000001330756104600316765ustar00rootroot00000000000000BasicTest.java000066400000000000000000000030661330756104600343500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit4/src/test/java/junit4package junit4; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class BasicTest { private static boolean tearDownCalled = false; private boolean setUpCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @AfterClass public static void oneTimeTearDown() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-dep/000077500000000000000000000000001330756104600266245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-dep/pom.xml000066400000000000000000000043571330756104600301520ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit44-dep 1.0-SNAPSHOT Test for junit-dep 1.6 1.6 junit junit-dep ${junit-dep.version} test provided381 junit junit 3.8.1 provided maven-surefire-plugin ${surefire.version} classes 1 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-dep/src/000077500000000000000000000000001330756104600274135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-dep/src/test/000077500000000000000000000000001330756104600303725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-dep/src/test/java/000077500000000000000000000000001330756104600313135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-dep/src/test/java/junit44Dep/000077500000000000000000000000001330756104600332455ustar00rootroot00000000000000BasicTest.java000066400000000000000000000034141330756104600357140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-dep/src/test/java/junit44Deppackage junit44Dep; /* * 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. */ import org.hamcrest.core.Is; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); Assert.assertFalse( "tearDown was called", tearDownCalled ); Assert.assertThat( true, Is.is( true ) ); } @AfterClass public static void oneTimeTearDown() { Assert.assertTrue( "tearDown was not called", tearDownCalled ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-environment/000077500000000000000000000000001330756104600304205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-environment/pom.xml000066400000000000000000000037421330756104600317430ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit44-environment 1.0-SNAPSHOT Test for setting environment variables 1.6 1.6 junit junit 4.4 test maven-surefire-plugin ${surefire.version} foo maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-environment/src/000077500000000000000000000000001330756104600312075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-environment/src/test/000077500000000000000000000000001330756104600321665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-environment/src/test/java/000077500000000000000000000000001330756104600331075ustar00rootroot00000000000000junit44/000077500000000000000000000000001330756104600343315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-environment/src/test/javaenvironment/000077500000000000000000000000001330756104600366755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-environment/src/test/java/junit44BasicTest.java000066400000000000000000000022631330756104600414240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-environment/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import static org.hamcrest.core.Is.*; import static org.hamcrest.core.IsNull.*; import org.junit.Assert; import org.junit.Test; public class BasicTest { @Test public void testEnvVar() { Assert.assertThat( System.getenv( "PATH" ), notNullValue() ); Assert.assertThat( System.getenv( "DUMMY_ENV_VAR" ), is( "foo" ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-hamcrest/000077500000000000000000000000001330756104600276625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-hamcrest/pom.xml000066400000000000000000000034771330756104600312120ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit44-hamcrest 1.0-SNAPSHOT Test for JUnit44 with Hamcrest extensions 1.6 1.6 junit junit 4.4 test maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-hamcrest/src/000077500000000000000000000000001330756104600304515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-hamcrest/src/test/000077500000000000000000000000001330756104600314305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-hamcrest/src/test/java/000077500000000000000000000000001330756104600323515ustar00rootroot00000000000000junit44/000077500000000000000000000000001330756104600335735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-hamcrest/src/test/javahamcrest/000077500000000000000000000000001330756104600354015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-hamcrest/src/test/java/junit44BasicTest.java000066400000000000000000000033151330756104600401270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-hamcrest/src/test/java/junit44/hamcrestpackage junit44.hamcrest; /* * 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. */ import org.hamcrest.core.Is; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); Assert.assertThat( true, Is.is( true ) ); } @AfterClass public static void oneTimeTearDown() { Assert.assertTrue( "tearDown was not called", tearDownCalled ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-method-pattern/000077500000000000000000000000001330756104600310075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-method-pattern/pom.xml000066400000000000000000000037411330756104600323310ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for JUnit 4 4.4 1.6 1.6 junit junit ${junitVersion} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} BasicTest#testSuccess* maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-method-pattern/src/000077500000000000000000000000001330756104600315765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-method-pattern/src/test/000077500000000000000000000000001330756104600325555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-method-pattern/src/test/java/000077500000000000000000000000001330756104600334765ustar00rootroot00000000000000junit4/000077500000000000000000000000001330756104600346345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-method-pattern/src/test/javaBasicTest.java000066400000000000000000000034011330756104600373560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-method-pattern/src/test/java/junit4package junit4; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); } @Test public void testSuccessTwo() { Assert.assertTrue( true ); } @AfterClass public static void oneTimeTearDown() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-multiple-methods/000077500000000000000000000000001330756104600313505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-multiple-methods/pom.xml000066400000000000000000000042641330756104600326730ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for JUnit 4 4.4 junit junit ${junitVersion} test org.apache.maven.plugins maven-surefire-plugin junit4/BasicTest#testSuccessOne+testFailOne,junit4/TestThree#testSuccessTwo maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-multiple-methods/src/000077500000000000000000000000001330756104600321375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-multiple-methods/src/test/000077500000000000000000000000001330756104600331165ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600337605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-multiple-methods/src/testjunit4/000077500000000000000000000000001330756104600351755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-multiple-methods/src/test/javaBasicTest.java000066400000000000000000000035421330756104600377250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-multiple-methods/src/test/java/junit4package junit4; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); } @Test public void testSuccessTwo() { Assert.assertTrue( true ); } @Test public void testFailOne() { Assert.assertFalse( false ); } @AfterClass public static void oneTimeTearDown() { } } TestThree.java000066400000000000000000000034011330756104600377450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-multiple-methods/src/test/java/junit4package junit4; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class TestThree { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); } @Test public void testSuccessTwo() { Assert.assertTrue( true ); } @AfterClass public static void oneTimeTearDown() { } } TestTwo.java000066400000000000000000000033771330756104600374630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-multiple-methods/src/test/java/junit4package junit4; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class TestTwo { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); } @Test public void testSuccessTwo() { Assert.assertTrue( true ); } @AfterClass public static void oneTimeTearDown() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-single-method/000077500000000000000000000000001330756104600306135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-single-method/pom.xml000066400000000000000000000037431330756104600321370ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for JUnit 4 4.4 1.6 1.6 junit junit ${junitVersion} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} BasicTest#testSuccessOne maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-single-method/src/000077500000000000000000000000001330756104600314025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-single-method/src/test/000077500000000000000000000000001330756104600323615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-single-method/src/test/java/000077500000000000000000000000001330756104600333025ustar00rootroot00000000000000junit4/000077500000000000000000000000001330756104600344405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-single-method/src/test/javaBasicTest.java000066400000000000000000000032421330756104600371650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit44-single-method/src/test/java/junit4package junit4; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); } @AfterClass public static void oneTimeTearDown() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-concurrency/000077500000000000000000000000001330756104600304115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-concurrency/pom.xml000066400000000000000000000040351330756104600317300ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire junit47-concurrency 1.0-SNAPSHOT Concurrency test for JUnit 4.7 junit junit 4.7 test org.apache.maven.plugins maven-surefire-plugin methods false 3 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-concurrency/src/000077500000000000000000000000001330756104600312005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-concurrency/src/test/000077500000000000000000000000001330756104600321575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-concurrency/src/test/java/000077500000000000000000000000001330756104600331005ustar00rootroot00000000000000junit47/000077500000000000000000000000001330756104600343255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-concurrency/src/test/javaBasicTest.java000066400000000000000000000032541330756104600370550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-concurrency/src/test/java/junit47package concurrentjunit47.src.test.java.junit47; /* * 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. */ import org.junit.*; import java.util.concurrent.TimeUnit; public class BasicTest { private boolean setUpCalled = false; @Before public void setUp() { setUpCalled = true; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @Test public void a() throws Exception { TimeUnit.SECONDS.sleep( 1 ); } @Test public void b() throws Exception { TimeUnit.SECONDS.sleep( 1 ); } @Test public void c() throws Exception { TimeUnit.SECONDS.sleep( 1 ); } @AfterClass public static void oneTimeTearDown() { } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/000077500000000000000000000000001330756104600276645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/pom.xml000066400000000000000000000051651330756104600312100ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 junit47-cucumber jar Tests cucumber with JUnit47 provider 1.1.3 4.11 org.apache.maven.plugins maven-surefire-plugin 0 true org.apache.maven.surefire surefire-junit47 ${surefire.version} junit junit ${junit.version} test info.cukes cucumber-java ${cucumber.version} test info.cukes cucumber-junit ${cucumber.version} test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/src/000077500000000000000000000000001330756104600304535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/src/test/000077500000000000000000000000001330756104600314325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/src/test/java/000077500000000000000000000000001330756104600323535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/000077500000000000000000000000001330756104600331425ustar00rootroot00000000000000sample/000077500000000000000000000000001330756104600343445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/src/test/java/orgcucumber/000077500000000000000000000000001330756104600361515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sampleFailingCucumberTest.java000066400000000000000000000020111330756104600427050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/* * 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. */ package org.sample.cucumber; import org.junit.runner.RunWith; import cucumber.api.junit.Cucumber; @RunWith( Cucumber.class ) @Cucumber.Options( features = { "classpath:failing" } ) public class FailingCucumberTest { } StepDefs.java000066400000000000000000000030031330756104600405250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/* * 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. */ package org.sample.cucumber; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; import static org.junit.Assert.fail; public class StepDefs { @Given( "^I have some code$" ) public void I_have_some_code() throws Throwable { // do nothing } @When( "^I run test$" ) public void I_run_test() throws Throwable { // do nothing } @Then( "^I get no failures$" ) public void I_get_no_failures() throws Throwable { // do nothing } @Then( "^I get a failure$" ) public void I_get_a_failure() throws Throwable { fail( "failing the test on purpose." ); } } SuccessCucumberTest.java000066400000000000000000000020111330756104600427440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/src/test/java/org/sample/cucumber/* * 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. */ package org.sample.cucumber; import org.junit.runner.RunWith; import cucumber.api.junit.Cucumber; @RunWith( Cucumber.class ) @Cucumber.Options( features = { "classpath:success" } ) public class SuccessCucumberTest { } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/src/test/resources/000077500000000000000000000000001330756104600334445ustar00rootroot00000000000000failing/000077500000000000000000000000001330756104600347765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/src/test/resourcesSample.feature000066400000000000000000000002511330756104600375720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/src/test/resources/failingFeature: Sample In order to use Maven As a user I want to do tests. Scenario: Do a failing test Given I have some code When I run test Then I get a failure success/000077500000000000000000000000001330756104600350355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/src/test/resourcesSample.feature000066400000000000000000000002561330756104600376360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-cucumber/src/test/resources/successFeature: Sample In order to use Maven As a user I want to do tests. Scenario: Do a successful test Given I have some code When I run test Then I get no failures maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-nts/000077500000000000000000000000001330756104600304555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-nts/pom.xml000066400000000000000000000043321330756104600317740ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire junit47-parallel-nts 1.0 junit47-parallel-nts http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit 4.8.1 com.github.stephenc.jcip jcip-annotations 1.0-1 maven-surefire-plugin maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-nts/src/000077500000000000000000000000001330756104600312445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-nts/src/test/000077500000000000000000000000001330756104600322235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-nts/src/test/java/000077500000000000000000000000001330756104600331445ustar00rootroot00000000000000surefireparallelnts/000077500000000000000000000000001330756104600371535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-nts/src/test/javaParallelTest.java000066400000000000000000000022711330756104600424140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-nts/src/test/java/surefireparallelntspackage surefireparallelnts; /* * 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. */ import org.junit.Test; /** * @author Tibor Digana (tibor17) * @since 2.19 */ public class ParallelTest { @Test public void test() throws InterruptedException { String name = Thread.currentThread().getName(); System.out.println( "maven-surefire-plugin@NotThreadSafe".equals( name ) ? "wrong-thread" : "expected-thread" ); } }RunningInSequenceTest.java000066400000000000000000000021761330756104600442640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-nts/src/test/java/surefireparallelntspackage surefireparallelnts; /* * 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. */ import org.junit.Test; /** * @author Tibor Digana (tibor17) * @since 2.19 */ @net.jcip.annotations.NotThreadSafe public class RunningInSequenceTest { @Test public void test() throws InterruptedException { System.out.println( "xxx-" + Thread.currentThread().getName() ); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-with-suite/000077500000000000000000000000001330756104600317535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-with-suite/pom.xml000066400000000000000000000025201330756104600332670ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit4-test jar 1.0-SNAPSHOT surefire-747-parallel-method-skips-test http://maven.apache.org junit junit 4.8.1 methods 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} false 5 **/TestSuite.java maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-with-suite/src/000077500000000000000000000000001330756104600325425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-with-suite/src/test/000077500000000000000000000000001330756104600335215ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600343635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-with-suite/src/testsurefire747/000077500000000000000000000000001330756104600364515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-with-suite/src/test/javaSuiteTest1.java000066400000000000000000000050621330756104600413310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-with-suite/src/test/java/surefire747package surefire747; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; /** * @author Kristian Rosenvold */ public class SuiteTest1 { private static final int PERFORMANCE_TEST_MULTIPLICATION_FACTOR = 4; private static long startedAt; public SuiteTest1() { System.out.println( "SuiteTest1.constructor" ); } @BeforeClass public static void beforeClass() { startedAt = System.currentTimeMillis(); } @AfterClass public static void afterClass() { System.out.println( String.format( "%s test finished after duration=%d", SuiteTest1.class.getSimpleName(), System.currentTimeMillis() - startedAt ) ); } @Before public void setUp() { System.out.println( "SuiteTest1.setUp" ); } @After public void tearDown() { System.out.println( "SuiteTest1.tearDown" ); } @Test public void first() throws InterruptedException { System.out.println( "begin SuiteTest1.first" ); Thread.sleep( 500 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR ); System.out.println( "end SuiteTest1.first" ); } @Test public void second() throws InterruptedException { System.out.println( "begin SuiteTest1.second" ); Thread.sleep( 500 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR ); System.out.println( "end SuiteTest1.second" ); } @Test public void third() throws InterruptedException { System.out.println( "begin SuiteTest1.third" ); Thread.sleep( 500 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR ); System.out.println( "end SuiteTest1.third" ); } } SuiteTest2.java000066400000000000000000000050621330756104600413320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-with-suite/src/test/java/surefire747package surefire747; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; /** * @author Kristian Rosenvold */ public class SuiteTest2 { private static final int PERFORMANCE_TEST_MULTIPLICATION_FACTOR = 4; private static long startedAt; public SuiteTest2() { System.out.println( "SuiteTest2.constructor" ); } @BeforeClass public static void beforeClass() { startedAt = System.currentTimeMillis(); } @AfterClass public static void afterClass() { System.out.println( String.format( "%s test finished after duration=%d", SuiteTest2.class.getSimpleName(), System.currentTimeMillis() - startedAt ) ); } @Before public void setUp() { System.out.println( "SuiteTest2.setUp" ); } @After public void tearDown() { System.out.println( "SuiteTest2.tearDown" ); } @Test public void first() throws InterruptedException { System.out.println( "begin SuiteTest2.first" ); Thread.sleep( 500 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR ); System.out.println( "end SuiteTest2.first" ); } @Test public void second() throws InterruptedException { System.out.println( "begin SuiteTest2.second" ); Thread.sleep( 500 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR ); System.out.println( "end SuiteTest2.second" ); } @Test public void third() throws InterruptedException { System.out.println( "begin SuiteTest2.third" ); Thread.sleep( 500 * PERFORMANCE_TEST_MULTIPLICATION_FACTOR ); System.out.println( "end SuiteTest2.third" ); } } TestSuite.java000066400000000000000000000027651330756104600412570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel-with-suite/src/test/java/surefire747package surefire747; /* * 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. */ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Suite; /** * @author Kristian Rosenvold */ @RunWith(Suite.class) @Suite.SuiteClasses( { SuiteTest1.class, SuiteTest2.class }) public class TestSuite { private static long startedAt; @BeforeClass public static void beforeClass() { startedAt = System.currentTimeMillis(); } @AfterClass public static void afterClass() { System.out.println( String.format( "%s suite finished after duration=%d", TestSuite.class.getSimpleName(), System.currentTimeMillis() - startedAt ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/000077500000000000000000000000001330756104600276535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/pom.xml000066400000000000000000000043461330756104600311770ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire junit47-parallel 1.0-SNAPSHOT junit47-parallel http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit 4.8.1 maven-surefire-plugin ${argLine} ${jacoco.agent} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/000077500000000000000000000000001330756104600304425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/test/000077500000000000000000000000001330756104600314215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/test/java/000077500000000000000000000000001330756104600323425ustar00rootroot00000000000000surefireparallel/000077500000000000000000000000001330756104600356245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/test/javaSuite1Test.java000066400000000000000000000022061330756104600405010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/test/java/surefireparallelpackage surefireparallel; /* * 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. */ import org.junit.runner.RunWith; import org.junit.runners.Suite; /** * @author Tibor Digana (tibor17) * @since 2.16 */ @RunWith( Suite.class ) @Suite.SuiteClasses( { Waiting1Test.class, Waiting2Test.class, Waiting3Test.class, Waiting4Test.class }) public class Suite1Test { } Suite2Test.java000066400000000000000000000022061330756104600405020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/test/java/surefireparallelpackage surefireparallel; /* * 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. */ import org.junit.runner.RunWith; import org.junit.runners.Suite; /** * @author Tibor Digana (tibor17) * @since 2.16 */ @RunWith( Suite.class ) @Suite.SuiteClasses( { Waiting5Test.class, Waiting6Test.class, Waiting7Test.class, Waiting8Test.class }) public class Suite2Test { } TestClass.java000066400000000000000000000024461330756104600404020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/test/java/surefireparallelpackage surefireparallel; /* * 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. */ import org.junit.Test; /** * @author Tibor Digana (tibor17) * @since 2.16 */ public class TestClass { @Test public void a() throws InterruptedException { Thread.sleep( 5000L ); } @Test public void b() throws InterruptedException { Thread.sleep( 5000L ); } @Test public void c() throws InterruptedException { Thread.sleep( 5000L ); } }Waiting1Test.java000066400000000000000000000023721330756104600410160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/test/java/surefireparallelpackage surefireparallel; /* * 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. */ import org.junit.Test; /** * @author Tibor Digana (tibor17) * @since 2.16 */ public class Waiting1Test { @Test public void a() throws InterruptedException { Thread.sleep( 300L ); } @Test public void b() throws InterruptedException { Thread.sleep( 300L ); } @Test public void c() throws InterruptedException { Thread.sleep( 300L ); } }Waiting2Test.java000066400000000000000000000023721330756104600410170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/test/java/surefireparallelpackage surefireparallel; /* * 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. */ import org.junit.Test; /** * @author Tibor Digana (tibor17) * @since 2.16 */ public class Waiting2Test { @Test public void a() throws InterruptedException { Thread.sleep( 300L ); } @Test public void b() throws InterruptedException { Thread.sleep( 300L ); } @Test public void c() throws InterruptedException { Thread.sleep( 300L ); } }Waiting3Test.java000066400000000000000000000023721330756104600410200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/test/java/surefireparallelpackage surefireparallel; /* * 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. */ import org.junit.Test; /** * @author Tibor Digana (tibor17) * @since 2.16 */ public class Waiting3Test { @Test public void a() throws InterruptedException { Thread.sleep( 300L ); } @Test public void b() throws InterruptedException { Thread.sleep( 300L ); } @Test public void c() throws InterruptedException { Thread.sleep( 300L ); } }Waiting4Test.java000066400000000000000000000023721330756104600410210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/test/java/surefireparallelpackage surefireparallel; /* * 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. */ import org.junit.Test; /** * @author Tibor Digana (tibor17) * @since 2.16 */ public class Waiting4Test { @Test public void a() throws InterruptedException { Thread.sleep( 300L ); } @Test public void b() throws InterruptedException { Thread.sleep( 300L ); } @Test public void c() throws InterruptedException { Thread.sleep( 300L ); } }Waiting5Test.java000066400000000000000000000023721330756104600410220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/test/java/surefireparallelpackage surefireparallel; /* * 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. */ import org.junit.Test; /** * @author Tibor Digana (tibor17) * @since 2.16 */ public class Waiting5Test { @Test public void a() throws InterruptedException { Thread.sleep( 300L ); } @Test public void b() throws InterruptedException { Thread.sleep( 300L ); } @Test public void c() throws InterruptedException { Thread.sleep( 300L ); } }Waiting6Test.java000066400000000000000000000023721330756104600410230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/test/java/surefireparallelpackage surefireparallel; /* * 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. */ import org.junit.Test; /** * @author Tibor Digana (tibor17) * @since 2.16 */ public class Waiting6Test { @Test public void a() throws InterruptedException { Thread.sleep( 300L ); } @Test public void b() throws InterruptedException { Thread.sleep( 300L ); } @Test public void c() throws InterruptedException { Thread.sleep( 300L ); } }Waiting7Test.java000066400000000000000000000023721330756104600410240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/test/java/surefireparallelpackage surefireparallel; /* * 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. */ import org.junit.Test; /** * @author Tibor Digana (tibor17) * @since 2.16 */ public class Waiting7Test { @Test public void a() throws InterruptedException { Thread.sleep( 300L ); } @Test public void b() throws InterruptedException { Thread.sleep( 300L ); } @Test public void c() throws InterruptedException { Thread.sleep( 300L ); } }Waiting8Test.java000066400000000000000000000023721330756104600410250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-parallel/src/test/java/surefireparallelpackage surefireparallel; /* * 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. */ import org.junit.Test; /** * @author Tibor Digana (tibor17) * @since 2.16 */ public class Waiting8Test { @Test public void a() throws InterruptedException { Thread.sleep( 300L ); } @Test public void b() throws InterruptedException { Thread.sleep( 300L ); } @Test public void c() throws InterruptedException { Thread.sleep( 300L ); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-redirect-output/000077500000000000000000000000001330756104600312165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-redirect-output/pom.xml000066400000000000000000000040431330756104600325340ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire fork-consoleOutput jar 1.0-SNAPSHOT fork-consoleOutput http://maven.apache.org junit junit ${junit.version} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} org.apache.maven.surefire surefire-junit47 ${surefire.version} ${forkMode} ${printSummary} true ${redirect.to.file} 2 ${parallel} alphabetical **/Test*.java 4.8.1 true once true none 1.6 1.6 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-redirect-output/src/000077500000000000000000000000001330756104600320055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-redirect-output/src/test/000077500000000000000000000000001330756104600327645ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600336265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-redirect-output/src/testjunit47ConsoleOutput/000077500000000000000000000000001330756104600376765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-redirect-output/src/test/javaTest0.java000066400000000000000000000033101330756104600415350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-redirect-output/src/test/java/junit47ConsoleOutputpackage junit47ConsoleOutput; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; public class Test0 { public Test0(){ System.out.println("Constructor"); } @Test public void testT0() throws Exception { System.out.println("testT0"); } @Test public void testT1() throws Exception { System.out.println("testT1"); } @BeforeClass public static void setUpBeforeClass() throws Exception { System.out.println("setUpBeforeClass"); } @AfterClass public static void tearDownAfterClass() throws Exception { System.out.println("tearDownAfterClass"); } @Before public void setUp() throws Exception { System.out.println("setUp"); } @After public void tearDown() throws Exception { System.out.println("tearDown"); } }Test1.java000066400000000000000000000025601330756104600415440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-redirect-output/src/test/java/junit47ConsoleOutputpackage junit47ConsoleOutput; /* * 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. */ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class Test1 { @Test public void test6281() { System.out.println( "Test1 on" + Thread.currentThread().getName()); } @BeforeClass public static void testWithFailingAssumption2() { System.out.println( "BeforeTest1 on" + Thread.currentThread().getName()); } @AfterClass public static void testWithFailingAssumption3() { System.out.println( "AfterTest1 on" + Thread.currentThread().getName()); } } Test2.java000066400000000000000000000025601330756104600415450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-redirect-output/src/test/java/junit47ConsoleOutputpackage junit47ConsoleOutput; /* * 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. */ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class Test2 { @Test public void test6281() { System.out.println( "Test2 on" + Thread.currentThread().getName()); } @BeforeClass public static void testWithFailingAssumption2() { System.out.println( "BeforeTest2 on" + Thread.currentThread().getName()); } @AfterClass public static void testWithFailingAssumption3() { System.out.println( "AfterTest2 on" + Thread.currentThread().getName()); } } Test3.java000066400000000000000000000016441330756104600415500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-redirect-output/src/test/java/junit47ConsoleOutputpackage junit47ConsoleOutput; /* * 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. */ import org.junit.Test; public class Test3 { @Test public void test3() { } } junit47-rerun-failing-tests-with-cucumber/000077500000000000000000000000001330756104600344565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000054051330756104600357770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber 4.0.0 org.apache.maven.surefire it-parent 1.0 junit47-rerun-failing-tests-with-cucumber Test for rerun failing cucumber tests in JUnit 47 2.0.0 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} org.apache.maven.surefire surefire-junit47 ${surefire.version} junit junit ${junit.version} test io.cucumber cucumber-java ${cucumber.version} test io.cucumber cucumber-junit ${cucumber.version} test src/000077500000000000000000000000001330756104600352455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumbertest/000077500000000000000000000000001330756104600362245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/srcjava/000077500000000000000000000000001330756104600371455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/testorg/000077500000000000000000000000001330756104600377345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/javasample/000077500000000000000000000000001330756104600412155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/java/orgcucumber/000077500000000000000000000000001330756104600430225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/java/org/sampleFlakeCucumberTest.java000066400000000000000000000017161330756104600472420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/java/org/sample/cucumber/* * 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. */ package org.sample.cucumber; import cucumber.api.junit.Cucumber; import org.junit.runner.RunWith; @RunWith( Cucumber.class ) public class FlakeCucumberTest { } StepDefs.java000066400000000000000000000031011330756104600453750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/java/org/sample/cucumber/* * 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. */ package org.sample.cucumber; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; import static org.junit.Assert.fail; public class StepDefs { private static int testFailures = 0; @Given( "^I have some code$" ) public void I_have_some_code() throws Throwable { // do nothing } @When( "^I run test$" ) public void I_run_test() throws Throwable { // do nothing } @Then( "^I get a flake$" ) public void I_get_a_flake() throws Throwable { // This test will error out with only one retry, but will pass with two if( testFailures < 2 ) { testFailures++; fail( "failing the test on purpose." ); } } } resources/000077500000000000000000000000001330756104600402365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/testorg/000077500000000000000000000000001330756104600410255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/resourcessample/000077500000000000000000000000001330756104600423065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/resources/orgcucumber/000077500000000000000000000000001330756104600441135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/resources/org/sampleSample.feature000066400000000000000000000002451330756104600467120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-rerun-failing-tests-with-cucumber/src/test/resources/org/sample/cucumberFeature: Sample In order to use Maven As a user I want to do tests. Scenario: Do a flake test Given I have some code When I run test Then I get a flake maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-static-inner-class-tests/000077500000000000000000000000001330756104600327225ustar00rootroot00000000000000pom.xml000066400000000000000000000026221330756104600341620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-static-inner-class-tests 4.0.0 org.apache.maven.plugins.surefire junit4-test jar 1.0-SNAPSHOT junit47-static-inner-class-tests http://maven.apache.org 1.6 1.6 junit junit 4.8.1 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} never org.apache.maven.surefire surefire-junit47 ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-static-inner-class-tests/src/000077500000000000000000000000001330756104600335115ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600344115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-static-inner-class-tests/srcjava/000077500000000000000000000000001330756104600353325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-static-inner-class-tests/src/testjunit4/000077500000000000000000000000001330756104600365475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-static-inner-class-tests/src/test/javaBasicTest.java000066400000000000000000000020511330756104600412710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-static-inner-class-tests/src/test/java/junit4package junit4; /* * 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. */ import org.junit.Test; import org.junit.experimental.runners.Enclosed; import org.junit.runner.RunWith; @RunWith(Enclosed.class) public class BasicTest { public static class InnerTest { @Test public void testSomething() { } } } TopLevelAbstractClassTest.java000066400000000000000000000021021330756104600444510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-static-inner-class-tests/src/test/java/junit4package junit4; /* * 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. */ import org.junit.Test; import org.junit.experimental.runners.Enclosed; import org.junit.runner.RunWith; @RunWith(Enclosed.class) public abstract class TopLevelAbstractClassTest { public static class InnerTest { @Test public void testSomething() { } } } TopLevelInterfaceTest.java000066400000000000000000000020711330756104600436250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit47-static-inner-class-tests/src/test/java/junit4package junit4; /* * 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. */ import org.junit.Test; import org.junit.experimental.runners.Enclosed; import org.junit.runner.RunWith; @RunWith(Enclosed.class) public interface TopLevelInterfaceTest { public static class InnerTest { @Test public void testSomething() { } } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-categories/000077500000000000000000000000001330756104600302055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-categories/pom.xml000066400000000000000000000045711330756104600315310ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for JUnit 4.8.1 4.8.1 junit4.CategoryA,junit4.CategoryB 1.6 1.6 junit junit ${junit.version} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${groups} ${excludedGroups} org.apache.maven.surefire surefire-junit47 ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-categories/src/000077500000000000000000000000001330756104600307745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-categories/src/test/000077500000000000000000000000001330756104600317535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-categories/src/test/java/000077500000000000000000000000001330756104600326745ustar00rootroot00000000000000junit4/000077500000000000000000000000001330756104600340325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-categories/src/test/javaBasicTest.java000066400000000000000000000036441330756104600365650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-categories/src/test/java/junit4package junit4; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; import org.junit.experimental.categories.Category; public class BasicTest { static int catACount = 0; static int catBCount = 0; static int catCCount = 0; static int catNoneCount = 0; @Test @Category(CategoryA.class) public void testInCategoryA() { System.out.println( "Ran testInCategoryA" ); catACount++; } @Test @Category(CategoryB.class) public void testInCategoryB() { System.out.println( "Ran testInCategoryB" ); catBCount++; } @Test @Category(CategoryC.class) public void testInCategoryC() { System.out.println( "Ran testInCategoryC" ); catCCount++; } @Test public void testInNoCategory() { System.out.println( "Ran testInNoCategory" ); catNoneCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("catA: " + catACount + "\n" + "catB: " + catBCount + "\n" + "catC: " + catCCount + "\n" + "catNone: " + catNoneCount); } } CategoryA.java000066400000000000000000000015221330756104600365530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-categories/src/test/java/junit4package junit4; /* * 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. */ interface CategoryA {} CategoryB.java000066400000000000000000000015221330756104600365540ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-categories/src/test/java/junit4package junit4; /* * 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. */ interface CategoryB {} CategoryC.java000066400000000000000000000015221330756104600365550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-categories/src/test/java/junit4package junit4; /* * 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. */ interface CategoryC {} CategoryCTest.java000066400000000000000000000033111330756104600374130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-categories/src/test/java/junit4package junit4; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; import org.junit.experimental.categories.Category; @Category(CategoryC.class) public class CategoryCTest { static int catACount = 0; static int catBCount = 0; static int catCCount = 0; static int catNoneCount = 0; @Test public void testInCategoryA() { catACount++; } @Test @Category(CategoryB.class) public void testInCategoryB() { catBCount++; } @Test @Category(CategoryC.class) public void testInCategoryC() { catCCount++; } @Test public void testInNoCategory() { catNoneCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("mA: " + catACount + "\n" + "mB: " + catBCount + "\n" + "mC: " + catCCount + "\n" + "CatNone: " + catNoneCount); } } NoCategoryTest.java000066400000000000000000000021721330756104600376110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-categories/src/test/java/junit4package junit4; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class NoCategoryTest { static int catNoneCount = 0; @Test public void testInNoCategory() { catNoneCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("NoCategoryTest.CatNone: " + catNoneCount); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-method-pattern/000077500000000000000000000000001330756104600310135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-method-pattern/pom.xml000066400000000000000000000062501330756104600323330ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for JUnit 4.8.1 4.8.1 junit junit ${junitVersion} test org.apache.maven.plugins maven-surefire-plugin BasicTest#testSuccess* once surefire-junit47 org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit47 ${surefire.version} surefire-junit4 org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit4 ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-method-pattern/src/000077500000000000000000000000001330756104600316025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-method-pattern/src/test/000077500000000000000000000000001330756104600325615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-method-pattern/src/test/java/000077500000000000000000000000001330756104600335025ustar00rootroot00000000000000junit4/000077500000000000000000000000001330756104600346405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-method-pattern/src/test/javaBasicTest.java000066400000000000000000000035301330756104600373650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-method-pattern/src/test/java/junit4package junit4; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.experimental.categories.Category; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); } @Test @Category(SampleCategory.class) public void testSuccessTwo() { Assert.assertTrue( true ); } @AfterClass public static void oneTimeTearDown() { } } SampleCategory.java000066400000000000000000000015411330756104600404230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-method-pattern/src/test/java/junit4package junit4; /* * 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. */ public interface SampleCategory { } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-method-patterns/000077500000000000000000000000001330756104600330275ustar00rootroot00000000000000pom.xml000066400000000000000000000137771330756104600343040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-method-patterns 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-745-junit 1.0 junit junit 4.8.1 test org.apache.maven.plugins maven-surefire-plugin junit4-test org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit4 ${surefire.version} junit47-test org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit47 ${surefire.version} junit4-includes org.apache.maven.plugins maven-surefire-plugin ${included} org.apache.maven.surefire surefire-junit4 ${surefire.version} junit47-includes org.apache.maven.plugins maven-surefire-plugin ${included} org.apache.maven.surefire surefire-junit47 ${surefire.version} junit4-includes-excludes org.apache.maven.plugins maven-surefire-plugin ${included} ${excluded} org.apache.maven.surefire surefire-junit4 ${surefire.version} junit47-includes-excludes org.apache.maven.plugins maven-surefire-plugin ${included} ${excluded} org.apache.maven.surefire surefire-junit47 ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-method-patterns/src/000077500000000000000000000000001330756104600336165ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600345165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-method-patterns/srcjava/000077500000000000000000000000001330756104600354375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-method-patterns/src/testjiras/000077500000000000000000000000001330756104600365475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-method-patterns/src/test/javasurefire745/000077500000000000000000000000001330756104600406335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-method-patterns/src/test/java/jirasBasicTest.java000066400000000000000000000026551330756104600433670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-method-patterns/src/test/java/jiras/surefire745package jiras.surefire745; /* * 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. */ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; import static org.junit.Assert.*; public class BasicTest { @Rule public final TestName testName = new TestName(); @Test public void testSuccessOne() { System.out.println( getClass() + "#" + testName.getMethodName() ); } @Test public void testSuccessTwo() { System.out.println( getClass() + "#" + testName.getMethodName() ); } @Test public void testFailure() { System.out.println( getClass() + "#" + testName.getMethodName() ); fail( ); } } TestFive.java000066400000000000000000000025741330756104600432370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-method-patterns/src/test/java/jiras/surefire745package jiras.surefire745; /* * 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. */ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; public class TestFive { @Rule public final TestName testName = new TestName(); @Test public void testSuccessOne() { System.out.println( getClass() + "#" + testName.getMethodName() ); } @Test public void testSuccessTwo() { System.out.println( getClass() + "#" + testName.getMethodName() ); } @Test public void testSuccessThree() { System.out.println( getClass() + "#" + testName.getMethodName() ); } } TestFour.java000066400000000000000000000025741330756104600432610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-method-patterns/src/test/java/jiras/surefire745package jiras.surefire745; /* * 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. */ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; public class TestFour { @Rule public final TestName testName = new TestName(); @Test public void testSuccessOne() { System.out.println( getClass() + "#" + testName.getMethodName() ); } @Test public void testSuccessTwo() { System.out.println( getClass() + "#" + testName.getMethodName() ); } @Test public void testSuccessThree() { System.out.println( getClass() + "#" + testName.getMethodName() ); } } TestThree.java000066400000000000000000000026521330756104600434120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-method-patterns/src/test/java/jiras/surefire745package jiras.surefire745; /* * 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. */ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; import static org.junit.Assert.*; public class TestThree { @Rule public final TestName testName = new TestName(); @Test public void testSuccessOne() { System.out.println( getClass() + "#" + testName.getMethodName() ); } @Test public void testSuccessTwo() { System.out.println( getClass() + "#" + testName.getMethodName() ); } @Test public void testFailOne() { System.out.println( getClass() + "#" + testName.getMethodName() ); fail(); } } TestTwo.java000066400000000000000000000023651330756104600431150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-method-patterns/src/test/java/jiras/surefire745package jiras.surefire745; /* * 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. */ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; public class TestTwo { @Rule public final TestName testName = new TestName(); @Test public void testSuccessOne() { System.out.println( getClass() + "#" + testName.getMethodName() ); } @Test public void testSuccessTwo() { System.out.println( getClass() + "#" + testName.getMethodName() ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-methods/000077500000000000000000000000001330756104600313545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-methods/pom.xml000066400000000000000000000063331330756104600326760ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for JUnit 4.8.1 4.8.1 junit junit ${junitVersion} test org.apache.maven.plugins maven-surefire-plugin junit4/BasicTest#testSuccessOne+testFailOne,junit4/TestThree#testSuccessTwo once surefire-junit47 org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit47 ${surefire.version} surefire-junit4 org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit4 ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-methods/src/000077500000000000000000000000001330756104600321435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-methods/src/test/000077500000000000000000000000001330756104600331225ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600337645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-methods/src/testjunit4/000077500000000000000000000000001330756104600352015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-methods/src/test/javaBasicTest.java000066400000000000000000000035421330756104600377310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-methods/src/test/java/junit4package junit4; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); } @Test public void testSuccessTwo() { Assert.assertTrue( true ); } @Test public void testFailOne() { Assert.assertFalse( false ); } @AfterClass public static void oneTimeTearDown() { } } TestThree.java000066400000000000000000000034011330756104600377510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-methods/src/test/java/junit4package junit4; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class TestThree { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); } @Test public void testSuccessTwo() { Assert.assertTrue( true ); } @AfterClass public static void oneTimeTearDown() { } } TestTwo.java000066400000000000000000000033761330756104600374660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-multiple-methods/src/test/java/junit4package junit4; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class TestTwo { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); } @Test public void testSuccessTwo() { Assert.assertTrue( true ); } @AfterClass public static void oneTimeTearDown() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-single-method/000077500000000000000000000000001330756104600306175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-single-method/pom.xml000066400000000000000000000062501330756104600321370ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for JUnit 4.8.1 4.8.1 junit junit ${junitVersion} test org.apache.maven.plugins maven-surefire-plugin BasicTest#testSuccessOne once surefire-junit47 org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit47 ${surefire.version} surefire-junit4 org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit4 ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-single-method/src/000077500000000000000000000000001330756104600314065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-single-method/src/test/000077500000000000000000000000001330756104600323655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-single-method/src/test/java/000077500000000000000000000000001330756104600333065ustar00rootroot00000000000000junit4/000077500000000000000000000000001330756104600344445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-single-method/src/test/javaBasicTest.java000066400000000000000000000032421330756104600371710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-single-method/src/test/java/junit4package junit4; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); } @AfterClass public static void oneTimeTearDown() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-smartStackTrace/000077500000000000000000000000001330756104600311535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-smartStackTrace/pom.xml000066400000000000000000000036451330756104600325000ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit4-smartstacktrace 1.0-SNAPSHOT Test for smart stack trace parser 4.8.1 1.6 1.6 junit junit ${junitVersion} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-smartStackTrace/src/000077500000000000000000000000001330756104600317425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-smartStackTrace/src/test/000077500000000000000000000000001330756104600327215ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600335635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-smartStackTrace/src/testjunit4/000077500000000000000000000000001330756104600350005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-smartStackTrace/src/test/javaSmartStackTraceTest.java000066400000000000000000000025141330756104600415400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/junit48-smartStackTrace/src/test/java/junit4package junit4; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import java.io.IOException; public class SmartStackTraceTest { @Test(expected = RuntimeException.class) public void shouldFailInMethodButDoesnt() { } @Test(expected = IOException.class) public void incorrectExceptionThrown() { throw new RuntimeException("We fail here"); } @Test(expected = IOException.class) public void shortName() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/large-test-results/000077500000000000000000000000001330756104600303235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/large-test-results/pom.xml000066400000000000000000000036111330756104600316410ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire large-test-results 1.0-SNAPSHOT Test for large test results maven-surefire-plugin ${surefire.version} numTests${numTests} -Xmx1024m junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/large-test-results/src/000077500000000000000000000000001330756104600311125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/large-test-results/src/test/000077500000000000000000000000001330756104600320715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/large-test-results/src/test/java/000077500000000000000000000000001330756104600330125ustar00rootroot00000000000000largeTestResults/000077500000000000000000000000001330756104600362475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/large-test-results/src/test/javaBasicTest.java000066400000000000000000000033021330756104600407710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/large-test-results/src/test/java/largeTestResultspackage largeTestResults; /* * 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. */ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class BasicTest extends TestCase { private final int number; public BasicTest( String name, int number ) { super( name ); this.number = number; } public static Test suite() { int tests = Integer.parseInt( System.getProperty( "numTests", "20" ) ); TestSuite suite = new TestSuite(); for ( int i = 0; i < tests; i++ ) { if ( i % 4 == 0 ) { suite.addTest( new BasicTest( "testPass", i ) ); } else { suite.addTest( new BasicTest( "testFail", i ) ); } } return suite; } public void testFail() { fail( "failure " + number ); } public void testPass() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/long-windows-path/000077500000000000000000000000001330756104600301365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/long-windows-path/pom.xml000066400000000000000000000035141330756104600314560ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire long-windows-path 1.0 junit junit 4.12 test maven-surefire-plugin once maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/long-windows-path/src/000077500000000000000000000000001330756104600307255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/long-windows-path/src/test/000077500000000000000000000000001330756104600317045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/long-windows-path/src/test/java/000077500000000000000000000000001330756104600326255ustar00rootroot00000000000000longwindowspath/000077500000000000000000000000001330756104600357755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/long-windows-path/src/test/javaBasicTest.java000066400000000000000000000023071330756104600405230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/long-windows-path/src/test/java/longwindowspathpackage longwindowspath; /* * 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. */ import org.junit.Test; public class BasicTest { @Test public void test() { System.out.println( "SUREFIRE-1400 user.dir=" + System.getProperty( "user.dir" ) ); System.out.println( "SUREFIRE-1400 surefire.real.class.path=" + System.getProperty( "surefire.real.class.path" ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/modulepath/000077500000000000000000000000001330756104600267175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/modulepath/pom.xml000066400000000000000000000025371330756104600302430ustar00rootroot00000000000000 4.0.0 foo app 1.0.0-SNAPSHOT app 9 org.apache.maven.plugins maven-compiler-plugin 3.6.2 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} joda-time joda-time 2.9.9 org.testng testng 6.11 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/modulepath/src/000077500000000000000000000000001330756104600275065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/modulepath/src/main/000077500000000000000000000000001330756104600304325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/modulepath/src/main/java/000077500000000000000000000000001330756104600313535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/modulepath/src/main/java/com/000077500000000000000000000000001330756104600321315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/modulepath/src/main/java/com/app/000077500000000000000000000000001330756104600327115ustar00rootroot00000000000000Main.java000066400000000000000000000022541330756104600343640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/modulepath/src/main/java/com/apppackage com.app; /* * 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. */ import org.joda.time.DateTime; public class Main { public static void main( String... args ) { System.out.println( "module path => " + System.getProperty( "jdk.module.path" ) ); System.out.println( " class path => " + System.getProperty( "java.class.path" ) ); DateTime dt = new DateTime(); System.out.println( dt ); } } module-info.java000066400000000000000000000015251330756104600343600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/modulepath/src/main/java/* * 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. */ module com.app { requires joda.time; } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/modulepath/src/test/000077500000000000000000000000001330756104600304655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/modulepath/src/test/java/000077500000000000000000000000001330756104600314065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/modulepath/src/test/java/com/000077500000000000000000000000001330756104600321645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/modulepath/src/test/java/com/app/000077500000000000000000000000001330756104600327445ustar00rootroot00000000000000AppTest.java000066400000000000000000000020021330756104600351020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/modulepath/src/test/java/com/apppackage com.app; /* * 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. */ import org.testng.annotations.Test; @Test public class AppTest { public void testNoop() throws Exception { } public void testMain() { Main.main(); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/norunnableTests/000077500000000000000000000000001330756104600277435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/norunnableTests/pom.xml000066400000000000000000000037151330756104600312660ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire norunnabletests 1.0-SNAPSHOT Test JUnit classes with inner classes 1.6 1.6 junit junit 4.8.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} true maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/norunnableTests/src/000077500000000000000000000000001330756104600305325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/norunnableTests/src/test/000077500000000000000000000000001330756104600315115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/norunnableTests/src/test/java/000077500000000000000000000000001330756104600324325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/norunnableTests/src/test/java/junit/000077500000000000000000000000001330756104600335635ustar00rootroot00000000000000norunnabletests/000077500000000000000000000000001330756104600367325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/norunnableTests/src/test/java/junitBasicTest.java000066400000000000000000000016331330756104600414610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/norunnableTests/src/test/java/junit/norunnabletestspackage junit.norunnabletests; /* * 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. */ import junit.framework.TestCase; public class BasicTest extends TestCase { } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/parallel-runtime/000077500000000000000000000000001330756104600300325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/parallel-runtime/pom.xml000066400000000000000000000026371330756104600313570ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire parallel-runtime jar 1.0-SNAPSHOT parallel-runtime http://maven.apache.org junit junit 4.10 classes 3 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${threadCount} false ${parallel} **/Test*.java maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/parallel-runtime/src/000077500000000000000000000000001330756104600306215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/parallel-runtime/src/test/000077500000000000000000000000001330756104600316005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/parallel-runtime/src/test/java/000077500000000000000000000000001330756104600325215ustar00rootroot00000000000000runorder/000077500000000000000000000000001330756104600343025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/parallel-runtime/src/test/javaparallel/000077500000000000000000000000001330756104600360765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/parallel-runtime/src/test/java/runorderTest1.java000077500000000000000000000031761330756104600377530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/parallel-runtime/src/test/java/runorder/parallelpackage runorder.parallel; /* * 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. */ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class Test1 { public static final int ms = 5000; static void sleep( int ms ) { long target = System.currentTimeMillis() + ms; try { do { Thread.sleep( ms ); } while ( System.currentTimeMillis() < target); } catch ( InterruptedException e ) { throw new RuntimeException( e ); } } @Test public void testSleep1() { Test1.sleep( ms ); } @Test public void testSleep2() { Test1.sleep( ms ); } @Test public void testSleep3() { Test1.sleep( ms ); } @Test public void testSleep4() { Test1.sleep( ms ); } }Test2.java000066400000000000000000000023601330756104600377430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/parallel-runtime/src/test/java/runorder/parallelpackage runorder.parallel; /* * 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. */ import org.junit.Test; /** * @author Kristian Rosenvold */ public class Test2 { @Test public void testSleep1() { Test1.sleep( Test1.ms ); } @Test public void testSleep2() { Test1.sleep( Test1.ms ); } @Test public void testSleep3() { Test1.sleep( Test1.ms ); } @Test public void testSleep4() { Test1.sleep( Test1.ms ); } }Test3.java000066400000000000000000000024521330756104600377460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/parallel-runtime/src/test/java/runorder/parallelpackage runorder.parallel; /* * 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. */ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; /** * @author Kristian Rosenvold */ public class Test3 { @Test public void testSleep1() { Test1.sleep( Test1.ms ); } @Test public void testSleep2() { Test1.sleep( Test1.ms ); } @Test public void testSleep3() { Test1.sleep( Test1.ms ); } @Test public void testSleep4() { Test1.sleep( Test1.ms ); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plain-old-java-classpath/000077500000000000000000000000001330756104600313335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plain-old-java-classpath/pom.xml000066400000000000000000000037341330756104600326570ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire plain-old-java-classpath 1.0-SNAPSHOT Test for useManifestOnlyJar=false 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} false junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plain-old-java-classpath/src/000077500000000000000000000000001330756104600321225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plain-old-java-classpath/src/test/000077500000000000000000000000001330756104600331015ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600337435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plain-old-java-classpath/src/testplainOldJavaClasspath/000077500000000000000000000000001330756104600401525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plain-old-java-classpath/src/test/javaBasicTest.java000066400000000000000000000042321330756104600426770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plain-old-java-classpath/src/test/java/plainOldJavaClasspathpackage plainOldJavaClasspath; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class BasicTest extends TestCase { private boolean setUpCalled = false; private static boolean tearDownCalled = false; public BasicTest( String name, String extraName ) { super( name ); } public static Test suite() { System.out.println( "suite" ); TestSuite suite = new TestSuite(); Test test = new BasicTest( "testSetUp", "dummy" ); suite.addTest( test ); return new TestSetup( suite ) { protected void setUp() { //oneTimeSetUp(); } protected void tearDown() { oneTimeTearDown(); } }; } protected void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } protected void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } public void testSetUp() { assertTrue( "setUp was not called", setUpCalled ); } public static void oneTimeTearDown() { assertTrue( "tearDown was not called", tearDownCalled ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plexus-conflict/000077500000000000000000000000001330756104600276745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plexus-conflict/pom.xml000066400000000000000000000037101330756104600312120ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire plexus-conflict 1.0-SNAPSHOT Test for plexus conflict 1.6 1.6 org.codehaus.plexus plexus-utils 1.0.4 junit junit 3.8.1 test maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plexus-conflict/src/000077500000000000000000000000001330756104600304635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plexus-conflict/src/main/000077500000000000000000000000001330756104600314075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plexus-conflict/src/main/java/000077500000000000000000000000001330756104600323305ustar00rootroot00000000000000plexusConflict/000077500000000000000000000000001330756104600352535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plexus-conflict/src/main/javaCommandlineExtender.java000066400000000000000000000022431330756104600420440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plexus-conflict/src/main/java/plexusConflictpackage plexusConflict; /* * 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. */ import org.codehaus.plexus.util.cli.Commandline; /** * Conflict with latest version of plexus by using modified protected class. */ public class CommandlineExtender extends Commandline { public CommandlineExtender() { // In 1.0.4, Commandline.envVars was a Vector; in 1.4.x, it's a Map. super.envVars.add( "" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plexus-conflict/src/test/000077500000000000000000000000001330756104600314425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plexus-conflict/src/test/java/000077500000000000000000000000001330756104600323635ustar00rootroot00000000000000plexusConflict/000077500000000000000000000000001330756104600353065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plexus-conflict/src/test/javaBasicTest.java000066400000000000000000000021501330756104600400300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/plexus-conflict/src/test/java/plexusConflictpackage plexusConflict; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class BasicTest extends TestCase { public void testPlexusConflict() { CommandlineExtender ce = new CommandlineExtender(); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/pojo-simple/000077500000000000000000000000001330756104600270135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/pojo-simple/pom.xml000066400000000000000000000035031330756104600303310ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire pojo-simple 1.0-SNAPSHOT Pojo simple test 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} true maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/pojo-simple/src/000077500000000000000000000000001330756104600276025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/pojo-simple/src/test/000077500000000000000000000000001330756104600305615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/pojo-simple/src/test/java/000077500000000000000000000000001330756104600315025ustar00rootroot00000000000000PojoTest.java000066400000000000000000000017051330756104600340400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/pojo-simple/src/test/java/* * 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. */ public class PojoTest { public void testSuccess() { assert true; } public void testFailure() { assert false; } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/pom.xml000066400000000000000000000024041330756104600260720ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent pom 1.0 It parent 1.6 1.6 maven-surefire-plugin ${surefire.version} never maven-failsafe-plugin ${surefire.version} never maven-surefire-report-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/reporters/000077500000000000000000000000001330756104600266025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/reporters/pom.xml000066400000000000000000000032671330756104600301270ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire reporters jar 1.0-SNAPSHOT reporters http://maven.apache.org org.testng testng 5.8 test jdk15 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} false ${forkMode} ${printSummary} true ${redirect.to.file} **/Test*.java 4.8.1 true once true 1.6 1.6 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/reporters/src/000077500000000000000000000000001330756104600273715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/reporters/src/test/000077500000000000000000000000001330756104600303505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/reporters/src/test/java/000077500000000000000000000000001330756104600312715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/reporters/src/test/java/reporters/000077500000000000000000000000001330756104600333165ustar00rootroot00000000000000Test1.java000066400000000000000000000017711330756104600351100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/reporters/src/test/java/reporterspackage reporters; /* * 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. */ import junit.framework.TestCase; public class Test1 extends TestCase { public void test6281() { System.out.println( "Test1 on" + Thread.currentThread().getName()); } } Test2.java000066400000000000000000000017711330756104600351110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/reporters/src/test/java/reporterspackage reporters; /* * 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. */ import junit.framework.TestCase; public class Test2 extends TestCase { public void test6281() { System.out.println( "Test2 on" + Thread.currentThread().getName()); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/result-counting/000077500000000000000000000000001330756104600277175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/result-counting/pom.xml000066400000000000000000000026541330756104600312430ustar00rootroot00000000000000 4.0.0 mag junit4-test jar 1.0-SNAPSHOT junit4-test http://maven.apache.org junit junit ${junit.version} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${forkMode} **/Test*.java **/MySuiteTest1.java **/MySuiteTest2.java **/MySuiteTest3.java 4.8.1 once 1.6 1.6 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/result-counting/src/000077500000000000000000000000001330756104600305065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/result-counting/src/test/000077500000000000000000000000001330756104600314655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/result-counting/src/test/java/000077500000000000000000000000001330756104600324065ustar00rootroot00000000000000resultcounting/000077500000000000000000000000001330756104600354145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/result-counting/src/test/javaMySuiteTest1.java000066400000000000000000000023701330756104600406010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/result-counting/src/test/java/resultcountingpackage resultcounting; /* * 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. */ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class MySuiteTest1 extends TestCase { public static Test suite () { TestSuite suite = new TestSuite(); suite.addTest (new MySuiteTest1("testMe" )); return suite; } public MySuiteTest1( String name ) { super (name); } public void testMe() { assertTrue (true); } } MySuiteTest2.java000066400000000000000000000024551330756104600406060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/result-counting/src/test/java/resultcountingpackage resultcounting; /* * 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. */ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class MySuiteTest2 extends TestCase { public static Test suite () { TestSuite suite = new TestSuite(); suite.addTest (new MySuiteTest2("testMe" )); suite.addTest (new MySuiteTest2("testMe" )); return suite; } public MySuiteTest2( String name ) { super (name); } public void testMe() { assertTrue (true); } } MySuiteTest3.java000066400000000000000000000025421330756104600406040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/result-counting/src/test/java/resultcountingpackage resultcounting; /* * 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. */ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class MySuiteTest3 extends TestCase { public static Test suite () { TestSuite suite = new TestSuite(); suite.addTest (new MySuiteTest3("testMe" )); suite.addTest (new MySuiteTest3("testMe" )); suite.addTest (new MySuiteTest3("testMe" )); return suite; } public MySuiteTest3( String name ) { super (name); } public void testMe() { assertTrue (true); } } Test1.java000066400000000000000000000044631330756104600372660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/result-counting/src/test/java/resultcountingpackage resultcounting; /* * 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. */ import org.junit.Test; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assume.*; import junit.framework.TestCase; public class Test1 extends TestCase { public void testWithFailingAssumption1() { assumeThat( 2, is(3)); } public void testWithFailingAssumption2() { assumeThat( 2, is(3)); } public void testWithFailingAssumption3() { assumeThat( 2, is(3)); } public void testWithFailingAssumption4() { assumeThat( 2, is(3)); } public void testWithFailingAssumption5() { assumeThat( 2, is(3)); } public void testWithFailingAssumption6() { assumeThat( 2, is(3)); } public void testWithFailingAssumption7() { assumeThat( 2, is(3)); } public void testWithFailingAssumption8() { assumeThat( 2, is(3)); } public void testWithFailingAssumption9() { assumeThat( 2, is(3)); } public void testWithFailingAssumption10() { assumeThat( 2, is(3)); } public void testWithFailingAssumption11() { assumeThat( 2, is(3)); } public void testWithFailingAssumption12() { assumeThat( 2, is(3)); } public void testWithFailingAssumption13() { assumeThat( 2, is(3)); } public void testWithFailingAssumption14() { assumeThat( 2, is(3)); } public void testWithFailingAssumption15() { assumeThat( 2, is(3)); } }Test2.java000066400000000000000000000053311330756104600372620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/result-counting/src/test/java/resultcountingpackage resultcounting; /* * 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. */ import org.junit.Ignore; import org.junit.Test; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assume.*; import static junit.framework.Assert.fail; /** * @author Kristian Rosenvold */ public class Test2 { @Test public void testAllok() { System.out.println( "testAllok to stdout" ); System.err.println( "testAllok to stderr" ); } @Ignore @Test public void testWithIgnore1() { } @Ignore @Test public void testWithIgnore2() { } @Test public void testiWithFail1() { fail( "We excpect this" ); } @Test public void testiWithFail2() { fail( "We excpect this" ); } @Test public void testiWithFail3() { fail( "We excpect this" ); } @Test public void testiWithFail4() { fail( "We excpect this" ); } @Test public void testWithException1() { System.out.println( "testWithException1 to stdout" ); System.err.println( "testWithException1 to stderr" ); throw new RuntimeException( "We expect this" ); } @Test public void testWithException2() { throw new RuntimeException( "We expect this" ); } @Test public void testWithException3() { throw new RuntimeException( "We expect this" ); } @Test public void testWithException4() { throw new RuntimeException( "We expect this" ); } @Test public void testWithException5() { throw new RuntimeException( "We expect this" ); } @Test public void testWithException6() { throw new RuntimeException( "We expect this" ); } @Test public void testWithException7() { throw new RuntimeException( "We expect this" ); } @Test public void testWithException8() { throw new RuntimeException( "We expect this" ); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runOrder/000077500000000000000000000000001330756104600263555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runOrder/pom.xml000066400000000000000000000037271330756104600277030ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire runOrder 1.0-SNAPSHOT Test for runOrder 1.6 1.6 junit junit 4.8.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} once maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runOrder/src/000077500000000000000000000000001330756104600271445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runOrder/src/test/000077500000000000000000000000001330756104600301235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runOrder/src/test/java/000077500000000000000000000000001330756104600310445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runOrder/src/test/java/junit/000077500000000000000000000000001330756104600321755ustar00rootroot00000000000000runOrder/000077500000000000000000000000001330756104600337165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runOrder/src/test/java/junitTestA.java000066400000000000000000000017341330756104600356060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runOrder/src/test/java/junit/runOrderpackage junit.runOrder; /* * 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. */ import junit.framework.TestCase; public class TestA extends TestCase { public void testTwo() { System.out.println( "TA" ); } } TestB.java000066400000000000000000000017341330756104600356070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runOrder/src/test/java/junit/runOrderpackage junit.runOrder; /* * 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. */ import junit.framework.TestCase; public class TestB extends TestCase { public void testTwo() { System.out.println( "TB" ); } } TestC.java000066400000000000000000000017341330756104600356100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runOrder/src/test/java/junit/runOrderpackage junit.runOrder; /* * 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. */ import junit.framework.TestCase; public class TestC extends TestCase { public void testTwo() { System.out.println( "TC" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runorder-parallel/000077500000000000000000000000001330756104600302075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runorder-parallel/pom.xml000066400000000000000000000026261330756104600315320ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire runorder-parallel jar 1.0-SNAPSHOT runorder-parallel http://maven.apache.org junit junit 4.10 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} balanced classesAndMethods 2 6 false **/Test*.java maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runorder-parallel/src/000077500000000000000000000000001330756104600307765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runorder-parallel/src/test/000077500000000000000000000000001330756104600317555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runorder-parallel/src/test/java/000077500000000000000000000000001330756104600326765ustar00rootroot00000000000000runorder/000077500000000000000000000000001330756104600344575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runorder-parallel/src/test/javaparallel/000077500000000000000000000000001330756104600362535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runorder-parallel/src/test/java/runorderTest1.java000077500000000000000000000050161330756104600401230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runorder-parallel/src/test/java/runorder/parallelpackage runorder.parallel; /* * 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. */ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class Test1 { public Test1() { System.out.println( Thread.currentThread().getName() + " Constructor" ); } static void sleep( int ms ) { long target = System.currentTimeMillis() + ms; try { do { Thread.sleep( 1L ); } while ( System.currentTimeMillis() < target ); } catch ( InterruptedException e ) { throw new RuntimeException( e ); } } @Test public void testSleep2000() { System.out.println( Thread.currentThread().getName() + " Test1.sleep2000 started @ " + System.currentTimeMillis() ); sleep( 2000 ); } @Test public void testSleep4000() { System.out.println( Thread.currentThread().getName() + " Test1.sleep4000 started @ " + System.currentTimeMillis() ); sleep( 4000 ); } @Test public void testSleep6000() { System.out.println( Thread.currentThread().getName() + " Test1.sleep6000 started @ " + System.currentTimeMillis() ); sleep( 6000 ); } @BeforeClass public static void setUpBeforeClass() throws Exception { System.out.println( Thread.currentThread().getName() + " beforeClass sleep 175 " + System.currentTimeMillis() ); Thread.sleep( 175 ); } @AfterClass public static void tearDownAfterClass() throws Exception { System.out.println( Thread.currentThread().getName() + " afterClass sleep 175 " + System.currentTimeMillis() ); Thread.sleep( 175 ); } }Test2.java000066400000000000000000000026421330756104600401230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runorder-parallel/src/test/java/runorder/parallelpackage runorder.parallel; /* * 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. */ import org.junit.Test; /** * @author Kristian Rosenvold */ public class Test2 { @Test public void testSleep1000() { System.out.println( "Test2.sleep1000 started @ " + System.currentTimeMillis() ); Test1.sleep( 1000 ); } @Test public void testSleep3000() { System.out.println( "Test2.sleep3000 started @ " + System.currentTimeMillis() ); Test1.sleep( 3000 ); } @Test public void testSleep5000() { System.out.println( "Test2.sleep5000 started @ " + System.currentTimeMillis() ); Test1.sleep( 5000 ); } }Test3.java000066400000000000000000000042771330756104600401320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/runorder-parallel/src/test/java/runorder/parallelpackage runorder.parallel; /* * 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. */ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; /** * @author Kristian Rosenvold */ public class Test3 { private void sleep( int ms ) { try { Thread.sleep( ms ); } catch ( InterruptedException e ) { throw new RuntimeException( e ); } } @Test public void testSleep100() { System.out.println( "Test3.sleep100 started @ " + System.currentTimeMillis() ); Test1.sleep( 100 ); } @Test public void testSleep300() { System.out.println( "Test3.sleep300 started @ " + System.currentTimeMillis() ); Test1.sleep( 300 ); } @Test public void testSleep500() { System.out.println( "Test3.sleep500 started @ " + System.currentTimeMillis() ); Test1.sleep( 500 ); } @BeforeClass public static void setUpBeforeClass() throws Exception { System.out.println( Thread.currentThread().getName() + " Test3 beforeClass sleep 175 " + System.currentTimeMillis() ); Thread.sleep( 175 ); } @AfterClass public static void tearDownAfterClass() throws Exception { System.out.println( Thread.currentThread().getName() + " Test3 afterClass sleep 175 " + System.currentTimeMillis() ); Thread.sleep( 175 ); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/settings.xml000066400000000000000000000032761330756104600271470ustar00rootroot00000000000000 it-repo true local.central ${localRepositoryUrl} true true local.central ${localRepositoryUrl} true true maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/000077500000000000000000000000001330756104600303245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/aggregator/000077500000000000000000000000001330756104600324465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/aggregator/pom.xml000066400000000000000000000034141330756104600337650ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire.its.sibling-aggregator aggregator 1.0-SNAPSHOT Test for aggregator whose modules are in ../child pom 1.6 1.6 ../child1 ../child2 maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/child1/000077500000000000000000000000001330756104600314705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/child1/pom.xml000066400000000000000000000032031330756104600330030ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire.its.sibling-aggregator child1 1.0-SNAPSHOT Test for aggregated child1 1.6 1.6 junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/child1/src/000077500000000000000000000000001330756104600322575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/child1/src/main/000077500000000000000000000000001330756104600332035ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600340455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/child1/src/mainsiblingAggregator/000077500000000000000000000000001330756104600374775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/child1/src/main/javaFooHolder.java000066400000000000000000000016251330756104600422270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/child1/src/main/java/siblingAggregatorpackage siblingAggregator; /* * 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. */ public class FooHolder { public static String getFoo() { return "foo"; } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/child2/000077500000000000000000000000001330756104600314715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/child2/pom.xml000066400000000000000000000035041330756104600330100ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire.its.sibling-aggregator child2 1.0-SNAPSHOT Test for aggregated child2 1.6 1.6 org.apache.maven.plugins.surefire.its.sibling-aggregator child1 1.0-SNAPSHOT junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/child2/src/000077500000000000000000000000001330756104600322605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/child2/src/test/000077500000000000000000000000001330756104600332375ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600341015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/child2/src/testsiblingAggregator/000077500000000000000000000000001330756104600375335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/child2/src/test/javaFooHolderTest.java000066400000000000000000000017111330756104600431170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/sibling-aggregator/child2/src/test/java/siblingAggregatorpackage siblingAggregator; /* * 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. */ public class FooHolderTest extends junit.framework.TestCase { public void testFoo() { FooHolder.getFoo(); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/small-result-counting/000077500000000000000000000000001330756104600310255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/small-result-counting/pom.xml000066400000000000000000000024131330756104600323420ustar00rootroot00000000000000 4.0.0 maven-surefire small-result-counting jar 1.0-SNAPSHOT small-result-counting http://maven.apache.org junit junit ${junit.version} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${forkMode} **/Test*.java 4.8.1 once 1.6 1.6 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/small-result-counting/src/000077500000000000000000000000001330756104600316145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/small-result-counting/src/test/000077500000000000000000000000001330756104600325735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/small-result-counting/src/test/java/000077500000000000000000000000001330756104600335145ustar00rootroot00000000000000smallresultcounting/000077500000000000000000000000001330756104600375535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/small-result-counting/src/test/javaTest1.java000066400000000000000000000031201330756104600414120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/small-result-counting/src/test/java/smallresultcountingpackage smallresultcounting; /* * 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. */ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assume.assumeThat; public class Test1 { @Test public void testWithFailingAssumption1() { assumeThat( 2, is( 3 ) ); } @Test public void testWithFailingAssumption2() { try { Thread.sleep( 150 ); } catch ( InterruptedException ignore ) { } assumeThat( 2, is( 3 ) ); } @Test public void testWithFailingAssumption3() { assumeThat( 2, is( 3 ) ); } @Test public void testWithFailingAssumption4() { assumeThat( 2, is( 3 ) ); } @Test public void testWithFailingAssumption5() { assumeThat( 2, is( 3 ) ); } }Test2.java000066400000000000000000000043661330756104600414300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/small-result-counting/src/test/java/smallresultcountingpackage smallresultcounting; /* * 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. */ import org.junit.Ignore; import org.junit.Test; import static junit.framework.Assert.fail; /** * @author Kristian Rosenvold */ public class Test2 { @Test public void testiWithFail1() { fail( "We excpect this1" ); } @Test public void testWithException1() { System.out.println( "testWithException1 to stdout" ); System.err.println( "testWithException1 to stderr" ); throw new RuntimeException( "We expect this1-1" ); } @Test public void testWithException2() { throw new RuntimeException( "We expect this1-2" ); } @Ignore( "We do this for a reason1" ) @Test public void testWithIgnore1() { } @Ignore( "We do this for a reason2" ) @Test public void testWithIgnore2() { } @Ignore @Test public void testWithIgnore3() { } @Test public void testAllok1() { System.out.println( "testAllok1 to stdout" ); System.err.println( "testAllok1 to stderr" ); try { Thread.sleep( 100 ); } catch ( InterruptedException ignore ) { } } @Test public void testAllok2() { } @Test public void testAllok3() { try { Thread.sleep( 250 ); } catch ( InterruptedException ignore ) { } } @Test public void testAllok4() { } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1024/000077500000000000000000000000001330756104600267655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1024/jiras-surefire-1024-it/000077500000000000000000000000001330756104600327155ustar00rootroot00000000000000pom.xml000066400000000000000000000050401330756104600341520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1024/jiras-surefire-1024-it 4.0.0 org.apache.maven.plugins.surefire jiras-surefire-1024 1.0 jiras-surefire-1024-it 1.0 pom junit junit 4.8.1 test org.apache.maven.plugins.surefire jiras-surefire-1024-testjar 1.0 test maven-failsafe-plugin integration-test integration-test integration-test verify verify verify org.apache.maven.plugins.surefire:jiras-surefire-1024-testjar jiras-surefire-1024-testjar/000077500000000000000000000000001330756104600336765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1024pom.xml000066400000000000000000000032721330756104600352170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1024/jiras-surefire-1024-testjar 4.0.0 org.apache.maven.plugins.surefire jiras-surefire-1024 1.0 jiras-surefire-1024-testjar 1.0 1.6 1.6 junit junit 4.8.1 true src/000077500000000000000000000000001330756104600344655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1024/jiras-surefire-1024-testjarmain/000077500000000000000000000000001330756104600354115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1024/jiras-surefire-1024-testjar/srcjava/000077500000000000000000000000001330756104600363325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1024/jiras-surefire-1024-testjar/src/mainjiras/000077500000000000000000000000001330756104600374425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1024/jiras-surefire-1024-testjar/src/main/javasurefire1024/000077500000000000000000000000001330756104600415755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1024/jiras-surefire-1024-testjar/src/main/java/jirasA1IT.java000066400000000000000000000003011330756104600431300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1024/jiras-surefire-1024-testjar/src/main/java/jiras/surefire1024package jiras.surefire1024; import org.junit.Test; public class A1IT { @Test public void test() { System.out.println( getClass() + "#test() dependency to scan" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1024/pom.xml000066400000000000000000000035221330756104600303040ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 org.apache.maven.plugins.surefire jiras-surefire-1024 1.0 pom http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava jiras-surefire-1024-testjar jiras-surefire-1024-it surefire-1028-unable-to-run-single-test/000077500000000000000000000000001330756104600336345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000037051330756104600351560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1028-unable-to-run-single-test 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-1028 1.0 jiras-surefire-1028 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit 4.10 test src/000077500000000000000000000000001330756104600344235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1028-unable-to-run-single-testtest/000077500000000000000000000000001330756104600354025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1028-unable-to-run-single-test/srcjava/000077500000000000000000000000001330756104600363235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1028-unable-to-run-single-test/src/testjiras/000077500000000000000000000000001330756104600374335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1028-unable-to-run-single-test/src/test/javasurefire1028/000077500000000000000000000000001330756104600415725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1028-unable-to-run-single-test/src/test/java/jirasSomeTest.java000066400000000000000000000020541330756104600442010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1028-unable-to-run-single-test/src/test/java/jiras/surefire1028package jiras.surefire1028; /* * 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. */ import org.junit.Assert; import org.junit.Test; public class SomeTest { @Test public void test() { System.out.println("OK!"); } @Test public void filteredOutTest() { Assert.fail(); } } surefire-1036-NonFilterableJUnitRunnerWithCategories/000077500000000000000000000000001330756104600364415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000045511330756104600377630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1036-NonFilterableJUnitRunnerWithCategories 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-1036 1.0 jiras-surefire-1036 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit 4.11 test org.mockito mockito-core 1.8.1 test maven-surefire-plugin jiras.surefire1036.IntegrationTest src/000077500000000000000000000000001330756104600372305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1036-NonFilterableJUnitRunnerWithCategoriestest/000077500000000000000000000000001330756104600402075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1036-NonFilterableJUnitRunnerWithCategories/srcjava/000077500000000000000000000000001330756104600411305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1036-NonFilterableJUnitRunnerWithCategories/src/testjiras/000077500000000000000000000000001330756104600422405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1036-NonFilterableJUnitRunnerWithCategories/src/test/javasurefire1036/000077500000000000000000000000001330756104600443765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1036-NonFilterableJUnitRunnerWithCategories/src/test/java/jirasIntegrationTest.java000066400000000000000000000015551330756104600503720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1036-NonFilterableJUnitRunnerWithCategories/src/test/java/jiras/surefire1036package jiras.surefire1036; /* * 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. */ public interface IntegrationTest { } TestSomeIntegration.java000066400000000000000000000023121330756104600512060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1036-NonFilterableJUnitRunnerWithCategories/src/test/java/jiras/surefire1036package jiras.surefire1036; /* * 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. */ import static org.junit.Assert.*; import org.junit.Test; import org.junit.experimental.categories.Category; @Category( IntegrationTest.class ) public class TestSomeIntegration { @Test public void thisIsAnIntegrationTest() throws Exception { String message = "This integration test will always pass"; System.out.println( message ); assertTrue( message, true ); } } TestSomeUnit.java000066400000000000000000000021531330756104600476450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1036-NonFilterableJUnitRunnerWithCategories/src/test/java/jiras/surefire1036package jiras.surefire1036; /* * 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. */ import org.junit.Test; import static org.junit.Assert.fail; public class TestSomeUnit { @Test public void thisIsJustAUnitTest() throws Exception { String message = "This unit test will never pass"; System.out.println( message ); fail(); } } TestSomethingWithMockitoRunner.java000066400000000000000000000027531330756104600534210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1036-NonFilterableJUnitRunnerWithCategories/src/test/java/jiras/surefire1036package jiras.surefire1036; /* * 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. */ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import java.util.List; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.when; @RunWith( MockitoJUnitRunner.class ) public class TestSomethingWithMockitoRunner { @Mock private List mTestList; @Before public void setUp() throws Exception { when( mTestList.size() ).thenReturn( 5 ); } @Test public void thisTestUsesMockitoRunnerButIsPrettyUseless() throws Exception { assertEquals( 5, mTestList.size() ); } } surefire-1041-exception-in-junit-runner/000077500000000000000000000000001330756104600337435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000040761330756104600352670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1041-exception-in-junit-runner 4.0.0 org.apache.maven.surefire it-parent 1.0 surefire-1041 Tests that test reporter does not fail with NPE when a JUnit-Runner has an error. maven-surefire-plugin once 1 org.apache.maven.surefire surefire-junit47 ${surefire.version} junit junit 4.11 test src/000077500000000000000000000000001330756104600345325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1041-exception-in-junit-runnertest/000077500000000000000000000000001330756104600355115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1041-exception-in-junit-runner/srcjava/000077500000000000000000000000001330756104600364325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1041-exception-in-junit-runner/src/testtest/000077500000000000000000000000001330756104600374115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1041-exception-in-junit-runner/src/test/javaAppTest.java000066400000000000000000000017751330756104600416460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1041-exception-in-junit-runner/src/test/java/testpackage test; /* * 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. */ import org.junit.Test; import org.junit.runner.RunWith; /** * * @author Dan Fabulich * */ @RunWith(BadRunner.class) public class AppTest { @Test public void testApp() { } } BadRunner.java000066400000000000000000000023741330756104600421420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1041-exception-in-junit-runner/src/test/java/testpackage test; /* * 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. */ import org.junit.runner.notification.RunNotifier; import org.junit.runners.BlockJUnit4ClassRunner; import org.junit.runners.model.InitializationError; /** * * @author Dan Fabulich * */ public class BadRunner extends BlockJUnit4ClassRunner{ public BadRunner(Class testClass) throws InitializationError { super(testClass); } @Override public void run(RunNotifier notifier) { String x = null; if (false) x = ""; x.toString(); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1053-system-properties/000077500000000000000000000000001330756104600325035ustar00rootroot00000000000000pom.xml000066400000000000000000000043521330756104600337450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1053-system-properties 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-1053 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit 4.11 test maven-surefire-plugin once myVal1 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1053-system-properties/src/000077500000000000000000000000001330756104600332725ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600341725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1053-system-properties/srcjava/000077500000000000000000000000001330756104600351135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1053-system-properties/src/testjiras/000077500000000000000000000000001330756104600362235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1053-system-properties/src/test/javasurefire1053/000077500000000000000000000000001330756104600403605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1053-system-properties/src/test/java/jirasATest.java000066400000000000000000000021521330756104600422430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1053-system-properties/src/test/java/jiras/surefire1053package jiras.surefire1053; /* * 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. */ import org.junit.Test; public final class ATest { @Test public void someMethod() throws InterruptedException { System.out.println( "file.encoding=" + System.getProperty( "file.encoding" ) ); System.out.println( "myArg=" + System.getProperty( "myArg" ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1055-parallelTestCount/000077500000000000000000000000001330756104600324345ustar00rootroot00000000000000pom.xml000066400000000000000000000046661330756104600337060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1055-parallelTestCount 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml foo foo 1.0 jar foo UTF-8 ${project.build.sourceEncoding} junit junit 4.11 test org.apache.maven.plugins maven-surefire-plugin once classesAndMethods false true 3 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1055-parallelTestCount/src/000077500000000000000000000000001330756104600332235ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600341235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1055-parallelTestCount/srcjava/000077500000000000000000000000001330756104600350445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1055-parallelTestCount/src/testfoo/000077500000000000000000000000001330756104600356275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1055-parallelTestCount/src/test/javaMethod1Test.java000066400000000000000000000016651330756104600406430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1055-parallelTestCount/src/test/java/foo/* * 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. */ package foo; import org.junit.Test; public class Method1Test { @Test public void only() { SleepUtil.sleep(); } } Methods2Test.java000066400000000000000000000020021330756104600410110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1055-parallelTestCount/src/test/java/foo/* * 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. */ package foo; import org.junit.Test; public class Methods2Test { @Test public void first() { SleepUtil.sleep(); } @Test public void second() { SleepUtil.sleep(); } } Methods3Test.java000066400000000000000000000021151330756104600410170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1055-parallelTestCount/src/test/java/foo/* * 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. */ package foo; import org.junit.Test; public class Methods3Test { @Test public void first() { SleepUtil.sleep(); } @Test public void second() { SleepUtil.sleep(); } @Test public void third() { SleepUtil.sleep(); } } Methods4Test.java000066400000000000000000000022271330756104600410240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1055-parallelTestCount/src/test/java/foo/* * 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. */ package foo; import org.junit.Test; public class Methods4Test { @Test public void first() { SleepUtil.sleep(); } @Test public void second() { SleepUtil.sleep(); } @Test public void third() { SleepUtil.sleep(); } @Test public void fourth() { SleepUtil.sleep(); } } Methods5Test.java000066400000000000000000000023411330756104600410220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1055-parallelTestCount/src/test/java/foo/* * 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. */ package foo; import org.junit.Test; public class Methods5Test { @Test public void first() { SleepUtil.sleep(); } @Test public void second() { SleepUtil.sleep(); } @Test public void third() { SleepUtil.sleep(); } @Test public void fourth() { SleepUtil.sleep(); } @Test public void fifth() { SleepUtil.sleep(); } } Methods6Test.java000066400000000000000000000010011330756104600410130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1055-parallelTestCount/src/test/java/foopackage foo; import org.junit.Test; public class Methods6Test { @Test public void first() { SleepUtil.sleep(); } @Test public void second() { SleepUtil.sleep(); } @Test public void third() { SleepUtil.sleep(); } @Test public void fourth() { SleepUtil.sleep(); } @Test public void fifth() { SleepUtil.sleep(); } @Test public void sixth() { SleepUtil.sleep(); } } SleepUtil.java000066400000000000000000000021741330756104600404040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1055-parallelTestCount/src/test/java/foo/* * 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. */ package foo; public class SleepUtil { public static void sleep() { /* a sleep seems to make the issue less likely to occur */ // try // { // Thread.sleep(2000); // } // catch (InterruptedException e) // { // Thread.currentThread().interrupt(); // } } } surefire-1080-parallel-fork-double-test/000077500000000000000000000000001330756104600336665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000045221330756104600352060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1080-parallel-fork-double-test 4.0.0 org.apache.maven.plugins.surefire jiras-surefire-1080 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava Qingzhou Luo 1.6 1.6 junit junit 4.7 test maven-surefire-plugin ${surefire.version} classes 2 true src/000077500000000000000000000000001330756104600344555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1080-parallel-fork-double-testtest/000077500000000000000000000000001330756104600354345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1080-parallel-fork-double-test/srcjava/000077500000000000000000000000001330756104600363555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1080-parallel-fork-double-test/src/testcom/000077500000000000000000000000001330756104600371335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1080-parallel-fork-double-test/src/test/javacal/000077500000000000000000000000001330756104600376725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1080-parallel-fork-double-test/src/test/java/comHelloWorldFlakyCotTest.java000066400000000000000000000020031330756104600451000ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1080-parallel-fork-double-test/src/test/java/com/calpackage com.cal; /* * 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. */ import org.junit.Test; public class HelloWorldFlakyCotTest { @Test public void testHelloWorldTextFlaky20() { } @Test public void testHelloWorldText2Flaky20() { } } HelloWorldFlakyErrorTest.java000066400000000000000000000020051330756104600454460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1080-parallel-fork-double-test/src/test/java/com/calpackage com.cal; /* * 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. */ import org.junit.Test; public class HelloWorldFlakyErrorTest { @Test public void testHelloWorldTextFlaky20() { } @Test public void testHelloWorldText2Flaky20() { } } HelloWorldTest.java000066400000000000000000000020671330756104600434550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1080-parallel-fork-double-test/src/test/java/com/calpackage com.cal; /* * 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. */ import org.junit.Test; public class HelloWorldTest { @Test public void testHelloWorldText() { } @Test public void testHelloWorldTextFlaky20() { } @Test public void testHelloWorldText2Flaky20() { } } SimpleTest.java000066400000000000000000000023371330756104600426330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1080-parallel-fork-double-test/src/test/java/com/calpackage com.cal; /* * 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. */ import org.junit.Test; import static org.junit.Assert.assertEquals; public class SimpleTest { /** * Make sure the universe hasn't broken. */ @Test public void testAddition() { assertEquals( 2, 1 + 1 ); } /** * Now try to break the universe :D */ @Test(expected = ArithmeticException.class) public void testDivision() { int i = 1 / 0; } } surefire-1082-parallel-junit-parameterized/000077500000000000000000000000001330756104600344655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000040651330756104600360070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1082-parallel-junit-parameterized 4.0.0 org.apache.maven.plugins.surefire jiras-surefire-1082 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava 1.6 1.6 junit junit 4.7 test maven-surefire-plugin ${surefire.version} src/000077500000000000000000000000001330756104600352545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1082-parallel-junit-parameterizedtest/000077500000000000000000000000001330756104600362335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1082-parallel-junit-parameterized/srcjava/000077500000000000000000000000001330756104600371545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1082-parallel-junit-parameterized/src/testjiras/000077500000000000000000000000001330756104600402645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1082-parallel-junit-parameterized/src/test/javasurefire1082/000077500000000000000000000000001330756104600424235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1082-parallel-junit-parameterized/src/test/java/jirasJira1082Test.java000066400000000000000000000033151330756104600453300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1082-parallel-junit-parameterized/src/test/java/jiras/surefire1082package jiras.surefire1082; /* * 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. */ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import java.util.Arrays; import java.util.concurrent.TimeUnit; @RunWith( Parameterized.class ) public class Jira1082Test { private final int x; public Jira1082Test( int x ) { this.x = x; } @Parameterized.Parameters public static Iterable data() { return Arrays.asList( new Object[][]{ { 0 }, { 1 } } ); } @Test public void a() throws InterruptedException { TimeUnit.MILLISECONDS.sleep( 500 ); System.out.println( getClass() + " a " + x + " " + Thread.currentThread().getName() ); } @Test public void b() throws InterruptedException { TimeUnit.MILLISECONDS.sleep( 500 ); System.out.println( getClass() + " b " + x + " " + Thread.currentThread().getName() ); } } Jira1264Test.java000066400000000000000000000022031330756104600453250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1082-parallel-junit-parameterized/src/test/java/jiras/surefire1082package jiras.surefire1082; /* * 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. */ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import java.util.Arrays; import java.util.concurrent.TimeUnit; @RunWith( Parameterized.class ) public final class Jira1264Test extends Jira1082Test { public Jira1264Test( int x ) { super( x ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1095-npe-in-runlistener/000077500000000000000000000000001330756104600325315ustar00rootroot00000000000000pom.xml000066400000000000000000000045751330756104600340020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1095-npe-in-runlistener 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-1095 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit ${junit.version} test maven-surefire-plugin **/SomeTest.java listener jiras.surefire1095.Listener maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1095-npe-in-runlistener/src/000077500000000000000000000000001330756104600333205ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600342205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1095-npe-in-runlistener/srcjava/000077500000000000000000000000001330756104600351415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1095-npe-in-runlistener/src/testjiras/000077500000000000000000000000001330756104600362515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1095-npe-in-runlistener/src/test/javasurefire1095/000077500000000000000000000000001330756104600404145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1095-npe-in-runlistener/src/test/java/jirasListener.java000066400000000000000000000025611330756104600430500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1095-npe-in-runlistener/src/test/java/jiras/surefire1095package jiras.surefire1095; /* * 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. */ import org.junit.runner.Description; import org.junit.runner.notification.RunListener; public class Listener extends RunListener { @Override public void testRunStarted( Description description ) throws Exception { String described = description.getDisplayName(); System.out.println( "testRunStarted " + ( described == null || described.equals( "null" ) ? description.getChildren() : description ) ); } } SomeTest.java000066400000000000000000000020031330756104600430150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1095-npe-in-runlistener/src/test/java/jiras/surefire1095package jiras.surefire1095; /* * 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. */ import junit.runner.Version; import org.junit.Test; public class SomeTest { @Test public void test() { System.out.println( "Running JUnit " + Version.id() ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1098-balanced-runorder/000077500000000000000000000000001330756104600323655ustar00rootroot00000000000000pom.xml000066400000000000000000000042021330756104600336210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1098-balanced-runorder 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-1098 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit 4.7 test maven-surefire-plugin balanced maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1098-balanced-runorder/src/000077500000000000000000000000001330756104600331545ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600340545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1098-balanced-runorder/srcjava/000077500000000000000000000000001330756104600347755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1098-balanced-runorder/src/testjiras/000077500000000000000000000000001330756104600361055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1098-balanced-runorder/src/test/javasurefire1098/000077500000000000000000000000001330756104600402535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1098-balanced-runorder/src/test/java/jirasATest.java000066400000000000000000000021541330756104600421400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1098-balanced-runorder/src/test/java/jiras/surefire1098package jiras.surefire1098; /* * 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. */ import org.junit.Test; import java.util.concurrent.TimeUnit; public final class ATest { @Test public void someMethod() throws InterruptedException { System.out.println(getClass() + " " + Thread.currentThread().getName()); TimeUnit.MILLISECONDS.sleep(100); } } BTest.java000066400000000000000000000021451330756104600421410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1098-balanced-runorder/src/test/java/jiras/surefire1098package jiras.surefire1098; /* * 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. */ import org.junit.Test; import java.util.concurrent.TimeUnit; public final class BTest { @Test public void someMethod() throws InterruptedException { System.out.println(getClass() + " " + Thread.currentThread().getName()); TimeUnit.SECONDS.sleep(2); } } CTest.java000066400000000000000000000021451330756104600421420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1098-balanced-runorder/src/test/java/jiras/surefire1098package jiras.surefire1098; /* * 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. */ import org.junit.Test; import java.util.concurrent.TimeUnit; public final class CTest { @Test public void someMethod() throws InterruptedException { System.out.println(getClass() + " " + Thread.currentThread().getName()); TimeUnit.SECONDS.sleep(4); } } DTest.java000066400000000000000000000021451330756104600421430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1098-balanced-runorder/src/test/java/jiras/surefire1098package jiras.surefire1098; /* * 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. */ import org.junit.Test; import java.util.concurrent.TimeUnit; public final class DTest { @Test public void someMethod() throws InterruptedException { System.out.println(getClass() + " " + Thread.currentThread().getName()); TimeUnit.SECONDS.sleep(8); } } surefire-1122-parallel-and-flakyTests/000077500000000000000000000000001330756104600333665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000051201330756104600347010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1122-parallel-and-flakyTests 4.0.0 org.apache.maven.plugins.surefire jiras-surefire-1122 1.0 1.6 1.6 junit junit 4.11 test maven-surefire-plugin ${surefire.version} org.apache.maven.surefire surefire-junit47 ${surefire.version} 2 parallel org.apache.maven.plugins maven-surefire-plugin true 0 classes src/000077500000000000000000000000001330756104600341555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1122-parallel-and-flakyTeststest/000077500000000000000000000000001330756104600351345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1122-parallel-and-flakyTests/srcjava/000077500000000000000000000000001330756104600360555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1122-parallel-and-flakyTests/src/testtest/000077500000000000000000000000001330756104600370345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1122-parallel-and-flakyTests/src/test/javaFlakyTest.java000066400000000000000000000021741330756104600416110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1122-parallel-and-flakyTests/src/test/java/testpackage test; /* * 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. */ import org.junit.Test; public class FlakyTest { private static int x = 1; @Test public void failsOnFirstExecution() { if ( x++ < 2 ) { org.junit.Assert.fail( "First execution always fails. Try again." ); } } @Test public void alwaysPasses() { } } surefire-1135-improve-ignore-message-for-testng/000077500000000000000000000000001330756104600353615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000051061330756104600367000ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1135-improve-ignore-message-for-testng 4.0.0 org.apache.maven.plugins.surefire surefire-1135-improve-ignore-message-for-testng 1.0-SNAPSHOT Surefire 1135 1.6 1.6 testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} SkipExceptionReportTest src/000077500000000000000000000000001330756104600361505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1135-improve-ignore-message-for-testngtest/000077500000000000000000000000001330756104600371275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1135-improve-ignore-message-for-testng/srcjava/000077500000000000000000000000001330756104600400505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1135-improve-ignore-message-for-testng/src/testtestng/000077500000000000000000000000001330756104600413545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1135-improve-ignore-message-for-testng/src/test/javaSkipExceptionReportTest.java000066400000000000000000000020221330756104600470340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1135-improve-ignore-message-for-testng/src/test/java/testng/* * 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. */ package testng; import org.testng.annotations.Test; import org.testng.SkipException; public class SkipExceptionReportTest { @Test public void testSkipException() { throw new SkipException("Skip test"); } }surefire-1136-cwd-propagation-in-forked-mode/000077500000000000000000000000001330756104600346045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000047461330756104600361340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1136-cwd-propagation-in-forked-mode 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml cwd cwd 1.0 jar cwd UTF-8 ${project.build.sourceEncoding} junit junit 4.11 test org.apache.maven.plugins maven-surefire-plugin once 1 ${project.name}_${surefire.forkNumber} ${basedir} src/000077500000000000000000000000001330756104600353735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1136-cwd-propagation-in-forked-modetest/000077500000000000000000000000001330756104600363525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1136-cwd-propagation-in-forked-mode/srcjava/000077500000000000000000000000001330756104600372735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1136-cwd-propagation-in-forked-mode/src/testcwd/000077500000000000000000000000001330756104600400505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1136-cwd-propagation-in-forked-mode/src/test/javaCurrentWorkingDirectoryInForkedModeTest.java000066400000000000000000000035201330756104600506520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1136-cwd-propagation-in-forked-mode/src/test/java/cwdpackage cwd; /* * 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. */ import org.junit.Test; import java.io.File; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; public class CurrentWorkingDirectoryInForkedModeTest { @Test public void testCurrentWorkingDirectoryPropagation() throws Exception { File projectDirectory = new File( System.getProperty( "maven.project.base.directory" ) ); File forkDirectory = new File( projectDirectory, "cwd_1" ); forkDirectory.deleteOnExit(); // user.dir and current working directory must be aligned, base directory is not affected assertEquals( projectDirectory.getCanonicalPath(), System.getProperty( "basedir" ) ); assertEquals( forkDirectory.getCanonicalPath(), System.getProperty( "user.dir" ) ); assertEquals( forkDirectory.getCanonicalPath(), new File( "." ).getCanonicalPath() ); // original working directory (before variable expansion) should not be created assertFalse( new File( "cwd_${surefire.forkNumber}" ).exists() ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1144-xml-runtime/000077500000000000000000000000001330756104600312475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1144-xml-runtime/pom.xml000066400000000000000000000033501330756104600325650ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 org.apache.maven.plugins.surefire surefire1144-xml-runtime 1.0 http://maven.apache.org lamyaa (Lamyaa Eloussi) eloussi2@illinois.edu junit junit 4.0 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1144-xml-runtime/src/000077500000000000000000000000001330756104600320365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1144-xml-runtime/src/test/000077500000000000000000000000001330756104600330155ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600336575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1144-xml-runtime/src/testsurefire1144/000077500000000000000000000000001330756104600360155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1144-xml-runtime/src/test/javaTest1.java000066400000000000000000000041031330756104600376560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1144-xml-runtime/src/test/java/surefire1144package surefire1144; /* * 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. */ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class Test1 { static void sleep( int ms ) { long target = System.currentTimeMillis() + ms; try { do { Thread.sleep( 1L ); } while ( System.currentTimeMillis() < target ); } catch ( InterruptedException e ) { throw new RuntimeException( e ); } } static void printTimeAndSleep( String msg, int ms ) { System.out.println( msg + " started @ " + System.currentTimeMillis() ); sleep( ms ); } @Test public void testSleep100() { printTimeAndSleep( "Test1.sleep100", 100 ); } @Test public void testSleep200() { printTimeAndSleep( "Test1.sleep200", 200 ); } @Test public void testSleep300() { printTimeAndSleep( "Test1.sleep300", 300 ); } @BeforeClass public static void setUpBeforeClass() throws Exception { printTimeAndSleep( "beforeClass sleep 500", 500 ); } @AfterClass public static void tearDownAfterClass() throws Exception { printTimeAndSleep( "afterClass sleep 500", 500 ); } } surefire-1146-rerunFailingTests-with-Parameterized/000077500000000000000000000000001330756104600361245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000042271330756104600374460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1146-rerunFailingTests-with-Parameterized 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-1146 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit 4.12 test maven-surefire-plugin 2 src/000077500000000000000000000000001330756104600367135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1146-rerunFailingTests-with-Parameterizedtest/000077500000000000000000000000001330756104600376725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1146-rerunFailingTests-with-Parameterized/srcjava/000077500000000000000000000000001330756104600406135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1146-rerunFailingTests-with-Parameterized/src/testjiras/000077500000000000000000000000001330756104600417235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1146-rerunFailingTests-with-Parameterized/src/test/javasurefire1146/000077500000000000000000000000001330756104600440635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1146-rerunFailingTests-with-Parameterized/src/test/java/jirasCustomDescriptionParameterizedTest.java000066400000000000000000000035021330756104600537610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1146-rerunFailingTests-with-Parameterized/src/test/java/jiras/surefire1146package jiras.surefire1146; /* * 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. */ import java.util.ArrayList; import java.util.List; import junit.runner.Version; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import static org.junit.Assert.*; @RunWith( Parameterized.class ) public class CustomDescriptionParameterizedTest { private static boolean success; public CustomDescriptionParameterizedTest( String test1, String test2, String test3 ) { } @Parameters( name = "{index}: ({0}); {1}; {2};" ) public static List getParameters() { List parameters = new ArrayList(); parameters.add( new String[]{ "Test11", "Test12", "Test13" } ); parameters.add( new String[]{ "Test21", "Test22", "Test23" } ); return parameters; } @Test public void flakyTest() { System.out.println( "Running JUnit " + Version.id() ); boolean current = success; success = !success; assertTrue( current ); } } CustomDescriptionWithCommaParameterizedTest.java000066400000000000000000000036341330756104600556000ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1146-rerunFailingTests-with-Parameterized/src/test/java/jiras/surefire1146package jiras.surefire1146; /* * 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. */ import java.util.ArrayList; import java.util.List; import junit.runner.Version; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import static org.junit.Assert.*; @RunWith( Parameterized.class ) public class CustomDescriptionWithCommaParameterizedTest { private static boolean success; public CustomDescriptionWithCommaParameterizedTest( String test1, String test2, String test3 ) { } @Parameters( name = "{index}: ({0}), {1}, {2};" ) public static List getParameters() { List parameters = new ArrayList(); parameters.add( new String[]{ "Test11", "Test12", "Test13" } ); parameters.add( new String[]{ "Test21", "Test22", "Test23" } ); parameters.add( new String[]{ "Test31", "Test32", "Test33" } ); return parameters; } @Test public void flakyTest() { System.out.println( "Running JUnit " + Version.id() ); boolean current = success; success = !success; assertTrue( current ); } } SimpleParameterizedTest.java000066400000000000000000000032771330756104600515450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1146-rerunFailingTests-with-Parameterized/src/test/java/jiras/surefire1146package jiras.surefire1146; /* * 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. */ import java.util.ArrayList; import java.util.List; import junit.runner.Version; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import static org.junit.Assert.*; @RunWith( Parameterized.class ) public class SimpleParameterizedTest { private static boolean success; public SimpleParameterizedTest( String test ) { } @Parameters public static List getParameters() { List parameters = new ArrayList(); parameters.add( new String[]{ "Test1" } ); parameters.add( new String[]{ "Test2" } ); return parameters; } @Test public void flakyTest() { System.out.println( "Running JUnit " + Version.id() ); boolean current = success; success = !success; assertTrue( current ); } } StandardTest.java000066400000000000000000000022631330756104600473310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1146-rerunFailingTests-with-Parameterized/src/test/java/jiras/surefire1146package jiras.surefire1146; /* * 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. */ import junit.runner.Version; import org.junit.Test; import static org.junit.Assert.*; public class StandardTest { private static boolean success; @Test public void flakyTest() { System.out.println( "Running JUnit " + Version.id() ); boolean current = success; success = !success; assertTrue( current ); } } surefire-1152-rerunFailingTestsCount-suite/000077500000000000000000000000001330756104600345165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000111111330756104600360260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1152-rerunFailingTestsCount-suite 4.0.0 org.apache.maven.surefire it-parent 1.0 org.apache.maven.plugins.surefire jiras-surefire-1152 1.0 true 2 2 org.apache.maven.plugins maven-surefire-plugin FlakyTestSuite org.apache.maven.plugins maven-failsafe-plugin integration-test verify FlakyITSuite surefire-junit47 org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit47 ${surefire.version} org.apache.maven.plugins maven-failsafe-plugin org.apache.maven.surefire surefire-junit47 ${surefire.version} surefire-junit4 org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit4 ${surefire.version} org.apache.maven.plugins maven-failsafe-plugin org.apache.maven.surefire surefire-junit4 ${surefire.version} junit junit 4.11 test src/000077500000000000000000000000001330756104600353055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1152-rerunFailingTestsCount-suitetest/000077500000000000000000000000001330756104600362645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1152-rerunFailingTestsCount-suite/srcjava/000077500000000000000000000000001330756104600372055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1152-rerunFailingTestsCount-suite/src/testjiras/000077500000000000000000000000001330756104600403155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1152-rerunFailingTestsCount-suite/src/test/javasurefire1152/000077500000000000000000000000001330756104600424525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1152-rerunFailingTestsCount-suite/src/test/java/jirasFlakyIT.java000066400000000000000000000021441330756104600446210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1152-rerunFailingTestsCount-suite/src/test/java/jiras/surefire1152package jiras.surefire1152; /* * 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. */ import org.junit.Test; import static org.junit.Assert.fail; public class FlakyIT { private static int n; @Test public void testFlaky() { if ( n++ == 0 ) { fail( "deliberately flaky test (should pass the next time)" ); } } } FlakyITSuite.java000066400000000000000000000017511330756104600456360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1152-rerunFailingTestsCount-suite/src/test/java/jiras/surefire1152package jiras.surefire1152; /* * 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. */ import org.junit.runner.RunWith; import org.junit.runners.Suite; @RunWith( Suite.class ) @Suite.SuiteClasses( { FlakyIT.class } ) public class FlakyITSuite { } FlakyParent.java000066400000000000000000000026031330756104600455360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1152-rerunFailingTestsCount-suite/src/test/java/jiras/surefire1152package jiras.surefire1152; /* * 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. */ import org.junit.Test; import java.util.HashSet; import java.util.Set; import static org.junit.Assert.fail; public class FlakyParent { // set of test classes which have previously invoked testFlakyParent private static final Set> previouslyRun = new HashSet>(); @Test public void testFlakyParent() { Class clazz = getClass(); if ( !previouslyRun.contains( clazz ) ) { previouslyRun.add( clazz ); fail( "deliberately flaky test (should pass the next time)" ); } } } FlakyTest.java000066400000000000000000000021721330756104600452250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1152-rerunFailingTestsCount-suite/src/test/java/jiras/surefire1152package jiras.surefire1152; /* * 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. */ import org.junit.Test; import static org.junit.Assert.fail; public class FlakyTest extends FlakyParent { private static int n; @Test public void testFlaky() { if ( n++ == 0 ) { fail( "deliberately flaky test (should pass the next time)" ); } } } FlakyTestSuite.java000066400000000000000000000020001330756104600462250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1152-rerunFailingTestsCount-suite/src/test/java/jiras/surefire1152package jiras.surefire1152; /* * 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. */ import org.junit.runner.RunWith; import org.junit.runners.Suite; @RunWith( Suite.class ) @Suite.SuiteClasses( { FlakyTest.class, FlakyParent.class } ) public class FlakyTestSuite { } surefire-1153-includesAndSpecifiedTest/000077500000000000000000000000001330756104600336145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000040241330756104600351310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1153-includesAndSpecifiedTest 4.0.0 org.apache.maven.surefire it-parent 1.0 org.apache.maven.plugins.surefire jiras-surefire-1153 1.0 http://maven.apache.org junit junit 4.12 test maven-surefire-plugin **/*UT.java test src/000077500000000000000000000000001330756104600344035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1153-includesAndSpecifiedTesttest/000077500000000000000000000000001330756104600353625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1153-includesAndSpecifiedTest/srcjava/000077500000000000000000000000001330756104600363035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1153-includesAndSpecifiedTest/src/testjiras/000077500000000000000000000000001330756104600374135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1153-includesAndSpecifiedTest/src/test/javasurefire1153/000077500000000000000000000000001330756104600415515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1153-includesAndSpecifiedTest/src/test/java/jirasIncludedUT.java000066400000000000000000000016611330756104600444200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1153-includesAndSpecifiedTest/src/test/java/jiras/surefire1153package jiras.surefire1153; /* * 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. */ import org.junit.Test; public class IncludedUT { @Test public void testIncluded() { } } NotIncludedTest.java000066400000000000000000000016711330756104600454710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1153-includesAndSpecifiedTest/src/test/java/jiras/surefire1153package jiras.surefire1153; /* * 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. */ import org.junit.Test; public class NotIncludedTest { @Test public void testNotIncluded() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1158-remove-info-lines/000077500000000000000000000000001330756104600323315ustar00rootroot00000000000000pom.xml000066400000000000000000000043411330756104600335710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1158-remove-info-lines 4.0.0 org.apache.maven.surefire it-parent 1.0 org.apache.maven.plugins.surefire surefire-1158 1.0 org.testng testng 5.7 jdk15 junit junit 4.7 org.apache.maven.plugins maven-surefire-plugin always org.apache.maven.surefire ${provider} ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1158-remove-info-lines/src/000077500000000000000000000000001330756104600331205ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600340205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1158-remove-info-lines/srcjava/000077500000000000000000000000001330756104600347415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1158-remove-info-lines/src/testjira1158/000077500000000000000000000000001330756104600362055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1158-remove-info-lines/src/test/javaJUnitTest.java000066400000000000000000000016451330756104600407470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1158-remove-info-lines/src/test/java/jira1158package jira1158; /* * 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. */ import org.junit.Test; public class JUnitTest { @Test public void doNothing() { } } TestNGSuiteTest.java000066400000000000000000000016711330756104600420730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1158-remove-info-lines/src/test/java/jira1158package jira1158; /* * 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. */ import org.testng.annotations.Test; public class TestNGSuiteTest { @Test public void doNothing() { } } surefire-1179-testng-parallel-dataprovider/000077500000000000000000000000001330756104600344775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000054161330756104600360220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1179-testng-parallel-dataprovider 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire surefire-1179-testng-parallel-dataprovider 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava org.testng testng 5.10 jdk15 org.apache.maven.plugins maven-surefire-plugin parallel methods dataproviderthreadcount 30 src/000077500000000000000000000000001330756104600352665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1179-testng-parallel-dataprovidertest/000077500000000000000000000000001330756104600362455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1179-testng-parallel-dataprovider/srcjava/000077500000000000000000000000001330756104600371665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1179-testng-parallel-dataprovider/src/testdebug/000077500000000000000000000000001330756104600402545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1179-testng-parallel-dataprovider/src/test/javaParallelTest.java000066400000000000000000000025201330756104600435120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1179-testng-parallel-dataprovider/src/test/java/debugpackage debug; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import org.testng.annotations.AfterClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; public class ParallelTest { private static final AtomicInteger concurrency = new AtomicInteger(); private static final AtomicInteger counter = new AtomicInteger(); @DataProvider( parallel = true, name = "dataProvider" ) public Iterator dataProvider() { List data = new ArrayList(); for ( int i = 0; i < 5000; i++ ) { data.add( new Object[]{ "ID_" + i } ); } return data.iterator(); } @Test( dataProvider = "dataProvider" ) public void testParallelDataProvider( String iterId ) throws Exception { int methodCount = counter.incrementAndGet(); int currentlyParallelCalls = concurrency.incrementAndGet(); if ( methodCount % 100 == 0 ) { System.out.println( iterId + ": CONCURRENCY=" + currentlyParallelCalls + "." ); } TimeUnit.MILLISECONDS.sleep( 20 ); concurrency.decrementAndGet(); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1185/000077500000000000000000000000001330756104600267755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1185/pom.xml000066400000000000000000000043601330756104600303150ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-1185 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org PMC Europe/Bratislava junit junit 4.0 test maven-surefire-plugin org.apache.maven.surefire surefire-junit4 ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1185/src/000077500000000000000000000000001330756104600275645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1185/src/test/000077500000000000000000000000001330756104600305435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1185/src/test/java/000077500000000000000000000000001330756104600314645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1185/src/test/java/pkg/000077500000000000000000000000001330756104600322455ustar00rootroot00000000000000RunningTest.java000066400000000000000000000016331330756104600353140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1185/src/test/java/pkgpackage pkg; /* * 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. */ import org.junit.Test; public class RunningTest { @Test public void test() { } } UnlistedTest.java000066400000000000000000000016341330756104600354640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1185/src/test/java/pkgpackage pkg; /* * 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. */ import org.junit.Test; public class UnlistedTest { @Test public void test() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1202-rerun-and-failfast/000077500000000000000000000000001330756104600324435ustar00rootroot00000000000000pom.xml000066400000000000000000000104611330756104600337030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1202-rerun-and-failfast 4.0.0 org.apache.maven.plugins.surefire jiras-surefire-1202 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org PMC Europe/Bratislava 1.6 1.6 junit junit 4.12 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} once 1 2 3 alphabetical junit47 true org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit47 ${surefire.version} junit4 org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit4 ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1202-rerun-and-failfast/src/000077500000000000000000000000001330756104600332325ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600341325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1202-rerun-and-failfast/srcjava/000077500000000000000000000000001330756104600350535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1202-rerun-and-failfast/src/testpkg/000077500000000000000000000000001330756104600356345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1202-rerun-and-failfast/src/test/javaATest.java000066400000000000000000000026211330756104600375200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1202-rerun-and-failfast/src/test/java/pkgpackage pkg; /* * 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. */ import org.junit.Test; import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.TimeUnit.SECONDS; public class ATest { private static int count; @Test public void testA() throws Exception { MILLISECONDS.sleep( 500 ); if ( count++ != 2 ) { throw new RuntimeException( "assert \"foo\" == \"bar\"\n" + " |\n" + " false" ); } SECONDS.sleep( 5 ); } }BTest.java000066400000000000000000000022131330756104600375160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1202-rerun-and-failfast/src/test/java/pkgpackage pkg; /* * 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. */ import org.junit.Test; import static java.util.concurrent.TimeUnit.SECONDS; public class BTest { private static int count; @Test public void testB() throws InterruptedException { SECONDS.sleep( 2 ); if ( count++ != 2 ) { throw new RuntimeException(); } } } CTest.java000066400000000000000000000020351330756104600375210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1202-rerun-and-failfast/src/test/java/pkgpackage pkg; /* * 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. */ import org.junit.Test; import static java.util.concurrent.TimeUnit.MILLISECONDS; public class CTest { @Test public void testC() throws InterruptedException { MILLISECONDS.sleep( 500 ); } } DTest.java000066400000000000000000000020351330756104600375220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1202-rerun-and-failfast/src/test/java/pkgpackage pkg; /* * 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. */ import org.junit.Test; import static java.util.concurrent.TimeUnit.MILLISECONDS; public class DTest { @Test public void testD() throws InterruptedException { MILLISECONDS.sleep( 500 ); } } ETest.java000066400000000000000000000016751330756104600375340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1202-rerun-and-failfast/src/test/java/pkgpackage pkg; /* * 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. */ import org.junit.Test; public class ETest { @Test public void test() throws InterruptedException { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1209-rerun-and-forkcount/000077500000000000000000000000001330756104600326735ustar00rootroot00000000000000pom.xml000066400000000000000000000101741330756104600341340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1209-rerun-and-forkcount 4.0.0 org.apache.maven.plugins.surefire jiras-surefire-1209 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org PMC Europe/Bratislava 1.6 1.6 junit junit 4.12 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} 2 3 junit47 true org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit47 ${surefire.version} junit4 org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit4 ${surefire.version} src/000077500000000000000000000000001330756104600334035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1209-rerun-and-forkcounttest/000077500000000000000000000000001330756104600343625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1209-rerun-and-forkcount/srcjava/000077500000000000000000000000001330756104600353035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1209-rerun-and-forkcount/src/testpkg/000077500000000000000000000000001330756104600360645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1209-rerun-and-forkcount/src/test/javaATest.java000066400000000000000000000026211330756104600377500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1209-rerun-and-forkcount/src/test/java/pkgpackage pkg; /* * 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. */ import org.junit.Test; import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.TimeUnit.SECONDS; public class ATest { private static int count; @Test public void testA() throws Exception { MILLISECONDS.sleep( 500 ); if ( count++ != 2 ) { throw new RuntimeException( "assert \"foo\" == \"bar\"\n" + " |\n" + " false" ); } SECONDS.sleep( 5 ); } }BTest.java000066400000000000000000000022131330756104600377460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1209-rerun-and-forkcount/src/test/java/pkgpackage pkg; /* * 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. */ import org.junit.Test; import static java.util.concurrent.TimeUnit.SECONDS; public class BTest { private static int count; @Test public void testB() throws InterruptedException { SECONDS.sleep( 2 ); if ( count++ != 2 ) { throw new RuntimeException(); } } } CTest.java000066400000000000000000000020351330756104600377510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1209-rerun-and-forkcount/src/test/java/pkgpackage pkg; /* * 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. */ import org.junit.Test; import static java.util.concurrent.TimeUnit.MILLISECONDS; public class CTest { @Test public void testC() throws InterruptedException { MILLISECONDS.sleep( 500 ); } } DTest.java000066400000000000000000000020351330756104600377520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1209-rerun-and-forkcount/src/test/java/pkgpackage pkg; /* * 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. */ import org.junit.Test; import static java.util.concurrent.TimeUnit.MILLISECONDS; public class DTest { @Test public void testD() throws InterruptedException { MILLISECONDS.sleep( 500 ); } } ETest.java000066400000000000000000000016751330756104600377640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1209-rerun-and-forkcount/src/test/java/pkgpackage pkg; /* * 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. */ import org.junit.Test; public class ETest { @Test public void test() throws InterruptedException { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1211/000077500000000000000000000000001330756104600267635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1211/pom.xml000066400000000000000000000042241330756104600303020ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 org.apache.maven.plugins.surefire surefire-1211 1.0 org.testng testng 6.9.4 junit junit 4.10 org.apache.maven.plugins maven-surefire-plugin once junit ${junit} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1211/src/000077500000000000000000000000001330756104600275525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1211/src/test/000077500000000000000000000000001330756104600305315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1211/src/test/java/000077500000000000000000000000001330756104600314525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1211/src/test/java/jira1211/000077500000000000000000000000001330756104600327045ustar00rootroot00000000000000JUnitTest.java000066400000000000000000000016451330756104600353670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1211/src/test/java/jira1211package jira1211; /* * 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. */ import org.junit.Test; public class JUnitTest { @Test public void doNothing() { } } TestNGSuiteTest.java000066400000000000000000000016711330756104600365130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1211/src/test/java/jira1211package jira1211; /* * 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. */ import org.testng.annotations.Test; public class TestNGSuiteTest { @Test public void doNothing() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1260-new-tests-pattern/000077500000000000000000000000001330756104600323715ustar00rootroot00000000000000pom.xml000066400000000000000000000040371330756104600336330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1260-new-tests-pattern 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire surefire-1260 1.0 http://maven.apache.org tibordigana Tibor Diga??a (tibor17) tibordigana@apache.org PMC Europe/Bratislava junit junit 4.0 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1260-new-tests-pattern/src/000077500000000000000000000000001330756104600331605ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600340605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1260-new-tests-pattern/srcjava/000077500000000000000000000000001330756104600350015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1260-new-tests-pattern/src/testpkg/000077500000000000000000000000001330756104600355625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1260-new-tests-pattern/src/test/javaJUnit3Tests.java000066400000000000000000000017231330756104600405670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1260-new-tests-pattern/src/test/java/pkgpackage pkg; /* * 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. */ import junit.framework.TestCase; public class JUnit3Tests extends TestCase { public void test1() { } public void test2() { } } JUnit4Tests.java000066400000000000000000000020161330756104600405640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1260-new-tests-pattern/src/test/java/pkgpackage pkg; /* * 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. */ import org.junit.Test; public class JUnit4Tests { @Test public void shouldTestA() { } @Test public void shouldTestB() { } @Test public void shouldTestC() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/000077500000000000000000000000001330756104600267735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/pom.xml000066400000000000000000000027771330756104600303250ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml com.appnexus.viewability.core.surefireJunitTests main 1.0.0 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} 2 all balanced once ${canFail} org.apache.maven.surefire surefire-junit47 ${surefire.version} junit junit 4.12 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/src/000077500000000000000000000000001330756104600275625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/src/test/000077500000000000000000000000001330756104600305415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/src/test/java/000077500000000000000000000000001330756104600314625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/src/test/java/com/000077500000000000000000000000001330756104600322405ustar00rootroot00000000000000appnexus/000077500000000000000000000000001330756104600340245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/src/test/java/comviewability/000077500000000000000000000000001330756104600363545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/src/test/java/com/appnexuscore/000077500000000000000000000000001330756104600373045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/src/test/java/com/appnexus/viewabilitysurefireJunitTests/000077500000000000000000000000001330756104600431655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/src/test/java/com/appnexus/viewability/coreATest.java000066400000000000000000000013011330756104600450430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/src/test/java/com/appnexus/viewability/core/surefireJunitTestspackage com.appnexus.viewability.core.surefireJunitTests; import org.junit.Assert; import org.junit.Test; public class ATest extends BaseTest { public ATest( String param ) { super( param ); } @Test public void methodA1() throws InterruptedException { sleep( 10 ); if ( Boolean.getBoolean( "canFail" ) ) { Assert.fail( "Failing test: ATest.methodA1[" + param + "]" ); } } @Test public void methodA2() throws InterruptedException { sleep( 10 ); if ( Boolean.getBoolean( "canFail" ) ) { Assert.fail( "Failing test: ATest.methodA2[" + param + "]" ); } } } BTest.java000066400000000000000000000013011330756104600450440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/src/test/java/com/appnexus/viewability/core/surefireJunitTestspackage com.appnexus.viewability.core.surefireJunitTests; import org.junit.Assert; import org.junit.Test; public class BTest extends BaseTest { public BTest( String param ) { super( param ); } @Test public void methodB1() throws InterruptedException { sleep( 10 ); if ( Boolean.getBoolean( "canFail" ) ) { Assert.fail( "Failing test: BTest.methodB1[" + param + "]" ); } } @Test public void methodB2() throws InterruptedException { sleep( 10 ); if ( Boolean.getBoolean( "canFail" ) ) { Assert.fail( "Failing test: BTest.methodB2[" + param + "]" ); } } } BaseTest.java000066400000000000000000000024121330756104600455410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/src/test/java/com/appnexus/viewability/core/surefireJunitTestspackage com.appnexus.viewability.core.surefireJunitTests; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.Collection; import org.junit.Rule; import org.junit.rules.TestName; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @RunWith( Parameterized.class ) public abstract class BaseTest { protected final String param; public BaseTest( String param ) { this.param = param; } @Rule public TestName testName = new TestName(); @Parameters( name = "{0}" ) public static Collection< String > parameterList() throws Exception { Collection< String > c = new ConcurrentLinkedQueue< String >(); c.add( "p0" ); c.add( "p1" ); return c; } public void sleep( int time ) { System.err.println( "Start: " + this.getClass().getSimpleName() + "." + testName.getMethodName() ); try { Thread.sleep( time * 100 ); } catch ( InterruptedException e ) { // TODO Auto-generated catch block e.printStackTrace(); } System.err.println( "End: " + this.getClass().getSimpleName() + "." + testName.getMethodName() ); } } CTest.java000066400000000000000000000012771330756104600450610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/src/test/java/com/appnexus/viewability/core/surefireJunitTestspackage com.appnexus.viewability.core.surefireJunitTests; import org.junit.Assert; import org.junit.Test; public class CTest extends BaseTest { public CTest( String param ) { super( param ); } @Test public void methodC1() throws InterruptedException { sleep( 1 ); if ( Boolean.getBoolean( "canFail" ) ) { Assert.fail( "Failing test: CTest.methodC1[" + param + "]" ); } } @Test public void methodC2() throws InterruptedException { sleep( 1 ); if ( Boolean.getBoolean( "canFail" ) ) { Assert.fail( "Failing test: CTest.methodC2[" + param + "]" ); } } } DTest.java000066400000000000000000000012771330756104600450620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1264/src/test/java/com/appnexus/viewability/core/surefireJunitTestspackage com.appnexus.viewability.core.surefireJunitTests; import org.junit.Assert; import org.junit.Test; public class DTest extends BaseTest { public DTest( String param ) { super( param ); } @Test public void methodC1() throws InterruptedException { sleep( 1 ); if ( Boolean.getBoolean( "canFail" ) ) { Assert.fail( "Failing test: DTest.methodD1[" + param + "]" ); } } @Test public void methodC2() throws InterruptedException { sleep( 1 ); if ( Boolean.getBoolean( "canFail" ) ) { Assert.fail( "Failing test: DTest.methodD2[" + param + "]" ); } } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1265/000077500000000000000000000000001330756104600267745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1265/pom.xml000066400000000000000000000035211330756104600303120ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 org.apache.maven.plugins.surefire surefire-1265 1.0 UTF-8 9 9 junit junit 4.12 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1265/src/000077500000000000000000000000001330756104600275635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1265/src/test/000077500000000000000000000000001330756104600305425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1265/src/test/java/000077500000000000000000000000001330756104600314635ustar00rootroot00000000000000J9Test.java000066400000000000000000000004631330756104600333740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1265/src/test/javaimport org.junit.Test; public class J9Test { @Test public void test_sql_mod() throws java.sql.SQLException { System.out.println( System.getProperty( "java.specification.version" ) ); } @Test public void test_corba_mod() /*throws org.omg.CORBA.BAD_INV_ORDER*/ { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1278-group-name-ending/000077500000000000000000000000001330756104600323125ustar00rootroot00000000000000pom.xml000066400000000000000000000036731330756104600335610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1278-group-name-ending 4.0.0 org.apache.maven.plugins.surefire jiras-surefire-1278 1.0-SNAPSHOT Test for testng groups 1.6 1.6 org.testng testng 6.8.7 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} group maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1278-group-name-ending/src/000077500000000000000000000000001330756104600331015ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600340015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1278-group-name-ending/srcjava/000077500000000000000000000000001330756104600347225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1278-group-name-ending/src/testpkg/000077500000000000000000000000001330756104600355035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1278-group-name-ending/src/test/javaATest.java000066400000000000000000000021401330756104600373630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1278-group-name-ending/src/test/java/pkgpackage pkg; /* * 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. */ import org.testng.Assert; import org.testng.annotations.Test; /** * Tests grouping */ public class ATest { @Test(groups = {"group"}) public void group() { } @Test(groups = {"agroup"}) public void agroup() { Assert.fail("Group should not be run"); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1364/000077500000000000000000000000001330756104600267745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1364/pom.xml000066400000000000000000000142761330756104600303230ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 org.apache.maven.plugins.surefire surefire-1364 1.0 UTF-8 once junit junit 4.12 test org.apache.maven.plugins maven-compiler-plugin 3.7.0 FirstTest.java SecondTest.java org.apache.maven.plugins maven-surefire-plugin ${forkedMode} forkedValue${surefire.forkNumber} junit3 org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit3 ${surefire.version} junit47 org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-junit47 ${surefire.version} testng org.testng testng 6.8.21 test org.apache.maven.plugins maven-compiler-plugin *.java org.apache.maven.plugins maven-surefire-plugin org.apache.maven.surefire surefire-testng ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1364/src/000077500000000000000000000000001330756104600275635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1364/src/test/000077500000000000000000000000001330756104600305425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1364/src/test/java/000077500000000000000000000000001330756104600314635ustar00rootroot00000000000000FirstTest.java000066400000000000000000000017661330756104600342100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1364/src/test/java/* * 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. */ import junit.framework.TestCase; import org.junit.Test; public class FirstTest extends TestCase { @Test public void test() throws InterruptedException { Thread.sleep( 100 ); } } SecondTest.java000066400000000000000000000017671330756104600343350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1364/src/test/java/* * 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. */ import junit.framework.TestCase; import org.junit.Test; public class SecondTest extends TestCase { @Test public void test() throws InterruptedException { Thread.sleep( 100 ); } } ThirdTest.java000066400000000000000000000017211330756104600341620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1364/src/test/java/* * 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. */ import org.testng.annotations.Test; public class ThirdTest { @Test public void test() throws InterruptedException { Thread.sleep( 100 ); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1367/000077500000000000000000000000001330756104600267775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1367/pom.xml000066400000000000000000000041731330756104600303210ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire surefire-1367 1.0 UTF-8 junit junit 4.12 test maven-surefire-plugin ${forkMode} true maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1367/src/000077500000000000000000000000001330756104600275665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1367/src/test/000077500000000000000000000000001330756104600305455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1367/src/test/java/000077500000000000000000000000001330756104600314665ustar00rootroot00000000000000ATest.java000066400000000000000000000022421330756104600332720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1367/src/test/java/* * 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. */ import org.junit.Test; import static org.junit.Assume.assumeTrue; public class ATest { @Test public void test() { System.out.println("Hi"); System.out.println(); System.out.println("There!"); System.err.println("Hello"); System.err.println(); System.err.println("What's up!"); assumeTrue( false ); } } BTest.java000066400000000000000000000020631330756104600332740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1367/src/test/java/* * 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. */ import org.junit.Test; import static org.junit.Assume.assumeTrue; public class BTest { @Test public void test() { System.out.println("Hey"); System.out.println(); System.out.println("you!"); assumeTrue( false ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1383/000077500000000000000000000000001330756104600267755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1383/pom.xml000066400000000000000000000032621330756104600303150ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire surefire-1383 1.0 pom runner sut UTF-8 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1383/runner/000077500000000000000000000000001330756104600303065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1383/runner/pom.xml000066400000000000000000000030411330756104600316210ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire surefire-1383 1.0 surefire-1383-runner org.testng testng 6.5.1 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1383/runner/src/000077500000000000000000000000001330756104600310755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1383/runner/src/main/000077500000000000000000000000001330756104600320215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1383/runner/src/main/java/000077500000000000000000000000001330756104600327425ustar00rootroot00000000000000pkg/000077500000000000000000000000001330756104600334445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1383/runner/src/main/javaDynamicRunningTest.java000066400000000000000000000021411330756104600400720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1383/runner/src/main/java/pkgpackage pkg; /* * 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. */ import org.testng.annotations.Test; @Test public class DynamicRunningTest { public void shouldRun() { // Test runners such as this one may dynamically invoke other frameworks such as Cucumber, Selenium, etc. // The actual operation is not relevant to the issue. } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1383/sut/000077500000000000000000000000001330756104600276105ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1383/sut/pom.xml000066400000000000000000000042301330756104600311240ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire surefire-1383 1.0 surefire-1383-sut ${project.groupId} surefire-1383-runner ${project.version} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${project.groupId}:surefire-1383-runner true surefire-1396-pluggableproviders-classpath-provider/000077500000000000000000000000001330756104600364305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000034341330756104600377510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath-provider 4.0.0 org.apache.maven.plugins.surefire surefire-test-classpath-provider 1.0-SNAPSHOT Test provider 1.6 1.6 org.apache.maven.surefire surefire-api ${surefire.version} src/main/resources/META-INF META-INF src/000077500000000000000000000000001330756104600372175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath-providermain/000077500000000000000000000000001330756104600401435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/srcjava/000077500000000000000000000000001330756104600410645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/src/mainorg/000077500000000000000000000000001330756104600416535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/src/main/javaapache/000077500000000000000000000000001330756104600430745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/src/main/java/orgmaven/000077500000000000000000000000001330756104600442025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/src/main/java/org/apachesurefire/000077500000000000000000000000001330756104600460265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/src/main/java/org/apache/maventestprovider/000077500000000000000000000000001330756104600505605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/src/main/java/org/apache/maven/surefiretestprovider/ClassPathTestProvider.java000066400000000000000000000043301330756104600556600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/src/main/java/org/apache/maven/surefirepackage org.apache.maven.surefire.testprovider; /* * 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. */ import java.lang.reflect.InvocationTargetException; import java.util.LinkedList; import java.util.Map.Entry; import org.apache.maven.surefire.providerapi.AbstractProvider; import org.apache.maven.surefire.providerapi.ProviderParameters; import org.apache.maven.surefire.report.ReporterException; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.TestSetFailedException; /** * @author Jonathan Bell */ public class ClassPathTestProvider extends AbstractProvider { boolean hasSLF4J; // SLF4J is not being included in our deps, so if it's in the classpath, that's a problem... public ClassPathTestProvider( ProviderParameters params ) { for ( Entry propEntry : params.getProviderProperties().entrySet() ) { if ( propEntry.getKey().startsWith( "surefireClassPathUrl" ) && propEntry.getValue().contains( "slf4j" ) ) hasSLF4J = true; } } public Iterable> getSuites() { LinkedList> ret = new LinkedList>(); return ret; } public RunResult invoke( Object arg0 ) throws TestSetFailedException, ReporterException, InvocationTargetException { if ( hasSLF4J ) throw new TestSetFailedException( "SLF4J was found on the boot classpath" ); return new RunResult( 1, 0, 0, 0 ); } } resources/000077500000000000000000000000001330756104600421555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/src/mainMETA-INF/000077500000000000000000000000001330756104600433155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/src/main/resourcesservices/000077500000000000000000000000001330756104600451405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/src/main/resources/META-INForg.apache.maven.surefire.providerapi.SurefireProvider000066400000000000000000000000751330756104600576450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/src/main/resources/META-INF/servicesorg.apache.maven.surefire.testprovider.ClassPathTestProvider surefire-1396-pluggableproviders-classpath/000077500000000000000000000000001330756104600346005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000055221330756104600361210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath 4.0.0 org.apache.maven.plugins.surefire pluggableproviders-classpath 1.0-SNAPSHOT pluggableproviders-classpath-test 1.6 1.6 junit junit 4.8.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} org.apache.maven.plugins.surefire surefire-test-classpath-provider 1.0-SNAPSHOT org.apache.maven.plugins maven-failsafe-plugin ${surefire.version} integration-test verify org.apache.maven.plugins.surefire surefire-test-classpath-provider 1.0-SNAPSHOT src/000077500000000000000000000000001330756104600353675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpathtest/000077500000000000000000000000001330756104600363465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath/srcjava/000077500000000000000000000000001330756104600372675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath/src/testpluggableproviders/000077500000000000000000000000001330756104600431675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath/src/test/javaEmptyIT.java000066400000000000000000000015431330756104600453700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath/src/test/java/pluggableproviderspackage pluggableproviders; /* * 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. */ public class EmptyIT { } EmptyTest.java000066400000000000000000000015451330756104600457750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1396-pluggableproviders-classpath/src/test/java/pluggableproviderspackage pluggableproviders; /* * 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. */ public class EmptyTest { } surefire-141-pluggableproviders-provider/000077500000000000000000000000001330756104600343535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000034171330756104600356750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders-provider 4.0.0 org.apache.maven.plugins.surefire surefire-test-provider 1.0-SNAPSHOT Test provider 1.6 1.6 org.apache.maven.surefire surefire-api ${surefire.version} src/main/resources/META-INF META-INF src/000077500000000000000000000000001330756104600351425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders-providermain/000077500000000000000000000000001330756104600360665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders-provider/srcjava/000077500000000000000000000000001330756104600370075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders-provider/src/mainorg/000077500000000000000000000000001330756104600375765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders-provider/src/main/javaapache/000077500000000000000000000000001330756104600410175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders-provider/src/main/java/orgmaven/000077500000000000000000000000001330756104600421255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders-provider/src/main/java/org/apachesurefire/000077500000000000000000000000001330756104600437515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders-provider/src/main/java/org/apache/maventestprovider/000077500000000000000000000000001330756104600465035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders-provider/src/main/java/org/apache/maven/surefiretestprovider/TestProvider.java000066400000000000000000000047241330756104600520070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders-provider/src/main/java/org/apache/maven/surefirepackage org.apache.maven.surefire.testprovider; /* * 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. */ import org.apache.maven.surefire.providerapi.AbstractProvider; import org.apache.maven.surefire.providerapi.ProviderParameters; import org.apache.maven.surefire.report.ReporterException; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.TestSetFailedException; /** * @author Kristian Rosenvold */ public class TestProvider extends AbstractProvider { public TestProvider( ProviderParameters booterParameters ) { invokeRuntimeExceptionIfSet( System.getProperty( "constructorCrash" ) ); } public Iterable> getSuites() { invokeRuntimeExceptionIfSet( System.getProperty( "getSuitesCrash" ) ); return null; } public RunResult invoke( Object forkTestSet ) throws TestSetFailedException, ReporterException { throwIfSet( System.getProperty( "invokeCrash" ) ); return new RunResult( 1, 0, 0, 2 ); } private void throwIfSet( String throwError ) throws TestSetFailedException, ReporterException { if ( "testSetFailed".equals( throwError ) ) { throw new TestSetFailedException( "Let's fail" ); } if ( "reporterException".equals( throwError ) ) { throw new ReporterException( "Let's fail with a reporterexception", new RuntimeException() ); } invokeRuntimeExceptionIfSet( throwError ); } private void invokeRuntimeExceptionIfSet( String throwError ) { if ( "runtimeException".equals( throwError ) ) { throw new RuntimeException( "Let's fail with a runtimeException" ); } } } resources/000077500000000000000000000000001330756104600401005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders-provider/src/mainMETA-INF/000077500000000000000000000000001330756104600412405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders-provider/src/main/resourcesservices/000077500000000000000000000000001330756104600430635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders-provider/src/main/resources/META-INForg.apache.maven.surefire.providerapi.SurefireProvider000066400000000000000000000000641330756104600555660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders-provider/src/main/resources/META-INF/servicesorg.apache.maven.surefire.testprovider.TestProvider maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders/000077500000000000000000000000001330756104600326025ustar00rootroot00000000000000pom.xml000066400000000000000000000045601330756104600340450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders 4.0.0 org.apache.maven.plugins.surefire surefire141-test 1.0-SNAPSHOT surefire-141-pluggableproviders junit junit 4.8.1 test 2.12.4 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} org.apache.maven.surefire surefire-junit3 ${surefire.version} org.apache.maven.plugins.surefire surefire-test-provider 1.0-SNAPSHOT maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders/src/000077500000000000000000000000001330756104600333715ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600342715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders/srcjava/000077500000000000000000000000001330756104600352125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders/src/testsurefire141/000077500000000000000000000000001330756104600372645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders/src/test/javaBasicTest.java000066400000000000000000000041571330756104600420170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders/src/test/java/surefire141package surefire141; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class BasicTest extends TestCase { private boolean setUpCalled = false; private static boolean tearDownCalled = false; public BasicTest( String name ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite(); Test test = new BasicTest( "testSetUp" ); suite.addTest( test ); TestSetup setup = new TestSetup( suite ) { protected void setUp() { //oneTimeSetUp(); } protected void tearDown() { oneTimeTearDown(); } }; return setup; } protected void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } protected void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } public void testSetUp() { assertTrue( "setUp was not called", setUpCalled ); } public static void oneTimeTearDown() { assertTrue( "tearDown was not called", tearDownCalled ); } } TestTwo.java000066400000000000000000000016571330756104600415510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-141-pluggableproviders/src/test/java/surefire141package surefire141; /* * 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. */ import junit.framework.TestCase; public class TestTwo extends TestCase { public void testTwo() {} } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-146-forkPerTestNoSetup/000077500000000000000000000000001330756104600324755ustar00rootroot00000000000000pom.xml000066400000000000000000000037401330756104600337370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-146-forkPerTestNoSetup 4.0.0 org.apache.maven.plugins.surefire forkPerTestNoSetup 1.0-SNAPSHOT Test for SUREFIRE-146 (forkMode=pertest fails to call setUp) 1.6 1.6 junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} pertest maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-146-forkPerTestNoSetup/src/000077500000000000000000000000001330756104600332645ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600341645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-146-forkPerTestNoSetup/srcjava/000077500000000000000000000000001330756104600351055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-146-forkPerTestNoSetup/src/testforkPerTestNoSetup/000077500000000000000000000000001330756104600406735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-146-forkPerTestNoSetup/src/test/javaTestSurefire2.java000066400000000000000000000041741330756104600442520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-146-forkPerTestNoSetup/src/test/java/forkPerTestNoSetuppackage forkPerTestNoSetup; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class TestSurefire2 extends TestCase { private boolean setUpCalled = false; private static boolean tearDownCalled = false; public TestSurefire2( String name, String extraName ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite(); Test test = new TestSurefire2( "testSetUp", "dummy" ); suite.addTest( test ); return new TestSetup( suite ) { protected void setUp() { //oneTimeSetUp(); } protected void tearDown() { oneTimeTearDown(); } }; } protected void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } protected void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } public void testSetUp() { assertTrue( "setUp was not called", setUpCalled ); } public static void oneTimeTearDown() { assertTrue( "tearDown was not called", tearDownCalled ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1490/000077500000000000000000000000001330756104600267745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1490/pom.xml000066400000000000000000000066101330756104600303140ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 org.apache.maven.plugins.surefire surefire-1490 1.0 junit junit 4.12 test maven-failsafe-plugin ${surefire.version} integration-tests integration-test verify-integration-tests verify maven-surefire-report-plugin ${surefire.version} reports report-only failsafe-report-only maven-project-info-reports-plugin 2.9 index summary maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1490/src/000077500000000000000000000000001330756104600275635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1490/src/test/000077500000000000000000000000001330756104600305425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1490/src/test/java/000077500000000000000000000000001330756104600314635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1490/src/test/java/it/000077500000000000000000000000001330756104600320775ustar00rootroot00000000000000Surefire1490IT.java000066400000000000000000000016361330756104600352300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1490/src/test/java/itpackage it; /* * 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. */ import org.junit.Test; public class Surefire1490IT { @Test public void test() { } } Surefire1490Test.java000066400000000000000000000016401330756104600356260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-1490/src/test/java/itpackage it; /* * 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. */ import org.junit.Test; public class Surefire1490Test { @Test public void test() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/000077500000000000000000000000001330756104600320515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/pom.xml000066400000000000000000000021351330756104600333670ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire.its surefire-162-charsetProvider Test alternate CharsetProvider 1.0-SNAPSHOT 1.6 1.6 maven-surefire-plugin ${surefire.version} once true junit junit 3.8.1 test jcharset jcharset 1.2.1 runtime maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/repo/000077500000000000000000000000001330756104600330165ustar00rootroot00000000000000jcharset/000077500000000000000000000000001330756104600345425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/repojcharset/000077500000000000000000000000001330756104600363455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/repo/jcharset1.2.1/000077500000000000000000000000001330756104600370045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/repo/jcharset/jcharsetjcharset-1.2.1.jar000066400000000000000000000542771330756104600417610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/repo/jcharset/jcharset/1.2.1PK  xk3 META-INF/PKxk3META-INF/MANIFEST.MFóMÌËLK-.Ñ K-*ÎÌϳR0Ô3àårÌCq,HLÎHUŠ%MõŒx¹œ‹RKRSt*­Àbñ†ºI Á¥y ¾™ÉEùÅ•Å%©¹Å žyÉzš¼\¼\PKÎ\.N^kPK Nk3net/PK Nk3net/freeutils/PK  xk3net/freeutils/charset/PK xk35net/freeutils/charset/ByteLookupCharset$Decoder.class•TËRQ=& "ï÷S ‰„ ¢‚$ ° BQ.¨!Èh˜¡&«Øø~€e¹q‹¢åÂ…K¿ÁoûäQŤêÞôéîÓÏÜï?¿|‚•PP€‚ ny0ˆC)cXˆ·ÅqGw=Œí=¡½/ãŒQB©“1r=CÂÔЖ­ëyÇÈæB©Œfç‰ì9z²^äw£'ÈAYÙ3Œî)&7LÙ Ä|×fH<×^j!Ó°Îl~kü«)j¥u‚7a˜úb~gS·“Úf–‘ê„•Ò²«šmù”DyZO±›MP㦩ÛѬ–Ëé¬_7«žS®Ï•bÇæâY<é‚1ìæ|禂6’ßÚbžsPø‚þ+XEÔe=—Ï fâžRœs0LBݕĄ+ï\Ò^ˆÀ#ÉêbŽgL¤ØúŽÆ32·9í+o§ô˜!:WÿG ŸŠjŒ©ð↌qÑ'cBE?&e<’1¥"‚¨ŠįˆaRUÌ"®bó*ˆBÿÙtBG±nŸ[øŠO$›Óͨ¼$‘õäÌFri#:;µL¨¹¢ÍÜeŸ?~QwÞdBë߯H([ZYŽ%–ÖíÿšxɶȈƒEØo×ÊŽañìk}ñ Ër6Üê-»eÙ;z:fÙ ÝÜv2„®K¶EÂìŠiôEýEÖFyº8}’4ºøQ©äG†Ã‰Eà» âã‚ÄH ˵,ÅY*á»b ¨ªŸ@p}(˜ÕñY)”äL T*G=cõ¬c4 ¹@X´hÛÐ~JûƒýJùNÂuˆ’Q)piÄ]ç^—Ò#î7 Á-½ƒ|€Òý&¡•«püjp¢Íõ5–ˤô”5é3<ûÁ¶×G(_{üíêþYvÃP9»z(Ô/5¢‰šÐEÍ襄©#Ô†)jGŒ:±@]xBÝ… &8·0:øÛY(>yVK’ÛÖÍ5ˆ_7ÑÃqÌ£}\3üê„›Q_!?šøö°}?Þ~PK%ØPK xk35net/freeutils/charset/ByteLookupCharset$Encoder.class•U]OÓ`~ÞÒ­tÆPPDecÈe* Ê“áb°ŒÂª£]ºÎÄÄøüÆxÃ-Dã…·&þ õÞøý5Ï[È—ômÏyÎyÎg»ç?Ÿ<ŠqDFšd›=hA«GÑ*ãÚ¸æÇq~œðî$GÛ9Ú!¡SÂ)·Ò³uÍ „¡Ù¡iKÓr¶žÎ†’)ÕÊ’&rÓÖ¦y=—‰®h:äᛆÒl=Iº¡Û] 1ÿ¶×ÔjÈÐÍ5›ßH`”AŒšSÃ΄nh¹ÙIÍQ'Ó¤)K˜I5=ªZ:—W•"/€Aê5’äf1(qÃЬhZÍf5Z¶›UÝ*Õ'$ɱ*– Í1&‚ C¿Ý”›DrÓÓij®ä±V•-XyÔ!-›Ksf6IWœ.ê­Ë^©Q'…  ¾-#1˜9{º!$Í(íJfãœI¶´Y•¦fÌP!ÃfÎJj1Ç©ø£)MœPAºìD‰„Ó Î ¡[A"¢zô"¦à,úÄáG¿‚sH(8ƒˆ1„þs 5ùú¿náÏ?£XŒïRý6£ÒÚDûº‡&F'"—Gz¼[ô™úçÄ7bë]fØû·Á2ŽöŃc ûþµ3<# %¿Œ™Õmݤá—ûãÖgmºÞœ1«f2|Ub¦•ÐŒ;ÅP»É8Oœ ßšÝþH ÏâÈzV²F-}gŠé»C¯!ߺ—‚ÿˆ¤ñ’\NRœ¤º54*Ê#°†àC3Åø^@Á+TTA9`ªÂ"ìÁ^‡¶ûVh™—ü 3!,¢ Ý\‚–|Òeq*,ÝÅÅÆ%¸Äûàž'L ‹•.ŸXRx«µÝ]é~I˜ƒRéö‰¥X¾ÝÔU-܃7H†…âÔä1ñ1<óÕ¼³„csËs Pæ×owj o¨ú·¨Ä;êÈ{Âñmø„>|¦}ÿ‚KøŠ+ø†¾ã:~8EQú}8ˆì§R‚ôÕÒ“H~a ½›·ÖuÄÌœ§Ã¨§dLÃ\ý*½yû©…ñðü)ÀCöEô7°â/PK-ˆ0>"PK xk3-net/freeutils/charset/ByteLookupCharset.class•V]lUþÆÏŒ'Iܺ`¨ÁmYâ8NÜ–6@ÿ MâÖmºi6%„ÒNÜI2©3cìI›Ò (?åïeµ»h—-Hy $H«e·[ ÄO+íÃJ«Ý—Õ¾ð¸ìw¯÷Ï­‚%ÏÜ{î9ß9÷;çÜ;_ÿïOWdñžƒ&žÂˆ‰§1ªãí‰þs?í&VáŽgM„qØÀñ¶ Œ(8*f¶‰qL˜4à˜2pÌ@Q,L›X 7LO¦¬‡Ò hÆF´àt˵çÞøkiF ë°^ÚóŒ¨úU–!È8€‰6žn]ÉÑE<•^Ù½-ø¹D«qº ?íQòꌩë7iqí*Ú©úgs“ìÑcz\»r-q-¦æteþ§ÿP1® $´r`.@É|çg’ ø´ò™# »9ÚƒåÈ#޽Xƒ}¤e€!ïçV~‰-Ä“8À•A>‡0‚a¦Í‘Øä ÜÖI€Në-Ü|éISò(G!"eñ©×¨µ›( ’‚g°™#AùmÚeBŽ`+S#¨ÚFÌ*A§¶ÎÕÓ—aä¿Bxä̽Ám™hÓ"ƒ=jLíäο‘´„â¡«X“˜ *­Fé·hI¨ÃÌD›…j&z—xÍãƒÄïëBÔ"1µµõ"Å­kÐz0S/£­jUÕëÑbZ÷©í /}°¸VfÕÕ§v­þŠþ’Ú}&! Ö—³÷ìóíËùö™=ó÷¿¿½àÃw"z1zç0&ÒrKDÆÝá¶€;"ˆˆˆbBÀ$ÇÜuãdS"$Œ ˜QÃ匈:.gE4py_D—1-\ΉhŨˆy¼/â<° ¢ƒ[\xȳ)\[t#Ù%¨|Y°"`U€Æ ʺ:_U¬„šd¨ ¯)›Š/•Ôt_DÙ0Tåö -G6ƒ¦®«ñ¤f„q]Õ -yÁÑç™apÍ%•ÇÒ 5šZ_T­)eQ'KCØŒ+úŒbiü9gt&W5 ~>l¨Iß²¥ª<~—Kë få¤enjKªEÙjr[c¦¥âû²…銱ⓓ–f¬£Ûqu#wwž ÝP™Üã í¯ŠßÒç9BU(©ZJÒä¥;9O@ah*`Ôb¨ˆ'§æ_•Åa Q!¢l¦¬¸:¦q.›ŠØäîà•p}\[Ã#º„u ­Çe`JØÀ‡, PÙe“àA¿€”„MŒ0t—oâôÔØ•àÁó™°c*z{®Å# Ÿás _àK_ øZÂ|#á[Îz]ñ <6{QózJz›ØÐJaî¤6·T+¨$ø:¸¼…—¾º`0Ðí[á<ô}õ&×h$<¥¦‚Sdm4Y(BPWtÑ rÚFò©-2Q¥†º2Iň—TšOÕTnJQ:-÷–c#nZ–ò˜"»”DXKðÎöÍ{$ÛƒÃ(Ks¹,|H¦ŒusI[¶GÜÑüSªx|zŽ›ªNÃAŽ•å/CôkR/(ºF¥Úê æ’lO‘êM¼Ò±D!V•DTÝNÚ~Ž—Fè¦W/}ì*Pŧ iU|t‚ñ¡CëûcH3deÿد¶Ã ­.ÛØEÛ ž À›¸H’aoåœ"´“äÅ]Tü¡? ii8÷QY?àŠxÿD7 !*þ¸W”E¼O)@;Õãʼn\Â^Ò(%‚ˆK´{§á'ÌUB SºsÍ.¨Ÿ’^ ¿· ç°½²¥qí2ùñØ'Éw˜04Ò0’+w4wÖÆ]ˆùrÅ}¸žæO^c‡ Q!·Áḩ ÐÇÄ‹‹,{uÂïpÅH±=TË1g5¤ÕÊ±Ê êH«—c® Hk”cBM¤5˱ª ZH;)Çêh»•Ô69<ðíÏqêÄ :ÈÔq\ïxñ3¢C#No›3ÓÄrñü†³ü¹kÝ #•m•û8Ãð#:¼\=˨ =G°;/ÿyâ`;/w½ÏPqØðA¸iBs˜¥¿•<À ­:ÒTðñ Ùvé% Õ¦å:ý{œ¥]#tܰ9wú.í½c¹—#-B_¶¸I´-à>Þ¥É{´ó¿÷PKŒ¼à›½™ PK xk3.net/freeutils/charset/GSMCharset$Decoder.classTKOQþn;e Ž¼«¨¢¶€| ÈChi¡XBˆ‰dh§0¦!Ó©‰‰;—.]dÃJ…ª€$b4®üQ⹥Вð°Éœ{Ïë»ç|÷Üþù»½À‹ûvãŠWá¶ÃwšÐÌÕ.®qÑÊmÞ"´¡‹ëvRoðà›"n‰è`(èV5ÕìepºÃOä§²WSuodA6’Šéõï­]ž)Á¯G†’°ª)#©ÄœbLÊsq²”‡õˆŸ’ •ëY£`.¨Iq@‰PšÁ …4M1üq9™TÈÑÖ?f(JÊTãɃ'dm̦v1X"”Q}|y öh&8¬ë‹ Ãyøž™Š/‹NÎÈó²FϨüÔq%™Šsd¡/DßÕ¡j Ž#Á¬zÊ<äÍ;…¡ÈP21­ÍS±zʈ(A•U’븕§J(Ámw$\B§ˆ»"º$t£GB/îIèC'ý|èá—0€€„ ƒ’Â0ƒûÉe¨?ŽÕ\Ä ƒ òѨ8‚"Äí åûr|0ÔžÄ:CáèT`<f¨;킬óŠ™9ÌGy‹zR5U®©ÒÊ»ÛÜ=<؇n8%BñÍLf'GgýCýã³ ÿX`€áu&åûè$äxL7J4¨aE›7\‡ª8¦E>8Un¿çÈÙ géóŸMG)ÊHë#ÍBkaS³$m‚­g"ÊIÚ3ö÷±‚ ÚÛ‹C%Îgp Q… „" 5{h¬Vo©y–›Ã6#D;lï`´lÀ*¬@LCX#Ÿ­×YZ³ o6à-Ê›ÉZ D7 N§Q¸“F‘³ »/[;„U§aßׂey)Âάµ8„7¦Ww_sˆƒFF2å Â>RÛŸ¨ì5Ôb(IÓŸÛg´ã ½¯DÅ&ØÂ¾aÛxŒïˆb:~ÀÄO<Ç/¼Âï ÚÑ2FÍÖÂI¸(¶ŽvVZ]Y‘p@ÕêÑ@ñ ©®¼ §é„ö™J/ÁœtFÕ¤PKIP?É¢PK xk3.net/freeutils/charset/GSMCharset$Encoder.classSYOQþn;í´uµÊ¾ Ú¨¢‚²ÓÒB±,„p(Œ–™f:5jŒû¾EüÆøÂ+ò€Æ_MüQâ¹-’°8ÉÜ9÷œïlß9óçïÏ_qá$<.xásÁŸMhæ×'YÏóã¿¶ò㢋¬—8î2ǵ‰hq…ÁÞ¥jªÙÃPå‰Ý”oËMÕñÙH)f ”ývz§„¾¨0äÇTMM¯.(Æ”¼ MQLˉiÙPù}G)˜+jŠA kqr3¤¨¦)F(!§R |1â/Š’6ÕDj7ãàäÈNÒ†×NKœ<Ê/Á¥dÀ1]O2 çtÂ!ÁôÒÅÙSïšÊŽÒ{@TžuBI¥<2[ 7JoœÁff›³Ì‘¢j î31Xõ´¹Ïš“’Ái(«2Ñ®-Så“zÚˆ+•Îßk¿…»JÈÇUÑ)¢KD·„ôJèC¿ˆ „$„ùA'?% !*a×$ÄÐËàù_¦j£xqÄ–D"|OŠ`„ñx£¹¶=>*ƒcl:<‰Í0T7-ë²bf’…jë›–24Ô?1?56œ “ßlI®r><êPI=¥šªNS/ñDsöfw¬ÅimUN&ùŽDt#¦hËæ CÝ>ð!e'ùº”z‚ÞÃ6æúè@–Ô!~{þX Ð~€¡n}t³Ð×áóKyßÁ¾eEtº2z"R(&éT‡œÎÄq eE@9*²ÑX;¬„Öü[°´ÙÝöYa±Íþš¶`µ}…¸ aƒl¶6av·Pà¸×Úa+³ý†hY‡Tfs …Ø~ÐÒSeù‚îMˆÇ@ŠýÌ!,nÁ9#ü€k£© b 'fšª8f‹ëÛ÷7!mì¶É´ýv<&žPOQ‰g¨Çs4ãò’þŒWÇkÄñ+xK¼Ã| ¯¤YÃ{|ÊP2DÍöa„ü«¨ñzÜB5IŹÔÂÆ©Ø%l†PODqé ¨;Ån$;Ég3ž#š9õŒÆ€Ò?PKg(¼³·PK xk3&net/freeutils/charset/GSMCharset.classí×y|TWðóf’Ìd2!ç†-ì!²@ ag’LÈÀ$˜˜H'Ã# „˜LØ¡îûÞªÕjmí®¨jW—¶Z\[µV[mÕÒE[µUk«µöwN†À‡Bëÿö“Ï|÷ÝwÞͻケóy§^½í."ª¦.7-È¥´ÐC#i‘‡Ó-¥e.Zî¡ò¹¨ÞCnÉ75ºÉï¦&7­Cš…€‡VÒ*i…µº(d‘«ÑŽ%7Û)‹¼DÂN5ôEûûí~ìð'2;²Z}-~‹ ƒÛ¢»£Õ}ÑDou8Š'zY”ßLô§£‰tG´oÀÆQ¾`Àö‡-Þu¡ú¸Á׆Ѭz'æ5ÿ¶>Òîïnu74ûÖXäè X4âܾîÁCQª›è–Ý9»´öÜγµ9‹ã‰xz)ªÊ+:0‡ÌÅ¢‚`[f•ŒEû:¢©¸lg:³Ò[ã¸%Á„®Þ’²ít¼¯¿:¶5šêGÏŠpKÃ`3rÇ’‰t4ž@ý„òÁ)'âÉ¡Ú3…˜[ Ec/^c‘'aïº!¥å­ÍeºUotH¦HNyq¬/su<áä@*f7ÅeÚg'6SFÁÅEOU£¿É·6Ø^å ¶5ûêýí^O¼TFm.Zí¥5v:×®sù›]±)™3—ã×ý/õCsãó'Luݳjjê,Ê“fæLq±U;¸¿ª¶>€³›L%^*¥­÷R„:½4…¦ziMµ¨øÍN¢¢‹]UL¡üõúž}y Ï™B¨g›ÃÑî^;­ß9|cÎÜ<-ÐNܬ‚óºpÏâýýÒÅpÏFžûßÕgí ŸEœJÙ…ç\¿/m“Éí;ÏN=–²£i;Øm£cpgæ{â*ï Tà[ˆ«;Ë‘‹Šh %‹ÆaË,’‡í"šH“†ú‹±;¢ý¥™ÄýМ¦™Ú2*‡ت#'ZDžÊBë9N’ó¨ŽS)}H¢Ê¥¹4-ï`%Í *¤E3±z޲•R›[y‚²¦Ÿ ì#CƒäèAm:À¨Á¢ÌÒšE³±ß¢9ø7ƒCÕdN(÷vʉTž$×-ç 9ç\r‡Îe.Í{ýn ÷üì à¦ùg.‰7Ÿ²ääòN»î$OÄY˜ŽdzÑìÂüp$§pXø89ŒEw`/E² ]Šdó”P$ÇÐõ¡ˆËÐÓ¡ˆÛÐ3¡£ëeúžE óD®¡§öÀfè^D¡Ó6Έ»a¡qÞ€nœ—!F畈‘Æy3b”q^mœ7!ŠŒ'ÆcŒó ÄXã¼ 1ΔŒ7tb‚¡' =†˜dè~D1ÃÉ<–p ,åR8ÅÐuˆ©<Nãi°ŒË`9—à ®€•\ §ót8ƒgÀ*®‚3y&¬æj8‹gÁÙ<Îá9°†kà\ž çñ<8ŸçÃZ®…u\ð¸ÂE¼.æÅp /Ky)\ÆËàrC× |ìƒõ\¸6r#ô³6q\Á+`37ÃàJ^ Wñ*ä láØÊ­0Ä!ØÆmp5¯†kx s¶s;\ËkawÀu¼®çõ°“;a—¡{ =„ØhèÄ&C"º ݈¸ÄÐ݈(Ga÷ÀÇàfÞ m¶áÞ{¹nå­0Îq¸·Áí¼öqÜÁ;`‚0ÉI¸“wÂ]¼ ¦8û¹¦9 xîæÝpï{y/ÜÇûà~ÞzqÐЋˆC†žG6ô âRC‡"†Þæß®¾C}§ú.õÝê{Ô÷ªïS߯~@ý ú!õÃêGÔªS?®~B½L½\ý¤ú)õÓêêgÔϪWªŸS?¯^¥~A½Z½Fý¢z­zz½zƒz£z“z³ú%õËêõ+êWÕ¯©·¨GÕcêqõëê7ÔêIõVõ›êmêíêêê]êÝê·Ôo«ßQ¿«Þ£Þ«Þ§~Oý¾z¿zJýúCõGêÕŸ¨?UPT¦þ\ý…úúKõaõWê¯ÕGÔGÕߨ¿USW§þ^ýƒú„zZ}R}J}Z}Fý£ú'õYõ9õÏê_Ô¿ªÏ«/¨Sÿ®þC}Qý§ú’ú²ú/õßê+êÔWÕÿ:BÇ© óKž,|²ñÉÁÇ…Û!¿‚l±næ:ôwÁ+¿ Òô ùÂ0¡@`Á…Âpao’ŸiŽF EÂa¬0N/L& “„ba²P"” S„©Â4¡Ì¡ëü]çÉ:/Ó…B•0Ó¡KüYâ¥9[˜#Ôs…yÂ|¡V¨ …E]Ö»tY?¬ËúFYÖ¥{9”E]šõBƒÐ(ø…&a…Ð,„•Â*!(´­BHhV k„°Ð.¬:„uÂz!"t ]Âa£°Iè.¢B6 ¶)>"kµ´{…­B\Ø&lú„BBH ;…]BJèÒ€°[Ø#ìö û…ÂAápX¸ÔñÖbüÖbü¾ó1*¸•Ìq*`Žæ€}µ/˜«¹`?íæiØ_ûƒt8P‚ùšÒAà` h8D‡€…ZºÔÕ¡à0×á [Ý`‘#tX¬ÅàH ŽÒQ þÀÑ:,ÑpŒŽÇêXpœŽÇëxp‚N½ê'êD°TKÁI: ô©œ¬“Á):,Ó2Я~pªN§é4°\ËÁé: h jœ¡3À™: i¬Ð 0¬a°R+ÁY: ¼B¯gëlpŽÎçê\ðJ½œ§óÀù:¼J¯è—ÇÈÕ} B_‹Ð×!ôõ}B߈Ð7!ôÍ} Bߊз!ôí}B߉Ðw!ôÝ}Bß‹Ð÷!ôýýB?ˆÐ!ôÃýB?ŠÐ!ôãýB?‰ÐO!ôÓýŒ‘Õô³FÖÐÏYO/4²~ÞÈ'ô F6Ò/ùœ~ÉÈbúeyÿЉZK¿ŠWôk&j ýº‘ÍôF~¤ß4) é·ðH/2²•®2ò7]Wôb#ëè·üF¿cäKz‰‘ÃôR”N¿kd½ %Óïa ôr”N¯@ÉôJcEöw–J¯6²ƒ~ßÈ^z‘?茜¢?4²þÈÈz­‘£ô:#'éõF¶ÑÙMo0r„þÄÈ úS#»èÏŒì£79Nnä4ý¦¦¿4ò;ý•‘Mô×øWô7F~¡¿5r€þÎÈ_ô÷F~¥7¡Dz³‘ýôBÿh$²ï[P½ÕÈAú'#?Ó?cjz–NoÇ’éFvÒ;Q½ËÈ!ú,þK¢C‰ôn”LïA‰ô^#Çè}Æš@ï7–—>€Òèß5›>hä,}%чœ¡àhé£8rú9} GG7)IôŸ8Zú/-}W>‰+@ŸÂ¤O›ÔÈýþW‚>ƒ«FŸrUó“½TÕïªùªÖ”h°9¾Ä6•Bô6‰|q›þPK#Ú>†Ä PK xk3+net/freeutils/charset/ISO88596Charset.classÕwXSWÇñ7Œ“€ÞQATDÙÄ-#j‰D#*FŒÅ !àÖî½÷Þ{«mµVín­Ývï½·ÝËö÷±­Ö?ŠïóùæÜœçzonž'»÷mÛIDN*·ÑÀ8J¤L!KÈŽ§$ʱR®òl”o£ ²Q¡Šâñ¶ÓJÅV*±PL}Õ$—…u‹ý~g«?´Ð鄃¡…Ã-”PÓjøC‘FkGÀBÖª:w•×åµP÷¦Ãí·Wû\Í žæšñUS-ÕäÆ1y-Çä= E7ÉA5" FFa™›×ˆk¨i›Ó'ÕCúŽ¥óáÿ¼Ö€\U[‹¿µÑʺë`LdQ°ÝB9u¡@Ĺ tD‚­íΖEþp;ޏ½žÊÊò¡5û׸,Ûˆ–Ö®ÿ/ÞÛÖn Œ ʉ’ÙZ$·„ËÀáB9^XQXí®uÛ©;%Û©õ´S/J±S*•Zˆ½ uki?pF¹ñ¦kÙüÏò_{]ïu¼×e§ÁTf¡¬ÿu·øX¿¯zU$P×Ö¶¤cÙß; sÿû óX›Üxdò”RZÂ$àup‚ý'ëz$Ö\lÁ6ÊÀW+ ßÈJ!&Mx„XE¡)ò)âuŠ|¦ø,»ÞK¥Þ0 «Q‹WDœï°l¢¨M½‰b¶PìF³³ŒGåŸDÅÔ¯ìû÷S?JGmÔÿÀ¹Ô^\þÔV;Hù¢V¯/Æaóúbq^ŸrÄ{}VG7¯Ïæ°{7S”¶Ðöx_t´ÇãñÅÆz|Jy|V«Çg³y|¬+¶2Ölc9Çq0žãa7îíl‡ œ9&qÄÔ¬¡ƒ°;w‡Éœ {pØ“{Â^Ü ¦p LåTØ›{Ã4Nƒ}¸ìË}a?îÓ9öçþ0ƒ3àò@˜É™0‹³`6gÃιœ ó8æs>,à8ˆÁB.„E\ì„Å\ K¸–r)̃a—Ár.‡\‡ðXÉ•p(…ÃxÎÃáGòH8ŠGÁÑ<Žá1°Š«`5Wîµ\ ]ì‚cy,ÇãàxÝì†xœÈa×ÁI< Ös=ô°NæÉp OSy*ô²6pœÆÓ`#7Âé<ÎàÿàLž ›¸ ÎâYp6φsxlæf8—çB?ûá<ž[¸Îçù0À¸€À…¼.âE0ÈA¸˜Ã%¼¶r+\ÊKaˆC°Ûà2^—óræ0lçváìàØÉp¯€+y%\Å«àj^ ×ð¸–×Âu¼®çõpoðø4‘‰‘…‘‘ƒ‘‹‘‡‘‘ž€‘žˆ‘ž„‘žŒ‘ž‚‘žŠ‘ž†‘žŽ‘ž‘ž‰‘ž…‘ž‘žƒ‘ž‹‘ž‡‘ž‘^€‘^ˆ‘^„‘^Œ‘^‚‘^Š‘^†‘^Ž‘^‘^%^e¼Úx Fz­Y]g¼ÞxƒñFãMÆ›·he—ÞŠ‘ÞfŽÞn¼Ã¸Ñ¸É¸Ùx§ñ.ãÝÆ-Æ­Æ{ŒÛŒ÷j•&ÝnV;Œ;÷i•.½ß¬Ð*Cú V¤i5Pú°V™ÒG´Ê’>ªU¶ô1­r¤»´Ê•>®Užt·VùÒ'´*>©Õ éSZJŸÖªHúŒVNé³ZKŸÓªDºG«RéóZ –¾ U™ôE­Ê¥/iU!}Y«!ÒW´ª”¾ªÕPékZ “¾nîê ã›Æ·ŒoßÑjŒô]­ª¤ïiU-}_«éZÕJ?ÔÊ%ýH«±Òµ'ýD«ñÒOµrK?Ój‚ôs­&J¿ÐªNú¥V“¤_iU/ýZ+ô­&K¿ÕjŠt¯VS¥ß™«ûÞøƒñGãOÆŸ¿5þfüÝø‡qŸñÏ(Ïfù)ŒÞJ ›)F~ -æ×0‘¢aeS©ÚEÓp4ÃüRø PK˺ß]› PK xk3+net/freeutils/charset/ISO88598Charset.classÕwXSgÆá7ÀIx¿ˆ€K ”¥F‘¨A4¢bÄQ ‚{tï½íÞ»µB[­U»—]î½·v·¶vÚ>ï'mÕúGõ¹îçä³¼²î̪µD”AÙVêNÑÔIH’"ˆ)ÙB)VJµRg+u±Rš•Ò­”›» Ý,ÔÝB=LVœ;¼ÐDö¢ižÙžŒj¿2à øü•}M™_㯠züÁROu×D–Ü"G®«Ðe¢¦e»Þ–ç.),/q–çÉe¢2ÎÉÏrNn3Qh™œ4÷óù}Á&§”â1ä×LÁÝGùüÞ⺓½Ïäj¯<ªš Ou©'à“ãÆ“aÁ*_­‰’ŠüÞ`ÆÔ€×[ôU×fTTyµ8ãp9³²2³³òÏãaYûUT7þ{®šº@…wOî(æ‚KÓå)áaàtšœOËJËs8lCÍlKq6Чæ6jA=MÄ>5©¨ýû剟s7‡åÿžsmáùמm¡2©—zS–‰:ý¯§Œ×æâ×åÍ z‹jj¦×ÍüçÊ´äÿ¾‘yoËxßä­²øj‡ 떩ߺq&Нx=A¯Ã?Û‹;<{çï“%¿‚_£vø¼1>«axùÙ … ñòÒâçxyuuñ7ÞÖ‚ZÂV8Ê!?qªÝTO!õZOa+ÈX®¯l #Pù¿€7µÁO¶³×S[J@­x÷ei…G?æSl^Cfw¨Ýâr‡Ù­.·aw¹Íö—Ûboâr[í6W…(­Žp‡†:ÝaaN·a8Ýf³Óm±8ÝV«ÓÍfÆ[Çle9Îá0‚#`nmlƒ‘ £8 Fs4ĨXA;ÛaSn c86ãf0–caÇÁxŽ‡Í¹9lÁ-`Kn [q+Øš[Ã6ܶå¶0`;nÛs{Ø;ÀŽÜvâN0‘a'ÁdN†)œS9væÎ° wiœÓ9fpìÊ]a7î»sw؃{ÀžÜfr&ìŽ`oî ³8 fs6ìÃ}`_î ûq?ØŸûÃÎxÈa.çÂ<΃ùœ ¸r!ăà` ‡ðè`ÊCá0‹¸çá°˜‹¡“p€#y$Å£ ‹]°„Kàh K¹Žá1p,…ø Çñ8XÆep<‡xœÈa9—ÃI< zØ'ódXÁp O^ö©<Vr%¬â*ècœÆÓàtž«¹ÎàÐÏ~XÃ5p&Ï„³x pÖr- rÖqœÍ³ážçò\8çÁù<.àp!/„‹x\Ì‹á^ât+º“^ŠI/ä—cÒ+0镘ô*Lz5&½“^‹I¯Ã¤×cÒ0é˜ô&Lz3&½“ÞŠIoä·cÒ;0é˜ô.Lz7&½“.Ť÷bÒû0éý˜ôLú &}“>ŒI ŤaÒÇ1é˜ôILú&}“>ƒIŸU´Mú&}“¾€I_ĤËTBŽô%Lº“ÖcÒLú2&}“¾ŠIW`Ò•˜ô5LºJÑiéë˜t5&]ƒI×bÒ7ô³}Sû–ömí;Úwµïiß×~ ýPû‘vöcí'ÚOµŸi?×®×nÐnÔnÒnÖnÑnÕnÓn×îÐîÔîÒîÖîÑîÕîS qÒýÊX/= Œ ÒƒÊØ(=¤ŒMÒÃÊØ,=¢Œ-Ò£ÊØ*=¦ ý>WÆvé eìžTÆNéÊØ%ýR»¥_)côkeì•~£Œ}Òo•±_ú2H¿WÆAéÊ8$=¥ŒÃÒ•qDú“2ŽJO+ã˜ôge—þ¢ŒÒ_•qRú›~–¿kÿP QÒ3*!Zúgˆ³BWRäRŠÄ·¤|˜h™³^NE5P˜|_šô÷e,¾Q‰’(‘º›wR™y?7Ÿ¤rÜÚ^§vø PK`ZI¶¸^ PK xk3(net/freeutils/charset/KOI8UCharset.class…Õ TT×Çñ;ð—ÇQÿ?@Å]®l"î+¢€¨(2 ˆŽDqÄFÇÁ ƒ‰ÙÛ¦mÚ¦m–îIÛ´ÍÒ&]lkš&é¾¥û¾ïû¾7]“þþ/¶§§ñœÀ9ŸïÜËåñÞ›;¼ÇžxèQç\“kˆ¸“Ýd·ÐXdTF]ÔÅî*⪣û°[v5!'Ý­»;B®´ëDêLª)›Ê 7õò™ÜðÆ›Ú>š+¤r…þTv<ráÖ®ÎÖÞŽÞ+¸ØúX[²¯c°/1ؾ£µ'äŠ:9g¯mÎ~rÅ6YÒœÉe -ÖÖõóÚGñðÓ»2¹t÷ø©£é|_êh6mg5:”Êö§ò_˜”ÂHf,䪻réBÓñ|:=^ÈdÇš†FRù1ÎìJt®Û×þÔ€çiÊ^øcÑÞÑñüPz[ÆŽ‚ÿ]·Ô.†§esûbnš›sês¥®,æÊ]mÈéÿ_0ïG°¾‡¿PçêC.þÌ'r5_Ôv¶î=9~ú¿+kŸ~/rÛ:yKí.V åÓ©Bº3w&Í]  èB]Hé"Z©•4®qZ¥U´Z«©WOëbZ£5´VkiÖÑz­§ Ú@—èÚ¨t©.¥MÚD—é2º\—Óº‚®Ô•t•®¢«u5]£kèZ]K×é:º^×Ó ºnÔ´Y›é&ÝD[´…nÖÍt‹n¡­ÚJÛ´¶k;ݪ[i‡vÐmºn×ít‡î ÚIwêNºKwÑ.í¢»u7íÖnšÐÝ£{è^ÝK{´‡öj/íÓ>ºO÷Ñ~í§ûu?= (¿éA=Ht€^¢—ÐCzˆÖÃtPé=BSš¢Gõ(Ò!zLÑ´¦éq=N‡u˜ŽèÍh†žÐô¤ž¤YÍÒSzŠæ4GGu”žÖÓôR½”æ5OÇtŒ´@ÇuœžÑ3ô2½Œ^®—Ó³z–^¡WÐ+õJz•^E¯Ö«é5z ½V¯M$ᮃwÖgÁYŸ ³>^­××[Ÿ _a}ü<ëóá«­7À/±¾~•õ…ðÍÖÁ_g½þzë‹áo°¾þFëKáo²Þ³õfø[¬·Àßj½U‹¬/ƒ¿ÃúrÄg[_øë+ßa}âǬ¯FèÝ~ë=ýÖ7Ã} üë½ðIë}ð­o…°¾ \çÛáYߨz?ü õø#Ö ø”õ$d}'ìÜ»à‡¬ï†”XÏCÂÖá[ß?l}~Äú^øŒõaøÖG Áý~>k}OÙú~H·õeÖB–[?Ùfý0$x_?Ymý(d«õc•ÖC:¬Ÿ€¬³>Yoý$dƒõSÖOC‚}ñÈ&ëg!-ÖÏA6[?IX¿Ùbý"¤Õú%H›õËvëW k¬_…¬°~ Òeý:d—õµÖoB‚ýñ-Ènë·!Öï@¶[¿ Ùiýd©õû`¿ÿë!‹­?‚ûÿÇÖŸ@‚}ÿSH™õgoý9$ø|üìÓ_B‚}ú+È\ë¯!Áçæ7ùÖßBXYhý=¤ÉúH°ïÿ öïŸ qëŸ!UÖ¿@fZ‡”Zÿ >ƒ4Xÿ™eý¤ÖúOH£õ_:ëë“úÄ9{”?è"çœØÓ4œ+‹“ÇÒiÍ 'ÕLFcƒÿü|Z ¾\SQŒ]êÎΫÖSkÉi‚Í#òuå{5Œ5¸çÐ9´ai¡l"Á‘•"RAé=å‘GÏ&Å]Åû3â«ÖÕ$Oi™ÿ!NSOܧÞÄP#k³¹’ó7µ”ÊÃJ¯pæ3FÖŒi]4R9Ò‘vá+ãîÈh@£Œ0-Ã'fd1ëÄœó2pWÆ"î9q_Æ,Éøɸ€u¨—ñ³bá`ˈɈC“Q‹·e$p—à}ãÙ.5”C„çìÁE"bTv3?¸Ïi½?Ž[UuJsC;j;ì.¡áÿÊ󜚙ŽD§Ï›½m¥À0wÓ¹m¼Ì æÔŒ8Kž—_Ûš B­'ì=ƒ ÅkFF·tƒÉTí;‚:@T¦ÔdÂ0SZ.£dnr8_?šøñªæwÑΦÄïBagzäv毕‚€à†åt6HÌÊwXnbiš%›Àø²ü-ÈçßE‘o¶…¯Y[„朿P%œT™ªPAÕha} Û…µ—s‘+á—u|ðâw³L¼;|¶]H‡1]—ê`§ú\,9*Ä’À•|„¢ Wèdl¯ö Ým_”âAû]ìÁ!} çK8wØVtø¾ô ƒnÇ+””¸ß§¸ÜÒCahÈmè¹fä"¿€"pBx¼ùU'óQ®5èÓ¸°xe¾¦%’Èf&¶{—}%סìÄ‹ ʈÄÉ&$ª%•%ž§¨³€3§^4•šØ»"„L+êÿÅÔN„Y·ž\~0 LkS1ê›<@UJë„e´ÖyH ªxÉaIcòý©l:®Et©–kí[¥›ŠôªØ„«TÜ;U\}*ZÐoÇ€ŠA ©¨D•Š+p¥Ã*QÜ­â Ùq¯Šû°OÅ~l;ZUŒ!&Ðxɲ Ô­¥÷ò ïÚ=‰ÈR­é\OÔ{‹‘¾ Ž”º‹Pfö¯aõi&PÚ;ÔÕ‰ö Ô®'ïæuI ž‘ÊÉÉ»ä 5òi°LËf¬äb~t öt.åà.Ò3„8¿ì­R=Óɇ&nÈáF¾F6=ê× læ«åæ[¨ðŸºCþQeóKÉ9VÈÎ91mVž¬A-×u\õseá×í ¨â-”øüó°ø  ¿Is ®6$ø3(ÅÓØ€g¹~Žae˜éŠkp­ íÆ\G›/óZ¸üÚ|–yX—1¦ïóL瘉¥æNå±øàÏ#<ÁåÙ6ßIX Å¿›õEØOÀ~œ¦R—íTú9sÈÕîöÇfNÁ¹€²a¿«I~N@=^ˆ[ ;Ç—8¾Œr¼Âœ_%1¯áz¼ŽxcE]m…ºÚ@³Q°•?9fVâqfeåÞ"ÓÙ¬QƃÇp6ÀÜìùܸ±±U‘IE”‹GY@ùl x”™×žò(.ÿ,*..Ëe;‡ƒ¹å°O!c>—m¥¾€tvÍatГÒbx”S¸ì(œ Ô4 g c9çòÅöU4%Ù1Ài–ø6%?þ:Ë^z‡¥¿K‘ßÇ 8‡]ø€?–çùä|È>úˆÏÉ"öáchø |Š>Ã#ø‡ñžÄ—ú+’ü5Nâ¢~KÄïð¾'Ê&í-ŒV‡9l£²á ,2Þfƒ,šR”ðä9ž¯2{—ïU¾U~¤ŸôÌJ*‚5KdT»\r:þèá™ ¿&ÏLµË™3J¶–ÍKtn©¶Ý¡ÑºŸ’ÌQ«”¦Zž˜‡c¹·[Ið“ü™WïÔãW–ô ûaüAÂþÄþBcÿà\€‹& ¾\…Ò³ùÞ“3IŒ,};xÁå­ØiƼ æâ¯;©‡ò/PKºÌpÕ PK xk3'net/freeutils/charset/UTF7Charset.classµØKSÙðÓ’@„ÁXÛ˜—ï‡Á¼’À€ŒÀ6B€°lIøí™Yd>@–Î$•JªR³É"¶3ãÊcR•EIUYd‘ÊwIåü¯Ì€í,2SýSßîÛ§ïíûW˜¿ýç÷"¢.ºo¡y+UÑ‚MX´Q5Ð\²Ñ2­Ø(H«fZ³‘…Bfºe#…pz„ÁØ4Óm ݱÐ] mYèž™"fÚÖÈìES;±´Fv2K{‘L&–‘¾¤~´8µàÓÈ1yéJD’{]Ál:žÜѨԓJf²‘d6IÅ䪩yÿTÐÔ¨ró´þe©Ùx*IxãéX4«‘¶¡Q‘w+è[ÕȰ‰F ×(š>>è—ۨƖ1ä[ ÊXŠGãÉxv\#£«5$#ôÈH5*Ÿ'c‹G‡Û±ôjd;ØSÑH"IÇÑÖš²ûq™`Ã|2–íÚMÇbGÙx"Óݤ3rdmufГۗ·º~8Sf¶a”F#ÉT2.w\ŒâaDñˆz˜–h*™Ä“²[§LÆSù[ß®UæoˆJ'çÙ}4²Êmr‹£æ/ר’±ÇùulpµžyµÞi$wI~…?t‰ÞI.)Žg¼Á˜¬™É5»jmMjFeó¨nÕÍ*ýSéܾœV;¶ÝtêpZžÊ@®°dSÇG,rž Ëh4¡¯²-˜:JGc3q,,P'F-Y‘Cƒvª£Kvj¡NµÓeºb¦;Åh×L{vÚ§¸,èGW½QJ¨rðIèÏÈNõtÕN  ‘šìÔLM2Þ“a‘yãb*Öýž€××Ñ#ÿª)H†£™5‰”ëé9Ñ«·£û¸WýGǤQÍY+ª‘ëÓBLŒ>°}[˜½XV½&äK~ÕA” ”Ÿ8$ ÏøÕ{"* XUx÷\Q•üI×'|#?ðå É㯒·#‘™jÈIµ¤ÑEiä³Ù ü#¡k°Tê³Aÿ”SŸÍêÓ!×´Kl•Ö™d¨ÄíÐÞÁøŽŒ¯Ua·h“Ot±Ñ0µÉž=וکC>Q¦S/s›ŒRHz¸ÛÚß‘É]÷ }_§LÎÝ bòËÕsª–;×_¯…½.5-ìuË„ jS2ÊÑêÕï4&gpÎêþ–ŠÛ¾%ó¯ó·)V—ïªòÕ¹NùòVê£~9¯Ñ5ÐKµ«¶\m:Y#U0]C~ºƒt]¿²_j¶?%ìv¿#ëoNTxRPÁ–¯0$òlªBÉÉ ?:¥‚…FhT¯0ªV_ÖÓù•¿!»³ï™M_“Éxb6Úë‚Jy€ãz¥ ½Ò„^©ÊYA_üò#ž)(VE“4¥ŠMŸ5¬Ò³+ýîÔaM`X(öÝ©Ãòä‡åÕ‹9eXçÕB%¬øç‚ŠÎüð<ùáÍêërÃû´¢)(Z—¦7?Ì1½h¥ “ßP™³Óðó3Jýµ Te~|Þüø&õRÕ¹ñ}¤Úß ªUç棙ü{"W­ÜùS2¾&‹*÷ã“eþQP¦'†¸J¼ÅÕâ:Ÿå!‹|AÜÄÐnƒ;à.Ø÷@„â6׊Q¾(îpãKâ._÷øŠ¸Ïõbœ¯ŠÜ ÞçF1ÁMâ!7‹InSìp«øÝbšÛÄ ·‹Yî¸S|Ä]âcîŸpø”{ÅgÜ'>Ç_€—à3ð¹!ð–ÊxÑå)É.OKxÙ#ée¯Ä—}’_žA€y æˆ0û‘ažCˆù&RÌóˆ1/ Ǽˆ sIæ%D™—‘e^A˜9ˆ4ó*âÌkÈ3‡h¾…Dó:"Íadš7jŽ Õ¼Xs¹æ›cH6ï"Ú¼‡ló>ÂÍq¤›o¾|sçC$œ“ˆ8§q~€óC•ò4RÎÄœ³È9© ?RA¬‚þDý© ú3ônôô^ô>ô~t|1†ÕcD}1FÕcL}1ÆÕNÈŠ½¥ò×êÏ#·úIV$¶R­öÐð3íË¢ËÚ+ó¿µ_ɵ9õî¦ü!‹¿ ò#­ŠÎË3ü¿Ã dú/PKuc@ŠÎUPK xk3/net/freeutils/charset/UTF7OptionalCharset.classQ]KÂP~ŽN7ÍÒfeßeÝha«+‰")–3Áº:®¥'ÖÛìUAP? ½›ÒEt.Þ¯ó¼Ïûõñùú@æ‚…,¦‘Â’Œe+ V¬ÉX—Qdµ³cU¿å\³¹ÓÓŒÀNï€a²î:~À ÍíÅ ×ôÓšql0ä¯Æá“‡ÂÁC¼Tnuݽ¦¬¬.«1¸ëZ^‹wm+,æšÜnsO„þ((}á3lëŽh7že aûšÙçžO‘‹ÖIµy×áv}£ŠÊ¡ij¦ wà™Ö‰ÉæÇÀwÂŽ¦è«R­4Ï[§ÍFMÏ`Sd±Áû9¡› ‰ˆ‘v0Jg(ÿ»Q†âߨoL¹ô{§cÖ|Yn£H'MÑc˜G`ÈD Ž3²³È‘œ&oYÀÄ–Êž“^Œ@*É4i`—ôòde†PÌ`–´‚¹ohÂWH¾AêÄՄёԤÑI¨²ñŒXHÉ"ÊdDQ"YvùPK ´úÈ‚‘PK ¹Nk3META-INF/services/PK“JÊ26META-INF/services/java.nio.charset.spi.CharsetProviderËK-ÑK+JM--ÉÌ)ÖKÎH,*Š8C耢ü²Ì”Ô"^.PK‹§|¹#'PK  xk3 íAMETA-INF/PKxk3Î\.N^k¤'META-INF/MANIFEST.MFPK Nk3íAÇnet/PK Nk3íAénet/freeutils/PK  xk3íAnet/freeutils/charset/PK xk3%Ø5¤Inet/freeutils/charset/ByteLookupCharset$Decoder.classPK xk3-ˆ0>"5¤¯net/freeutils/charset/ByteLookupCharset$Encoder.classPK xk3ë-ß秆 -¤Pnet/freeutils/charset/ByteLookupCharset.classPK xk3Œ¼à›½™ +¤Rnet/freeutils/charset/CharsetProvider.classPK xk3IP?É¢.¤hnet/freeutils/charset/GSMCharset$Decoder.classPK xk3g(¼³·.¤Ônet/freeutils/charset/GSMCharset$Encoder.classPK xk3°[ƒ¢J&¤Fnet/freeutils/charset/GSMCharset.classPK xk3#Ú>†Ä +¤<#net/freeutils/charset/HPRoman8Charset.classPK xk3˺ß]› +¤Y)net/freeutils/charset/ISO88596Charset.classPK xk3`ZI¶¸^ +¤M/net/freeutils/charset/ISO88598Charset.classPK xk3ˆJ öòë (¤^5net/freeutils/charset/KOI8UCharset.classPK xk3ü| Ò™P/¤¦;net/freeutils/charset/UTF7Charset$Decoder.classPK xk3ºÌpÕ /¤œ@net/freeutils/charset/UTF7Charset$Encoder.classPK xk3uc@ŠÎU'¤ÎEnet/freeutils/charset/UTF7Charset.classPK xk3 ´úÈ‚‘/¤ñNnet/freeutils/charset/UTF7OptionalCharset.classPK ¹Nk3íAÐPMETA-INF/services/PK“JÊ2‹§|¹#'6¤QMETA-INF/services/java.nio.charset.spi.CharsetProviderPK"‡Qjcharset-1.2.1.jar.md5000066400000000000000000000000401330756104600424200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/repo/jcharset/jcharset/1.2.1c4b966f51890d6f093f9695073eddd17jcharset-1.2.1.jar.sha1000066400000000000000000000000501330756104600425700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/repo/jcharset/jcharset/1.2.13cd17d7cc1cca87607df77a9fe1b8f66bdfadcbbjcharset-1.2.1.pom000066400000000000000000000004211330756104600417560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/repo/jcharset/jcharset/1.2.1 4.0.0 jcharset jcharset 1.2.1 deployed jcharset-1.2.1.pom.md5000066400000000000000000000000401330756104600424370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/repo/jcharset/jcharset/1.2.15e621bbe805a5a50e7d06bc1f6978e65jcharset-1.2.1.pom.sha1000066400000000000000000000000501330756104600426070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/repo/jcharset/jcharset/1.2.11d048854e95e548527550e11ef3ba1615cd0c3ecmaven-metadata.xml000066400000000000000000000004441330756104600417550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/repo/jcharset/jcharset jcharset jcharset 1.2.1 1.2.1 20071219170211 maven-metadata.xml.md5000066400000000000000000000000401330756104600424310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/repo/jcharset/jcharset6b6e65bd49d8b6f5fa035b7f842217d5maven-metadata.xml.sha1000066400000000000000000000000501330756104600426010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/repo/jcharset/jcharset31af2f983559347ed4cdc42e882fdc1ccf9cfc24maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/src/000077500000000000000000000000001330756104600326405ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600335405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/srcjava/000077500000000000000000000000001330756104600344615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/src/testcharsetProvider/000077500000000000000000000000001330756104600376255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/src/test/javaMSUREFIRE77TestCase.java000066400000000000000000000024131330756104600436430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-162-charsetProvider/src/test/java/charsetProviderpackage charsetProvider; /* * 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. */ import java.io.UnsupportedEncodingException; import junit.framework.TestCase; public class MSUREFIRE77TestCase extends TestCase { public void testThatICanUseCharsets() throws UnsupportedEncodingException { System.out.println( new String( "foo".getBytes(), "GSM_0338" ) ); } public static void main( String[] args ) throws Exception { new MSUREFIRE77TestCase().testThatICanUseCharsets(); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-224-wellFormedXmlFailures/000077500000000000000000000000001330756104600331605ustar00rootroot00000000000000pom.xml000066400000000000000000000037461330756104600344300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-224-wellFormedXmlFailures 4.0.0 org.apache.maven.plugins.surefire wellFormedXmlFailures 1.0-SNAPSHOT Test for MSUREFIRE-54 (well-formed XML failures) 1.6 1.6 junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} true src/000077500000000000000000000000001330756104600336705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-224-wellFormedXmlFailurestest/000077500000000000000000000000001330756104600346475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-224-wellFormedXmlFailures/srcjava/000077500000000000000000000000001330756104600355705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-224-wellFormedXmlFailures/src/testwellFormedXmlFailures/000077500000000000000000000000001330756104600420445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-224-wellFormedXmlFailures/src/test/javaTestSurefire3.java000066400000000000000000000026141330756104600454210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-224-wellFormedXmlFailures/src/test/java/wellFormedXmlFailurespackage wellFormedXmlFailures; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class TestSurefire3 extends TestCase { public TestSurefire3( ) { super( ); } public TestSurefire3( String name ) { super( name ); } public void testQuote() { fail( "\"" ); } public void testLower() { fail( "<" ); } public void testGreater() { fail( ">" ); } public void testU0000() { fail( "\u0000" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/000077500000000000000000000000001330756104600317445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module1/000077500000000000000000000000001330756104600333125ustar00rootroot00000000000000pom.xml000066400000000000000000000014541330756104600345540ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module1 4.0.0 org.apache.maven.surefire-257-rerunningTests surefire-257-rerunningTests 0.0.1-SNAPSHOT org.apache.maven.surefire-257-rerunningTests.module1 module1 0.0.1-SNAPSHOT junit junit 3.8.2 jar test src/000077500000000000000000000000001330756104600340225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module1main/000077500000000000000000000000001330756104600347465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module1/srcjava/000077500000000000000000000000001330756104600356675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module1/src/mainsurefire257/000077500000000000000000000000001330756104600377515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module1/src/main/javaMyModule1Class.java000066400000000000000000000016141330756104600434200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module1/src/main/java/surefire257package surefire257; /* * 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. */ public class MyModule1Class { public int getFoo() { return 42; } } test/000077500000000000000000000000001330756104600350015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module1/srcjava/000077500000000000000000000000001330756104600357225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module1/src/testsurefire257/000077500000000000000000000000001330756104600400045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module1/src/test/javaMyModule1ClassTest.java000066400000000000000000000021271330756104600443130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module1/src/test/java/surefire257package surefire257; /* * 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. */ import junit.framework.Assert; import junit.framework.TestCase; import surefire257.MyModule1Class; public class MyModule1ClassTest extends TestCase { public void testGetFooOK() { MyModule1Class mc = new MyModule1Class(); Assert.assertEquals(42, mc.getFoo()); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module2/000077500000000000000000000000001330756104600333135ustar00rootroot00000000000000pom.xml000066400000000000000000000014541330756104600345550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module2 4.0.0 org.apache.maven.surefire-257-rerunningTests surefire-257-rerunningTests 0.0.1-SNAPSHOT org.apache.maven.surefire-257-rerunningTests.module2 module2 0.0.1-SNAPSHOT junit junit 3.8.2 jar test src/000077500000000000000000000000001330756104600340235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module2main/000077500000000000000000000000001330756104600347475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module2/srcjava/000077500000000000000000000000001330756104600356705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module2/src/mainsurefire257/000077500000000000000000000000001330756104600377525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module2/src/main/javaMyModule2Class.java000066400000000000000000000001401330756104600434130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module2/src/main/java/surefire257package surefire257; public class MyModule2Class { public int getFoo() { return 42; } } test/000077500000000000000000000000001330756104600350025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module2/srcjava/000077500000000000000000000000001330756104600357235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module2/src/testsurefire257/000077500000000000000000000000001330756104600400055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module2/src/test/javaMyModule2ClassTest.java000066400000000000000000000004531330756104600443150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/module2/src/test/java/surefire257package surefire257; import junit.framework.Assert; import junit.framework.TestCase; import surefire257.MyModule2Class; public class MyModule2ClassTest extends TestCase { public void testGetFooOK() { MyModule2Class mc = new MyModule2Class(); Assert.assertEquals(42, mc.getFoo()); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-257-rerunningTests/pom.xml000066400000000000000000000023541330756104600332650ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire-257-rerunningTests surefire-257-rerunningTests 0.0.1-SNAPSHOT pom 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true module1 module2 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-260-testWithIdenticalNames/000077500000000000000000000000001330756104600333205ustar00rootroot00000000000000pom.xml000066400000000000000000000042561330756104600345650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-260-testWithIdenticalNames 4.0.0 org.apache.maven.plugins.surefire surefire-260-testsWithIdenticalNames 1.0-SNAPSHOT surefire-260-testsWithIdenticalNames 1.6 1.6 junit junit 4.8.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} src/000077500000000000000000000000001330756104600340305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-260-testWithIdenticalNamestest/000077500000000000000000000000001330756104600350075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-260-testWithIdenticalNames/srcjava/000077500000000000000000000000001330756104600357305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-260-testWithIdenticalNames/src/testsurefire260/000077500000000000000000000000001330756104600400045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-260-testWithIdenticalNames/src/test/javaTestA.java000066400000000000000000000020041330756104600416630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-260-testWithIdenticalNames/src/test/java/surefire260package surefire260; /* * 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. */ import junit.framework.TestCase; public class TestA extends TestCase { public void testOne() { } public void testDup() { fail( "This is what we want" ); } } TestB.java000066400000000000000000000017351330756104600416760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-260-testWithIdenticalNames/src/test/java/surefire260package surefire260; /* * 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. */ import junit.framework.TestCase; public class TestB extends TestCase { public void testDup() { fail( "This is what we want" ); } } TestC.java000066400000000000000000000017351330756104600416770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-260-testWithIdenticalNames/src/test/java/surefire260package surefire260; /* * 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. */ import junit.framework.TestCase; public class TestC extends TestCase { public void testDup() { fail( "This is what we want" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-34-securityManager-success/000077500000000000000000000000001330756104600334335ustar00rootroot00000000000000pom.xml000066400000000000000000000041471330756104600346770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-34-securityManager-success 4.0.0 org.apache.maven.plugins.surefire surefire34 1.0-SNAPSHOT Surefire-34-SecurityManager 3.8.1 1.6 1.6 junit junit ${junitVersion} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} java.lang.SecurityManager src/000077500000000000000000000000001330756104600341435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-34-securityManager-successtest/000077500000000000000000000000001330756104600351225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-34-securityManager-success/srcjava/000077500000000000000000000000001330756104600360435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-34-securityManager-success/src/testjunit4/000077500000000000000000000000001330756104600372605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-34-securityManager-success/src/test/javaSecurityManagerTest.java000066400000000000000000000026611330756104600440720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-34-securityManager-success/src/test/java/junit4package junit4; /* * 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. */ import junit.framework.TestCase; public class SecurityManagerTest extends TestCase { private boolean setUpCalled = false; private static boolean tearDownCalled = false; public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } public void testSetUp() { assertTrue( "setUp was not called", setUpCalled ); } public void testNotMuch() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-34-securityManager/000077500000000000000000000000001330756104600317655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-34-securityManager/pom.xml000066400000000000000000000041471330756104600333100ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire surefire34 1.0-SNAPSHOT Surefire-34-SecurityManager 3.8.1 1.6 1.6 junit junit ${junitVersion} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} java.lang.SecurityManager maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-34-securityManager/src/000077500000000000000000000000001330756104600325545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-34-securityManager/src/test/000077500000000000000000000000001330756104600335335ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600343755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-34-securityManager/src/testjunit4/000077500000000000000000000000001330756104600356125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-34-securityManager/src/test/javaSecurityManagerTest.java000066400000000000000000000030461330756104600424220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-34-securityManager/src/test/java/junit4package junit4; /* * 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. */ import java.io.File; import junit.framework.TestCase; public class SecurityManagerTest extends TestCase { private boolean setUpCalled = false; private static boolean tearDownCalled = false; public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } public void testSetUp() { assertTrue( "setUp was not called", setUpCalled ); } public void testWillFailWhenAccessingCurrentDirectory() { File file = new File( "." ); file.isDirectory(); } } surefire-408-manual-provider-selection/000077500000000000000000000000001330756104600337215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000060631330756104600352430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-408-manual-provider-selection 4.0.0 org.apache.maven.plugins.surefire junit-twoTestCases 1.0-SNAPSHOT Test for two test cases 1.6 1.6 junit junit 4.8.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} org.apache.maven.surefire surefire-junit3 ${surefire.version} src/000077500000000000000000000000001330756104600345105ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-408-manual-provider-selectiontest/000077500000000000000000000000001330756104600354675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-408-manual-provider-selection/srcjava/000077500000000000000000000000001330756104600364105ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-408-manual-provider-selection/src/testjunit/000077500000000000000000000000001330756104600375415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-408-manual-provider-selection/src/test/javatwoTestCases/000077500000000000000000000000001330756104600421715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-408-manual-provider-selection/src/test/java/junitBasicTest.java000066400000000000000000000041251330756104600447170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-408-manual-provider-selection/src/test/java/junit/twoTestCasespackage junit.twoTestCases; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class BasicTest extends TestCase { private boolean setUpCalled = false; private static boolean tearDownCalled = false; public BasicTest( String name ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite(); Test test = new BasicTest( "testSetUp" ); suite.addTest( test ); return new TestSetup( suite ) { protected void setUp() { //oneTimeSetUp(); } protected void tearDown() { oneTimeTearDown(); } }; } protected void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } protected void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } public void testSetUp() { assertTrue( "setUp was not called", setUpCalled ); } public static void oneTimeTearDown() { assertTrue( "tearDown was not called", tearDownCalled ); } } TestTwo.java000066400000000000000000000016661330756104600444560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-408-manual-provider-selection/src/test/java/junit/twoTestCasespackage junit.twoTestCases; /* * 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. */ import junit.framework.TestCase; public class TestTwo extends TestCase { public void testTwo() {} } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-500-puzzling-error/000077500000000000000000000000001330756104600317125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-500-puzzling-error/pom.xml000066400000000000000000000023471330756104600332350ustar00rootroot00000000000000 4.0.0 com.example surefire-500 jar 1.0-SNAPSHOT surefire-500-puzzling-error http://maven.apache.org 4.4 1.6 1.6 junit junit ${junit.version} test maven-surefire-plugin ${surefire.version} brief true maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-500-puzzling-error/src/000077500000000000000000000000001330756104600325015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-500-puzzling-error/src/test/000077500000000000000000000000001330756104600334605ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600343225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-500-puzzling-error/src/testsurefire500/000077500000000000000000000000001330756104600363735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-500-puzzling-error/src/test/javaExplodingTest.java000066400000000000000000000024061330756104600420310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-500-puzzling-error/src/test/java/surefire500package surefire500; /* * 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. */ import org.junit.Test; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; public class ExplodingTest { static { // noinspection ConstantIfStatement if ( true ) { throw new java.lang.NoClassDefFoundError( "whoops!" ); } } @Test public void testPass() { assertTrue( true ); } public void testFail() { fail( "fail" ); } } PassingTest.java000066400000000000000000000022331330756104600415020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-500-puzzling-error/src/test/java/surefire500package surefire500; /* * 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. */ import org.junit.Test; import static org.junit.Assert.assertTrue; public class PassingTest { @Test public void testOne() { assertTrue(true); } @Test public void testTwo() { assertTrue(true); } @Test public void testThree() { assertTrue(true); } @Test public void testFour() { assertTrue(true); } } Suite.java000066400000000000000000000020171330756104600403270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-500-puzzling-error/src/test/java/surefire500package surefire500; /* * 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. */ import org.junit.runner.RunWith; import org.junit.runners.Suite.SuiteClasses; @RunWith(org.junit.runners.Suite.class) @SuiteClasses(value={ExplodingTest.class, PassingTest.class}) public class Suite { } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-510-testClassPath/000077500000000000000000000000001330756104600314645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-510-testClassPath/pom.xml000066400000000000000000000036221330756104600330040ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire Surefire-510-systemprops 1.0-SNAPSHOT Surefire-510-systemprops 1.6 1.6 maven-surefire-plugin ${surefire.version} ${forkMode} junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-510-testClassPath/src/000077500000000000000000000000001330756104600322535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-510-testClassPath/src/test/000077500000000000000000000000001330756104600332325ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600340745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-510-testClassPath/src/testsurefire510/000077500000000000000000000000001330756104600361465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-510-testClassPath/src/test/javaTest1.java000066400000000000000000000022231330756104600400100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-510-testClassPath/src/test/java/surefire510package surefire510; /* * 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. */ import junit.framework.TestCase; import java.io.IOException; public class Test1 extends TestCase { public void test1() throws IOException { String tcp = System.getProperty( "surefire.test.class.path" ); if ( tcp != null ) { System.out.println( "tcp is set" ); } } } surefire-569-RunTestFromDependencyJars/000077500000000000000000000000001330756104600337105ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcesmodule1/000077500000000000000000000000001330756104600352565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-569-RunTestFromDependencyJarspom.xml000066400000000000000000000034061330756104600365760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-569-RunTestFromDependencyJars/module1 4.0.0 org.apache.maven.surefire surefire-569-RunTestFromDependencyJars 0.0.1-SNAPSHOT ../ org.apache.maven.plugins.surefire.dependency-jar module1 0.0.1-SNAPSHOT junit junit 4.8.1 jar test org.apache.maven.plugins.surefire.dependency-jar testjar ${project.version} tests test org.apache.maven.plugins maven-surefire-plugin **/*A*.java org.apache.maven.plugins.surefire.dependency-jar:testjar pom.xml000066400000000000000000000012061330756104600352240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-569-RunTestFromDependencyJars 4.0.0 org.apache.maven.surefire it-parent 1.0 surefire-569-RunTestFromDependencyJars 0.0.1-SNAPSHOT pom testjar module1 testjar/000077500000000000000000000000001330756104600353645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-569-RunTestFromDependencyJarspom.xml000066400000000000000000000030611330756104600367010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-569-RunTestFromDependencyJars/testjar 4.0.0 org.apache.maven.surefire surefire-569-RunTestFromDependencyJars 0.0.1-SNAPSHOT ../ org.apache.maven.plugins.surefire.dependency-jar testjar 0.0.1-SNAPSHOT junit junit 4.8.1 jar test maven-jar-plugin test-jar org.apache.maven.plugins maven-surefire-plugin true src/000077500000000000000000000000001330756104600361535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-569-RunTestFromDependencyJars/testjartest/000077500000000000000000000000001330756104600371325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-569-RunTestFromDependencyJars/testjar/srcjava/000077500000000000000000000000001330756104600400535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-569-RunTestFromDependencyJars/testjar/src/testorg/000077500000000000000000000000001330756104600406425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-569-RunTestFromDependencyJars/testjar/src/test/javatest/000077500000000000000000000000001330756104600416215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-569-RunTestFromDependencyJars/testjar/src/test/java/orgTestA.java000066400000000000000000000016221330756104600435050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-569-RunTestFromDependencyJars/testjar/src/test/java/org/testpackage org.test; /* * 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. */ import org.junit.Test; public class TestA { @Test public void shouldRun() { } }TestB.java000066400000000000000000000016221330756104600435060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-569-RunTestFromDependencyJars/testjar/src/test/java/org/testpackage org.test; /* * 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. */ import org.junit.Test; public class TestB { @Test public void shouldRun() { } }surefire-570-multipleReportDirectories/000077500000000000000000000000001330756104600340555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcesmodule1/000077500000000000000000000000001330756104600354235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectoriespom.xml000066400000000000000000000013651330756104600367450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1 4.0.0 org.apache.maven.surefire-report surefire-570-multipleReportDirectories 0.0.1-SNAPSHOT org.apache.maven.surefire-report.module1 module1 0.0.1-SNAPSHOT junit junit 3.8.2 jar test src/000077500000000000000000000000001330756104600362125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1main/000077500000000000000000000000001330756104600371365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/srcjava/000077500000000000000000000000001330756104600400575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/mainorg/000077500000000000000000000000001330756104600406465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/main/javaapache/000077500000000000000000000000001330756104600420675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/main/java/orgmaven/000077500000000000000000000000001330756104600431755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/main/java/org/apachesurefire570/000077500000000000000000000000001330756104600452555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/main/java/org/apache/mavenMyModule1Class.java000066400000000000000000000016351330756104600507270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/main/java/org/apache/maven/surefire570package org.apache.maven.surefire570; /* * 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. */ public class MyModule1Class { public int getFoo() { return 42; } } test/000077500000000000000000000000001330756104600371715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/srcjava/000077500000000000000000000000001330756104600401125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/testorg/000077500000000000000000000000001330756104600407015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/test/javaapache/000077500000000000000000000000001330756104600421225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/test/java/orgmaven/000077500000000000000000000000001330756104600432305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/test/java/org/apachesurefire570/000077500000000000000000000000001330756104600453105ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/test/java/org/apache/mavenMyModule1ClassTest.java000066400000000000000000000023651330756104600516230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/test/java/org/apache/maven/surefire570package org.apache.maven.surefire570; /* * 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. */ import junit.framework.Assert; import junit.framework.TestCase; import org.apache.maven.surefire570.MyModule1Class; public class MyModule1ClassTest extends TestCase { public void testGetFooKO() { MyModule1Class mc = new MyModule1Class(); Assert.assertEquals(18, mc.getFoo()); } public void testGetFooOK() { MyModule1Class mc = new MyModule1Class(); Assert.assertEquals(42, mc.getFoo()); } } resources/000077500000000000000000000000001330756104600412035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/testsurefire-reports/000077500000000000000000000000001330756104600445235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/test/resourcesTEST-org.apache.maven.surefireReport.surefireReportTest.MyClassTest.xml000066400000000000000000000130031330756104600622430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/test/resources/surefire-reports junit.framework.AssertionFailedError: expected:<18> but was:<42> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:280) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:198) at junit.framework.Assert.assertEquals(Assert.java:204) at org.apache.maven.surefireReport.surefireReportTest.module1.MyDummyClassTest.testGetFooKO(MyClassTest.java:10) org.apache.maven.surefireReport.surefireReportTest.MyClassTest.txt000066400000000000000000000016251330756104600615140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module1/src/test/resources/surefire-reports------------------------------------------------------------------------------- Test set: org.apache.maven.surefireReport.surefireReportTest.module1.MyDummyClassTest ------------------------------------------------------------------------------- Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.049 sec <<< FAILURE! testGetFooKO(org.apache.maven.surefireReport.surefireReportTest.module1.MyDummyClassTest) Time elapsed: 0.01 sec <<< FAILURE! junit.framework.AssertionFailedError: expected:<18> but was:<42> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:280) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:198) at junit.framework.Assert.assertEquals(Assert.java:204) at org.apache.maven.surefireReport.surefireReportTest.module1.MyDummyClassTest.testGetFooKO(MyClassTest.java:10) module2/000077500000000000000000000000001330756104600354245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectoriespom.xml000066400000000000000000000013651330756104600367460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2 4.0.0 org.apache.maven.surefire-report surefire-570-multipleReportDirectories 0.0.1-SNAPSHOT org.apache.maven.surefire-report.module2 module2 0.0.1-SNAPSHOT junit junit 3.8.2 jar test src/000077500000000000000000000000001330756104600362135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2main/000077500000000000000000000000001330756104600371375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/srcjava/000077500000000000000000000000001330756104600400605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/mainorg/000077500000000000000000000000001330756104600406475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/main/javaapache/000077500000000000000000000000001330756104600420705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/main/java/orgmaven/000077500000000000000000000000001330756104600431765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/main/java/org/apachesurefire570/000077500000000000000000000000001330756104600452565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/main/java/org/apache/mavenmodule2/000077500000000000000000000000001330756104600466255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/main/java/org/apache/maven/surefire570module2/MyModule2Class.java000066400000000000000000000001711330756104600522720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/main/java/org/apache/maven/surefire570package org.apache.maven.surefire570.module2; public class MyModule2Class { public int getFoo() { return 42; } } test/000077500000000000000000000000001330756104600371725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/srcjava/000077500000000000000000000000001330756104600401135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/testorg/000077500000000000000000000000001330756104600407025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/test/javaapache/000077500000000000000000000000001330756104600421235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/test/java/orgmaven/000077500000000000000000000000001330756104600432315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/test/java/org/apachesurefire570/000077500000000000000000000000001330756104600453115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/test/java/org/apache/mavenmodule2/000077500000000000000000000000001330756104600466605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/test/java/org/apache/maven/surefire570module2/MyModule2ClassTest.java000066400000000000000000000007311330756104600531670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/test/java/org/apache/maven/surefire570package org.apache.maven.surefire570.module2; import junit.framework.Assert; import junit.framework.TestCase; import org.apache.maven.surefire570.module2.MyModule2Class; public class MyModule2ClassTest extends TestCase { public void testGetFooKO() { MyModule2Class mc = new MyModule2Class(); Assert.assertEquals(18, mc.getFoo()); } public void testGetFooOK() { MyModule2Class mc = new MyModule2Class(); Assert.assertEquals(42, mc.getFoo()); } } resources/000077500000000000000000000000001330756104600412045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/testsurefire-reports/000077500000000000000000000000001330756104600445245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/test/resourcesTEST-org.apache.maven.surefireReport.surefireReportTest.MyClassTest.xml000066400000000000000000000130261330756104600622510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/test/resources/surefire-reports junit.framework.AssertionFailedError: expected:<18> but was:<42> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:280) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(va:198) at junit.framework.Assert.assertEquals(Assert.java:204) at org.apache.maven.surefireReport.surefireReportTest.module1.MyDummyClassTest.testGetFooKO(MyClassTest.java:10) org.apache.maven.surefireReport.surefireReportTest.MyClassTest.txt000066400000000000000000000016251330756104600615150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories/module2/src/test/resources/surefire-reports------------------------------------------------------------------------------- Test set: org.apache.maven.surefireReport.surefireReportTest.module1.MyDummyClassTest ------------------------------------------------------------------------------- Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.049 sec <<< FAILURE! testGetFooKO(org.apache.maven.surefireReport.surefireReportTest.module1.MyDummyClassTest) Time elapsed: 0.01 sec <<< FAILURE! junit.framework.AssertionFailedError: expected:<18> but was:<42> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:280) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:198) at junit.framework.Assert.assertEquals(Assert.java:204) at org.apache.maven.surefireReport.surefireReportTest.module1.MyDummyClassTest.testGetFooKO(MyClassTest.java:10) pom.xml000066400000000000000000000073751330756104600354060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-570-multipleReportDirectories 4.0.0 org.apache.maven.surefire-report surefire-570-multipleReportDirectories 0.0.1-SNAPSHOT pom 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-3 ${basedir} org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true ${basedir}/target/surefire-reports ${basedir}/src/test/resources/surefire-reports org.apache.maven.plugins maven-surefire-plugin ${surefire.version} org.apache.maven.plugins maven-site-plugin 3.1 maven-site-plugin attach-descriptor attach-descriptor org.apache.maven.plugins maven-surefire-report-plugin org.apache.maven.plugins maven-site-plugin org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true ${basedir}/target/surefire-reports ${basedir}/src/test/resources/surefire-reports report-only module1 module2 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-613-testCount-in-parallel/000077500000000000000000000000001330756104600330745ustar00rootroot00000000000000pom.xml000066400000000000000000000024451330756104600343370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-613-testCount-in-parallel 4.0.0 org.apache.maven.plugins.surefire junit4-test jar 1.0-SNAPSHOT junit4-test http://maven.apache.org 1.6 1.6 junit junit 4.8.1 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} once methods 10 **/Test*.java src/000077500000000000000000000000001330756104600336045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-613-testCount-in-paralleltest/000077500000000000000000000000001330756104600345635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-613-testCount-in-parallel/srcjava/000077500000000000000000000000001330756104600355045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-613-testCount-in-parallel/src/testsurefire163/000077500000000000000000000000001330756104600375625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-613-testCount-in-parallel/src/test/javaTest1.java000066400000000000000000000046241330756104600414330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-613-testCount-in-parallel/src/test/java/surefire163package surefire613; /* * 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. */ import org.junit.Test; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assume.*; public class Test1 { @Test public void testWithFailingAssumption1() { assumeThat( 2, is(3)); } @Test public void testWithFailingAssumption2() { assumeThat( 2, is(3)); } @Test public void testWithFailingAssumption3() { assumeThat( 2, is(3)); } @Test public void testWithFailingAssumption4() { assumeThat( 2, is(3)); } @Test public void testWithFailingAssumption5() { assumeThat( 2, is(3)); } @Test public void testWithFailingAssumption6() { assumeThat( 2, is(3)); } @Test public void testWithFailingAssumption7() { assumeThat( 2, is(3)); } @Test public void testWithFailingAssumption8() { assumeThat( 2, is(3)); } @Test public void testWithFailingAssumption9() { assumeThat( 2, is(3)); } @Test public void testWithFailingAssumption10() { assumeThat( 2, is(3)); } @Test public void testWithFailingAssumption11() { assumeThat( 2, is(3)); } @Test public void testWithFailingAssumption12() { assumeThat( 2, is(3)); } @Test public void testWithFailingAssumption13() { assumeThat( 2, is(3)); } @Test public void testWithFailingAssumption14() { assumeThat( 2, is(3)); } @Test public void testWithFailingAssumption15() { assumeThat( 2, is(3)); } }Test2.java000066400000000000000000000053551330756104600414360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-613-testCount-in-parallel/src/test/java/surefire163package surefire613; /* * 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. */ import org.junit.Ignore; import org.junit.Test; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assume.*; import static junit.framework.Assert.fail; /** * @author Kristian Rosenvold */ public class Test2 { @Test public void testAllok() { System.out.println( "testAllok to stdout" ); System.err.println( "testAllok to stderr" ); } @Ignore @Test public void testWithIgnore1() { } @Ignore("Ignorance is bliss2") @Test public void testWithIgnore2() { } @Test public void testiWithFail1() { fail( "We excpect this" ); } @Test public void testiWithFail2() { fail( "We excpect this" ); } @Test public void testiWithFail3() { fail( "We excpect this" ); } @Test public void testiWithFail4() { fail( "We excpect this" ); } @Test public void testWithException1() { System.out.println( "testWithException1 to stdout" ); System.err.println( "testWithException1 to stderr" ); throw new RuntimeException( "We expect this" ); } @Test public void testWithException2() { throw new RuntimeException( "We expect this" ); } @Test public void testWithException3() { throw new RuntimeException( "We expect this" ); } @Test public void testWithException4() { throw new RuntimeException( "We expect this" ); } @Test public void testWithException5() { throw new RuntimeException( "We expect this" ); } @Test public void testWithException6() { throw new RuntimeException( "We expect this" ); } @Test public void testWithException7() { throw new RuntimeException( "We expect this" ); } @Test public void testWithException8() { throw new RuntimeException( "We expect this" ); } }surefire-621-testCounting-junit3-in-parallel/000077500000000000000000000000001330756104600347245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000233571330756104600362530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-621-testCounting-junit3-in-parallel 4.0.0 org.apache.maven.plugins.surefire surefire-test jar 1.0-SNAPSHOT junit-test http://maven.apache.org 4.8.1 1.6 1.6 junit junit ${junit.version} src/it/java all-parallel-junit3-testcases org.apache.maven.plugins maven-surefire-plugin ${surefire.version} true all 10 false surefire-it integration-test test false true **/MySuiteTest1.java **/MySuiteTest2.java **/MySuiteTest3.java once parallel-junit3-testcases org.apache.maven.plugins maven-surefire-plugin ${surefire.version} true classes 10 surefire-it integration-test test false true **/MySuiteTest1.java **/MySuiteTest2.java **/MySuiteTest3.java once junit3-testcases org.apache.maven.plugins maven-surefire-plugin ${surefire.version} true surefire-it integration-test test false true **/MySuiteTest1.java **/MySuiteTest2.java **/MySuiteTest3.java once org.apache.maven.surefire surefire-junit47 ${surefire.version} parallel-junit3-testsuite org.apache.maven.plugins maven-surefire-plugin ${surefire.version} true all 10 false surefire-it integration-test test false true JUnit4AdapterSuiteTest once junit3-testsuite org.apache.maven.plugins maven-surefire-plugin ${surefire.version} true surefire-it integration-test test false true JUnit4AdapterSuiteTest once org.apache.maven.surefire surefire-junit47 ${surefire.version} src/000077500000000000000000000000001330756104600355135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-621-testCounting-junit3-in-parallelit/000077500000000000000000000000001330756104600361275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-621-testCounting-junit3-in-parallel/srcjava/000077500000000000000000000000001330756104600370505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-621-testCounting-junit3-in-parallel/src/itmho/000077500000000000000000000000001330756104600376335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-621-testCounting-junit3-in-parallel/src/it/javaJUnit4AdapterSuiteTest.java000066400000000000000000000023251330756104600447700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-621-testCounting-junit3-in-parallel/src/it/java/mhopackage mho; /* * 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. */ import junit.framework.JUnit4TestAdapter; import junit.framework.Test; import org.junit.runner.RunWith; import org.junit.runners.Suite; @Suite.SuiteClasses( { MySuiteTest1.class, MySuiteTest2.class, MySuiteTest3.class } ) @RunWith( Suite.class ) public class JUnit4AdapterSuiteTest { public static Test suite() { return new JUnit4TestAdapter( JUnit4AdapterSuiteTest.class ); } } MySuiteTest1.java000066400000000000000000000026361330756104600430250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-621-testCounting-junit3-in-parallel/src/it/java/mhopackage mho; /* * 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. */ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class MySuiteTest1 extends TestCase { public static Test suite () { TestSuite suite = new TestSuite(); suite.addTest (new MySuiteTest1("testMe", 1)); return suite; } private final int number; public MySuiteTest1(String name, int number) { super (name); this.number = number; } public void testMe() { System.out.println ("### "+ this.getClass().getName()+":"+this.getName()+" - number "+number); assertTrue (true); } } MySuiteTest2.java000066400000000000000000000027251330756104600430250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-621-testCounting-junit3-in-parallel/src/it/java/mhopackage mho; /* * 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. */ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class MySuiteTest2 extends TestCase { public static Test suite () { TestSuite suite = new TestSuite(); suite.addTest (new MySuiteTest2("testMe", 1)); suite.addTest (new MySuiteTest2("testMe", 2)); return suite; } private final int number; public MySuiteTest2(String name, int number) { super (name); this.number = number; } public void testMe() { System.out.println ("### "+ this.getClass().getName()+":"+this.getName()+" - number "+number); assertTrue (true); } } MySuiteTest3.java000066400000000000000000000030131330756104600430150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-621-testCounting-junit3-in-parallel/src/it/java/mhopackage mho; /* * 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. */ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class MySuiteTest3 extends TestCase { public static Test suite () { TestSuite suite = new TestSuite(); suite.addTest (new MySuiteTest3("testMe", 1)); suite.addTest (new MySuiteTest3("testMe", 2)); suite.addTest (new MySuiteTest3("testMe", 3)); return suite; } private final int number; public MySuiteTest3(String name, int number) { super (name); this.number = number; } public void testMe() { System.out.println ("### "+ this.getClass().getName()+":"+this.getName()+" - number "+number); assertTrue (true); } } surefire-628-consoleoutputbeforeandafterclass/000077500000000000000000000000001330756104600354765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000025331330756104600370160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-628-consoleoutputbeforeandafterclass 4.0.0 org.apache.maven.plugins.surefire junit4-test jar 1.0-SNAPSHOT junit4-test http://maven.apache.org 4.8.1 methods 1.6 1.6 junit junit ${junit.version} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} once 5 **/Test*.java src/000077500000000000000000000000001330756104600362655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-628-consoleoutputbeforeandafterclasstest/000077500000000000000000000000001330756104600372445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-628-consoleoutputbeforeandafterclass/srcjava/000077500000000000000000000000001330756104600401655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-628-consoleoutputbeforeandafterclass/src/testsurefire628/000077500000000000000000000000001330756104600422515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-628-consoleoutputbeforeandafterclass/src/test/javaTest1.java000066400000000000000000000030151330756104600441130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-628-consoleoutputbeforeandafterclass/src/test/java/surefire628package surefire628; /* * 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. */ import org.junit.Test; import org.junit.BeforeClass; import org.junit.AfterClass; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assume.*; public class Test1 { @Test public void test6281() { System.out.println( "628Test1 on" + Thread.currentThread().getName()); } @BeforeClass public static void testWithFailingAssumption2() { System.out.println( "Before628Test1 on" + Thread.currentThread().getName()); } @AfterClass public static void testWithFailingAssumption3() { System.out.println( "After628Test1 on" + Thread.currentThread().getName()); } }Test2.java000066400000000000000000000025641330756104600441240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-628-consoleoutputbeforeandafterclass/src/test/java/surefire628package surefire628; /* * 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. */ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class Test2 { @Test public void test6281() { System.out.println( "628Test2 on" + Thread.currentThread().getName()); } @BeforeClass public static void testWithFailingAssumption2() { System.out.println( "BeforeClass628Test2 on" + Thread.currentThread().getName()); } @AfterClass public static void testWithFailingAssumption3() { System.out.println( "AfterClass628Test2 on" + Thread.currentThread().getName()); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-634-systemPropertiesWarning/000077500000000000000000000000001330756104600336405ustar00rootroot00000000000000pom.xml000066400000000000000000000042031330756104600350750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-634-systemPropertiesWarning 4.0.0 org.apache.maven.plugins.surefire surefire-634-propertiesWarning 1.0-SNAPSHOT Test for warning about system properties that cannot be set 4.4 1.6 1.6 junit junit ${junitVersion} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${basedir}/src/main src/000077500000000000000000000000001330756104600343505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-634-systemPropertiesWarningtest/000077500000000000000000000000001330756104600353275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-634-systemPropertiesWarning/srcjava/000077500000000000000000000000001330756104600362505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-634-systemPropertiesWarning/src/testjunit4/000077500000000000000000000000001330756104600374655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-634-systemPropertiesWarning/src/test/javaBasicTest.java000066400000000000000000000030711330756104600422120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-634-systemPropertiesWarning/src/test/java/junit4package junit4; /* * 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. */ import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @Before public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @After public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( "setUp was not called", setUpCalled ); } @AfterClass public static void oneTimeTearDown() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemProperties/000077500000000000000000000000001330756104600323205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemProperties/pom.xml000066400000000000000000000044161330756104600336420ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-649-sys-props 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit 4.11 test maven-surefire-plugin emptyProperty maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemProperties/src/000077500000000000000000000000001330756104600331075ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600340075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemProperties/srcjava/000077500000000000000000000000001330756104600347305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemProperties/src/testjiras/000077500000000000000000000000001330756104600360405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemProperties/src/test/javasurefire649/000077500000000000000000000000001330756104600401275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemProperties/src/test/java/jirasSystemPropertiesTest.java000066400000000000000000000021621330756104600451740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemProperties/src/test/java/jiras/surefire649package jiras.surefire649; /* * 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. */ import org.junit.Test; public final class SystemPropertiesTest { @Test public void someMethod() throws InterruptedException { String prop = System.getProperty( "emptyProperty" ); System.out.println( "emptyProperty=" + ( prop == null ? null : "'" + prop + "'" ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemPropertyVariables/000077500000000000000000000000001330756104600336415ustar00rootroot00000000000000pom.xml000066400000000000000000000043161330756104600351030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemPropertyVariables 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-649-sys-prop-vars 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit 4.11 test maven-surefire-plugin src/000077500000000000000000000000001330756104600343515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemPropertyVariablestest/000077500000000000000000000000001330756104600353305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemPropertyVariables/srcjava/000077500000000000000000000000001330756104600362515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemPropertyVariables/src/testjiras/000077500000000000000000000000001330756104600373615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemPropertyVariables/src/test/javasurefire649/000077500000000000000000000000001330756104600414505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemPropertyVariables/src/test/java/jirasSystemPropertyVariablesTest.java000066400000000000000000000021711330756104600500360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-649-systemPropertyVariables/src/test/java/jiras/surefire649package jiras.surefire649; /* * 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. */ import org.junit.Test; public final class SystemPropertyVariablesTest { @Test public void someMethod() throws InterruptedException { String prop = System.getProperty( "emptyProperty" ); System.out.println( "emptyProperty=" + ( prop == null ? null : "'" + prop + "'" ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-673-mockito/000077500000000000000000000000001330756104600303615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-673-mockito/pom.xml000066400000000000000000000022261330756104600317000ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire MockitoTest surefire-673-mockito 1.0.0-SNAPSHOT 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} junit junit 4.8.2 test org.mockito mockito-core 1.8.5 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-673-mockito/src/000077500000000000000000000000001330756104600311505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-673-mockito/src/test/000077500000000000000000000000001330756104600321275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-673-mockito/src/test/java/000077500000000000000000000000001330756104600330505ustar00rootroot00000000000000surefire673/000077500000000000000000000000001330756104600350555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-673-mockito/src/test/javaTestMockito.java000066400000000000000000000020611330756104600401640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-673-mockito/src/test/java/surefire673package surefire673; /* * 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. */ import org.junit.Test; import org.mockito.Mockito; public class TestMockito { @Test public void canMockPrivateStaticClass() { Mockito.mock(PrivateClass.class); } private static class PrivateClass { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-674-buildFailingWhenErrors/000077500000000000000000000000001330756104600333255ustar00rootroot00000000000000pom.xml000066400000000000000000000027401330756104600345660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-674-buildFailingWhenErrors 4.0.0 org.apache.maven.plugins.surefire buildFailingWhenErrors jar 1.0-SNAPSHOT buildFailingWhenErrors http://maven.apache.org junit junit ${junit.version} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${forkMode} **/Test*.java **/MySuiteTest1.java **/MySuiteTest2.java **/MySuiteTest3.java 4.8.1 once 1.6 1.6 src/000077500000000000000000000000001330756104600340355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-674-buildFailingWhenErrorstest/000077500000000000000000000000001330756104600350145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-674-buildFailingWhenErrors/srcjava/000077500000000000000000000000001330756104600357355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-674-buildFailingWhenErrors/src/testresultcounting/000077500000000000000000000000001330756104600410225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-674-buildFailingWhenErrors/src/test/javaTest2.java000066400000000000000000000020561330756104600426710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-674-buildFailingWhenErrors/src/test/java/resultcountingpackage resultcounting; /* * 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. */ import org.junit.Test; /** * A test that causes an error * * @author Kristian Rosenvold */ public class Test2 { @Test public void testWithException1() { throw new RuntimeException( "We expect this" ); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-685-commaseparatedIncludes/000077500000000000000000000000001330756104600333735ustar00rootroot00000000000000pom.xml000066400000000000000000000044361330756104600346400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-685-commaseparatedIncludes 4.0.0 org.apache.maven.plugins.surefire surefire-685-commaseparatedIncludes 1.0-SNAPSHOT surefire-685-commaseparatedIncludes 1.6 1.6 junit junit 4.8.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} once **/TestA.java,**/TestB.java src/000077500000000000000000000000001330756104600341035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-685-commaseparatedIncludestest/000077500000000000000000000000001330756104600350625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-685-commaseparatedIncludes/srcjava/000077500000000000000000000000001330756104600360035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-685-commaseparatedIncludes/src/testsurefire685/000077500000000000000000000000001330756104600400725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-685-commaseparatedIncludes/src/test/javaTestA.java000066400000000000000000000016611330756104600417610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685package surefire685; /* * 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. */ import junit.framework.TestCase; public class TestA extends TestCase { public void testTwo() { } } TestB.java000066400000000000000000000016611330756104600417620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685package surefire685; /* * 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. */ import junit.framework.TestCase; public class TestB extends TestCase { public void testTwo() { } } TestC.java000066400000000000000000000016611330756104600417630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-685-commaseparatedIncludes/src/test/java/surefire685package surefire685; /* * 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. */ import junit.framework.TestCase; public class TestC extends TestCase { public void testTwo() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-697-niceSummary/000077500000000000000000000000001330756104600312165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-697-niceSummary/pom.xml000066400000000000000000000036061330756104600325400ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire surefire-697-niceSummary 1.0-SNAPSHOT Tests summary with long/multiline exception messages 1.6 1.6 junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-697-niceSummary/src/000077500000000000000000000000001330756104600320055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-697-niceSummary/src/test/000077500000000000000000000000001330756104600327645ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600336265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-697-niceSummary/src/testjunit/000077500000000000000000000000001330756104600347575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-697-niceSummary/src/test/javasurefire697/000077500000000000000000000000001330756104600370515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-697-niceSummary/src/test/java/junitBasicTest.java000066400000000000000000000047101330756104600415770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-697-niceSummary/src/test/java/junit/surefire697package junit.surefire697; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class BasicTest extends TestCase { public void testShort() { throw new RuntimeException( "A very short message" ); } public void testShortMultiline() { throw new RuntimeException( "A very short multiline message\nHere is line 2" ); } public void testLong() { throw new RuntimeException( "A very long single line message" + "012345678900123456789001234567890012345678900123456789001234567890" + "012345678900123456789001234567890012345678900123456789001234567890" ); } public void testLongMultiLineNoCr() { throw new RuntimeException( "A very long multi line message" + "012345678900123456789001234567890012345678900123456789001234567890" + "012345678900123456789001234567890012345678900123456789001234567890\n" + "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" + "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" ); } public void testLongMultiLine() { throw new RuntimeException( "A very long single line message" + "012345678900123456789001234567890012345678900123456789001234567890" + "012345678900123456789001234567890012345678900123456789001234567890\n" + "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" + "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ\n" ); } } TestTwo.java000066400000000000000000000016731330756104600413340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-697-niceSummary/src/test/java/junit/surefire697package junit.surefire697; /* * 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. */ import junit.framework.TestCase; public class TestTwo extends TestCase { public void testTwo() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-733-allOverridesCaptured/000077500000000000000000000000001330756104600330345ustar00rootroot00000000000000pom.xml000066400000000000000000000037121330756104600342750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-733-allOverridesCaptured 4.0.0 org.apache.maven.plugins.surefire surefire-733-allOverridesCaptured 1.0-SNAPSHOT Ensures that all versions of system.out capture are handled junit junit ${junit.version} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} 4.8.1 1.6 1.6 src/000077500000000000000000000000001330756104600335445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-733-allOverridesCapturedtest/000077500000000000000000000000001330756104600345235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-733-allOverridesCaptured/srcjava/000077500000000000000000000000001330756104600354445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-733-allOverridesCaptured/src/testjunit/000077500000000000000000000000001330756104600365755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-733-allOverridesCaptured/src/test/javasurefire733/000077500000000000000000000000001330756104600406565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-733-allOverridesCaptured/src/test/java/junitATest.java000066400000000000000000000027061330756104600425460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-733-allOverridesCaptured/src/test/java/junit/surefire733package junit.surefire733; /* * 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. */ import junit.framework.TestCase; public class ATest extends TestCase { public void testConsoleOut() { System.out.write( (int) 'a' ); final byte[] bytes = "bc".getBytes(); System.out.write( bytes, 0, bytes.length ); System.out.write( '\n' ); System.out.println( "ABC" ); System.out.println( (String) null ); final byte[] errbytes = "ef".getBytes(); System.err.write( (int) 'z' ); System.err.write( errbytes, 0, bytes.length ); System.err.write( '\n' ); System.err.println( "XYZ" ); System.err.println( (String) null ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-740-comma-truncated/000077500000000000000000000000001330756104600317725ustar00rootroot00000000000000persistent-reports/000077500000000000000000000000001330756104600356075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-740-comma-truncatedTEST-junit.twoTestCases.BasicTest.xml000066400000000000000000000123741330756104600445550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-740-comma-truncated/persistent-reports TEST-junit.twoTestCases.TestTwo.xml000066400000000000000000000123631330756104600443030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-740-comma-truncated/persistent-reports maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-740-comma-truncated/pom.xml000066400000000000000000000041441330756104600333120ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-twoTestCases 1.0-SNAPSHOT Test for two test cases junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true ${basedir}/persistent-reports org.apache.maven.plugins maven-site-plugin 3.1 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-both-reports/000077500000000000000000000000001330756104600313445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-both-reports/pom.xml000066400000000000000000000056311330756104600326660ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-twoTestCases 1.0-SNAPSHOT Test for two test cases junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true org.apache.maven.plugins maven-site-plugin 3.1 skipFailsafe org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true true skipSurefire org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true true maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-both-reports/target/000077500000000000000000000000001330756104600326325ustar00rootroot00000000000000failsafe-reports/000077500000000000000000000000001330756104600360215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-both-reports/targetTEST-junit.twoTestCases.BasicTest.xml000066400000000000000000000123741330756104600447670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-both-reports/target/failsafe-reports TEST-junit.twoTestCases.TestTwo.xml000066400000000000000000000123631330756104600445150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-both-reports/target/failsafe-reports surefire-reports/000077500000000000000000000000001330756104600360735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-both-reports/targetTEST-junit.twoTestCases.BasicTest.xml000066400000000000000000000123741330756104600450410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-both-reports/target/surefire-reports TEST-junit.twoTestCases.TestTwo.xml000066400000000000000000000123631330756104600445670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-both-reports/target/surefire-reports maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-no-failsafe-reports/000077500000000000000000000000001330756104600325745ustar00rootroot00000000000000pom.xml000066400000000000000000000056561330756104600340460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-no-failsafe-reports 4.0.0 org.apache.maven.plugins.surefire junit-twoTestCases 1.0-SNAPSHOT Test for two test cases junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true org.apache.maven.plugins maven-site-plugin 3.1 skipFailsafe org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true true forceFailsafe org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true true target/000077500000000000000000000000001330756104600340035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-no-failsafe-reportssurefire-reports/000077500000000000000000000000001330756104600373235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-no-failsafe-reports/targetTEST-junit.twoTestCases.BasicTest.xml000066400000000000000000000123741330756104600462710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-no-failsafe-reports/target/surefire-reports TEST-junit.twoTestCases.TestTwo.xml000066400000000000000000000123631330756104600460170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-no-failsafe-reports/target/surefire-reports maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-no-reports/000077500000000000000000000000001330756104600310245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-no-reports/pom.xml000066400000000000000000000036451330756104600323510ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit-twoTestCases 1.0-SNAPSHOT Test for two test cases junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true org.apache.maven.plugins maven-site-plugin 3.1 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-no-surefire-reports/000077500000000000000000000000001330756104600326465ustar00rootroot00000000000000pom.xml000066400000000000000000000056621330756104600341150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-no-surefire-reports 4.0.0 org.apache.maven.plugins.surefire junit-twoTestCases 1.0-SNAPSHOT Test for two test cases junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true org.apache.maven.plugins maven-site-plugin 3.1 skipSurefire org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true true optionalSurefire org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true false target/000077500000000000000000000000001330756104600340555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-no-surefire-reportsfailsafe-reports/000077500000000000000000000000001330756104600373235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-no-surefire-reports/targetTEST-junit.twoTestCases.BasicTest.xml000066400000000000000000000123741330756104600462710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-no-surefire-reports/target/failsafe-reports TEST-junit.twoTestCases.TestTwo.xml000066400000000000000000000123631330756104600460170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-no-surefire-reports/target/failsafe-reports maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-specified-reports/000077500000000000000000000000001330756104600323435ustar00rootroot00000000000000persistent-reports/000077500000000000000000000000001330756104600361605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-specified-reportsTEST-junit.twoTestCases.BasicTest.xml000066400000000000000000000123741330756104600451260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-specified-reports/persistent-reports TEST-junit.twoTestCases.TestTwo.xml000066400000000000000000000123631330756104600446540ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-specified-reports/persistent-reports pom.xml000066400000000000000000000061301330756104600336010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-772-specified-reports 4.0.0 org.apache.maven.plugins.surefire junit-twoTestCases 1.0-SNAPSHOT Test for two test cases junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true ${basedir}/persistent-reports org.apache.maven.plugins maven-site-plugin 3.1 skipFailsafe org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true true skipSurefire org.apache.maven.plugins maven-surefire-report-plugin ${surefire.version} true true surefire-803-multiFailsafeExec-failureInFirst/000077500000000000000000000000001330756104600351465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000046551330756104600364750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst 4.0.0 org.apache.maven.plugins.surefire surefire-803-multiFailsafeExec-failureInFirst 1.0-SNAPSHOT jar surefire-803-failure-prevents-subsequent-executions UTF-8 1.6 1.6 junit junit 4.8.2 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} true org.apache.maven.plugins maven-failsafe-plugin ${surefire.version} failing integration-test **/FailingTest.java **/SucceedingTest.java succeed integration-test **/SucceedingTest.java **/FailingTest.java verify verify src/000077500000000000000000000000001330756104600357355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirstmain/000077500000000000000000000000001330756104600366615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/srcjava/000077500000000000000000000000001330756104600376025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/mainorg/000077500000000000000000000000001330756104600403715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/main/javaapache/000077500000000000000000000000001330756104600416125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/main/java/orgmaven/000077500000000000000000000000001330756104600427205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/main/java/org/apachesurefire/000077500000000000000000000000001330756104600445445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/main/java/org/apache/maventest/000077500000000000000000000000001330756104600455235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/main/java/org/apache/maven/surefireApp.java000066400000000000000000000020401330756104600471020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/main/java/org/apache/maven/surefire/testpackage org.apache.maven.surefire.test; /* * 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. */ public class App { private String test = "value"; public String getTest() { return test; } public void setTest( final String test ) { this.test = test; } } test/000077500000000000000000000000001330756104600367145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/srcjava/000077500000000000000000000000001330756104600376355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/testorg/000077500000000000000000000000001330756104600404245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/test/javaapache/000077500000000000000000000000001330756104600416455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/test/java/orgmaven/000077500000000000000000000000001330756104600427535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/test/java/org/apachesurefire/000077500000000000000000000000001330756104600445775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/test/java/org/apache/maventest/000077500000000000000000000000001330756104600455565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/test/java/org/apache/maven/surefireFailingTest.java000066400000000000000000000041721330756104600506360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/test/java/org/apache/maven/surefire/testpackage org.apache.maven.surefire.test; /* * 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. */ import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertThat; import org.junit.After; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; import java.io.File; import java.io.FileWriter; import java.io.IOException; public class FailingTest { @Rule public TestName name = new TestName(); @Test public void defaultTestValueIs_Value() { assertThat( new App().getTest(), equalTo( "wrong" ) ); } @Test public void setTestAndRetrieveValue() { final App app = new App(); final String val = "foo"; app.setTest( val ); assertThat( app.getTest(), equalTo( "bar" ) ); } @After public void writeFile() throws IOException { final File f = new File( "target/tests-run", getClass().getName() + ".txt" ); f.getParentFile().mkdirs(); FileWriter w = null; try { w = new FileWriter( f, true ); w.write( name.getMethodName() ); } finally { if ( w != null ) { try { w.close(); } catch ( final IOException e ) { } } } } } SucceedingTest.java000066400000000000000000000041731330756104600513370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-failureInFirst/src/test/java/org/apache/maven/surefire/testpackage org.apache.maven.surefire.test; /* * 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. */ import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertThat; import org.junit.After; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; import java.io.File; import java.io.FileWriter; import java.io.IOException; public class SucceedingTest { @Rule public TestName name = new TestName(); @Test public void defaultTestValueIs_Value() { assertThat( new App().getTest(), equalTo( "value" ) ); } @Test public void setTestAndRetrieveValue() { final App app = new App(); final String val = "foo"; app.setTest( val ); assertThat( app.getTest(), equalTo( val ) ); } @After public void writeFile() throws IOException { final File f = new File( "target/tests-run", getClass().getName() + ".txt" ); f.getParentFile().mkdirs(); FileWriter w = null; try { w = new FileWriter( f, true ); w.write( name.getMethodName() ); } finally { if ( w != null ) { try { w.close(); } catch ( final IOException e ) { } } } } } surefire-803-multiFailsafeExec-rebuildOverwrites/000077500000000000000000000000001330756104600357405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000036311330756104600372600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites 4.0.0 org.apache.maven.plugins.surefire surefire-803-multiFailsafeExec-rebuildOverwrites 1.0-SNAPSHOT jar surefire-803-failure-prevents-subsequent-executions UTF-8 1.6 1.6 junit junit 4.8.2 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} true org.apache.maven.plugins maven-failsafe-plugin ${surefire.version} its integration-test verify **/TheTest.java ${success} src/000077500000000000000000000000001330756104600365275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwritesmain/000077500000000000000000000000001330756104600374535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/srcjava/000077500000000000000000000000001330756104600403745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/src/mainorg/000077500000000000000000000000001330756104600411635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/src/main/javaapache/000077500000000000000000000000001330756104600424045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/src/main/java/orgmaven/000077500000000000000000000000001330756104600435125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/src/main/java/org/apachesurefire/000077500000000000000000000000001330756104600453365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/src/main/java/org/apache/maventest/000077500000000000000000000000001330756104600463155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/src/main/java/org/apache/maven/surefiretest/App.java000066400000000000000000000020401330756104600476740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/src/main/java/org/apache/maven/surefirepackage org.apache.maven.surefire.test; /* * 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. */ public class App { private String test = "value"; public String getTest() { return test; } public void setTest( final String test ) { this.test = test; } } test/000077500000000000000000000000001330756104600375065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/srcjava/000077500000000000000000000000001330756104600404275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/src/testorg/000077500000000000000000000000001330756104600412165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/src/test/javaapache/000077500000000000000000000000001330756104600424375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/src/test/java/orgmaven/000077500000000000000000000000001330756104600435455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/src/test/java/org/apachesurefire/000077500000000000000000000000001330756104600453715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/src/test/java/org/apache/maventest/000077500000000000000000000000001330756104600463505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/src/test/java/org/apache/maven/surefiretest/TheTest.java000066400000000000000000000024051330756104600505740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-803-multiFailsafeExec-rebuildOverwrites/src/test/java/org/apache/maven/surefirepackage org.apache.maven.surefire.test; /* * 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. */ import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertThat; import org.junit.After; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; import java.io.File; import java.io.FileWriter; import java.io.IOException; public class TheTest { @Test public void checkSuccessCLIParam() { assertThat( Boolean.getBoolean( "success" ), equalTo( true ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-multi/000077500000000000000000000000001330756104600330205ustar00rootroot00000000000000pom.xml000066400000000000000000000055301330756104600342610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-multi 4.0.0 org.apache.maven.plugins.surefire default-configuration-multi-exec 1.0-SNAPSHOT Test for single test in one of multiple executions 1.6 1.6 junit junit 3.8.1 test maven-surefire-plugin ${surefire.version} default-test test **/FirstTest.java **/ThirdTest.java first second test **/SecondTest.java **/FourthTest.java second src/000077500000000000000000000000001330756104600335305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-multitest/000077500000000000000000000000001330756104600345075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-multi/srcjava/000077500000000000000000000000001330756104600354305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-multi/src/testdefaultConfiguration/000077500000000000000000000000001330756104600416045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-multi/src/test/javaFirstTest.java000066400000000000000000000021541330756104600444000ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-multi/src/test/java/defaultConfigurationpackage defaultConfiguration; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class FirstTest extends TestCase { public void testSetUp() { assertEquals( "first", System.getProperty( "phaseName" ) ); } } FourthTest.java000066400000000000000000000021561330756104600445620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-multi/src/test/java/defaultConfigurationpackage defaultConfiguration; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class FourthTest extends TestCase { public void testSetUp() { assertEquals( "second", System.getProperty( "phaseName" ) ); } } SecondTest.java000066400000000000000000000021561330756104600445260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-multi/src/test/java/defaultConfigurationpackage defaultConfiguration; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class SecondTest extends TestCase { public void testSetUp() { assertEquals( "second", System.getProperty( "phaseName" ) ); } } ThirdTest.java000066400000000000000000000021541330756104600443630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-multi/src/test/java/defaultConfigurationpackage defaultConfiguration; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class ThirdTest extends TestCase { public void testSetUp() { assertEquals( "first", System.getProperty( "phaseName" ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-single/000077500000000000000000000000001330756104600331475ustar00rootroot00000000000000pom.xml000066400000000000000000000044721330756104600344140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-single 4.0.0 org.apache.maven.plugins.surefire default-configuration-multi-exec 1.0-SNAPSHOT Test for single test in one of multiple executions 1.6 1.6 junit junit 3.8.1 test maven-surefire-plugin ${surefire.version} default-test test **/FirstTest.java first src/000077500000000000000000000000001330756104600336575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-singletest/000077500000000000000000000000001330756104600346365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-single/srcjava/000077500000000000000000000000001330756104600355575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-single/src/testdefaultConfiguration/000077500000000000000000000000001330756104600417335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-single/src/test/javaFirstTest.java000066400000000000000000000021531330756104600445260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-single/src/test/java/defaultConfigurationpackage defaultConfiguration; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class FirstTest extends TestCase { public void testSetUp() { assertEquals( "FAIL", System.getProperty( "phaseName" ) ); } } FourthTest.java000066400000000000000000000021561330756104600447110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-single/src/test/java/defaultConfigurationpackage defaultConfiguration; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class FourthTest extends TestCase { public void testSetUp() { assertEquals( "second", System.getProperty( "phaseName" ) ); } } SecondTest.java000066400000000000000000000021561330756104600446550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-single/src/test/java/defaultConfigurationpackage defaultConfiguration; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class SecondTest extends TestCase { public void testSetUp() { assertEquals( "second", System.getProperty( "phaseName" ) ); } } ThirdTest.java000066400000000000000000000021541330756104600445120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-806-specifiedTests-single/src/test/java/defaultConfigurationpackage defaultConfiguration; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class ThirdTest extends TestCase { public void testSetUp() { assertEquals( "first", System.getProperty( "phaseName" ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-junit48/000077500000000000000000000000001330756104600322135ustar00rootroot00000000000000pom.xml000066400000000000000000000036111330756104600334520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-junit48 4.0.0 org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for JUnit 4.8.1 4.8.1 1.6 1.6 junit junit ${junit.version} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-junit48/src/000077500000000000000000000000001330756104600330025ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600337025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-junit48/srcjava/000077500000000000000000000000001330756104600346235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-junit48/src/testjunit4/000077500000000000000000000000001330756104600360405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-junit48/src/test/javaBasicTest.java000066400000000000000000000042221330756104600405640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-junit48/src/test/java/junit4package junit4; /* * 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. */ import org.junit.AfterClass; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.rules.TestName; public class BasicTest { static int catACount = 0; static int catBCount = 0; static int catCCount = 0; static int catNoneCount = 0; @Rule public TestName testName = new TestName(); @Before public void testName() { System.out.println( "Running " + getClass().getName() + "." + testName.getMethodName() ); } @Test @Category(CategoryA.class) public void testInCategoryA() { catACount++; } @Test @Category(CategoryB.class) public void testInCategoryB() { catBCount++; } @Test @Category({CategoryA.class, CategoryB.class}) public void testInCategoryAB() { catACount++; catBCount++; } @Test @Category(CategoryC.class) public void testInCategoryC() { catCCount++; } @Test public void testInNoCategory() { catNoneCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("catA: " + catACount + "\n" + "catB: " + catBCount + "\n" + "catC: " + catCCount + "\n" + "catNone: " + catNoneCount); } } CategoryA.java000066400000000000000000000015221330756104600405610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-junit48/src/test/java/junit4package junit4; /* * 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. */ interface CategoryA {} CategoryB.java000066400000000000000000000015221330756104600405620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-junit48/src/test/java/junit4package junit4; /* * 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. */ interface CategoryB {} CategoryC.java000066400000000000000000000015221330756104600405630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-junit48/src/test/java/junit4package junit4; /* * 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. */ interface CategoryC {} CategoryCTest.java000066400000000000000000000037521330756104600414320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-junit48/src/test/java/junit4package junit4; /* * 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. */ import org.junit.AfterClass; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.rules.TestName; @Category(CategoryC.class) public class CategoryCTest { static int catACount = 0; static int catBCount = 0; static int catCCount = 0; @Rule public TestName testName = new TestName(); @Before public void testName() { System.out.println( "Running " + getClass().getName() + "." + testName.getMethodName() ); } @Test @Category( CategoryA.class ) public void testInCategoryA() { catACount++; } @Test @Category(CategoryB.class) public void testInCategoryB() { catBCount++; } @Test @Category({CategoryA.class, CategoryB.class}) public void testInCategoriesAB() { catACount++; catBCount++; } @Test public void testInCategoryC() { catCCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("mA: " + catACount + "\n" + "mB: " + catBCount + "\n" + "mC: " + catCCount ); } } NoCategoryTest.java000066400000000000000000000021721330756104600416170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-junit48/src/test/java/junit4package junit4; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class NoCategoryTest { static int catNoneCount = 0; @Test public void testInNoCategory() { catNoneCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("NoCategoryTest.CatNone: " + catNoneCount); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-testng/000077500000000000000000000000001330756104600322125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-testng/pom.xml000066400000000000000000000040631330756104600335320ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire testng-group-expressions 1.0-SNAPSHOT TestNG group expressions tests org.testng testng 5.8 jdk15 test !CategoryC 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-testng/src/000077500000000000000000000000001330756104600330015ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600337015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-testng/srcjava/000077500000000000000000000000001330756104600346225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-testng/src/testtestng/000077500000000000000000000000001330756104600361265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-testng/src/test/javaBasicTest.java000066400000000000000000000036061330756104600406570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-testng/src/test/java/testngpackage testng; /* * 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. */ import org.testng.annotations.AfterClass; import org.testng.annotations.Test; public class BasicTest { static int catACount = 0; static int catBCount = 0; static int catCCount = 0; static int catNoneCount = 0; @Test( groups = "CategoryA" ) public void testInCategoryA() { catACount++; } @Test( groups = "CategoryB" ) public void testInCategoryB() { catBCount++; } @Test( groups = { "CategoryA", "CategoryB" } ) public void testInCategoryAB() { System.out.println( getClass().getSimpleName() + ".testInCategoriesAB()" ); catACount++; catBCount++; } @Test( groups = "CategoryC" ) public void testInCategoryC() { catCCount++; } @Test public void testInNoCategory() { catNoneCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("catA: " + catACount + "\n" + "catB: " + catBCount + "\n" + "catC: " + catCCount + "\n" + "catNone: " + catNoneCount); } } CategoryCTest.java000066400000000000000000000033351330756104600415150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-testng/src/test/java/testngpackage testng; /* * 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. */ import org.testng.annotations.AfterClass; import org.testng.annotations.Test; public class CategoryCTest { static int catACount = 0; static int catBCount = 0; static int catCCount = 0; @Test( groups = "CategoryA" ) public void testInCategoryA() { catACount++; } @Test( groups = "CategoryB" ) public void testInCategoryB() { catBCount++; } @Test( groups = { "CategoryA", "CategoryB" } ) public void testInCategoriesAB() { System.out.println( getClass().getSimpleName() + ".testInCategoriesAB()" ); catACount++; catBCount++; } @Test( groups="CategoryC" ) public void testInCategoryC() { catCCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("mA: " + catACount + "\n" + "mB: " + catBCount + "\n" + "mC: " + catCCount ); } } NoCategoryTest.java000066400000000000000000000022241330756104600417030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-809-groupExpr-testng/src/test/java/testngpackage testng; /* * 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. */ import org.testng.annotations.AfterClass; import org.testng.annotations.Test; public class NoCategoryTest { static int catNoneCount = 0; @Test public void testInNoCategory() { catNoneCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("NoCategoryTest.CatNone: " + catNoneCount); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-812-log4j-classloader/000077500000000000000000000000001330756104600322205ustar00rootroot00000000000000pom.xml000066400000000000000000000027241330756104600334630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-812-log4j-classloader 4.0.0 org.apache.maven.plugins.surefire log4jClassloader surefire-812-log4j-classloader 1.0.0-SNAPSHOT 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} false always true true junit junit 4.8.2 test log4j log4j 1.2.16 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-812-log4j-classloader/src/000077500000000000000000000000001330756104600330075ustar00rootroot00000000000000main/000077500000000000000000000000001330756104600336545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-812-log4j-classloader/srcresources/000077500000000000000000000000001330756104600356665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-812-log4j-classloader/src/mainlog4j.properties000066400000000000000000000013731330756104600410270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-812-log4j-classloader/src/main/resources log4j.rootLogger=debug, stdout, xml, R log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.xml=org.apache.log4j.FileAppender log4j.appender.xml.file=example_xml.log log4j.appender.xml.append=false log4j.appender.xml.layout=org.apache.log4j.xml.XMLLayout # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=example.log log4j.appender.R.MaxFileSize=100KB # Keep one backup file log4j.appender.R.MaxBackupIndex=1 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%ntest/000077500000000000000000000000001330756104600337075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-812-log4j-classloader/srcjava/000077500000000000000000000000001330756104600346305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-812-log4j-classloader/src/testsurefire812/000077500000000000000000000000001330756104600367075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-812-log4j-classloader/src/test/javaLoggingTest.java000066400000000000000000000021731330756104600420030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-812-log4j-classloader/src/test/java/surefire812package surefire812; /* * 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. */ import org.apache.log4j.Logger; import junit.framework.TestCase; public class LoggingTest extends TestCase { //static { // Logger.getLogger( LoggingTest.class ).debug( "fud"); // } public void testCanLogAMessage() { Logger.getLogger( LoggingTest.class ).warn( "hey you" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-817-system-exit/000077500000000000000000000000001330756104600312075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-817-system-exit/pom.xml000066400000000000000000000045771330756104600325410ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-817 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit 4.7 test maven-surefire-plugin always org.apache.maven.surefire surefire-junit47 ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-817-system-exit/src/000077500000000000000000000000001330756104600317765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-817-system-exit/src/test/000077500000000000000000000000001330756104600327555ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600336175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-817-system-exit/src/testjiras/000077500000000000000000000000001330756104600347275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-817-system-exit/src/test/javasurefire817/000077500000000000000000000000001330756104600370135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-817-system-exit/src/test/java/jirasTest.java000066400000000000000000000020011330756104600405660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-817-system-exit/src/test/java/jiras/surefire817package jiras.surefire817; /* * 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. */ public class Test { @org.junit.Test public void test() { System.out.println( getClass() + " " + Thread.currentThread().getName() ); System.exit( 1 ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-818-ignored-tests-on-npe/000077500000000000000000000000001330756104600326765ustar00rootroot00000000000000pom.xml000066400000000000000000000022441330756104600341360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-818-ignored-tests-on-npe 4.0.0 test cyril 0.0.1-SNAPSHOT cyril 1.6 1.6 junit junit 4.4 test jmock jmock 1.1.0 test maven-surefire-plugin ${surefire.version} src/000077500000000000000000000000001330756104600334065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-818-ignored-tests-on-npetest/000077500000000000000000000000001330756104600343655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-818-ignored-tests-on-npe/srcjava/000077500000000000000000000000001330756104600353065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-818-ignored-tests-on-npe/src/testcyril/000077500000000000000000000000001330756104600364305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-818-ignored-tests-on-npe/src/test/javatest/000077500000000000000000000000001330756104600374075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-818-ignored-tests-on-npe/src/test/java/cyrilFirstTest.java000066400000000000000000000026771330756104600422150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-818-ignored-tests-on-npe/src/test/java/cyril/testpackage cyril.test; /* * 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. */ import org.jmock.Mock; import org.jmock.MockObjectTestCase; import org.junit.Test; public class FirstTest extends MockObjectTestCase { private Mock myServiceMock; @Override protected void setUp() throws Exception { myServiceMock = mock( MyService.class ); } @Test public void test() { Message myMessage = new Message( "MyMessage" ); // Expectations myServiceMock.expects( once() ).method( "writeMessage" ).with( eq( myMessage ) ).will( returnValue( myMessage ) ); ( (MyService) myServiceMock.proxy() ).writeMessage( null ); } } IgnoredTest.java000066400000000000000000000017371330756104600425110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-818-ignored-tests-on-npe/src/test/java/cyril/testpackage cyril.test; /* * 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. */ import org.junit.Test; public class IgnoredTest { @Test public void test() { System.out.println( "My test is running fine" ); } } Message.java000066400000000000000000000020321330756104600416330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-818-ignored-tests-on-npe/src/test/java/cyril/testpackage cyril.test; /* * 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. */ public class Message { private String content; public Message( String content ) { this.content = content; } public int hashCode() { throw new NullPointerException(); } } MyService.java000066400000000000000000000016271330756104600421660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-818-ignored-tests-on-npe/src/test/java/cyril/testpackage cyril.test; /* * 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. */ public interface MyService { public Message writeMessage( Message aMessage ); } MyServiceImpl.java000066400000000000000000000002501330756104600427770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-818-ignored-tests-on-npe/src/test/java/cyril/testpackage cyril.test; public class MyServiceImpl implements MyService { public Message writeMessage( Message aMessage ) { return aMessage; } } surefire-822-legal-JUnit4-descriptions/000077500000000000000000000000001330756104600335345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000023611330756104600350530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-822-legal-JUnit4-descriptions 4.0.0 surefire-testcase surefire-testcase 1.0 junit junit-dep 4.10 test org.hamcrest hamcrest-core 1.2.1 pl.pragmatists JUnitParams 0.4.0 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} both src/000077500000000000000000000000001330756104600343235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-822-legal-JUnit4-descriptionstest/000077500000000000000000000000001330756104600353025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-822-legal-JUnit4-descriptions/srcjava/000077500000000000000000000000001330756104600362235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-822-legal-JUnit4-descriptions/src/testsurefire/000077500000000000000000000000001330756104600400475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-822-legal-JUnit4-descriptions/src/test/javatestcase/000077500000000000000000000000001330756104600416625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-822-legal-JUnit4-descriptions/src/test/java/surefireJunitParamsTest.java000066400000000000000000000030371330756104600456250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-822-legal-JUnit4-descriptions/src/test/java/surefire/testcasepackage surefire.testcase; /* * 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. */ import java.util.Arrays; import java.util.Collection; import junitparams.JUnitParamsRunner; import junitparams.Parameters; import org.junit.Test; import org.junit.runner.RunWith; import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertThat; /** * Surefire JunitParams test. */ @RunWith( JUnitParamsRunner.class ) public class JunitParamsTest { @Parameters( method = "parameters" ) @Test public void testSum( int a, int b, int expected ) { assertThat( a + b, equalTo( expected ) ); } public Collection parameters() { Integer[][] parameters = { { 1, 2, 3 }, { 2, 3, 5 }, { 3, 4, 7 }, }; return Arrays.asList( parameters ); } } NonJunitParamsTest.java000066400000000000000000000021451330756104600462770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-822-legal-JUnit4-descriptions/src/test/java/surefire/testcasepackage surefire.testcase; /* * 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. */ import org.junit.Test; import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertThat; /** * Surefire non-JunitParams test. */ public class NonJunitParamsTest { @Test public void testSum() { assertThat( 1 + 2, equalTo( 3 ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-junit48/000077500000000000000000000000001330756104600332335ustar00rootroot00000000000000pom.xml000066400000000000000000000060461330756104600344770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-junit48 4.0.0 org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for JUnit 4.8.1 4.8.1 junit4.CategoryA,junit4.CategoryB 1.6 1.6 junit junit ${junitVersion} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${groups} ${excludedGroups} org.apache.maven.surefire surefire-junit47 ${surefire.version} emptyGroups profile emptyGroups junit4.CategoryC emptyExcludedGroups profile emptyExcludedGroups junit4.CategoryA && junit4.CategoryB src/000077500000000000000000000000001330756104600337435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-junit48test/000077500000000000000000000000001330756104600347225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-junit48/srcjava/000077500000000000000000000000001330756104600356435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-junit48/src/testjunit4/000077500000000000000000000000001330756104600370605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-junit48/src/test/javaBasicTest.java000066400000000000000000000042221330756104600416040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-junit48/src/test/java/junit4package junit4; /* * 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. */ import org.junit.AfterClass; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.rules.TestName; public class BasicTest { static int catACount = 0; static int catBCount = 0; static int catCCount = 0; static int catNoneCount = 0; @Rule public TestName testName = new TestName(); @Before public void testName() { System.out.println( "Running " + getClass().getName() + "." + testName.getMethodName() ); } @Test @Category(CategoryA.class) public void testInCategoryA() { catACount++; } @Test @Category(CategoryB.class) public void testInCategoryB() { catBCount++; } @Test @Category({CategoryA.class, CategoryB.class}) public void testInCategoryAB() { catACount++; catBCount++; } @Test @Category(CategoryC.class) public void testInCategoryC() { catCCount++; } @Test public void testInNoCategory() { catNoneCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("catA: " + catACount + "\n" + "catB: " + catBCount + "\n" + "catC: " + catCCount + "\n" + "catNone: " + catNoneCount); } } CategoryA.java000066400000000000000000000015221330756104600416010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-junit48/src/test/java/junit4package junit4; /* * 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. */ interface CategoryA {} CategoryB.java000066400000000000000000000015221330756104600416020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-junit48/src/test/java/junit4package junit4; /* * 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. */ interface CategoryB {} CategoryC.java000066400000000000000000000015221330756104600416030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-junit48/src/test/java/junit4package junit4; /* * 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. */ interface CategoryC {} CategoryCTest.java000066400000000000000000000037521330756104600424520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-junit48/src/test/java/junit4package junit4; /* * 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. */ import org.junit.AfterClass; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.rules.TestName; @Category(CategoryC.class) public class CategoryCTest { static int catACount = 0; static int catBCount = 0; static int catCCount = 0; @Rule public TestName testName = new TestName(); @Before public void testName() { System.out.println( "Running " + getClass().getName() + "." + testName.getMethodName() ); } @Test @Category( CategoryA.class ) public void testInCategoryA() { catACount++; } @Test @Category(CategoryB.class) public void testInCategoryB() { catBCount++; } @Test @Category({CategoryA.class, CategoryB.class}) public void testInCategoriesAB() { catACount++; catBCount++; } @Test public void testInCategoryC() { catCCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("mA: " + catACount + "\n" + "mB: " + catBCount + "\n" + "mC: " + catCCount ); } } NoCategoryTest.java000066400000000000000000000021721330756104600426370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-junit48/src/test/java/junit4package junit4; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class NoCategoryTest { static int catNoneCount = 0; @Test public void testInNoCategory() { catNoneCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("NoCategoryTest.CatNone: " + catNoneCount); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-testng/000077500000000000000000000000001330756104600332325ustar00rootroot00000000000000pom.xml000066400000000000000000000056001330756104600344710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-testng 4.0.0 org.apache.maven.plugins.surefire testng-group-expressions 1.0-SNAPSHOT TestNG group expressions tests 1.6 1.6 org.testng testng 5.8 jdk15 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${groups} ${excludedGroups} emptyGroups profile emptyGroups CategoryC emptyExcludedGroups profile emptyExcludedGroups CategoryA && CategoryB src/000077500000000000000000000000001330756104600337425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-testngtest/000077500000000000000000000000001330756104600347215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-testng/srcjava/000077500000000000000000000000001330756104600356425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-testng/src/testtestng/000077500000000000000000000000001330756104600371465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-testng/src/test/javaBasicTest.java000066400000000000000000000036061330756104600416770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-testng/src/test/java/testngpackage testng; /* * 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. */ import org.testng.annotations.AfterClass; import org.testng.annotations.Test; public class BasicTest { static int catACount = 0; static int catBCount = 0; static int catCCount = 0; static int catNoneCount = 0; @Test( groups = "CategoryA" ) public void testInCategoryA() { catACount++; } @Test( groups = "CategoryB" ) public void testInCategoryB() { catBCount++; } @Test( groups = { "CategoryA", "CategoryB" } ) public void testInCategoryAB() { System.out.println( getClass().getSimpleName() + ".testInCategoriesAB()" ); catACount++; catBCount++; } @Test( groups = "CategoryC" ) public void testInCategoryC() { catCCount++; } @Test public void testInNoCategory() { catNoneCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("catA: " + catACount + "\n" + "catB: " + catBCount + "\n" + "catC: " + catCCount + "\n" + "catNone: " + catNoneCount); } } CategoryCTest.java000066400000000000000000000033351330756104600425350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-testng/src/test/java/testngpackage testng; /* * 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. */ import org.testng.annotations.AfterClass; import org.testng.annotations.Test; public class CategoryCTest { static int catACount = 0; static int catBCount = 0; static int catCCount = 0; @Test( groups = "CategoryA" ) public void testInCategoryA() { catACount++; } @Test( groups = "CategoryB" ) public void testInCategoryB() { catBCount++; } @Test( groups = { "CategoryA", "CategoryB" } ) public void testInCategoriesAB() { System.out.println( getClass().getSimpleName() + ".testInCategoriesAB()" ); catACount++; catBCount++; } @Test( groups="CategoryC" ) public void testInCategoryC() { catCCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("mA: " + catACount + "\n" + "mB: " + catBCount + "\n" + "mC: " + catCCount ); } } NoCategoryTest.java000066400000000000000000000022241330756104600427230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-828-emptyGroupExpr-testng/src/test/java/testngpackage testng; /* * 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. */ import org.testng.annotations.AfterClass; import org.testng.annotations.Test; public class NoCategoryTest { static int catNoneCount = 0; @Test public void testInNoCategory() { catNoneCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("NoCategoryTest.CatNone: " + catNoneCount); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-832-provider-selection/000077500000000000000000000000001330756104600325265ustar00rootroot00000000000000pom.xml000066400000000000000000000037311330756104600337700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-832-provider-selection 4.0.0 org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT 4.8.1 provider selection Test for JUnit Groups 4.8.1 junit4.CategoryA,junit4.CategoryB 1.6 1.6 junit junit ${junitVersion} test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-832-provider-selection/src/000077500000000000000000000000001330756104600333155ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600342155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-832-provider-selection/srcjava/000077500000000000000000000000001330756104600351365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-832-provider-selection/src/testjunit4/000077500000000000000000000000001330756104600363535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-832-provider-selection/src/test/javaBasicTest.java000066400000000000000000000042221330756104600410770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-832-provider-selection/src/test/java/junit4package junit4; /* * 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. */ import org.junit.AfterClass; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.rules.TestName; public class BasicTest { static int catACount = 0; static int catBCount = 0; static int catCCount = 0; static int catNoneCount = 0; @Rule public TestName testName = new TestName(); @Before public void testName() { System.out.println( "Running " + getClass().getName() + "." + testName.getMethodName() ); } @Test @Category(CategoryA.class) public void testInCategoryA() { catACount++; } @Test @Category(CategoryB.class) public void testInCategoryB() { catBCount++; } @Test @Category({CategoryA.class, CategoryB.class}) public void testInCategoryAB() { catACount++; catBCount++; } @Test @Category(CategoryC.class) public void testInCategoryC() { catCCount++; } @Test public void testInNoCategory() { catNoneCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("catA: " + catACount + "\n" + "catB: " + catBCount + "\n" + "catC: " + catCCount + "\n" + "catNone: " + catNoneCount); } } CategoryA.java000066400000000000000000000015221330756104600410740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-832-provider-selection/src/test/java/junit4package junit4; /* * 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. */ interface CategoryA {} CategoryB.java000066400000000000000000000015221330756104600410750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-832-provider-selection/src/test/java/junit4package junit4; /* * 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. */ interface CategoryB {} CategoryC.java000066400000000000000000000015221330756104600410760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-832-provider-selection/src/test/java/junit4package junit4; /* * 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. */ interface CategoryC {} CategoryCTest.java000066400000000000000000000037521330756104600417450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-832-provider-selection/src/test/java/junit4package junit4; /* * 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. */ import org.junit.AfterClass; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.rules.TestName; @Category(CategoryC.class) public class CategoryCTest { static int catACount = 0; static int catBCount = 0; static int catCCount = 0; @Rule public TestName testName = new TestName(); @Before public void testName() { System.out.println( "Running " + getClass().getName() + "." + testName.getMethodName() ); } @Test @Category( CategoryA.class ) public void testInCategoryA() { catACount++; } @Test @Category(CategoryB.class) public void testInCategoryB() { catBCount++; } @Test @Category({CategoryA.class, CategoryB.class}) public void testInCategoriesAB() { catACount++; catBCount++; } @Test public void testInCategoryC() { catCCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("mA: " + catACount + "\n" + "mB: " + catBCount + "\n" + "mC: " + catCCount ); } } NoCategoryTest.java000066400000000000000000000021721330756104600421320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-832-provider-selection/src/test/java/junit4package junit4; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class NoCategoryTest { static int catNoneCount = 0; @Test public void testInNoCategory() { catNoneCount++; } @AfterClass public static void oneTimeTearDown() { System.out.println("NoCategoryTest.CatNone: " + catNoneCount); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-847-testngfail/000077500000000000000000000000001330756104600310575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-847-testngfail/README.txt000066400000000000000000000001001330756104600325440ustar00rootroot00000000000000start project mvn clean test -Dtest=org.codehaus.SomeFailedTestmaven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-847-testngfail/pom.xml000066400000000000000000000043721330756104600324020ustar00rootroot00000000000000 4.0.0 org.codehaus.jira surefire-847 0.0.1-SNAPSHOT com.google.inject guice 3.0 no_aop test org.testng testng 6.5.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} false ${project.build.directory}/test-classes ${basedir}/src/test/resources/suite.xml 1.6 1.6 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-847-testngfail/src/000077500000000000000000000000001330756104600316465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-847-testngfail/src/test/000077500000000000000000000000001330756104600326255ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600334675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-847-testngfail/src/testorg/000077500000000000000000000000001330756104600342565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-847-testngfail/src/test/javacodehaus/000077500000000000000000000000001330756104600360515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-847-testngfail/src/test/java/orgSomeFailedTest.java000066400000000000000000000017531330756104600415720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-847-testngfail/src/test/java/org/codehauspackage org.codehaus; /* * 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. */ import org.testng.Assert; import org.testng.annotations.Test; @Test public class SomeFailedTest { @Test public void failedTest() { Assert.assertFalse(true); } } SomePassedTest.java000066400000000000000000000017501330756104600416220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-847-testngfail/src/test/java/org/codehauspackage org.codehaus; /* * 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. */ import org.testng.Assert; import org.testng.annotations.Test; public class SomePassedTest { @Test public void passedTestA(){ Assert.assertTrue(true); } } resources/000077500000000000000000000000001330756104600345605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-847-testngfail/src/testsuite.xml000066400000000000000000000003551330756104600364360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-847-testngfail/src/test/resources maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/000077500000000000000000000000001330756104600325315ustar00rootroot00000000000000pom.xml000066400000000000000000000100211330756104600337610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-855-bundle 1.0 bundle http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit 4.11 test org.easytesting fest-assert-core 2.0M9 test org.hamcrest hamcrest-library 1.3 test org.apache.maven.plugins maven-source-plugin 2.3 attach-sources jar-no-fork org.apache.maven.plugins maven-javadoc-plugin 3.0.0 attach-javadoc jar org.apache.felix maven-bundle-plugin 2.3.7 true org.surefire.its.${project.artifactId} org.apache.maven.plugins maven-failsafe-plugin integration-test integration-test verify verify always maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/000077500000000000000000000000001330756104600333205ustar00rootroot00000000000000main/000077500000000000000000000000001330756104600341655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/srcjava/000077500000000000000000000000001330756104600351065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/mainpkg/000077500000000000000000000000001330756104600356675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/main/javaAClassInOSGiBundle.java000066400000000000000000000015351330756104600420470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/main/java/pkgpackage pkg; /* * 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. */ public class AClassInOSGiBundle { } resources/000077500000000000000000000000001330756104600361775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/mainmain/000077500000000000000000000000001330756104600371235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/main/resourcessurefire855.properties000066400000000000000000000000231330756104600433220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/main/resources/mainissue=SUREFIRE-855 test/000077500000000000000000000000001330756104600342205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/srcjava/000077500000000000000000000000001330756104600351415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/testjiras/000077500000000000000000000000001330756104600362515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/test/javasurefre855/000077500000000000000000000000001330756104600401665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/test/java/jirasbundle/000077500000000000000000000000001330756104600414375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/test/java/jiras/surefre855FooIT.java000066400000000000000000000131061330756104600432630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/test/java/jiras/surefre855/bundlepackage jiras.surefire855.bundle; /* * 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. */ import org.junit.Test; import java.io.File; import java.io.FileFilter; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.Properties; import java.util.jar.JarFile; import java.util.jar.Manifest; import static org.fest.assertions.api.Assertions.assertThat; import static org.fest.assertions.api.Assertions.contentOf; import static org.hamcrest.Matchers.*; import static org.hamcrest.MatcherAssert.assertThat; public final class FooIT { private static final String ARTIFACT_FILE_NAME = "jiras-surefire-855-bundle-1.0.jar"; private static final String MAIN_RESOURCE = "/main/surefire855.properties"; private static final String TEST_RESOURCE = "/jiras/surefire855/bundle/properties/surefire855.properties"; private static File surefireDir() throws IOException { String bootPath = System.getProperty( "surefire.real.class.path" ); return bootPath == null ? null : new File( bootPath ).getParentFile(); } private static File[] surefireProviderProperties() throws IOException { return surefireDir().listFiles( new FileFilter() { public boolean accept( File pathname ) { try { return isSurefireProviderProperties( pathname ); } catch ( IOException e ) { return false; } } } ); } /** * See BooterSerializer#serialize(). */ private static boolean isSurefireProviderProperties( File pathname ) throws IOException { pathname = pathname.getCanonicalFile(); String fileName = pathname.getName(); return pathname.isFile() && fileName.startsWith( "surefire" ) && !fileName.startsWith( "surefire_" ) && fileName.endsWith( "tmp" ); } private static boolean isSurefireBooter( File pathname ) throws IOException { pathname = pathname.getCanonicalFile(); String fileName = pathname.getName(); return pathname.isFile() && fileName.startsWith( "surefirebooter" ) && fileName.endsWith( ".jar" ); } private static String manifestClassPath( Class clazz ) throws IOException { File booter = new File( System.getProperty( "surefire.real.class.path" ) ); assertThat( booter ).exists(); assertThat( booter ).isFile(); JarFile jarFile = new JarFile( booter ); try { Manifest manifest = jarFile.getManifest(); return manifest.getMainAttributes().getValue( "Class-Path" ); } finally { jarFile.close(); } } private static Properties loadProperties( Class clazz, String resourcePath ) throws IOException { InputStream is = clazz.getResourceAsStream( resourcePath ); Properties prop = new Properties(); prop.load( is ); is.close(); return prop; } private static Properties loadMainProperties( Class clazz ) throws IOException { return loadProperties( clazz, MAIN_RESOURCE ); } private static Properties loadTestProperties( Class clazz ) throws IOException { return loadProperties( clazz, TEST_RESOURCE ); } @Test public void test() throws IOException { String classPath = manifestClassPath( getClass() ); System.out.println( "CLASS PATH:" ); System.out.println( classPath ); assertThat( classPath, not( containsString( "/target/classes" ) ) ); assertThat( classPath, containsString( "/target/" + ARTIFACT_FILE_NAME ) ); File[] descriptors = surefireProviderProperties(); assertThat( descriptors ).hasSize( 1 ); assertThat( descriptors ).doesNotContainNull(); assertThat( descriptors[0] ).isFile(); String surefireProperties = contentOf( descriptors[0] ); Properties properties = new Properties(); properties.load( new StringReader( surefireProperties ) ); System.out.println( properties.toString() ); File actualArtifact = new File( properties.getProperty( "classPathUrl.1" ) ).getCanonicalFile(); File expectedArtifact = new File( "target/" + ARTIFACT_FILE_NAME ).getCanonicalFile(); assertThat( actualArtifact ).isFile(); assertThat( expectedArtifact ).isFile(); assertThat( actualArtifact ).isEqualTo( expectedArtifact ); } @Test public void shouldAlwaysHaveResources() throws IOException { assertThat( loadTestProperties( getClass() ).getProperty( "issue" ), is( "SUREFIRE-855" ) ); assertThat( loadMainProperties( getClass() ).getProperty( "issue" ), is( "SUREFIRE-855" ) ); } } resources/000077500000000000000000000000001330756104600362325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/testjiras/000077500000000000000000000000001330756104600373425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/test/resourcessurefire855/000077500000000000000000000000001330756104600414305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/test/resources/jirasbundle/000077500000000000000000000000001330756104600427015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/test/resources/jiras/surefire855properties/000077500000000000000000000000001330756104600450755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/test/resources/jiras/surefire855/bundlesurefire855.properties000066400000000000000000000000231330756104600512740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-bundle/src/test/resources/jiras/surefire855/bundle/propertiesissue=SUREFIRE-855 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/000077500000000000000000000000001330756104600320345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/pom.xml000066400000000000000000000071521330756104600333560ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-855-jar 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit 4.11 test org.easytesting fest-assert-core 2.0M9 test org.hamcrest hamcrest-library 1.3 test org.apache.maven.plugins maven-source-plugin 2.3 attach-sources jar-no-fork org.apache.maven.plugins maven-javadoc-plugin 3.0.0 attach-javadoc jar org.apache.maven.plugins maven-failsafe-plugin integration-test integration-test verify verify ${forkMode} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/000077500000000000000000000000001330756104600326235ustar00rootroot00000000000000main/000077500000000000000000000000001330756104600334705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/srcjava/000077500000000000000000000000001330756104600344115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/mainpkg/000077500000000000000000000000001330756104600351725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/main/javaToRunJavadoc.java000066400000000000000000000001141330756104600403700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/main/java/pkgpackage pkg; public class ToRunJavadoc { public void x() { } } resources/000077500000000000000000000000001330756104600355025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/mainmain/000077500000000000000000000000001330756104600364265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/main/resourcessurefire855.properties000066400000000000000000000000231330756104600426250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/main/resources/mainissue=SUREFIRE-855 test/000077500000000000000000000000001330756104600335235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/srcjava/000077500000000000000000000000001330756104600344445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/testjiras/000077500000000000000000000000001330756104600355545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/test/javasurefire855/000077500000000000000000000000001330756104600376425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/test/java/jirasjar/000077500000000000000000000000001330756104600404165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/test/java/jiras/surefire855FooIT.java000066400000000000000000000137741330756104600422550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/test/java/jiras/surefire855/jarpackage jiras.surefire855.jar; /* * 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. */ import org.junit.Test; import java.io.File; import java.io.FileFilter; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.Properties; import java.util.jar.JarFile; import java.util.jar.Manifest; import static org.fest.assertions.api.Assertions.assertThat; import static org.fest.assertions.api.Assertions.contentOf; import static org.hamcrest.Matchers.*; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assume.assumeThat; public final class FooIT { private static final String ARTIFACT_FILE_NAME = "jiras-surefire-855-jar-1.0.jar"; private static final String MAIN_RESOURCE = "/main/surefire855.properties"; private static final String TEST_RESOURCE = "/jiras/surefire855/jar/properties/surefire855.properties"; private static File surefireDir() throws IOException { String bootPath = System.getProperty( "surefire.real.class.path" ); return bootPath == null ? null : new File( bootPath ).getParentFile(); } private static File[] surefireProviderProperties() throws IOException { return surefireDir().listFiles( new FileFilter() { public boolean accept( File pathname ) { try { return isSurefireProviderProperties( pathname ); } catch ( IOException e ) { return false; } } } ); } /** * See BooterSerializer#serialize(). */ private static boolean isSurefireProviderProperties( File pathname ) throws IOException { pathname = pathname.getCanonicalFile(); String fileName = pathname.getName(); return pathname.isFile() && fileName.startsWith( "surefire" ) && !fileName.startsWith( "surefire_" ) && fileName.endsWith( "tmp" ); } private static boolean isSurefireBooter( File pathname ) throws IOException { pathname = pathname.getCanonicalFile(); String fileName = pathname.getName(); return pathname.isFile() && fileName.startsWith( "surefirebooter" ) && fileName.endsWith( ".jar" ); } private static String manifestClassPath( Class clazz ) throws IOException { File booter = new File( System.getProperty( "surefire.real.class.path" ) ); assertThat( booter ).exists(); assertThat( booter ).isFile(); JarFile jarFile = new JarFile( booter ); try { Manifest manifest = jarFile.getManifest(); return manifest.getMainAttributes().getValue( "Class-Path" ); } finally { jarFile.close(); } } private static Properties loadProperties( Class clazz, String resourcePath ) throws IOException { InputStream is = clazz.getResourceAsStream( resourcePath ); Properties prop = new Properties(); prop.load( is ); is.close(); return prop; } private static Properties loadMainProperties( Class clazz ) throws IOException { return loadProperties( clazz, MAIN_RESOURCE ); } private static Properties loadTestProperties( Class clazz ) throws IOException { return loadProperties( clazz, TEST_RESOURCE ); } @Test public void shouldBeJarWithForking() throws IOException { assumeThat( System.getProperty( "forkMode" ), is( not( "never" ) ) ); String classPath = manifestClassPath( getClass() ); System.out.println( "CLASS PATH:" ); System.out.println( classPath ); assertThat( classPath, not( containsString( "/target/classes" ) ) ); assertThat( classPath, containsString( "/target/" + ARTIFACT_FILE_NAME ) ); File[] descriptors = surefireProviderProperties(); assertThat( descriptors ).hasSize( 1 ); assertThat( descriptors ).doesNotContainNull(); assertThat( descriptors[0] ).isFile(); String surefireProperties = contentOf( descriptors[0] ); Properties properties = new Properties(); properties.load( new StringReader( surefireProperties ) ); System.out.println( properties.toString() ); File actualArtifact = new File( properties.getProperty( "classPathUrl.1" ) ).getCanonicalFile(); File expectedArtifact = new File( "target/" + ARTIFACT_FILE_NAME ).getCanonicalFile(); assertThat( actualArtifact ).isFile(); assertThat( expectedArtifact ).isFile(); assertThat( actualArtifact ).isEqualTo( expectedArtifact ); } @Test public void jarShouldExistWhenNotForking() throws Exception { assumeThat( System.getProperty( "forkMode" ), is( "never" ) ); assertThat( surefireDir() ).isNull(); assertThat( new File( "target/" + ARTIFACT_FILE_NAME ).getCanonicalFile() ).isFile(); } @Test public void shouldAlwaysHaveResources() throws IOException { assertThat( loadTestProperties( getClass() ).getProperty( "issue" ), is( "SUREFIRE-855" ) ); assertThat( loadMainProperties( getClass() ).getProperty( "issue" ), is( "SUREFIRE-855" ) ); } } resources/000077500000000000000000000000001330756104600355355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/testjiras/000077500000000000000000000000001330756104600366455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/test/resourcessurefire855/000077500000000000000000000000001330756104600407335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/test/resources/jirasjar/000077500000000000000000000000001330756104600415075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/test/resources/jiras/surefire855properties/000077500000000000000000000000001330756104600437035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/test/resources/jiras/surefire855/jarsurefire855.properties000066400000000000000000000000231330756104600501020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-jar/src/test/resources/jiras/surefire855/jar/propertiesissue=SUREFIRE-855 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/000077500000000000000000000000001330756104600320515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/pom.xml000066400000000000000000000076221330756104600333750ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-855-war 1.0 war http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit 4.11 test org.easytesting fest-assert-core 2.0M9 test org.hamcrest hamcrest-library 1.3 test org.apache.maven.plugins maven-source-plugin 2.3 attach-sources jar-no-fork org.apache.maven.plugins maven-javadoc-plugin 3.0.0 attach-javadoc jar org.apache.maven.plugins maven-war-plugin 2.4 false org.apache.maven.plugins maven-failsafe-plugin integration-test integration-test verify verify always maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/000077500000000000000000000000001330756104600326405ustar00rootroot00000000000000main/000077500000000000000000000000001330756104600335055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/srcjava/000077500000000000000000000000001330756104600344265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/mainpkg/000077500000000000000000000000001330756104600352075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/main/javaToCreateClassesDirectory.java000066400000000000000000000015431330756104600427660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/main/java/pkgpackage pkg; /* * 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. */ public class ToCreateClassesDirectory { } resources/000077500000000000000000000000001330756104600355175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/mainmain/000077500000000000000000000000001330756104600364435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/main/resourcessurefire855.properties000066400000000000000000000000231330756104600426420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/main/resources/mainissue=SUREFIRE-855 test/000077500000000000000000000000001330756104600335405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/srcjava/000077500000000000000000000000001330756104600344615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/testjiras/000077500000000000000000000000001330756104600355715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/test/javasurefire855/000077500000000000000000000000001330756104600376575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/test/java/jiraswar/000077500000000000000000000000001330756104600404505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/test/java/jiras/surefire855FooIT.java000066400000000000000000000126061330756104600423000ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/test/java/jiras/surefire855/warpackage jiras.surefire855.war; /* * 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. */ import org.junit.Test; import java.io.File; import java.io.FileFilter; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.util.Properties; import java.util.jar.JarFile; import java.util.jar.Manifest; import static org.fest.assertions.api.Assertions.assertThat; import static org.fest.assertions.api.Assertions.contentOf; import static org.hamcrest.Matchers.*; import static org.hamcrest.MatcherAssert.assertThat; public final class FooIT { private static final String MAIN_RESOURCE = "/main/surefire855.properties"; private static final String TEST_RESOURCE = "/jiras/surefire855/war/properties/surefire855.properties"; private static File surefireDir() throws IOException { String bootPath = System.getProperty( "surefire.real.class.path" ); return bootPath == null ? null : new File( bootPath ).getParentFile(); } private static File[] surefireProviderProperties() throws IOException { return surefireDir().listFiles( new FileFilter() { public boolean accept( File pathname ) { try { return isSurefireProviderProperties( pathname ); } catch ( IOException e ) { return false; } } } ); } /** * See BooterSerializer#serialize(). */ private static boolean isSurefireProviderProperties( File pathname ) throws IOException { pathname = pathname.getCanonicalFile(); String fileName = pathname.getName(); return pathname.isFile() && fileName.startsWith( "surefire" ) && !fileName.startsWith( "surefire_" ) && fileName.endsWith( "tmp" ); } private static boolean isSurefireBooter( File pathname ) throws IOException { pathname = pathname.getCanonicalFile(); String fileName = pathname.getName(); return pathname.isFile() && fileName.startsWith( "surefirebooter" ) && fileName.endsWith( ".jar" ); } private static String manifestClassPath( Class clazz ) throws IOException { File booter = new File( System.getProperty( "surefire.real.class.path" ) ); assertThat( booter ).exists(); assertThat( booter ).isFile(); JarFile jarFile = new JarFile( booter ); try { Manifest manifest = jarFile.getManifest(); return manifest.getMainAttributes().getValue( "Class-Path" ); } finally { jarFile.close(); } } private static Properties loadProperties( Class clazz, String resourcePath ) throws IOException { InputStream is = clazz.getResourceAsStream( resourcePath ); Properties prop = new Properties(); prop.load( is ); is.close(); return prop; } private static Properties loadMainProperties( Class clazz ) throws IOException { return loadProperties( clazz, MAIN_RESOURCE ); } private static Properties loadTestProperties( Class clazz ) throws IOException { return loadProperties( clazz, TEST_RESOURCE ); } @Test public void test() throws IOException { String classPath = manifestClassPath( getClass() ); System.out.println( "CLASS PATH:" ); System.out.println( classPath ); assertThat( classPath, containsString( "/target/classes" ) ); File[] descriptors = surefireProviderProperties(); assertThat( descriptors ).hasSize( 1 ); assertThat( descriptors ).doesNotContainNull(); assertThat( descriptors[0] ).isFile(); String surefireProperties = contentOf( descriptors[0] ); Properties properties = new Properties(); properties.load( new StringReader( surefireProperties ) ); System.out.println( properties.toString() ); File actualArtifact = new File( properties.getProperty( "classPathUrl.1" ) ).getCanonicalFile(); File expectedArtifact = new File( "target/classes" ).getCanonicalFile(); assertThat( actualArtifact ).isDirectory(); assertThat( expectedArtifact ).isDirectory(); assertThat( actualArtifact ).isEqualTo( expectedArtifact ); } @Test public void shouldAlwaysHaveResources() throws IOException { assertThat( loadTestProperties( getClass() ).getProperty( "issue" ), is( "SUREFIRE-855" ) ); assertThat( loadMainProperties( getClass() ).getProperty( "issue" ), is( "SUREFIRE-855" ) ); } } resources/000077500000000000000000000000001330756104600355525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/testjiras/000077500000000000000000000000001330756104600366625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/test/resourcessurefire855/000077500000000000000000000000001330756104600407505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/test/resources/jiraswar/000077500000000000000000000000001330756104600415415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/test/resources/jiras/surefire855properties/000077500000000000000000000000001330756104600437355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/test/resources/jiras/surefire855/warsurefire855.properties000066400000000000000000000000231330756104600501340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-855-failsafe-use-war/src/test/resources/jiras/surefire855/war/propertiesissue=SUREFIRE-855 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-926-2-provider-failure/000077500000000000000000000000001330756104600323335ustar00rootroot00000000000000pom.xml000066400000000000000000000026031330756104600335720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-926-2-provider-failure 4.0.0 groupId artifactId 1.0-SNAPSHOT org.apache.maven.plugins maven-surefire-plugin ${surefire.version} org.apache.maven.surefire surefire-testng ${surefire.version} org.apache.maven.surefire surefire-junit47 ${surefire.version} junit junit 4.10 test org.testng testng 6.8 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-926-2-provider-failure/src/000077500000000000000000000000001330756104600331225ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600340225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-926-2-provider-failure/srcjava/000077500000000000000000000000001330756104600347435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-926-2-provider-failure/src/testcom/000077500000000000000000000000001330756104600355215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-926-2-provider-failure/src/test/javacompany/000077500000000000000000000000001330756104600371675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-926-2-provider-failure/src/test/java/comJUnitTest.java000066400000000000000000000017671330756104600417360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-926-2-provider-failure/src/test/java/com/companypackage com.company; /* * 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. */ import org.junit.Assert; import org.junit.Test; public class JUnitTest { @Test public void test() { //Assert.assertTrue(true); Assert.assertTrue(false); } } TestNGTest.java000066400000000000000000000020131330756104600420320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-926-2-provider-failure/src/test/java/com/companypackage com.company; /* * 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. */ import org.testng.Assert; import org.testng.annotations.Test; public class TestNGTest { @Test public void test() { Assert.assertTrue(true); //Assert.assertTrue(false); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/000077500000000000000000000000001330756104600323475ustar00rootroot00000000000000pom.xml000066400000000000000000000035371330756104600336150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests 4.0.0 org.apache.maven.plugins failsafe-test 1.0.0-SNAPSHOT FailSafe Test surefire-930 2.12.4 1.6 1.6 org.testng testng 6.8 test maven-surefire-plugin true maven-failsafe-plugin ${surefire.version} ${project.basedir}/src/test/resources/testng-integrationTest.xml integration-test verify maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/src/000077500000000000000000000000001330756104600331365ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600340365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/srcjava/000077500000000000000000000000001330756104600347575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/src/testorg/000077500000000000000000000000001330756104600355465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/src/test/javaapache/000077500000000000000000000000001330756104600367675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/src/test/java/orgmaven/000077500000000000000000000000001330756104600400755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/src/test/java/org/apacheplugins/000077500000000000000000000000001330756104600415565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/src/test/java/org/apache/mavenfailsafe/000077500000000000000000000000001330756104600433305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/src/test/java/org/apache/maven/pluginsExampleIntegrationTest.java000066400000000000000000000022011330756104600506250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/src/test/java/org/apache/maven/plugins/failsafepackage org.apache.maven.plugins.failsafe; /* * 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. */ import org.junit.Assert; import org.testng.annotations.Test; @Test(groups = { TestConstants.IntegrationTest }) public class ExampleIntegrationTest { public void shouldRun() { System.out.println("Hello from Integration-Test"); Assert.fail("this will not be executed"); } } ExampleTest.java000066400000000000000000000021271330756104600464300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/src/test/java/org/apache/maven/plugins/failsafepackage org.apache.maven.plugins.failsafe; /* * 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. */ import org.junit.Assert; import org.testng.annotations.Test; @Test(groups = { TestConstants.UnitTest }) public class ExampleTest { public void shouldRun() { System.out.println("Hello from Unit-Test"); Assert.assertTrue(true); } } TestConstants.java000066400000000000000000000022671330756104600470160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/src/test/java/org/apache/maven/plugins/failsafepackage org.apache.maven.plugins.failsafe; /* * 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. */ /** * Constants for testing * * @author mspika */ public final class TestConstants { public static final String UnitTest = "Unit-Test"; public static final String IntegrationTest = "Integration-Test"; public static final String ManualTest = "Manual-Test"; public static final String BrokenTest = "Broken-Test"; } resources/000077500000000000000000000000001330756104600360505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/src/testtestng-integrationTest.xml000066400000000000000000000010721330756104600432570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/src/test/resources testng.xml000066400000000000000000000010011330756104600400660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-930-failsafe-runtests/src/test/resources maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/000077500000000000000000000000001330756104600321705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/pom.xml000066400000000000000000000025611330756104600335110ustar00rootroot00000000000000 4.0.0 com.mycompany TestFailed 1.0-SNAPSHOT jar TestFailed http://maven.apache.org UTF-8 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} junit junit 3.8.1 test org.testng testng 6.8 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/src/000077500000000000000000000000001330756104600327575ustar00rootroot00000000000000main/000077500000000000000000000000001330756104600336245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/srcjava/000077500000000000000000000000001330756104600345455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/src/maincom/000077500000000000000000000000001330756104600353235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/src/main/javamycompany/000077500000000000000000000000001330756104600373375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/src/main/java/comtestfailed/000077500000000000000000000000001330756104600414635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/src/main/java/com/mycompanyApp.java000066400000000000000000000017461330756104600430560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/src/main/java/com/mycompany/testfailedpackage com.mycompany.testfailed; /* * 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. */ /** * Hello world! * */ public class App { public static void main( String[] args ) { System.out.println( "Hello World!" ); } } test/000077500000000000000000000000001330756104600336575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/srcjava/000077500000000000000000000000001330756104600346005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/src/testcom/000077500000000000000000000000001330756104600353565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/src/test/javamycompany/000077500000000000000000000000001330756104600373725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/src/test/java/comtestfailed/000077500000000000000000000000001330756104600415165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/src/test/java/com/mycompanyAppTest.java000066400000000000000000000022021330756104600437350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-931-provider-failure/src/test/java/com/mycompany/testfailedpackage com.mycompany.testfailed; /* * 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. */ import junit.framework.TestCase; import org.testng.annotations.Test; /** * Unit test for simple App. */ public class AppTest extends TestCase { @Test(groups = "deleteLocation", dependsOnGroups = { "postLocation", "getLocation" }) public void removeNonExistentLocation() {} } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-942-testngSuite/000077500000000000000000000000001330756104600312315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-942-testngSuite/pom.xml000066400000000000000000000020471330756104600325510ustar00rootroot00000000000000 4.0.0 surefire-testng surefire-testng 1.0-SNAPSHOT 2.12.4 org.testng testng 5.14 test maven-surefire-plugin ${surefire.version} src/test/resources/config.xml maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-942-testngSuite/src/000077500000000000000000000000001330756104600320205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-942-testngSuite/src/test/000077500000000000000000000000001330756104600327775ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600336415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-942-testngSuite/src/testorg/000077500000000000000000000000001330756104600344305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-942-testngSuite/src/test/javaBasicTest.java000066400000000000000000000026731330756104600371640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-942-testngSuite/src/test/java/orgpackage org; /* * 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. */ import org.testng.annotations.*; import org.testng.Assert; public class BasicTest { private boolean setUpCalled = false; @BeforeTest public void setUp() { setUpCalled = true; } @AfterTest public void tearDown() { setUpCalled = false; } @Test public void testSetUp() { Assert.assertTrue( setUpCalled ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); } @Test public void testSuccessTwo() { Assert.assertTrue( true ); } @AfterClass public static void oneTimeTearDown() { } } resources/000077500000000000000000000000001330756104600347325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-942-testngSuite/src/testconfig.xml000066400000000000000000000002561330756104600367240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-942-testngSuite/src/test/resources maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-943-report-content/000077500000000000000000000000001330756104600316775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-943-report-content/pom.xml000066400000000000000000000023711330756104600332170ustar00rootroot00000000000000 4.0.0 dummy 1.0-SNAPSHOT dummy surefire-943-report-content 2.13 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} org.apache.maven.surefire surefire-junit47 ${surefire.version} junit junit test 4.11 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-943-report-content/src/000077500000000000000000000000001330756104600324665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-943-report-content/src/test/000077500000000000000000000000001330756104600334455ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600343075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-943-report-content/src/testorg/000077500000000000000000000000001330756104600350765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-943-report-content/src/test/javasample/000077500000000000000000000000001330756104600363575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-943-report-content/src/test/java/orgmodule/000077500000000000000000000000001330756104600376445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-943-report-content/src/test/java/org/sampleMy1Test.java000066400000000000000000000024051330756104600420160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-943-report-content/src/test/java/org/sample/modulepackage org.sample.module; /* * 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. */ import static org.junit.Assert.fail; import org.junit.Test; import org.junit.Ignore; public class My1Test { @Test public void fails() throws Exception { Thread.sleep( 1000 ); fail( "Always fails" ); } @Test public void alwaysSuccessful() throws Exception { Thread.sleep( 1000 ); } @Test @Ignore( "Ignore-Message" ) public void alwaysIgnored() { } } My2Test.java000066400000000000000000000023651330756104600420240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-943-report-content/src/test/java/org/sample/modulepackage org.sample.module; /* * 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. */ import static org.junit.Assert.fail; import org.junit.Test; import org.junit.Ignore; public class My2Test { @Test public void fails() throws Exception { Thread.sleep( 1000 ); fail( "Always fails" ); } @Test public void alwaysSuccessful() throws Exception { Thread.sleep( 1000 ); } @Test @Ignore public void alwaysIgnored() { } } My3Test.java000066400000000000000000000022241330756104600420170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-943-report-content/src/test/java/org/sample/modulepackage org.sample.module; /* * 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. */ import static org.junit.Assert.fail; import org.junit.Test; public class My3Test { @Test public void fails() throws Exception { Thread.sleep( 1000 ); fail( "Always fails" ); } @Test public void alwaysSuccessful() throws Exception { Thread.sleep( 1000 ); } } My4Test.java000066400000000000000000000020531330756104600420200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-943-report-content/src/test/java/org/sample/modulepackage org.sample.module; /* * 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. */ import org.junit.Test; import org.junit.Ignore; @Ignore( "Ignore-Message" ) public class My4Test { @Test public void alsoIgnored() { } @Test @Ignore public void alwaysIgnored() { } } My5Test.java000066400000000000000000000021771330756104600420300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-943-report-content/src/test/java/org/sample/modulepackage org.sample.module; /* * 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. */ import org.junit.BeforeClass; import org.junit.Test; public class My5Test { @BeforeClass public static void failsOnBeforeClass() { throw new RuntimeException("always fails before class"); } @Test public void neverExecuted() throws Exception { } } surefire-946-killMainProcessInReusableFork/000077500000000000000000000000001330756104600345335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000041261330756104600360530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork 4.0.0 org.apache.maven.plugins.surefire surefire-946 1.0-SNAPSHOT Tests killing the main maven process when using reusable forks 1.6 1.6 junit junit 4.4 test org.apache.maven.plugins.surefire maven-selfdestruct-plugin 0.1 ${selfdestruct.timeoutInMillis} ${selfdestruct.method} maven-surefire-plugin ${surefire.version} src/000077500000000000000000000000001330756104600353225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableForktest/000077500000000000000000000000001330756104600363015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork/srcjava/000077500000000000000000000000001330756104600372225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork/src/testjunit44/000077500000000000000000000000001330756104600405235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork/src/test/javaenvironment/000077500000000000000000000000001330756104600430675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork/src/test/java/junit44Basic01Test.java000066400000000000000000000023061330756104600457550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class Basic01Test { @Test public void testNothing() { } @AfterClass public static void waitSomeTimeAround() { try { Thread.sleep( Integer.getInteger( "testSleepTime", 2000 ) ); } catch ( InterruptedException ignored ) { } } } Basic02Test.java000066400000000000000000000023061330756104600457560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class Basic02Test { @Test public void testNothing() { } @AfterClass public static void waitSomeTimeAround() { try { Thread.sleep( Integer.getInteger( "testSleepTime", 2000 ) ); } catch ( InterruptedException ignored ) { } } } Basic03Test.java000066400000000000000000000023061330756104600457570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class Basic03Test { @Test public void testNothing() { } @AfterClass public static void waitSomeTimeAround() { try { Thread.sleep( Integer.getInteger( "testSleepTime", 2000 ) ); } catch ( InterruptedException ignored ) { } } } Basic04Test.java000066400000000000000000000023061330756104600457600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class Basic04Test { @Test public void testNothing() { } @AfterClass public static void waitSomeTimeAround() { try { Thread.sleep( Integer.getInteger( "testSleepTime", 2000 ) ); } catch ( InterruptedException ignored ) { } } } Basic05Test.java000066400000000000000000000023061330756104600457610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class Basic05Test { @Test public void testNothing() { } @AfterClass public static void waitSomeTimeAround() { try { Thread.sleep( Integer.getInteger( "testSleepTime", 2000 ) ); } catch ( InterruptedException ignored ) { } } } Basic06Test.java000066400000000000000000000023061330756104600457620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class Basic06Test { @Test public void testNothing() { } @AfterClass public static void waitSomeTimeAround() { try { Thread.sleep( Integer.getInteger( "testSleepTime", 2000 ) ); } catch ( InterruptedException ignored ) { } } } Basic07Test.java000066400000000000000000000023061330756104600457630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class Basic07Test { @Test public void testNothing() { } @AfterClass public static void waitSomeTimeAround() { try { Thread.sleep( Integer.getInteger( "testSleepTime", 2000 ) ); } catch ( InterruptedException ignored ) { } } } Basic08Test.java000066400000000000000000000023061330756104600457640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class Basic08Test { @Test public void testNothing() { } @AfterClass public static void waitSomeTimeAround() { try { Thread.sleep( Integer.getInteger( "testSleepTime", 2000 ) ); } catch ( InterruptedException ignored ) { } } } Basic09Test.java000066400000000000000000000023061330756104600457650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class Basic09Test { @Test public void testNothing() { } @AfterClass public static void waitSomeTimeAround() { try { Thread.sleep( Integer.getInteger( "testSleepTime", 2000 ) ); } catch ( InterruptedException ignored ) { } } } Basic10Test.java000066400000000000000000000023061330756104600457550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-killMainProcessInReusableFork/src/test/java/junit44/environmentpackage junit44.environment; /* * 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. */ import org.junit.AfterClass; import org.junit.Test; public class Basic10Test { @Test public void testNothing() { } @AfterClass public static void waitSomeTimeAround() { try { Thread.sleep( Integer.getInteger( "testSleepTime", 2000 ) ); } catch ( InterruptedException ignored ) { } } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-self-destruct-plugin/000077500000000000000000000000001330756104600327775ustar00rootroot00000000000000pom.xml000066400000000000000000000031261330756104600342370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-self-destruct-plugin 4.0.0 org.apache.maven.plugins.surefire maven-selfdestruct-plugin 0.1 maven-plugin maven-selfdestruct-plugin Maven Plugin http://maven.apache.org UTF-8 1.6 1.6 org.apache.maven maven-plugin-api 2.0 junit junit 3.8.1 test org.apache.maven.plugins maven-plugin-plugin 2.9 maven-selfdestruct-plugin generated-helpmojo helpmojo src/000077500000000000000000000000001330756104600335075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-self-destruct-pluginmain/000077500000000000000000000000001330756104600344335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-self-destruct-plugin/srcjava/000077500000000000000000000000001330756104600353545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-self-destruct-plugin/src/mainorg/000077500000000000000000000000001330756104600361435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-self-destruct-plugin/src/main/javaapache/000077500000000000000000000000001330756104600373645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-self-destruct-plugin/src/main/java/orgmaven/000077500000000000000000000000001330756104600404725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-self-destruct-plugin/src/main/java/org/apacheplugins/000077500000000000000000000000001330756104600421535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-self-destruct-plugin/src/main/java/org/apache/mavensurefire/000077500000000000000000000000001330756104600437775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-self-destruct-plugin/src/main/java/org/apache/maven/pluginsselfdestruct/000077500000000000000000000000001330756104600465065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-self-destruct-plugin/src/main/java/org/apache/maven/plugins/surefireselfdestruct/SelfDestructMojo.java000066400000000000000000000115541330756104600526130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-946-self-destruct-plugin/src/main/java/org/apache/maven/plugins/surefirepackage org.apache.maven.plugins.surefire.selfdestruct; /* * Copyright 2001-2005 The Apache Software Foundation. * * Licensed 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. */ import java.io.IOException; import java.lang.management.ManagementFactory; import java.util.ArrayList; import java.util.List; import java.util.Timer; import java.util.TimerTask; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; /* * 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. */ /** * Goal which terminates the maven process it is executed in after a timeout. * * @goal selfdestruct * @phase test */ public class SelfDestructMojo extends AbstractMojo { private enum DestructMethod { exit, halt, interrupt; } /** * Timeout in milliseconds * * @parameter */ private long timeoutInMillis = 0; /** * Method of self-destruction: 'exit' will use System.exit (default), 'halt' will use Runtime.halt, 'interrupt' will * try to call 'taskkill' (windows) or 'kill -INT' (others) * * @parameter */ private String method = "exit"; public void execute() throws MojoExecutionException { DestructMethod destructMethod = DestructMethod.valueOf( method ); if ( timeoutInMillis > 0 ) { getLog().warn( "Self-Destruct in " + timeoutInMillis + " ms using " + destructMethod ); Timer timer = new Timer( "", true ); timer.schedule( new SelfDestructionTask( destructMethod ), timeoutInMillis ); } else { new SelfDestructionTask( destructMethod ).run(); } } private void selfDestruct( DestructMethod destructMethod ) { getLog().warn( "Self-Destructing NOW." ); switch ( destructMethod ) { case exit: System.exit( 1 ); case halt: Runtime.getRuntime().halt( 1 ); case interrupt: String name = ManagementFactory.getRuntimeMXBean().getName(); int indexOfAt = name.indexOf( '@' ); if ( indexOfAt > 0 ) { String pid = name.substring( 0, indexOfAt ); getLog().warn( "Going to kill process with PID " + pid ); List args = new ArrayList(); if ( System.getProperty( "os.name" ).startsWith( "Windows" ) ) { args.add( "taskkill" ); args.add( "/PID" ); } else { args.add( "kill" ); args.add( "-INT" ); } args.add( pid ); try { new ProcessBuilder( args ).start(); } catch ( IOException e ) { getLog().error( "Unable to spawn process. Killing with System.exit.", e ); } } else { getLog().warn( "Unable to determine my PID... Using System.exit" ); } } System.exit( 1 ); } private class SelfDestructionTask extends TimerTask { private DestructMethod destructMethod; public SelfDestructionTask( DestructMethod destructMethod ) { this.destructMethod = destructMethod; } @Override public void run() { selfDestruct( destructMethod ); } } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/000077500000000000000000000000001330756104600324735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/boom/000077500000000000000000000000001330756104600334275ustar00rootroot00000000000000pom.xml000066400000000000000000000035351330756104600346730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/boom 4.0.0 class-rule-boom-boom org.apache.maven.surefire class-rule-boom 1.0-SNAPSHOT junit junit 4.11 test org.apache.maven.surefire class-rule 1.0-SNAPSHOT test org.apache.maven.plugins maven-failsafe-plugin ${surefire.version} integration-test verify always org.apache.maven.surefire surefire-junit47 ${surefire.version} src/000077500000000000000000000000001330756104600341375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/boomtest/000077500000000000000000000000001330756104600351165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/boom/srcjava/000077500000000000000000000000001330756104600360375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/boom/src/testorg/000077500000000000000000000000001330756104600366265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/boom/src/test/javaapache/000077500000000000000000000000001330756104600400475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/boom/src/test/java/orgmaven/000077500000000000000000000000001330756104600411555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/boom/src/test/java/org/apachesurefire/000077500000000000000000000000001330756104600430015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/boom/src/test/java/org/apache/mavencrb/000077500000000000000000000000001330756104600435475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/boom/src/test/java/org/apache/maven/surefireClassRuleIT.java000066400000000000000000000024171330756104600465500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/boom/src/test/java/org/apache/maven/surefire/crbpackage org.apache.maven.surefire.crb; /* * 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. */ import org.junit.Assert; import org.junit.ClassRule; import org.junit.Test; /** * Created with IntelliJ IDEA. * User: benson * Date: 3/16/13 * Time: 11:00 AM * To change this template use File | Settings | File Templates. */ public class ClassRuleIT extends Assert { @ClassRule public static ExampleClassRule rule = new ExampleClassRule(ExampleClassRule.someStaticFunction()); @Test public void dummyTest() { } } class-rule/000077500000000000000000000000001330756104600344665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdefpom.xml000066400000000000000000000011461330756104600360050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/class-rule 4.0.0 class-rule org.apache.maven.surefire class-rule-boom 1.0-SNAPSHOT junit junit 4.11 src/000077500000000000000000000000001330756104600352555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/class-rulemain/000077500000000000000000000000001330756104600362015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/class-rule/srcjava/000077500000000000000000000000001330756104600371225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/class-rule/src/mainorg.apache.maven.surefire.crb/000077500000000000000000000000001330756104600446265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/class-rule/src/main/javaExampleClassRule.java000066400000000000000000000012311330756104600506770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef/class-rule/src/main/java/org.apache.maven.surefire.crbpackage org.apache.maven.surefire.crb; import org.junit.rules.ExternalResource; /** * Created with IntelliJ IDEA. * User: benson * Date: 3/16/13 * Time: 10:52 AM * To change this template use File | Settings | File Templates. */ public class ExampleClassRule extends ExternalResource { public ExampleClassRule(String dummy) { // } protected void before() throws Throwable { System.err.println("ExampleClassRule.before()"); } protected void after() { System.err.println("ExampleClassRule.after()"); } public static String someStaticFunction() { throw new RuntimeException("Surprise!"); } } pom.xml000066400000000000000000000026111330756104600337310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-972-bizarre-noclassdef 4.0.0 org.apache.maven.surefire class-rule-boom pom 1.0-SNAPSHOT class-rule boom 1.6 1.6 org.apache.maven.plugins maven-compiler-plugin 2.5.1 true true org.apache.maven.plugins maven-surefire-plugin 2.14 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-975-wrong-encoding/000077500000000000000000000000001330756104600316415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-975-wrong-encoding/pom.xml000077500000000000000000000021121330756104600331550ustar00rootroot00000000000000 4.0.0 encoding-bug ru.fors.encoding 1.0-SNAPSHOT UTF-8 UTF-8 1.6 1.6 junit junit 4.11 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-975-wrong-encoding/src/000077500000000000000000000000001330756104600324305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-975-wrong-encoding/src/test/000077500000000000000000000000001330756104600334075ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600342515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-975-wrong-encoding/src/testEncodingInReportTest.java000077500000000000000000000017421330756104600411740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-975-wrong-encoding/src/test/javaimport org.junit.Test; /* * 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. */ public class EncodingInReportTest { @Test public void test1() { } @Test public void кириллице() { } }surefire-979-smartStackTrace-wrongClassloader/000077500000000000000000000000001330756104600352505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcesmodule1/000077500000000000000000000000001330756104600366165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloaderpom.xml000066400000000000000000000022341330756104600401340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloader/module1 4.0.0 surefire-979 module1 1.0 surefire-979-base 1.6 1.6 junit junit 4.10 commons-io commons-io 2.2 provided maven-surefire-plugin ${surefire.version} src/000077500000000000000000000000001330756104600374055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloader/module1main/000077500000000000000000000000001330756104600403315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloader/module1/srcjava/000077500000000000000000000000001330756104600412525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloader/module1/src/mainsurefire979/000077500000000000000000000000001330756104600433475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloader/module1/src/main/javaTestBase.java000066400000000000000000000021331330756104600457230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloader/module1/src/main/java/surefire979package surefire979; /* * 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. */ import org.apache.commons.io.input.AutoCloseInputStream; import org.junit.Test; import java.io.ByteArrayInputStream; public class TestBase { static { AutoCloseInputStream directoryWalker = new AutoCloseInputStream(new ByteArrayInputStream(new byte[200])); } } module2/000077500000000000000000000000001330756104600366175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloaderpom.xml000066400000000000000000000022621330756104600401360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloader/module2 4.0.0 surefire-979 module2 1.0 surefire-979 1.6 1.6 junit junit 4.10 test surefire-979 module1 1.0 test maven-surefire-plugin ${surefire.version} src/000077500000000000000000000000001330756104600374065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloader/module2test/000077500000000000000000000000001330756104600403655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloader/module2/srcjava/000077500000000000000000000000001330756104600413065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloader/module2/src/testsurefire979/000077500000000000000000000000001330756104600434035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloader/module2/src/test/javaFailingStaticInitializerTest.java000066400000000000000000000020171330756104600520330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloader/module2/src/test/java/surefire979package surefire979; /* * 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. */ import org.junit.Test; public class FailingStaticInitializerTest extends TestBase { @Test public void test() { throw new IllegalStateException("This test will never run"); } } pom.xml000066400000000000000000000016131330756104600365660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-979-smartStackTrace-wrongClassloader 4.0.0 test surefire-979 0.0.1-SNAPSHOT surefire-979 pom module1 module2 1.6 1.6 maven-surefire-plugin ${surefire.version} surefire-985-parameterized-and-categories/000077500000000000000000000000001330756104600343625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000035341330756104600357040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-985-parameterized-and-categories 4.0.0 org.apache.maven.surefire it-parent 1.0 surefire-985 Tests Parameterized runner together with @Categories junit junit 4.11 test maven-surefire-plugin ${surefire.version} alphabetical sample.CategoryActivated src/000077500000000000000000000000001330756104600351515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-985-parameterized-and-categoriestest/000077500000000000000000000000001330756104600361305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-985-parameterized-and-categories/srcjava/000077500000000000000000000000001330756104600370515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-985-parameterized-and-categories/src/testsample/000077500000000000000000000000001330756104600403325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-985-parameterized-and-categories/src/test/javaCategoryActivated.java000066400000000000000000000015441330756104600446030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-985-parameterized-and-categories/src/test/java/samplepackage sample; /* * 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. */ public interface CategoryActivated { } CategoryNotSelected.java000066400000000000000000000015461330756104600451120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-985-parameterized-and-categories/src/test/java/samplepackage sample; /* * 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. */ public interface CategoryNotSelected { } parameterized/000077500000000000000000000000001330756104600431665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-985-parameterized-and-categories/src/test/java/sampleParameterized01Test.java000066400000000000000000000032431330756104600476300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-985-parameterized-and-categories/src/test/java/sample/parameterizedpackage sample.parameterized; /* * 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. */ import java.util.Arrays; import java.util.Collection; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import sample.CategoryNotSelected; @RunWith( Parameterized.class ) @Category( CategoryNotSelected.class ) public class Parameterized01Test { static { System.out.println( "Initializing Parameterized01Test" ); } @Parameters public static Collection getParams() { return Arrays.asList( new Integer[] { 1 }, new Integer[] { 2 }, new Integer[] { 3 }, new Integer[] { 4 } ); } public Parameterized01Test( Integer param ) { } @Test public void testNothing() { } @Test public void testNothingEither() { } } Parameterized02Test.java000066400000000000000000000032431330756104600476310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-985-parameterized-and-categories/src/test/java/sample/parameterizedpackage sample.parameterized; /* * 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. */ import java.util.Arrays; import java.util.Collection; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import sample.CategoryActivated; @RunWith( Parameterized.class ) public class Parameterized02Test { static { System.out.println( "Initializing Parameterized02Test" ); } @Parameters public static Collection getParams() { return Arrays.asList( new Integer[] { 1 }, new Integer[] { 2 }, new Integer[] { 3 }, new Integer[] { 4 } ); } public Parameterized02Test( Integer param ) { } @Test @Category( CategoryActivated.class ) public void testNothing() { } @Test public void testNothingEither() { } } Parameterized03Test.java000066400000000000000000000032371330756104600476350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-985-parameterized-and-categories/src/test/java/sample/parameterizedpackage sample.parameterized; /* * 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. */ import java.util.Arrays; import java.util.Collection; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import sample.CategoryActivated; @Category( CategoryActivated.class ) @RunWith( Parameterized.class ) public class Parameterized03Test { static { System.out.println( "Initializing Parameterized03Test" ); } @Parameters public static Collection getParams() { return Arrays.asList( new Integer[] { 1 }, new Integer[] { 2 }, new Integer[] { 3 }, new Integer[] { 4 } ); } public Parameterized03Test( Integer param ) { } @Test public void testNothing() { } @Test public void testNothingEither() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-995-categoryInheritance/000077500000000000000000000000001330756104600327125ustar00rootroot00000000000000pom.xml000066400000000000000000000055471330756104600341630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-995-categoryInheritance 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-995 1.0 http://maven.apache.org 4.12 tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava junit junit ${version.junit} test maven-surefire-plugin positive-tests maven-surefire-plugin jiras.surefire955.SomeCategory positive-tests-excluded-categories maven-surefire-plugin jiras.surefire955.SomeCategory maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-995-categoryInheritance/src/000077500000000000000000000000001330756104600335015ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600344015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-995-categoryInheritance/srcjava/000077500000000000000000000000001330756104600353225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-995-categoryInheritance/src/testjiras/000077500000000000000000000000001330756104600364325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-995-categoryInheritance/src/test/javasurefire955/000077500000000000000000000000001330756104600405215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-995-categoryInheritance/src/test/java/jirasCategorizedTest.java000066400000000000000000000020621330756104600444640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-995-categoryInheritance/src/test/java/jiras/surefire955package jiras.surefire955; /* * 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. */ import org.junit.Test; import org.junit.experimental.categories.Category; @Category( SomeCategory.class ) public class CategorizedTest { @Test public void a() { System.out.println( "CategorizedTest#a" ); } } NotIncludedTest.java000066400000000000000000000017451330756104600444430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-995-categoryInheritance/src/test/java/jiras/surefire955package jiras.surefire955; /* * 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. */ import org.junit.Test; public class NotIncludedTest { @Test public void test() { System.out.println( "NotIncludedTest#test" ); } } SomeCategory.java000066400000000000000000000015511330756104600437670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-995-categoryInheritance/src/test/java/jiras/surefire955package jiras.surefire955; /* * 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. */ public interface SomeCategory { } SpecialCategorizedTest.java000066400000000000000000000020171330756104600457650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-995-categoryInheritance/src/test/java/jiras/surefire955package jiras.surefire955; /* * 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. */ import org.junit.Test; public final class SpecialCategorizedTest extends CategorizedTest { @Test public void b() { System.out.println( "SpecialCategorizedTest#b" ); } } SpecialNonCategoryTest.java000066400000000000000000000017631330756104600457640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/surefire-995-categoryInheritance/src/test/java/jiras/surefire955package jiras.surefire955; /* * 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. */ import org.junit.Test; public class SpecialNonCategoryTest { @Test public void test() { System.out.println( "SpecialNonCategoryTest#test" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/system-properties/000077500000000000000000000000001330756104600302735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/system-properties/pom.xml000066400000000000000000000066731330756104600316240ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire system-properties 1.0-SNAPSHOT Test for systemProperties org.codehaus.mojo build-helper-maven-plugin 1.2 generate-sources reserve-network-port reservedPort1 reservedPort2 reservedPort3 maven-surefire-plugin ${surefire.version} setInPom foo ${project.build.directory} ${reservedPort1} ${reservedPort2} ${setOnArgLineWorkAround} value2 ${project.basedir}/src/test/config/propsfile.properties -DsetOnArgLine=bar junit junit 3.8.1 test fool 1.6 1.6 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/system-properties/src/000077500000000000000000000000001330756104600310625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/system-properties/src/test/000077500000000000000000000000001330756104600320415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/system-properties/src/test/config/000077500000000000000000000000001330756104600333065ustar00rootroot00000000000000propsfile.properties000066400000000000000000000000631330756104600373470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/system-properties/src/test/configsetInFile = bar overriddenPropertyFomFile = value1 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/system-properties/src/test/java/000077500000000000000000000000001330756104600327625ustar00rootroot00000000000000systemProperties/000077500000000000000000000000001330756104600363045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/system-properties/src/test/javaBasicTest.java000066400000000000000000000062561330756104600410410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/system-properties/src/test/java/systemPropertiespackage systemProperties; /* * 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. */ import java.io.File; import junit.framework.TestCase; public class BasicTest extends TestCase { public void testSetInPom() { assertEquals( "property setInPom not set", "foo", System.getProperty( "setInPom" ) ); } public void testSetOnArgLine() { assertEquals( "setOnArgLine property not set", "bar", System.getProperty( "setOnArgLine" ) ); } public void testSystemPropertyUsingMavenProjectProperties() { String actualBuildDirectory = new File( System.getProperty( "basedir" ), "target" ).getAbsolutePath(); String buildDirectoryFromPom = new File( System.getProperty( "buildDirectory" ) ).getAbsolutePath(); assertEquals( "Pom property not set.", actualBuildDirectory, buildDirectoryFromPom ); } public void testSystemPropertyGenerateByOtherPlugin() throws Exception { int reservedPort1 = Integer.parseInt( System.getProperty( "reservedPort1" ) ); int reservedPort2 = Integer.parseInt( System.getProperty( "reservedPort2" ) ); System.out.println( "reservedPort1: " + reservedPort1 ); System.out.println( "reservedPort2: " + reservedPort2 ); assertTrue( reservedPort1 != reservedPort2 ); } public void testEmptySystemProperties() { assertNull( "Null property is not null", System.getProperty( "nullProperty" ) ); assertEquals( "Empty property is not empty", "", System.getProperty( "emptyProperty" ) ); assertNotNull( "Blank property is null", System.getProperty( "blankProperty" ) ); assertEquals( "Blank property is not trimmed", "", System.getProperty( "blankProperty" ) ); } /** * work around for SUREFIRE-121 */ public void testSetOnArgLineWorkAround() { assertEquals( "property setOnArgLineWorkAround not set", "baz", System.getProperty( "setOnArgLineWorkAround" ) ); } public void testSetOnMavenCommandLine() { assertEquals( "property setOnMavenCommandLine not set", "baz", System.getProperty( "setOnMavenCommandLine" ) ); } public void testSetInFile() { assertEquals( "property setInFile not set", "bar", System.getProperty( "setInFile" ) ); assertEquals( "property overriddenPropertyFomFile not overridden", "value2", System.getProperty( "overriddenPropertyFomFile" ) ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/test-helper-dump-pid-plugin/000077500000000000000000000000001330756104600320225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/test-helper-dump-pid-plugin/pom.xml000066400000000000000000000032711330756104600333420ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire maven-dump-pid-plugin 0.1 maven-plugin maven-dump-pid-plugin Maven Plugin http://maven.apache.org UTF-8 1.6 1.6 org.apache.maven maven-plugin-api 2.2.1 org.apache.maven.plugin-tools maven-plugin-annotations 3.2 junit junit 3.8.1 test org.apache.maven.plugins maven-plugin-plugin 3.2 true mojo-descriptor descriptor maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/test-helper-dump-pid-plugin/src/000077500000000000000000000000001330756104600326115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/test-helper-dump-pid-plugin/src/main/000077500000000000000000000000001330756104600335355ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600343775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/test-helper-dump-pid-plugin/src/mainorg/000077500000000000000000000000001330756104600351665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/test-helper-dump-pid-plugin/src/main/javaapache/000077500000000000000000000000001330756104600364075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/test-helper-dump-pid-plugin/src/main/java/orgmaven/000077500000000000000000000000001330756104600375155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/test-helper-dump-pid-plugin/src/main/java/org/apacheplugins/000077500000000000000000000000001330756104600411765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/test-helper-dump-pid-plugin/src/main/java/org/apache/mavensurefire/000077500000000000000000000000001330756104600430225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/test-helper-dump-pid-plugin/src/main/java/org/apache/maven/pluginsdumppid/000077500000000000000000000000001330756104600444645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/test-helper-dump-pid-plugin/src/main/java/org/apache/maven/plugins/surefireDumpPidMojo.java000066400000000000000000000042231330756104600475170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/test-helper-dump-pid-plugin/src/main/java/org/apache/maven/plugins/surefire/dumppidpackage org.apache.maven.plugins.surefire.dumppid; /* * Copyright 2001-2005 The Apache Software Foundation. * * Licensed 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. */ import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.lang.management.ManagementFactory; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; /** * Goal dumps the PID of the maven process */ @Mojo( name = "dump-pid", defaultPhase = LifecyclePhase.GENERATE_TEST_RESOURCES ) public class DumpPidMojo extends AbstractMojo { @Parameter( defaultValue = "${project.build.directory}", property = "dumpPid.targetDir" ) private File targetDir; public void execute() throws MojoExecutionException { File target; try { getLog().info( "Dumping PID to " + targetDir ); if ( !targetDir.exists() ) { targetDir.mkdirs(); } target = new File( targetDir, "maven.pid" ).getCanonicalFile(); FileWriter fw = new FileWriter( target ); String pid = ManagementFactory.getRuntimeMXBean().getName(); fw.write( pid ); fw.flush(); fw.close(); getLog().info( "Wrote " + pid + " to " + target ); } catch ( IOException e ) { throw new MojoExecutionException( "Unable to create pid file", e ); } } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-afterSuiteFailure/000077500000000000000000000000001330756104600315025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-afterSuiteFailure/pom.xml000066400000000000000000000047321330756104600330250ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire testng-afterSuiteFailure 1.0-SNAPSHOT TestNG failure after suite 1.6 1.6 testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-afterSuiteFailure/src/000077500000000000000000000000001330756104600322715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-afterSuiteFailure/src/test/000077500000000000000000000000001330756104600332505ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600341125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-afterSuiteFailure/src/testtestng/000077500000000000000000000000001330756104600354165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-afterSuiteFailure/src/test/javaafterSuiteFailure/000077500000000000000000000000001330756104600410415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-afterSuiteFailure/src/test/java/testngTestNGSuiteTest.java000066400000000000000000000021111330756104600447150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-afterSuiteFailure/src/test/java/testng/afterSuiteFailurepackage testng.afterSuiteFailure; /* * 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. */ import org.testng.Assert; import org.testng.annotations.AfterSuite; import org.testng.annotations.Test; public class TestNGSuiteTest { @Test public void doNothing() { } @AfterSuite public void failAfterSuite() { Assert.fail(); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethod/000077500000000000000000000000001330756104600304625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethod/pom.xml000066400000000000000000000047321330756104600320050ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire testng-beforeMethod 1.0-SNAPSHOT TestNG @BeforeMethod annotation 1.6 1.6 testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethod/src/000077500000000000000000000000001330756104600312515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethod/src/test/000077500000000000000000000000001330756104600322305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethod/src/test/java/000077500000000000000000000000001330756104600331515ustar00rootroot00000000000000testng/000077500000000000000000000000001330756104600343765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethod/src/test/javabeforeMethod/000077500000000000000000000000001330756104600370015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethod/src/test/java/testngTestNGSuiteTest.java000066400000000000000000000022551330756104600426660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethod/src/test/java/testng/beforeMethodpackage testng.beforeMethod; /* * 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. */ import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class TestNGSuiteTest { private boolean beforeMethod = false; @BeforeMethod public void beforeMethod() { beforeMethod = true; } @Test public void testBeforeMethod() { Assert.assertTrue( beforeMethod ); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethodFailure/000077500000000000000000000000001330756104600317725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethodFailure/pom.xml000066400000000000000000000047541330756104600333210ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire testng-beforeMethodFailure 1.0-SNAPSHOT TestNG failure in @BeforeMethod annotation 1.6 1.6 testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethodFailure/src/000077500000000000000000000000001330756104600325615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethodFailure/src/test/000077500000000000000000000000001330756104600335405ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600344025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethodFailure/src/testtestng/000077500000000000000000000000001330756104600357065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethodFailure/src/test/javabeforeMethodFailure/000077500000000000000000000000001330756104600416215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethodFailure/src/test/java/testngTestNGSuiteTest.java000066400000000000000000000022641330756104600455060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-beforeMethodFailure/src/test/java/testng/beforeMethodFailurepackage testng.beforeMethodFailure; /* * 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. */ import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class TestNGSuiteTest { private final boolean beforeMethod = false; @BeforeMethod public void beforeMethod() { Assert.fail(); } @Test public void testBeforeMethod() { Assert.assertTrue( beforeMethod ); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-execute-error/000077500000000000000000000000001330756104600306505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-execute-error/pom.xml000066400000000000000000000052271330756104600321730ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire testng-execute-error 1.0-SNAPSHOT Test proper output from forked execution in case of uncatched error during suite run 1.6 1.6 testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} maven-surefire-plugin ${surefire.version} once true true maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-execute-error/src/000077500000000000000000000000001330756104600314375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-execute-error/src/test/000077500000000000000000000000001330756104600324165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-execute-error/src/test/java/000077500000000000000000000000001330756104600333375ustar00rootroot00000000000000it/000077500000000000000000000000001330756104600336745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-execute-error/src/test/javaBasicTest.java000066400000000000000000000021471330756104600364240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-execute-error/src/test/java/itpackage it; /* * 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. */ import static org.testng.Assert.*; import org.testng.annotations.*; /* * Intentionally misconfigured (cycle) to cause an error before the suite is actually run. */ @Test(groups = { "test" }, dependsOnGroups = { "test" }) public class BasicTest { public void testTrue() { assertTrue(true); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-group-thread-parallel/000077500000000000000000000000001330756104600322525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-group-thread-parallel/pom.xml000066400000000000000000000053441330756104600335750ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire testng-group-thread-parallel 1.0-SNAPSHOT TestNG group/parallel thread tests testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} nonexistent, functional 3 methods 0 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-group-thread-parallel/src/000077500000000000000000000000001330756104600330415ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600337415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-group-thread-parallel/srcjava/000077500000000000000000000000001330756104600346625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-group-thread-parallel/src/testtestng/000077500000000000000000000000001330756104600361665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-group-thread-parallel/src/test/javagroupThreadParallel/000077500000000000000000000000001330756104600421275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-group-thread-parallel/src/test/java/testngTestNGTest.java000066400000000000000000000060371330756104600450040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-group-thread-parallel/src/test/java/testng/groupThreadParallelpackage testng.groupThreadParallel; /* * 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. */ import org.testng.Assert; import org.testng.annotations.AfterSuite; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /** * Tests grouping/threading/parallel functionality of TestNG. * * @author jkuhnert */ public class TestNGTest { private static volatile int m_testCount = 0; /** * Sets up testObject */ @BeforeClass( groups = "functional" ) public void configureTest() { testObject = new Object(); } @AfterSuite( alwaysRun = true, groups = "functional" ) public void check_Test_Count() { System.out.println( "check_Test_Count(): " + m_testCount ); Assert.assertEquals( m_testCount, 3 ); } Object testObject; @Test( groups = { "functional", "notincluded" } ) public void test1() throws InterruptedException { doTest( "test1" ); } private void doTest( String test ) throws InterruptedException { incrementTestCount(); System.out.println( "running " + test ); Assert.assertNotNull( testObject, "testObject" ); waitForTestCountToBeThree(); } private static synchronized void incrementTestCount() { m_testCount++; } @Test( groups = { "functional", "notincluded" } ) public void test2() throws InterruptedException { doTest( "test2" ); } @Test( groups = { "functional", "notincluded" } ) public void test3() throws InterruptedException { doTest( "test3" ); } private void waitForTestCountToBeThree() throws InterruptedException { if ( m_testCount == 3 ) return; long now = System.currentTimeMillis(); long timeout = 5 * 1000; long finish = now + timeout; while ( m_testCount < 3 && System.currentTimeMillis() < finish ) { Thread.sleep( 10 ); } Assert.assertTrue( m_testCount >= 3, "Expected TestCount >= 3, but was: " + m_testCount ); } /** * Sample method that shouldn't be run by test suite. */ @Test( groups = "notincluded" ) public void shouldNotRun() { Assert.fail( "Group specified by test shouldnt be run." ); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-groups/000077500000000000000000000000001330756104600273765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-groups/pom.xml000066400000000000000000000035431330756104600307200ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire testng-groups 1.0-SNAPSHOT Test for testng groups 1.6 1.6 org.testng testng 6.8.7 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-groups/src/000077500000000000000000000000001330756104600301655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-groups/src/test/000077500000000000000000000000001330756104600311445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-groups/src/test/java/000077500000000000000000000000001330756104600320655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-groups/src/test/java/testng/000077500000000000000000000000001330756104600333715ustar00rootroot00000000000000groups/000077500000000000000000000000001330756104600346315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-groups/src/test/java/testngTestNGGroupTest.java000066400000000000000000000035131330756104600405170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-groups/src/test/java/testng/groupspackage testng.groups; /* * 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. */ import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /** * Tests grouping */ public class TestNGGroupTest { private Object testObject; @BeforeClass( groups = "functional" ) public void configureTest() { testObject = new Object(); } @Test( groups = { "functional" } ) public void isFunctional() { Assert.assertNotNull( testObject, "testObject is null" ); } @Test( groups = { "functional", "notincluded" } ) public void isFunctionalAndNotincluded() { Assert.assertNotNull( testObject, "testObject is null" ); } @Test( groups = "notincluded" ) public void isNotIncluded() { Assert.assertTrue( false ); } @Test( groups = "abc-def" ) public void isDashedGroup() { } @Test( groups = "foo.bar" ) public void isFooBar() { } @Test( groups = "foo.zap" ) public void isFooZap() { } @Test public void noGroup() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-jdk14/000077500000000000000000000000001330756104600267745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-jdk14/pom.xml000066400000000000000000000043041330756104600303120ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire testng-jdk14 1.0-SNAPSHOT Test for testng jdk14 integration 1.6 1.6 junit junit 3.8.1 test org.testng testng 5.7 jdk14 test src/test/java org.apache.maven.plugins maven-surefire-plugin ${surefire.version} functional maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-jdk14/src/000077500000000000000000000000001330756104600275635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-jdk14/src/test/000077500000000000000000000000001330756104600305425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-jdk14/src/test/java/000077500000000000000000000000001330756104600314635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-jdk14/src/test/java/testng/000077500000000000000000000000001330756104600327675ustar00rootroot00000000000000jdk14/000077500000000000000000000000001330756104600336255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-jdk14/src/test/java/testngTestNGJavadocTest.java000066400000000000000000000033261330756104600377700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-jdk14/src/test/java/testng/jdk14package testng.jdk14; /* * 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. */ import org.testng.Assert; /** * Tests that forcing testng to run tests via the "${maven.test.forcetestng}" configuration option works. * * @author jkuhnert */ public class TestNGJavadocTest { /** * Sets up testObject * * @testng.configuration beforeTestClass = "true" groups = "functional" */ public void configureTest() { testObject = new Object(); } Object testObject; /** * Tests reporting an error * * @testng.test groups = "functional, notincluded" */ public void isTestObjectNull() { Assert.assertNotNull( testObject, "testObject is null" ); } /** * Sample method that shouldn't be run by test suite. * * @testng.test groups = "notincluded" */ public void shouldNotRun() { Assert.assertTrue( false, "Group specified by test shouldnt be run." ); } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit-together/000077500000000000000000000000001330756104600310275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit-together/pom.xml000066400000000000000000000052321330756104600323460ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire testng-junit-together 1.0-SNAPSHOT TestNG and Junit Together 1.6 1.6 testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit-together/src/000077500000000000000000000000001330756104600316165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit-together/src/test/000077500000000000000000000000001330756104600325755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit-together/src/test/java/000077500000000000000000000000001330756104600335165ustar00rootroot00000000000000JunitTest.java000066400000000000000000000023331330756104600362340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit-together/src/test/javaimport junit.framework.TestCase; /* * 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. */ /** * Provided to ensure both junit and testng tests can run together. * * @author jkuhnert */ public class JunitTest extends TestCase { Object testObject; /** * Creates an object instance */ public void setUp() { testObject = new Object(); } /** * Tests that object created in setup * isn't null. */ public void testJunitObject() { assertNotNull(testObject); } } TestNGJunitTest.java000066400000000000000000000023251330756104600373220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit-together/src/test/javaimport org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /* * 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. */ /** * Simple test * * @author jkuhnert */ public class TestNGJunitTest { /** * Sets up testObject */ @BeforeClass public void configureTest() { testObject = new Object(); } Object testObject; /** * Tests reporting an error */ @Test public void testNGTest() { assert testObject != null : "testObject is null"; } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit4-together/000077500000000000000000000000001330756104600311135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit4-together/pom.xml000066400000000000000000000033311330756104600324300ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 testng-junit4-together 1.0-SNAPSHOT TestNG and Junit4 Together junit junit 4.11 test org.testng testng 6.8.5 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit4-together/src/000077500000000000000000000000001330756104600317025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit4-together/src/test/000077500000000000000000000000001330756104600326615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit4-together/src/test/java/000077500000000000000000000000001330756104600336025ustar00rootroot00000000000000Junit4NoRunWithTest.java000066400000000000000000000024571330756104600402310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit4-together/src/test/java/* * 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. */ import static org.junit.Assert.assertNotNull; import org.junit.Before; import org.junit.Test; /** * Provided to ensure both junit and testng tests can run together. * * @author jkuhnert * @author agudian */ public class Junit4NoRunWithTest { Object testObject; /** * Creates an object instance */ @Before public void setUp() { testObject = new Object(); } /** * Tests that object created in setup * isn't null. */ @Test public void isJunitObject() { assertNotNull(testObject); } } Junit4SimpleRunWithTest.java000066400000000000000000000026141330756104600411010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit4-together/src/test/java/* * 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. */ import static org.junit.Assert.assertNotNull; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** * Provided to ensure both junit and testng tests can run together. * * @author jkuhnert * @author agudian */ @RunWith(JUnit4.class) public class Junit4SimpleRunWithTest { Object testObject; /** * Creates an object instance */ @Before public void setUp() { testObject = new Object(); } /** * Tests that object created in setup * isn't null. */ @Test public void isJunitObject() { assertNotNull(testObject); } } TestNGTest.java000066400000000000000000000023161330756104600363740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-junit4-together/src/test/java/* * 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. */ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /** * Simple test * * @author jkuhnert */ public class TestNGTest { /** * Sets up testObject */ @BeforeClass public void configureTest() { testObject = new Object(); } Object testObject; /** * Tests reporting an error */ @Test public void testNGTest() { assert testObject != null : "testObject is null"; } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listener-reporter/000077500000000000000000000000001330756104600315445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listener-reporter/pom.xml000066400000000000000000000062031330756104600330620ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire testng-listener-reporter 1.0-SNAPSHOT TestNG listener and reporter test 1.6 1.6 testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} org.testng guice org.apache.maven.plugins maven-surefire-plugin ${surefire.version} usedefaultlistenersfalse listenerlistenReport.ResultListener,listenReport.SuiteListener reporterlistenReport.Reporter maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listener-reporter/src/000077500000000000000000000000001330756104600323335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listener-reporter/src/test/000077500000000000000000000000001330756104600333125ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600341545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listener-reporter/src/testlistenReport/000077500000000000000000000000001330756104600366465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listener-reporter/src/test/javaFileHelper.java000066400000000000000000000026131330756104600415320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listener-reporter/src/test/java/listenReportpackage listenReport; /* * 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. */ import java.io.File; import java.io.FileWriter; import java.io.IOException; public class FileHelper { public static void writeFile(String fileName, String content) { try { File target = new File( "target" ).getAbsoluteFile(); File listenerOutput = new File( target, fileName ); FileWriter out = new FileWriter(listenerOutput); out.write( content ); out.flush(); out.close(); } catch ( IOException e ) { throw new RuntimeException(e); } } } Reporter.java000066400000000000000000000022501330756104600413120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listener-reporter/src/test/java/listenReportpackage listenReport; /* * 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. */ import java.util.List; import org.testng.IReporter; import org.testng.ISuite; import org.testng.xml.XmlSuite; public class Reporter implements IReporter { public void generateReport( List xmlSuites, List suites, String outputDirectory ) { FileHelper.writeFile( "reporter-output.txt", "This is a reporter" ); } } ResultListener.java000066400000000000000000000034011330756104600424730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listener-reporter/src/test/java/listenReportpackage listenReport; /* * 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. */ import org.testng.ITestContext; import org.testng.ITestResult; import org.testng.internal.IResultListener; public class ResultListener implements IResultListener { public void onFinish( ITestContext context ) { } public void onStart( ITestContext context ) { FileHelper.writeFile( "resultlistener-output.txt", "This is a result listener" ); } public void onTestFailedButWithinSuccessPercentage( ITestResult result ) { } public void onTestFailure( ITestResult result ) { } public void onTestSkipped( ITestResult result ) { } public void onTestStart( ITestResult result ) { } public void onTestSuccess( ITestResult result ) { } public void onConfigurationFailure( ITestResult itr ) { } public void onConfigurationSkip( ITestResult itr ) { } public void onConfigurationSuccess( ITestResult itr ) { } } SuiteListener.java000066400000000000000000000022011330756104600423030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listener-reporter/src/test/java/listenReportpackage listenReport; /* * 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. */ import org.testng.ISuite; import org.testng.ISuiteListener; public class SuiteListener implements ISuiteListener { public void onFinish( ISuite suite ) { } public void onStart( ISuite suite ) { FileHelper.writeFile( "suitelistener-output.txt", "This is a suite listener" ); } } TestNGSuiteTest.java000066400000000000000000000016621330756104600425340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listener-reporter/src/test/java/listenReportpackage listenReport; /* * 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. */ import org.testng.annotations.Test; public class TestNGSuiteTest { @Test public void doNothing() { } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listeners/000077500000000000000000000000001330756104600300675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listeners/pom.xml000066400000000000000000000030551330756104600314070ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml testng-listeners 1.0-SNAPSHOT org.testng testng 6.8.8 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listeners/src/000077500000000000000000000000001330756104600306565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listeners/src/test/000077500000000000000000000000001330756104600316355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listeners/src/test/java/000077500000000000000000000000001330756104600325565ustar00rootroot00000000000000listeners/000077500000000000000000000000001330756104600345075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listeners/src/test/javaMarkAsFailureListener.java000066400000000000000000000050311330756104600415450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listeners/src/test/java/listenerspackage listeners; /* * 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. */ import org.testng.IInvokedMethod; import org.testng.IInvokedMethodListener; import org.testng.ITestContext; import org.testng.ITestListener; import org.testng.ITestResult; /** * Created by etigwuu on 2014-04-26. */ public class MarkAsFailureListener implements ITestListener, IInvokedMethodListener { //todo add @Override in surefire 3.0 running on the top of JDK 6 public void onTestStart(ITestResult result) { } //todo add @Override in surefire 3.0 running on the top of JDK 6 public void onTestSuccess(ITestResult result) { } public static int counter = 0; /** * I will be called twice in some condition!!! * @param result */ //todo add @Override in surefire 3.0 running on the top of JDK 6 public void onTestFailure(ITestResult result) { System.out.println(++counter); } //todo add @Override in surefire 3.0 running on the top of JDK 6 public void onTestSkipped(ITestResult result) { } //todo add @Override in surefire 3.0 running on the top of JDK 6 public void onTestFailedButWithinSuccessPercentage(ITestResult result) { } //todo add @Override in surefire 3.0 running on the top of JDK 6 public void onStart(ITestContext context) { } //todo add @Override in surefire 3.0 running on the top of JDK 6 public void onFinish(ITestContext context) { } //todo add @Override in surefire 3.0 running on the top of JDK 6 public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { } //todo add @Override in surefire 3.0 running on the top of JDK 6 public void afterInvocation(IInvokedMethod method, ITestResult testResult) { testResult.setStatus(ITestResult.FAILURE); } } SimpleTest.java000066400000000000000000000021231330756104600374410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-listeners/src/test/java/listenerspackage listeners; /* * 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. */ import org.testng.annotations.Listeners; import org.testng.annotations.Test; /** * Created by etigwuu on 2014-04-26. */ @Listeners(MarkAsFailureListener.class) public class SimpleTest { @Test public void test1(){ System.out.println("Hello world"); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern-after/000077500000000000000000000000001330756104600321115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern-after/pom.xml000066400000000000000000000050361330756104600334320ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for Testng 1.6 1.6 testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} BasicTest#testSuccess* maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern-after/src/000077500000000000000000000000001330756104600327005ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern-after/src/test/000077500000000000000000000000001330756104600336575ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600345215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern-after/src/testtestng/000077500000000000000000000000001330756104600360255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern-after/src/test/javaBasicTest.java000066400000000000000000000035361330756104600405600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern-after/src/test/java/testngpackage testng; /* * 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. */ import org.testng.annotations.*; import org.testng.Assert; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; private Integer foo; @BeforeTest public void intialize() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); foo = Integer.valueOf( 1 ); } @AfterTest public void shutdown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( setUpCalled ); Assert.assertNotNull( foo ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); Assert.assertNotNull( foo ); } @Test public void testSuccessTwo() { Assert.assertTrue( true ); Assert.assertNotNull( foo ); } @AfterClass public static void oneTimeTearDown() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern-before/000077500000000000000000000000001330756104600322525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern-before/pom.xml000066400000000000000000000050361330756104600335730ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for Testng 1.6 1.6 testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} BasicTest#testSuccess* maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern-before/src/000077500000000000000000000000001330756104600330415ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600337415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern-before/srcjava/000077500000000000000000000000001330756104600346625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern-before/src/testtestng/000077500000000000000000000000001330756104600361665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern-before/src/test/javaBasicTest.java000066400000000000000000000035361330756104600407210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern-before/src/test/java/testngpackage testng; /* * 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. */ import org.testng.annotations.*; import org.testng.Assert; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; private Integer foo; @BeforeTest public void intialize() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); foo = Integer.valueOf( 1 ); } @AfterTest public void shutdown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( setUpCalled ); Assert.assertNotNull( foo ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); Assert.assertNotNull( foo ); } @Test public void testSuccessTwo() { Assert.assertTrue( true ); Assert.assertNotNull( foo ); } @AfterClass public static void oneTimeTearDown() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern/000077500000000000000000000000001330756104600310125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern/pom.xml000066400000000000000000000050431330756104600323310ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for Testng 1.6 1.6 testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} BasicTest#testSuccess* maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern/src/000077500000000000000000000000001330756104600316015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern/src/test/000077500000000000000000000000001330756104600325605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern/src/test/java/000077500000000000000000000000001330756104600335015ustar00rootroot00000000000000testng/000077500000000000000000000000001330756104600347265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern/src/test/javaBasicTest.java000066400000000000000000000032551330756104600374570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-method-pattern/src/test/java/testngpackage testng; /* * 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. */ import org.testng.annotations.*; import org.testng.Assert; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @BeforeTest public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @AfterTest public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( setUpCalled ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); } @Test public void testSuccessTwo() { Assert.assertTrue( true ); } @AfterClass public static void oneTimeTearDown() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-multiple-method-patterns/000077500000000000000000000000001330756104600330265ustar00rootroot00000000000000pom.xml000066400000000000000000000062341330756104600342710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-multiple-method-patterns 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire jiras-surefire-745-testng 1.0 org.testng testng 5.7 jdk15 test org.apache.maven.plugins maven-surefire-plugin testng-test org.apache.maven.plugins maven-surefire-plugin testng-includes org.apache.maven.plugins maven-surefire-plugin ${included} testng-includes-excludes org.apache.maven.plugins maven-surefire-plugin ${included} ${excluded} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-multiple-method-patterns/src/000077500000000000000000000000001330756104600336155ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600345155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-multiple-method-patterns/srcjava/000077500000000000000000000000001330756104600354365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-multiple-method-patterns/src/testjiras/000077500000000000000000000000001330756104600365465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-multiple-method-patterns/src/test/javasurefire745/000077500000000000000000000000001330756104600406325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-multiple-method-patterns/src/test/java/jirasBasicTest.java000066400000000000000000000024251330756104600433610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-multiple-method-patterns/src/test/java/jiras/surefire745package jiras.surefire745; /* * 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. */ import org.testng.annotations.*; import static org.testng.Assert.*; public class BasicTest { @Test public void testSuccessOne() { System.out.println( getClass() + "#testSuccessOne" ); } @Test public void testSuccessTwo() { System.out.println( getClass() + "#testSuccessTwo" ); } @Test public void testFailure() { System.out.println( getClass() + "#testFailure" ); fail( ); } } TestFive.java000066400000000000000000000023511330756104600432270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-multiple-method-patterns/src/test/java/jiras/surefire745package jiras.surefire745; /* * 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. */ import org.testng.annotations.*; public class TestFive { @Test public void testSuccessOne() { System.out.println( getClass() + "#testSuccessOne" ); } @Test public void testSuccessTwo() { System.out.println( getClass() + "#testSuccessTwo" ); } @Test public void testSuccessThree() { System.out.println( getClass() + "#testSuccessThree" ); } } TestFour.java000066400000000000000000000023511330756104600432510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-multiple-method-patterns/src/test/java/jiras/surefire745package jiras.surefire745; /* * 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. */ import org.testng.annotations.*; public class TestFour { @Test public void testSuccessOne() { System.out.println( getClass() + "#testSuccessOne" ); } @Test public void testSuccessTwo() { System.out.println( getClass() + "#testSuccessTwo" ); } @Test public void testSuccessThree() { System.out.println( getClass() + "#testSuccessThree" ); } } TestThree.java000066400000000000000000000024231330756104600434050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-multiple-method-patterns/src/test/java/jiras/surefire745package jiras.surefire745; /* * 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. */ import org.testng.annotations.*; import static org.testng.Assert.*; public class TestThree { @Test public void testSuccessOne() { System.out.println( getClass() + "#testSuccessOne" ); } @Test public void testSuccessTwo() { System.out.println( getClass() + "#testSuccessTwo" ); } @Test public void testFailOne() { System.out.println( getClass() + "#testFailOne" ); fail(); } } TestTwo.java000066400000000000000000000021561330756104600431120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-multiple-method-patterns/src/test/java/jiras/surefire745package jiras.surefire745; /* * 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. */ import org.testng.annotations.*; public class TestTwo { @Test public void testSuccessOne() { System.out.println( getClass() + "#testSuccessOne" ); } @Test public void testSuccessTwo() { System.out.println( getClass() + "#testSuccessTwo" ); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-objectFactory/000077500000000000000000000000001330756104600306555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-objectFactory/pom.xml000066400000000000000000000042241330756104600321740ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire testng-testobjectfactory 1.0 TestNG using custom object factory. org.testng testng 5.7 jdk15 test org.apache.maven.plugins maven-surefire-plugin objectfactory testng.objectfactory.TestNGCustomObjectFactory maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-objectFactory/src/000077500000000000000000000000001330756104600314445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-objectFactory/src/test/000077500000000000000000000000001330756104600324235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-objectFactory/src/test/java/000077500000000000000000000000001330756104600333445ustar00rootroot00000000000000testng/000077500000000000000000000000001330756104600345715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-objectFactory/src/test/javaobjectfactory/000077500000000000000000000000001330756104600374275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-objectFactory/src/test/java/testngFileHelper.java000066400000000000000000000012451330756104600423130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactorypackage testng.objectfactory; import java.io.File; import java.io.FileWriter; import java.io.IOException; public class FileHelper { public static void writeFile( String fileName, String content ) { try { File target = new File( System.getProperty("user.dir"), "target" ).getCanonicalFile(); File listenerOutput = new File( target, fileName ); FileWriter out = new FileWriter( listenerOutput, true ); out.write( content ); out.flush(); out.close(); } catch ( IOException exception ) { throw new RuntimeException( exception ); } } } TestNGCustomObjectFactory.java000066400000000000000000000011751330756104600453140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactorypackage testng.objectfactory; import java.lang.reflect.Constructor; import org.testng.IObjectFactory; public class TestNGCustomObjectFactory implements IObjectFactory { public Object newInstance( Constructor constructor, Object... params ) { String testClassName = constructor.getDeclaringClass().getName(); FileHelper.writeFile( "objectFactory-output.txt", "Instantiated Test: " + testClassName + "\n" ); try { return constructor.newInstance( params ); } catch ( Exception exception ) { throw new RuntimeException( exception ); } } }TestNGSuiteTest.java000066400000000000000000000002261330756104600433100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-objectFactory/src/test/java/testng/objectfactorypackage testng.objectfactory; import org.testng.annotations.Test; public class TestNGSuiteTest { @Test public void doNothing() { } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-suites/000077500000000000000000000000001330756104600311655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-suites/pom.xml000066400000000000000000000047731330756104600325150ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire testng-parallel-suites 1.0 http://maven.apache.org tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org Committer Europe/Bratislava org.testng testng 6.9.8 test org.apache.maven.plugins maven-surefire-plugin src/test/resources/testng1.xml src/test/resources/testng2.xml suitethreadpoolsize 2 maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-suites/src/000077500000000000000000000000001330756104600317545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-suites/src/test/000077500000000000000000000000001330756104600327335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-suites/src/test/java/000077500000000000000000000000001330756104600336545ustar00rootroot00000000000000testng/000077500000000000000000000000001330756104600351015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-suites/src/test/javasuiteXml/000077500000000000000000000000001330756104600367135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-suites/src/test/java/testngShouldNotRunTest.java000066400000000000000000000021641330756104600430250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-suites/src/test/java/testng/suiteXmlpackage testng.suiteXml; /* * 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. */ import org.testng.annotations.Test; /** * @author Tibor Digana (tibor17) * @since 2.19 */ public class ShouldNotRunTest { @Test public void shouldNotRun() { System.out.println( getClass().getSimpleName() + "#shouldNotRun()" ); } }TestNGSuiteTest.java000066400000000000000000000025601330756104600425770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-suites/src/test/java/testng/suiteXmlpackage testng.suiteXml; /* * 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. */ import org.testng.annotations.Test; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; /** * @author Tibor Digana (tibor17) * @since 2.19 */ public class TestNGSuiteTest { private static final AtomicInteger counter = new AtomicInteger(); @Test public void shouldRunAndPrintItself() throws Exception { System.out.println( getClass().getSimpleName() + "#shouldRunAndPrintItself() " + counter.incrementAndGet() + "."); TimeUnit.SECONDS.sleep( 2 ); } }resources/000077500000000000000000000000001330756104600346665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-suites/src/testtestng1.xml000066400000000000000000000020511330756104600367730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-suites/src/test/resources testng2.xml000066400000000000000000000020511330756104600367740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-suites/src/test/resources maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-with-annotations/000077500000000000000000000000001330756104600331575ustar00rootroot00000000000000pom.xml000066400000000000000000000035571330756104600344270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-with-annotations 4.0.0 org.apache.maven.plugins.surefire testng-group-thread-parallel 1.0-SNAPSHOT TestNG group/parallel thread tests, with parallel settings set by @Test(threadPoolSize) 1.6 1.6 org.testng testng 5.8 jdk15 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-with-annotations/src/000077500000000000000000000000001330756104600337465ustar00rootroot00000000000000test/000077500000000000000000000000001330756104600346465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-with-annotations/srcjava/000077500000000000000000000000001330756104600355675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-with-annotations/src/testtestng/000077500000000000000000000000001330756104600370735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-with-annotations/src/test/javaparalellwithannotations/000077500000000000000000000000001330756104600440415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-with-annotations/src/test/java/testngTestNGParallelTest.java000066400000000000000000000041201330756104600503620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-parallel-with-annotations/src/test/java/testng/paralellwithannotationspackage testng.paralellwithannotations; /* * 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. */ import static org.testng.Assert.*; import org.testng.annotations.AfterSuite; import org.testng.annotations.BeforeSuite; import org.testng.annotations.Test; import java.util.Date; /** * Test that parallel tests actually run and complete within the expected time. */ public class TestNGParallelTest { static int testCount = 0; static long startTime; @BeforeSuite( alwaysRun = true ) public void startClock() { startTime = new Date().getTime(); } @AfterSuite( alwaysRun = true ) public void checkTestResults() { long runtime = new Date().getTime() - startTime; System.out.println( "Runtime was: " + runtime ); assertTrue( testCount == 3, "Expected test to be run 3 times, but was " + testCount ); // Note, this can be < 1000 on Windows. assertTrue( runtime < 1400, "Runtime was " + runtime + ". It should be a little over 1000ms" ); } @Test( threadPoolSize = 2, invocationCount = 3 ) public void incrementTestCountAndSleepForOneSecond() throws InterruptedException { incrementTestCount(); Thread.sleep( 500 ); System.out.println( "Ran test" ); } private synchronized void incrementTestCount() { testCount++; } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-path with spaces/000077500000000000000000000000001330756104600312065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-path with spaces/pom.xml000066400000000000000000000047401330756104600325300ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire testng-path-with-spaces 1.0-SNAPSHOT TestNG test in a path with spaces 1.6 1.6 testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-path with spaces/src/000077500000000000000000000000001330756104600317755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-path with spaces/src/test/000077500000000000000000000000001330756104600327545ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600336165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-path with spaces/src/testtestng/000077500000000000000000000000001330756104600351225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-path with spaces/src/test/javapathWithSpaces/000077500000000000000000000000001330756104600400515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-path with spaces/src/test/java/testngTestNGSuiteTest.java000066400000000000000000000021321330756104600437300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-path with spaces/src/test/java/testng/pathWithSpacespackage testng.pathWithSpaces; /* * 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. */ import java.io.File; import java.net.URISyntaxException; import org.testng.annotations.Test; public class TestNGSuiteTest { @Test public void loadTestResourceWithSpaces() throws URISyntaxException { new File( getClass().getResource( "/test.txt" ).toURI() ); } }resources/000077500000000000000000000000001330756104600347075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-path with spaces/src/testtest.txt000066400000000000000000000000141330756104600364220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-path with spaces/src/test/resourcesHello world!maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-simple/000077500000000000000000000000001330756104600273505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-simple/pom.xml000066400000000000000000000066761330756104600307040ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire testng-simple 1.0-SNAPSHOT TestNG simple test testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} junit junit testng-new !testNgClassifier org.testng testng ${testNgVersion} junit junit 0 1.6 1.6 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${argLine} ${jacoco.agent} reversealphabetical surefire.testng.verbose ${surefire.testng.verbose} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-simple/src/000077500000000000000000000000001330756104600301375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-simple/src/test/000077500000000000000000000000001330756104600311165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-simple/src/test/java/000077500000000000000000000000001330756104600320375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-simple/src/test/java/testng/000077500000000000000000000000001330756104600333435ustar00rootroot00000000000000simple/000077500000000000000000000000001330756104600345555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-simple/src/test/java/testngTestNGSuiteTestA.java000066400000000000000000000016641330756104600405460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-simple/src/test/java/testng/simplepackage testng.simple; /* * 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. */ import org.testng.annotations.Test; public class TestNGSuiteTestA { @Test public void doNothing() { } }TestNGSuiteTestB.java000066400000000000000000000016641330756104600405470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-simple/src/test/java/testng/simplepackage testng.simple; /* * 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. */ import org.testng.annotations.Test; public class TestNGSuiteTestB { @Test public void doNothing() { } }TestNGSuiteTestC.java000066400000000000000000000016641330756104600405500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-simple/src/test/java/testng/simplepackage testng.simple; /* * 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. */ import org.testng.annotations.Test; public class TestNGSuiteTestC { @Test public void doNothing() { } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-single-method-5-14-9/000077500000000000000000000000001330756104600313505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-single-method-5-14-9/pom.xml000066400000000000000000000036371330756104600326760ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for Testng 1.6 1.6 org.testng testng 5.14.9 org.apache.maven.plugins maven-surefire-plugin ${surefire.version} BasicTest#testSuccessOne maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-single-method-5-14-9/src/000077500000000000000000000000001330756104600321375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-single-method-5-14-9/src/test/000077500000000000000000000000001330756104600331165ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600337605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-single-method-5-14-9/src/testtestng/000077500000000000000000000000001330756104600352645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-single-method-5-14-9/src/test/javaBasicTest.java000066400000000000000000000032551330756104600400150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-single-method-5-14-9/src/test/java/testngpackage testng; /* * 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. */ import org.testng.annotations.*; import org.testng.Assert; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @BeforeTest public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @AfterTest public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( setUpCalled ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); } @Test public void testSuccessTwo() { Assert.assertTrue( true ); } @AfterClass public static void oneTimeTearDown() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-single-method/000077500000000000000000000000001330756104600306165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-single-method/pom.xml000066400000000000000000000050451330756104600321370ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire junit4 1.0-SNAPSHOT Test for Testng 1.6 1.6 testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} BasicTest#testSuccessOne maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-single-method/src/000077500000000000000000000000001330756104600314055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-single-method/src/test/000077500000000000000000000000001330756104600323645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-single-method/src/test/java/000077500000000000000000000000001330756104600333055ustar00rootroot00000000000000testng/000077500000000000000000000000001330756104600345325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-single-method/src/test/javaBasicTest.java000066400000000000000000000032551330756104600372630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-single-method/src/test/java/testngpackage testng; /* * 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. */ import org.testng.annotations.*; import org.testng.Assert; public class BasicTest { private boolean setUpCalled = false; private static boolean tearDownCalled = false; @BeforeTest public void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } @AfterTest public void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } @Test public void testSetUp() { Assert.assertTrue( setUpCalled ); } @Test public void testSuccessOne() { Assert.assertTrue( true ); } @Test public void testSuccessTwo() { Assert.assertTrue( true ); } @AfterClass public static void oneTimeTearDown() { } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-succes-percentage/000077500000000000000000000000001330756104600314575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-succes-percentage/pom.xml000066400000000000000000000042531330756104600330000ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 testng-success-percentage 1.0-SNAPSHOT Test for Testng testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-succes-percentage/src/000077500000000000000000000000001330756104600322465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-succes-percentage/src/test/000077500000000000000000000000001330756104600332255ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600340675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-succes-percentage/src/testtestng/000077500000000000000000000000001330756104600353735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-succes-percentage/src/test/javaTestNGSuccessPercentFailingTest.java000066400000000000000000000026361330756104600444150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-succes-percentage/src/test/java/testngpackage testng; /* * 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. */ import org.testng.annotations.*; import static org.testng.Assert.*; import java.util.concurrent.atomic.AtomicInteger; public class TestNGSuccessPercentFailingTest { private static final AtomicInteger counter = new AtomicInteger( 0 ); // Pass 2 of 4 tests, expect this test to fail when 60% success is required @Test( invocationCount = 4, successPercentage = 60 ) public void testFailure() { int value = counter.addAndGet( 1 ); assertTrue( isOdd( value ), "is odd: " + value ); } private boolean isOdd( int number ) { return number % 2 == 0; } } TestNGSuccessPercentPassingTest.java000066400000000000000000000026351330756104600444470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-succes-percentage/src/test/java/testngpackage testng; /* * 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. */ import org.testng.annotations.*; import static org.testng.Assert.*; import java.util.concurrent.atomic.AtomicInteger; public class TestNGSuccessPercentPassingTest { private static final AtomicInteger counter = new AtomicInteger( 0 ); // Pass 2 of 4 tests, expect this test to pass when 50% success is required @Test( invocationCount = 4, successPercentage = 50 ) public void testSuccess() { int value = counter.addAndGet( 1 ); assertTrue( isOdd( value ), "is odd: " + value ); } private boolean isOdd( int number ) { return number % 2 == 0; } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-suite-xml/000077500000000000000000000000001330756104600300065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-suite-xml/pom.xml000066400000000000000000000052231330756104600313250ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire suiteXml 1.0-SNAPSHOT TestNG Suite XML File 1.6 1.6 testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} src/test-data/testng1.xml src/test-data/testng2.xml maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-suite-xml/src/000077500000000000000000000000001330756104600305755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-suite-xml/src/test-data/000077500000000000000000000000001330756104600324635ustar00rootroot00000000000000testng1.xml000066400000000000000000000020511330756104600345110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-suite-xml/src/test-data testng2.xml000066400000000000000000000020511330756104600345120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-suite-xml/src/test-data maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-suite-xml/src/test/000077500000000000000000000000001330756104600315545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-suite-xml/src/test/java/000077500000000000000000000000001330756104600324755ustar00rootroot00000000000000testng/000077500000000000000000000000001330756104600337225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-suite-xml/src/test/javasuiteXml/000077500000000000000000000000001330756104600355345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-suite-xml/src/test/java/testngTestNGSuiteTest.java000066400000000000000000000025441330756104600414220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-suite-xml/src/test/java/testng/suiteXmlpackage testng.suiteXml; /* * 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. */ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /** * Tests that forcing testng to run tests via the * "${maven.test.forcetestng}" configuration option * works. * * @author jkuhnert */ public class TestNGSuiteTest { /** * Sets up testObject */ @BeforeClass public void configureTest() { testObject = new Object(); } Object testObject; /** * Tests reporting an error */ @Test public void isTestObjectNull() { assert testObject != null : "testObject is null"; } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-testRunnerFactory/000077500000000000000000000000001330756104600315605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-testRunnerFactory/pom.xml000066400000000000000000000050271330756104600331010ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire it-parent 1.0 ../pom.xml org.apache.maven.plugins.surefire testng-testrunnerfactory 1.0 TestNG using custom test runner factory org.testng testng 5.10 jdk15 test org.apache.maven.plugins maven-surefire-plugin testrunfactory testng.testrunnerfactory.TestNGCustomTestRunnerFactory maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-testRunnerFactory/src/000077500000000000000000000000001330756104600323475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-testRunnerFactory/src/test/000077500000000000000000000000001330756104600333265ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600341705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-testRunnerFactory/src/testtestng/000077500000000000000000000000001330756104600354745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-testRunnerFactory/src/test/javatestrunnerfactory/000077500000000000000000000000001330756104600412755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-testRunnerFactory/src/test/java/testngFileHelper.java000066400000000000000000000012511330756104600441560ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactorypackage testng.testrunnerfactory; import java.io.File; import java.io.FileWriter; import java.io.IOException; public class FileHelper { public static void writeFile( String fileName, String content ) { try { File target = new File( System.getProperty("user.dir"), "target" ).getCanonicalFile(); File listenerOutput = new File( target, fileName ); FileWriter out = new FileWriter( listenerOutput, true ); out.write( content ); out.flush(); out.close(); } catch ( IOException exception ) { throw new RuntimeException( exception ); } } } TestNGCustomTestRunnerFactory.java000066400000000000000000000013471330756104600500660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactorypackage testng.testrunnerfactory; import org.testng.ISuite; import org.testng.ITestRunnerFactory; import org.testng.TestRunner; import org.testng.xml.XmlTest; //import org.testng.IInvokedMethodListener; import java.util.List; public class TestNGCustomTestRunnerFactory implements ITestRunnerFactory { public TestRunner newTestRunner( ISuite suite, XmlTest test/*, List listeners*/ ) { FileHelper.writeFile( "testrunnerfactory-output.txt", "Instantiated Test Runner for suite:\n\t" + suite + "\nand test:\n\t" + test +"\n\n" ); return new TestRunner( suite, test, test.skipFailedInvocationCounts()/*, listeners*/ ); } } TestNGSuiteTest.java000066400000000000000000000002321330756104600451530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-testRunnerFactory/src/test/java/testng/testrunnerfactorypackage testng.testrunnerfactory; import org.testng.annotations.Test; public class TestNGSuiteTest { @Test public void doNothing() { } }maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-twoTestCaseSuite/000077500000000000000000000000001330756104600313365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-twoTestCaseSuite/pom.xml000066400000000000000000000051771330756104600326650ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire testng-twoTestCaseSuite 1.0-SNAPSHOT TestNG Suite XML with two test cases 1.6 1.6 testng-old testNgClassifier org.testng testng ${testNgVersion} ${testNgClassifier} testng-new !testNgClassifier org.testng testng ${testNgVersion} org.apache.maven.plugins maven-surefire-plugin ${surefire.version} src/test/resources/suite.xml maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-twoTestCaseSuite/src/000077500000000000000000000000001330756104600321255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-twoTestCaseSuite/src/test/000077500000000000000000000000001330756104600331045ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600337465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-twoTestCaseSuite/src/testtestng/000077500000000000000000000000001330756104600352525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-twoTestCaseSuite/src/test/javatwo/000077500000000000000000000000001330756104600360635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-twoTestCaseSuite/src/test/java/testngTestNGSuiteTest.java000066400000000000000000000016611330756104600417500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-twoTestCaseSuite/src/test/java/testng/twopackage testng.two; /* * 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. */ import org.testng.annotations.Test; public class TestNGSuiteTest { @Test public void doNothing() { } }TestNGTestTwo.java000066400000000000000000000016541330756104600414320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-twoTestCaseSuite/src/test/java/testng/twopackage testng.two; /* * 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. */ import org.testng.annotations.Test; public class TestNGTestTwo { @Test public void testTwo() { } }resources/000077500000000000000000000000001330756104600350375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-twoTestCaseSuite/src/testsuite.xml000066400000000000000000000002061330756104600367100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/testng-twoTestCaseSuite/src/test/resources maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/timeout-forked/000077500000000000000000000000001330756104600275135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/timeout-forked/pom.xml000066400000000000000000000037401330756104600310340ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire timeout-forked 1.0-SNAPSHOT Timeout forked process 1.6 1.6 maven-surefire-plugin ${surefire.version} ${forkTimeout} plain junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/timeout-forked/src/000077500000000000000000000000001330756104600303025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/timeout-forked/src/test/000077500000000000000000000000001330756104600312615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/timeout-forked/src/test/java/000077500000000000000000000000001330756104600322025ustar00rootroot00000000000000timeoutForked/000077500000000000000000000000001330756104600347445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/timeout-forked/src/test/javaBasicTest.java000066400000000000000000000022601330756104600374700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/timeout-forked/src/test/java/timeoutForkedpackage timeoutForked; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class BasicTest extends TestCase { public void testSleep() throws Exception { int sleepLength = Integer.valueOf( System.getProperty( "sleepLength", "10000" )); Thread.sleep(sleepLength); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/unicode-testnames/000077500000000000000000000000001330756104600302045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/unicode-testnames/pom.xml000066400000000000000000000037751330756104600315350ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire unicode-testnames 1.0-SNAPSHOT Testcases with unicode names UTF-8 UTF-8 1.6 1.6 junit junit 3.8.1 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/unicode-testnames/src/000077500000000000000000000000001330756104600307735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/unicode-testnames/src/test/000077500000000000000000000000001330756104600317525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/unicode-testnames/src/test/java/000077500000000000000000000000001330756104600326735ustar00rootroot00000000000000junit/000077500000000000000000000000001330756104600337455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/unicode-testnames/src/test/javatwoTestCases/000077500000000000000000000000001330756104600363755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/unicode-testnames/src/test/java/junitEscapeTest.java000066400000000000000000000041301330756104600412760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/unicode-testnames/src/test/java/junit/twoTestCasespackage junit.twoTestCases; /* * 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. */ import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class EscapeTest extends TestCase { private boolean setUpCalled = false; private static boolean tearDownCalled = false; public EscapeTest( String name ) { super( name ); } public static Test suite() { TestSuite suite = new TestSuite(); Test test = new EscapeTest( "testSetUp" ); suite.addTest( test ); return new TestSetup( suite ) { protected void setUp() { //oneTimeSetUp(); } protected void tearDown() { oneTimeTearDown(); } }; } protected void setUp() { setUpCalled = true; tearDownCalled = false; System.out.println( "Called setUp" ); } protected void tearDown() { setUpCalled = false; tearDownCalled = true; System.out.println( "Called tearDown" ); } public void testSetUp() { assertTrue( "setUp was not called", setUpCalled ); } public static void oneTimeTearDown() { assertTrue( "tearDown was not called", tearDownCalled ); } } XXYZTest.java000066400000000000000000000017601330756104600407260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/unicode-testnames/src/test/java/junit/twoTestCasespackage junit.twoTestCases; /* * 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. */ import junit.framework.TestCase; public class 而索其情Test extends TestCase { public void testIHopeTheChineseDoesntMeanAnyhtingOffensive索其(){ } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/webapp/000077500000000000000000000000001330756104600260335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/webapp/pom.xml000066400000000000000000000064361330756104600273610ustar00rootroot00000000000000 4.0.0 org.apache.surefire.its webapp war 1.0-SNAPSHOT sample webapp with Jetty test webapp org.apache.maven.plugins maven-surefire-plugin ${surefire.version} org.apache.maven.plugins maven-war-plugin 2.0 generate-test-resources exploded ${project.build.directory}/webapp junit junit 3.8.1 test jetty org.mortbay.jetty 5.1.10 test javax.servlet servlet-api 2.4 test jetty jasper-compiler 5.1.10 test jetty jasper-runtime 5.1.10 commons-beanutils commons-beanutils 1.7.0 test javax.servlet jsp-api 2.0 ant ant 1.6.5 commons-el commons-el 1.0 default-tools.jar java.vendor Sun Microsystems Inc. com.sun tools system system ${java.home}/../lib/tools.jar maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/webapp/src/000077500000000000000000000000001330756104600266225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/webapp/src/main/000077500000000000000000000000001330756104600275465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/webapp/src/main/webapp/000077500000000000000000000000001330756104600310245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/webapp/src/main/webapp/WEB-INF/000077500000000000000000000000001330756104600320535ustar00rootroot00000000000000web.xml000066400000000000000000000003271330756104600332750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/webapp/src/main/webapp/WEB-INF Archetype Created Web Application maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/webapp/src/main/webapp/index.jsp000066400000000000000000000000641330756104600326510ustar00rootroot00000000000000

Hello World!

maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/webapp/src/test/000077500000000000000000000000001330756104600276015ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/webapp/src/test/java/000077500000000000000000000000001330756104600305225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/webapp/src/test/java/WebAppTest.java000066400000000000000000000036151330756104600334100ustar00rootroot00000000000000/* * 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. */ import java.io.InputStream; import java.net.URL; import junit.framework.TestCase; import org.mortbay.jetty.Server; public class WebAppTest extends TestCase { private Server server = null; public void setUp() throws Exception { System.setProperty( "org.mortbay.xml.XmlParser.NotValidating", "true" ); server = new Server(); String testPort = ":18080"; server.addListener( testPort ); server.addWebApplication( "127.0.0.1", "/webapp", "target/webapp" ); server.start(); } public void testBlah() throws Exception { URL url = new URL( "http://127.0.0.1:18080/webapp/index.jsp" ); InputStream stream = url.openStream(); StringBuffer sb = new StringBuffer(); for ( int i = stream.read(); i != -1; i = stream.read() ) { sb.append( (char) i ); } String value = sb.toString(); assertTrue( value, value.contains( "Hello" ) ); } public void tearDown() throws Exception { if ( server != null ) server.stop(); } } working-directory-is-invalid-property/000077500000000000000000000000001330756104600340775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resourcespom.xml000066400000000000000000000037101330756104600354150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory-is-invalid-property 4.0.0 localhost working-directory-test 1.0 Don't run tests if working directory is invalid property. 1.6 1.6 junit junit 3.8.2 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${notSet} src/000077500000000000000000000000001330756104600346665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory-is-invalid-propertytest/000077500000000000000000000000001330756104600356455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory-is-invalid-property/srcjava/000077500000000000000000000000001330756104600365665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory-is-invalid-property/src/testMyTest.java000066400000000000000000000016711330756104600406630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory-is-invalid-property/src/test/javaimport junit.framework.TestCase; /* * 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. */ public class MyTest extends TestCase { public void testSomething() { assertTrue(true); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory-missing/000077500000000000000000000000001330756104600317065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory-missing/pom.xml000066400000000000000000000037441330756104600332330ustar00rootroot00000000000000 4.0.0 localhost working-directory-test 1.0 Run tests in a nonexistent working directory 1.6 1.6 junit junit 3.8.2 test org.apache.maven.plugins maven-surefire-plugin ${surefire.version} ${project.build.directory}/surefire-working-directory maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory-missing/src/000077500000000000000000000000001330756104600324755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory-missing/src/test/000077500000000000000000000000001330756104600334545ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600343165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory-missing/src/testMyTest.java000066400000000000000000000016711330756104600364130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory-missing/src/test/javaimport junit.framework.TestCase; /* * 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. */ public class MyTest extends TestCase { public void testSomething() { assertTrue(true); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory/000077500000000000000000000000001330756104600302375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory/child/000077500000000000000000000000001330756104600313225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory/child/pom.xml000066400000000000000000000031121330756104600326340ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire working-directory 1.0-SNAPSHOT working-directory-child Test for working directory configuration junit junit 3.8.1 test maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory/child/src/000077500000000000000000000000001330756104600321115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory/child/src/test/000077500000000000000000000000001330756104600330705ustar00rootroot00000000000000java/000077500000000000000000000000001330756104600337325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory/child/src/testworkingDir/000077500000000000000000000000001330756104600360515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory/child/src/test/javaBasicTest.java000066400000000000000000000026221330756104600405770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory/child/src/test/java/workingDirpackage workingDir; /* * 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. */ import junit.framework.TestCase; import java.io.*; import java.util.Properties; public class BasicTest extends TestCase { public void testWorkingDir() throws Exception { File target = new File( "target" ).getAbsoluteFile(); File outFile = new File( target, "out.txt" ); FileOutputStream os = new FileOutputStream( outFile ); String userDir = System.getProperty( "user.dir" ); Properties p = new Properties(); p.setProperty( "user.dir", userDir ); p.store( os, "" ); os.flush(); os.close(); } } maven-surefire-surefire-2.22.0/surefire-its/src/test/resources/working-directory/pom.xml000066400000000000000000000035051330756104600315570ustar00rootroot00000000000000 4.0.0 org.apache.maven.plugins.surefire working-directory 1.0-SNAPSHOT Test for working directory configuration (parent) pom 1.6 1.6 child org.apache.maven.plugins maven-surefire-plugin ${surefire.version} maven-surefire-surefire-2.22.0/surefire-logger-api/000077500000000000000000000000001330756104600222245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/pom.xml000066400000000000000000000036501330756104600235450ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire 2.22.0 surefire-logger-api SureFire Logger API Interfaces and Utilities related only to internal SureFire Logger API. Free of dependencies. UTF-8 tibordigana Tibor Digaňa (tibor17) tibordigana@apache.org PMC Europe/Bratislava maven-surefire-surefire-2.22.0/surefire-logger-api/src/000077500000000000000000000000001330756104600230135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/000077500000000000000000000000001330756104600237375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/java/000077500000000000000000000000001330756104600246605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/java/org/000077500000000000000000000000001330756104600254475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/java/org/apache/000077500000000000000000000000001330756104600266705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600277765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/java/org/apache/maven/plugin/000077500000000000000000000000001330756104600312745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/000077500000000000000000000000001330756104600331205ustar00rootroot00000000000000log/000077500000000000000000000000001330756104600336225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefireapi/000077500000000000000000000000001330756104600343735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/logConsoleLogger.java000066400000000000000000000042441330756104600400040ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/apipackage org.apache.maven.plugin.surefire.log.api; /* * 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. */ /** * Allows providers to write console messages on the running maven process. *
* This output is associated with the entire test run and not a specific * test, which means it just goes "straight" to the console "immediately". *
* This interface is used in org.apache.maven.plugin.surefire.CommonReflector and reflected * via IsolatedClassLoader which can see classes from JRE only. This interface MUST use * JRE types in method signatures, e.g. {@link String} or {@link Throwable}, etc. */ public interface ConsoleLogger { boolean isDebugEnabled(); void debug( String message ); boolean isInfoEnabled(); void info( String message ); boolean isWarnEnabled(); void warning( String message ); boolean isErrorEnabled(); /** * @param message message to log */ void error( String message ); /** * Simply delegates to {@link #error(String) error( toString( t, message ) )}. * * @param message message to log * @param t exception, message and trace to log */ void error( String message, Throwable t ); /** * Simply delegates to method {@link #error(String, Throwable) error(null, Throwable)}. * * @param t exception, message and trace to log */ void error( Throwable t ); } ConsoleLoggerDecorator.java000066400000000000000000000117251330756104600416510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/apipackage org.apache.maven.plugin.surefire.log.api; /* * 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. */ /** * Decorator around {@link ConsoleLogger}. * This class is loaded in the isolated ClassLoader and the child logger in the in-plugin ClassLoader. * * @author Tibor Digana (tibor17) * @since 2.20 */ public final class ConsoleLoggerDecorator implements ConsoleLogger { private final Object logger; public ConsoleLoggerDecorator( Object logger ) { if ( logger == null ) { throw new NullPointerException( "logger argument is null in " + ConsoleLoggerDecorator.class ); } this.logger = logger; } @Override public boolean isDebugEnabled() { try { return (Boolean) logger.getClass() .getMethod( "isDebugEnabled" ) .invoke( logger ); } catch ( Exception e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } } @Override public void debug( String message ) { try { logger.getClass() .getMethod( "debug", String.class ) .invoke( logger, message ); } catch ( Exception e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } } @Override public boolean isInfoEnabled() { try { return (Boolean) logger.getClass() .getMethod( "isInfoEnabled" ) .invoke( logger ); } catch ( Exception e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } } @Override public void info( String message ) { try { logger.getClass() .getMethod( "info", String.class ) .invoke( logger, message ); } catch ( Exception e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } } @Override public boolean isWarnEnabled() { try { return (Boolean) logger.getClass() .getMethod( "isWarnEnabled" ) .invoke( logger ); } catch ( Exception e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } } @Override public void warning( String message ) { try { logger.getClass() .getMethod( "warning", String.class ) .invoke( logger, message ); } catch ( Exception e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } } @Override public boolean isErrorEnabled() { try { return (Boolean) logger.getClass() .getMethod( "isErrorEnabled" ) .invoke( logger ); } catch ( Exception e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } } @Override public void error( String message ) { try { logger.getClass() .getMethod( "error", String.class ) .invoke( logger, message ); } catch ( Exception e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } } @Override public void error( String message, Throwable t ) { try { logger.getClass() .getMethod( "error", String.class, Throwable.class ) .invoke( logger, message, t ); } catch ( Exception e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } } @Override public void error( Throwable t ) { try { logger.getClass() .getMethod( "error", Throwable.class ) .invoke( logger, t ); } catch ( Exception e ) { throw new IllegalStateException( e.getLocalizedMessage(), e ); } } } ConsoleLoggerUtils.java000066400000000000000000000032211330756104600410170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/apipackage org.apache.maven.plugin.surefire.log.api; /* * 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. */ import java.io.PrintWriter; import java.io.StringWriter; /** * @author Tibor Digana (tibor17) * @since 2.20 */ public final class ConsoleLoggerUtils { private ConsoleLoggerUtils() { throw new IllegalStateException( "non instantiable constructor" ); } public static String toString( String message, Throwable t ) { StringWriter result = new StringWriter( 512 ); PrintWriter writer = new PrintWriter( result ); try { if ( message != null ) { writer.println( message ); } t.printStackTrace( writer ); writer.flush(); return result.toString(); } finally { writer.close(); } } } Level.java000066400000000000000000000034561330756104600363150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/apipackage org.apache.maven.plugin.surefire.log.api; /* * 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. */ /** * Test result levels {@link #FAILURE}, {@link #UNSTABLE}, {@link #SUCCESS}. * Writing to console without color via {@link #NO_COLOR}. * * @author Tibor Digana (tibor17) * @since 2.20 */ public enum Level { /** * direct println */ NO_COLOR, /** * defaults to bold, green */ FAILURE, /** * defaults to bold, yellow */ UNSTABLE, /** * defaults to bold, red */ SUCCESS; public static Level resolveLevel( boolean hasSuccessful, boolean hasFailure, boolean hasError, boolean hasSkipped, boolean hasFlake ) { boolean isRed = hasFailure | hasError; if ( isRed ) { return FAILURE; } boolean isYellow = hasSkipped | hasFlake; if ( isYellow ) { return UNSTABLE; } return hasSuccessful ? SUCCESS : NO_COLOR; } } NullConsoleLogger.java000066400000000000000000000034461330756104600406420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/apipackage org.apache.maven.plugin.surefire.log.api; /* * 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. */ /** * Logger doing nothing rather than using null. * * @author Tibor Digana (tibor17) * @since 2.20 */ public final class NullConsoleLogger implements ConsoleLogger { @Override public boolean isDebugEnabled() { return false; } @Override public void debug( String message ) { } @Override public boolean isInfoEnabled() { return false; } @Override public void info( String message ) { } @Override public boolean isWarnEnabled() { return false; } @Override public void warning( String message ) { } @Override public boolean isErrorEnabled() { return false; } @Override public void error( String message ) { } @Override public void error( String message, Throwable t ) { } @Override public void error( Throwable t ) { } } PrintStreamLogger.java000066400000000000000000000040551330756104600406520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-logger-api/src/main/java/org/apache/maven/plugin/surefire/log/apipackage org.apache.maven.plugin.surefire.log.api; /* * 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. */ import java.io.PrintStream; /** * For testing purposes. */ public class PrintStreamLogger implements ConsoleLogger { private final PrintStream stream; public PrintStreamLogger( PrintStream stream ) { this.stream = stream; } @Override public boolean isDebugEnabled() { return true; } @Override public void debug( String message ) { stream.println( message ); } @Override public boolean isInfoEnabled() { return true; } @Override public void info( String message ) { stream.println( message ); } @Override public boolean isWarnEnabled() { return true; } @Override public void warning( String message ) { stream.println( message ); } @Override public boolean isErrorEnabled() { return true; } @Override public void error( String message ) { stream.println( message ); } @Override public void error( String message, Throwable t ) { error( ConsoleLoggerUtils.toString( message, t ) ); } @Override public void error( Throwable t ) { error( null, t ); } } maven-surefire-surefire-2.22.0/surefire-providers/000077500000000000000000000000001330756104600222135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/000077500000000000000000000000001330756104600245075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/pom.xml000066400000000000000000000047761330756104600260420ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire-providers 2.22.0 common-java5 Shared Java 5 Provider Base Shared Java 5 code for all providers. org.apache.maven.shared maven-shared-utils org.apache.maven.plugins maven-shade-plugin package shade true org.codehaus.plexus.util org.apache.maven.surefire.commonjunit48.org.codehaus.plexus.util maven-surefire-plugin **/fixture/** maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/000077500000000000000000000000001330756104600252765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/main/000077500000000000000000000000001330756104600262225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/main/java/000077500000000000000000000000001330756104600271435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/main/java/org/000077500000000000000000000000001330756104600277325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/main/java/org/apache/000077500000000000000000000000001330756104600311535ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600322615ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600340265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/main/java/org/apache/mavenreport/000077500000000000000000000000001330756104600353415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/main/java/org/apache/maven/surefireClassNameStackTraceFilter.java000066400000000000000000000023521330756104600431670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ /** * Filters stacktrace element by class name. */ final class ClassNameStackTraceFilter implements StackTraceFilter { private final String className; ClassNameStackTraceFilter( String className ) { this.className = className; } @Override public boolean matches( StackTraceElement element ) { return className.equals( element.getClassName() ); } } NullStackTraceFilter.java000066400000000000000000000020411330756104600422260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ /** * always returns true */ final class NullStackTraceFilter implements StackTraceFilter { @Override public boolean matches( StackTraceElement element ) { return true; } } PojoStackTraceWriter.java000066400000000000000000000065401330756104600422620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import org.apache.maven.surefire.util.internal.StringUtils; import java.io.PrintWriter; import java.io.StringWriter; /** * Write the trace out for a POJO test. * * @author Brett Porter */ public class PojoStackTraceWriter implements StackTraceWriter { private final Throwable t; private final String testClass; private final String testMethod; public PojoStackTraceWriter( String testClass, String testMethod, Throwable t ) { this.testClass = testClass; this.testMethod = testMethod; this.t = t; } @Override public String writeTraceToString() { if ( t != null ) { StringWriter w = new StringWriter(); PrintWriter stackTrace = new PrintWriter( w ); try { t.printStackTrace( stackTrace ); stackTrace.flush(); } finally { stackTrace.close(); } StringBuffer builder = w.getBuffer(); if ( isMultiLineExceptionMessage( t ) ) { // SUREFIRE-986 String exc = t.getClass().getName() + ": "; if ( StringUtils.startsWith( builder, exc ) ) { builder.insert( exc.length(), '\n' ); } } return builder.toString(); } return ""; } @Override public String smartTrimmedStackTrace() { return t == null ? "" : new SmartStackTraceParser( testClass, t, testMethod ).getString(); } @Override public String writeTrimmedTraceToString() { return t == null ? "" : SmartStackTraceParser.stackTraceWithFocusOnClassAsString( t, testClass ); } @Override public SafeThrowable getThrowable() { return t == null ? null : new SafeThrowable( t ); } private static boolean isMultiLineExceptionMessage( Throwable t ) { String msg = t.getLocalizedMessage(); if ( msg != null ) { int countNewLines = 0; for ( int i = 0, length = msg.length(); i < length; i++ ) { if ( msg.charAt( i ) == '\n' ) { if ( ++countNewLines == 2 ) { break; } } } return countNewLines > 1 || countNewLines == 1 && !msg.trim().endsWith( "\n" ); } return false; } } SmartStackTraceParser.java000066400000000000000000000245701330756104600424240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import java.util.ArrayList; import java.util.Collections; import java.util.List; import static java.util.Arrays.asList; import static org.apache.maven.shared.utils.StringUtils.chompLast; import static org.apache.maven.shared.utils.StringUtils.isNotEmpty; /** * @author Kristian Rosenvold */ @SuppressWarnings( "ThrowableResultOfMethodCallIgnored" ) public class SmartStackTraceParser { private static final int MAX_LINE_LENGTH = 77; private final SafeThrowable throwable; private final StackTraceElement[] stackTrace; private final String simpleName; private final String testClassName; private final Class testClass; private final String testMethodName; public SmartStackTraceParser( Class testClass, Throwable throwable ) { this( testClass.getName(), throwable, null ); } public SmartStackTraceParser( String testClassName, Throwable throwable, String testMethodName ) { this.testMethodName = testMethodName; this.testClassName = testClassName; testClass = getClass( testClassName ); simpleName = testClassName.substring( testClassName.lastIndexOf( "." ) + 1 ); this.throwable = new SafeThrowable( throwable ); stackTrace = throwable.getStackTrace(); } private static Class getClass( String name ) { try { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); return classLoader != null ? classLoader.loadClass( name ) : null; } catch ( ClassNotFoundException e ) { return null; } } private static String getSimpleName( String className ) { int i = className.lastIndexOf( "." ); return className.substring( i + 1 ); } @SuppressWarnings( "ThrowableResultOfMethodCallIgnored" ) public String getString() { if ( testClass == null ) { return throwable.getLocalizedMessage(); } final StringBuilder result = new StringBuilder(); final List stackTraceElements = focusOnClass( stackTrace, testClass ); Collections.reverse( stackTraceElements ); if ( stackTraceElements.isEmpty() ) { result.append( simpleName ); if ( isNotEmpty( testMethodName ) ) { result.append( "." ) .append( testMethodName ); } } else { for ( int i = 0; i < stackTraceElements.size(); i++ ) { final StackTraceElement stackTraceElement = stackTraceElements.get( i ); if ( i == 0 ) { result.append( simpleName ); if ( !stackTraceElement.getClassName().equals( testClassName ) ) { result.append( ">" ); } else { result.append( "." ); } } if ( !stackTraceElement.getClassName().equals( testClassName ) ) { result.append( getSimpleName( stackTraceElement.getClassName() ) ) // Add the name of the superclas .append( "." ); } result.append( stackTraceElement.getMethodName() ) .append( ":" ) .append( stackTraceElement.getLineNumber() ) .append( "->" ); } if ( result.length() >= 2 ) { result.deleteCharAt( result.length() - 1 ) .deleteCharAt( result.length() - 1 ); } } Throwable target = throwable.getTarget(); String exception = target.getClass().getName(); if ( target instanceof AssertionError || "junit.framework.AssertionFailedError".equals( exception ) || "junit.framework.ComparisonFailure".equals( exception ) ) { String msg = throwable.getMessage(); if ( isNotEmpty( msg ) ) { result.append( " " ) .append( msg ); } } else { result.append( rootIsInclass() ? " " : " » " ); result.append( getMinimalThrowableMiniMessage( target ) ); result.append( getTruncatedMessage( MAX_LINE_LENGTH - result.length() ) ); } return result.toString(); } private static String getMinimalThrowableMiniMessage( Throwable throwable ) { String name = throwable.getClass().getSimpleName(); if ( name.endsWith( "Exception" ) ) { return chompLast( name, "Exception" ); } if ( name.endsWith( "Error" ) ) { return chompLast( name, "Error" ); } return name; } private String getTruncatedMessage( int i ) { if ( i < 0 ) { return ""; } String msg = throwable.getMessage(); if ( msg == null ) { return ""; } String substring = msg.substring( 0, Math.min( i, msg.length() ) ); if ( i < msg.length() ) { return " " + substring + "..."; } else { return " " + substring; } } private boolean rootIsInclass() { return stackTrace.length > 0 && stackTrace[0].getClassName().equals( testClassName ); } static List focusOnClass( StackTraceElement[] stackTrace, Class clazz ) { List result = new ArrayList(); for ( StackTraceElement element : stackTrace ) { if ( element != null && isInSupers( clazz, element.getClassName() ) ) { result.add( element ); } } return result; } private static boolean isInSupers( Class testClass, String lookFor ) { if ( lookFor.startsWith( "junit.framework." ) ) { return false; } while ( !testClass.getName().equals( lookFor ) && testClass.getSuperclass() != null ) { testClass = testClass.getSuperclass(); } return testClass.getName().equals( lookFor ); } static Throwable findTopmostWithClass( final Throwable t, StackTraceFilter filter ) { Throwable n = t; do { if ( containsClassName( n.getStackTrace(), filter ) ) { return n; } n = n.getCause(); } while ( n != null ); return t; } public static String stackTraceWithFocusOnClassAsString( Throwable t, String className ) { StackTraceFilter filter = new ClassNameStackTraceFilter( className ); Throwable topmost = findTopmostWithClass( t, filter ); List stackTraceElements = focusInsideClass( topmost.getStackTrace(), filter ); String s = causeToString( topmost.getCause(), filter ); return toString( t, stackTraceElements, filter ) + s; } static List focusInsideClass( StackTraceElement[] stackTrace, StackTraceFilter filter ) { List result = new ArrayList(); for ( StackTraceElement element : stackTrace ) { if ( filter.matches( element ) ) { result.add( element ); } } return result; } static boolean containsClassName( StackTraceElement[] stackTrace, StackTraceFilter filter ) { for ( StackTraceElement element : stackTrace ) { if ( filter.matches( element ) ) { return true; } } return false; } private static String causeToString( Throwable cause, StackTraceFilter filter ) { StringBuilder resp = new StringBuilder(); while ( cause != null ) { resp.append( "Caused by: " ); resp.append( toString( cause, asList( cause.getStackTrace() ), filter ) ); cause = cause.getCause(); } return resp.toString(); } private static String toString( Throwable t, Iterable elements, StackTraceFilter filter ) { StringBuilder result = new StringBuilder(); if ( t != null ) { result.append( t.getClass().getName() ); String msg = t.getMessage(); if ( msg != null ) { result.append( ": " ); if ( isMultiLine( msg ) ) { // SUREFIRE-986 result.append( '\n' ); } result.append( msg ); } result.append( '\n' ); } for ( StackTraceElement element : elements ) { if ( filter.matches( element ) ) { result.append( "\tat " ) .append( element ) .append( '\n' ); } } return result.toString(); } private static boolean isMultiLine( String msg ) { int countNewLines = 0; for ( int i = 0, length = msg.length(); i < length; i++ ) { if ( msg.charAt( i ) == '\n' ) { if ( ++countNewLines == 2 ) { break; } } } return countNewLines > 1 || countNewLines == 1 && !msg.trim().endsWith( "\n" ); } } StackTraceFilter.java000066400000000000000000000017151330756104600414020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/main/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ /** * StackTrace element filter. */ interface StackTraceFilter { boolean matches( StackTraceElement element ); } maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/000077500000000000000000000000001330756104600262555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/000077500000000000000000000000001330756104600271765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/000077500000000000000000000000001330756104600277655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/000077500000000000000000000000001330756104600312065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600323145ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600340615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/mavenreport/000077500000000000000000000000001330756104600353745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefireABaseClass.java000066400000000000000000000017161330756104600402050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ public class ABaseClass { public void npe() { throw new NullPointerException( "It was null" ); } } ADifferen0tTestClass.java000066400000000000000000000015661330756104600421640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ class ADifferen0tTestClass { } ASubClass.java000066400000000000000000000016041330756104600400600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ public class ASubClass extends ABaseClass { } ATestClass.java000066400000000000000000000032531330756104600402500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import java.io.File; @SuppressWarnings( "UnusedDeclaration" ) public class ATestClass { public void failInAssert() { throw new AssertionError( "X is not Z" ); } public void nestedFailInAssert() { failInAssert(); } public void npe() { throw new NullPointerException( "It was null" ); } public void nestedNpe() { npe(); } public void npeOutsideTest() { File file = new File( (String) null ); } public void nestedNpeOutsideTest() { npeOutsideTest(); } public void aLongTestErrorMessage() { throw new RuntimeException( "This message will be truncated, somewhere over the rainbow. " + "Gangnam style, Gangnam style, Gangnam style, , Gangnam style, Gangnam style" ); } } AssertionNoMessage.java000066400000000000000000000020011330756104600420010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import junit.framework.TestCase; class AssertionNoMessage extends TestCase { public void testThrowSomething() { assertEquals( "abc", "xyz" ); } } CaseThatWillFail.java000066400000000000000000000017751330756104600413710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import junit.framework.TestCase; class CaseThatWillFail extends TestCase { public void testThatWillFail() { assertEquals( "abc", "def" ); } } FailWithFail.java000066400000000000000000000017521330756104600405470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import junit.framework.TestCase; class FailWithFail extends TestCase { public void testThatWillFail() { fail( "abc" ); } } InnerATestClass.java000066400000000000000000000023031330756104600412370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import junit.framework.Assert; /** * Created with IntelliJ IDEA. * User: kristian * Date: 12/21/12 * Time: 2:32 AM * To change this template use File | Settings | File Templates. */ class InnerATestClass { public static void testFake() { innerMethod(); } private static void innerMethod() { Assert.assertTrue( false ); } } PojoStackTraceWriterTest.java000066400000000000000000000047201330756104600431530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import junit.framework.TestCase; public class PojoStackTraceWriterTest extends TestCase { public void testTrimmedThrowableReal() { PojoStackTraceWriter w = new PojoStackTraceWriter( ATestClass.AnotherTestClass.class.getName(), "testQuote", getAThrowAble() ); String out = w.writeTrimmedTraceToString(); String expected = "org.apache.maven.surefire.report.PojoStackTraceWriterTest$ATestClass$AnotherTestClass.getAThrowable(PojoStackTraceWriterTest.java"; assertTrue( out.contains( expected ) ); } public void testMultiLineMessage() { String msg = "assert \"foo\" == \"bar\"\n" + " |\n" + " false"; try { throw new RuntimeException( msg ); } catch ( Throwable t ) { PojoStackTraceWriter writer = new PojoStackTraceWriter( null, null, t ); String stackTrace = writer.writeTraceToString(); assertTrue( stackTrace.startsWith( "java.lang.RuntimeException: \n" + msg ) ); } } static class ATestClass { static class AnotherTestClass { public static Throwable getAThrowable() { try { throw new Exception( "Hey ho, hey ho, a throwable we throw!" ); } catch ( Exception e ) { return e; } } } } private Throwable getAThrowAble() { return ATestClass.AnotherTestClass.getAThrowable(); } } RunnableTestClass1.java000066400000000000000000000032121330756104600417120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; import org.apache.maven.surefire.util.internal.DaemonThreadFactory; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.FutureTask; /* * 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. */ class RunnableTestClass1 implements Callable { @Override public Object call() throws Exception { doSomethingThatThrows(); return "yo"; } private void doSomethingThatThrows() throws ExecutionException { RunnableTestClass2 rt2 = new RunnableTestClass2(); FutureTask futureTask = new FutureTask( rt2 ); DaemonThreadFactory.newDaemonThread( futureTask ).start(); try { futureTask.get(); } catch ( InterruptedException e ) { throw new RuntimeException(); } } } RunnableTestClass2.java000066400000000000000000000025331330756104600417200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; import java.util.concurrent.Callable; /* * 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. */ class RunnableTestClass2 implements Callable { @Override public Object call() throws Exception { InnerRunnableTestClass.cThrows(); return null; //To change body of implemented methods use File | Settings | File Templates. } static class InnerRunnableTestClass { public static void cThrows() throws Exception { throw new Exception( "Hey ho, hey ho, a throwable we throw!" ); } } } SmartStackTraceParserTest.java000066400000000000000000000276551330756104600433260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import java.lang.reflect.Field; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.FutureTask; import junit.framework.AssertionFailedError; import junit.framework.ComparisonFailure; import junit.framework.TestCase; import org.apache.maven.surefire.util.internal.DaemonThreadFactory; import static org.apache.maven.surefire.report.SmartStackTraceParser.*; @SuppressWarnings( "ThrowableResultOfMethodCallIgnored" ) public class SmartStackTraceParserTest extends TestCase { public void testGetString() throws Exception { ATestClass aTestClass = new ATestClass(); try { aTestClass.failInAssert(); } catch ( AssertionError e ) { SmartStackTraceParser smartStackTraceParser = new SmartStackTraceParser( ATestClass.class, e ); String res = smartStackTraceParser.getString(); assertEquals( "ATestClass.failInAssert:30 X is not Z", res ); } } public void testNestedFailure() throws Exception { ATestClass aTestClass = new ATestClass(); try { aTestClass.nestedFailInAssert(); } catch ( AssertionError e ) { SmartStackTraceParser smartStackTraceParser = new SmartStackTraceParser( ATestClass.class, e ); String res = smartStackTraceParser.getString(); assertEquals( "ATestClass.nestedFailInAssert:35->failInAssert:30 X is not Z", res ); } } public void testNestedNpe() throws Exception { ATestClass aTestClass = new ATestClass(); try { aTestClass.nestedNpe(); } catch ( NullPointerException e ) { SmartStackTraceParser smartStackTraceParser = new SmartStackTraceParser( ATestClass.class, e ); String res = smartStackTraceParser.getString(); assertEquals( "ATestClass.nestedNpe:45->npe:40 NullPointer It was null", res ); } } public void testNestedNpeOutsideTest() throws Exception { ATestClass aTestClass = new ATestClass(); try { aTestClass.nestedNpeOutsideTest(); } catch ( NullPointerException e ) { SmartStackTraceParser smartStackTraceParser = new SmartStackTraceParser( ATestClass.class, e ); String res = smartStackTraceParser.getString(); assertEquals( "ATestClass.nestedNpeOutsideTest:55->npeOutsideTest:50 » NullPointer", res ); } } public void testLongMessageTruncation() throws Exception { ATestClass aTestClass = new ATestClass(); try { aTestClass.aLongTestErrorMessage(); } catch ( RuntimeException e ) { SmartStackTraceParser smartStackTraceParser = new SmartStackTraceParser( ATestClass.class, e ); String res = smartStackTraceParser.getString(); assertEquals( "ATestClass.aLongTestErrorMessage:60 Runtime This message will be truncated, so...", res ); } } public void testFailureInBaseClass() throws Exception { ASubClass aTestClass = new ASubClass(); try { aTestClass.npe(); } catch ( NullPointerException e ) { SmartStackTraceParser smartStackTraceParser = new SmartStackTraceParser( ASubClass.class, e ); String res = smartStackTraceParser.getString(); assertEquals( "ASubClass>ABaseClass.npe:27 » NullPointer It was null", res ); } } public void testClassThatWillFail() throws Exception { CaseThatWillFail aTestClass = new CaseThatWillFail(); try { aTestClass.testThatWillFail(); } catch ( ComparisonFailure e ) { SmartStackTraceParser smartStackTraceParser = new SmartStackTraceParser( CaseThatWillFail.class, e ); String res = smartStackTraceParser.getString(); assertEquals( "CaseThatWillFail.testThatWillFail:29 expected:<[abc]> but was:<[def]>", res ); } } public Throwable getAThrownException() { try { TestClass1.InnerBTestClass.throwSomething(); } catch ( Throwable t ) { return t; } return null; } public void testCollections() { Throwable aThrownException = getAThrownException(); List innerMost = focusInsideClass( aThrownException.getCause().getStackTrace(), new ClassNameStackTraceFilter( TestClass1.InnerBTestClass.class.getName() ) ); assertEquals( 2, innerMost.size() ); StackTraceElement inner = innerMost.get( 0 ); assertEquals( TestClass1.InnerBTestClass.class.getName(), inner.getClassName() ); StackTraceElement outer = innerMost.get( 1 ); assertEquals( TestClass1.InnerBTestClass.class.getName(), outer.getClassName() ); } public void testAssertionWithNoMessage() { try { new AssertionNoMessage().testThrowSomething(); } catch ( ComparisonFailure e ) { SmartStackTraceParser smartStackTraceParser = new SmartStackTraceParser( AssertionNoMessage.class, e ); String res = smartStackTraceParser.getString(); assertEquals( "AssertionNoMessage.testThrowSomething:29 expected:<[abc]> but was:<[xyz]>", res ); } } public void testFailWithFail() { try { new FailWithFail().testThatWillFail(); } catch ( AssertionFailedError e ) { SmartStackTraceParser smartStackTraceParser = new SmartStackTraceParser( FailWithFail.class, e ); String res = smartStackTraceParser.getString(); assertEquals( "FailWithFail.testThatWillFail:29 abc", res ); } } public void testCollectorWithNested() { try { InnerATestClass.testFake(); } catch ( Throwable t ) { List stackTraceElements = focusInsideClass( t.getStackTrace(), new ClassNameStackTraceFilter( InnerATestClass.class.getName() ) ); assertNotNull( stackTraceElements ); assertEquals( 2, stackTraceElements.size() ); StackTraceElement innerMost = stackTraceElements.get( 0 ); assertEquals( InnerATestClass.class.getName(), innerMost.getClassName() ); StackTraceElement outer = stackTraceElements.get( 1 ); assertEquals( InnerATestClass.class.getName(), outer.getClassName() ); } } public void testNonClassNameStacktrace() { SmartStackTraceParser smartStackTraceParser = new SmartStackTraceParser( "Not a class name", new Throwable( "my message" ), null ); assertEquals( "my message", smartStackTraceParser.getString() ); } public void testNullElementInStackTrace() throws Exception { ATestClass aTestClass = new ATestClass(); try { aTestClass.failInAssert(); } catch ( AssertionError e ) { SmartStackTraceParser smartStackTraceParser = new SmartStackTraceParser( ATestClass.class, e ); Field stackTrace = SmartStackTraceParser.class.getDeclaredField( "stackTrace" ); stackTrace.setAccessible( true ); stackTrace.set( smartStackTraceParser, new StackTraceElement[0] ); String res = smartStackTraceParser.getString(); assertEquals( "ATestClass X is not Z", res ); } } public void testSingleNestedWithThread() { ExecutionException e = getSingleNested(); String name = getClass().getName(); Throwable focus = findTopmostWithClass( e, new ClassNameStackTraceFilter( name ) ); assertSame( e, focus ); List stackTraceElements = focusInsideClass( focus.getStackTrace(), new ClassNameStackTraceFilter( name ) ); assertEquals( stackTraceElements.get( stackTraceElements.size() - 1 ).getClassName(), name ); } public void testDoubleNestedWithThread() { ExecutionException e = getDoubleNestedException(); String name = getClass().getName(); Throwable focus = findTopmostWithClass( e, new ClassNameStackTraceFilter( name ) ); assertSame( e, focus ); List stackTraceElements = focusInsideClass( focus.getStackTrace(), new ClassNameStackTraceFilter( name ) ); assertEquals( stackTraceElements.get( stackTraceElements.size() - 1 ).getClassName(), name ); name = RunnableTestClass1.class.getName(); focus = findTopmostWithClass( e, new ClassNameStackTraceFilter( name ) ); assertSame( e.getCause(), focus ); stackTraceElements = focusInsideClass( focus.getStackTrace(), new ClassNameStackTraceFilter( name ) ); assertEquals( stackTraceElements.get( stackTraceElements.size() - 1 ).getClassName(), name ); } public void testStackTraceWithFocusOnClassAsString() { try { new StackTraceFocusedOnClass.C().c(); fail(); } catch ( Exception e ) { String trace = stackTraceWithFocusOnClassAsString( e, StackTraceFocusedOnClass.B.class.getName() ); assertEquals( "java.lang.RuntimeException: java.lang.IllegalStateException: java.io.IOException: I/O error\n" + "\tat org.apache.maven.surefire.report.StackTraceFocusedOnClass$B.b(StackTraceFocusedOnClass.java:65)\n" + "Caused by: java.lang.IllegalStateException: java.io.IOException: I/O error\n" + "\tat org.apache.maven.surefire.report.StackTraceFocusedOnClass$B.b(StackTraceFocusedOnClass.java:61)\n" + "Caused by: java.io.IOException: I/O error\n" + "\tat org.apache.maven.surefire.report.StackTraceFocusedOnClass$B.abs(StackTraceFocusedOnClass.java:73)\n" + "\tat org.apache.maven.surefire.report.StackTraceFocusedOnClass$B.b(StackTraceFocusedOnClass.java:61)\n", trace ); } } public ExecutionException getSingleNested() { FutureTask futureTask = new FutureTask( new RunnableTestClass2() ); DaemonThreadFactory.newDaemonThread( futureTask ).start(); try { futureTask.get(); } catch ( InterruptedException e ) { fail(); } catch ( ExecutionException e ) { return e; } fail(); return null; } private ExecutionException getDoubleNestedException() { FutureTask futureTask = new FutureTask( new RunnableTestClass1() ); DaemonThreadFactory.newDaemonThread( futureTask ).start(); try { futureTask.get(); } catch ( InterruptedException e ) { fail(); } catch ( ExecutionException e ) { return e; } return null; } } StackTraceFocusedOnClass.java000066400000000000000000000036461330756104600430700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ import java.io.IOException; final class StackTraceFocusedOnClass { static class JRE { void throwException() throws IOException { throw new IOException( "I/O error" ); } } static abstract class A { abstract void abs() throws IOException; void a() { try { abs(); } catch ( Exception e ) { throw new IllegalStateException( e ); } } } static class B extends A { private final JRE jre = new JRE(); void b() { try { a(); } catch ( Exception e ) { throw new RuntimeException( e ); } } @Override void abs() throws IOException { jre.throwException(); } } static class C { private final B b = new B(); void c() { b.b(); } } } TestClass1.java000066400000000000000000000024211330756104600402240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ class TestClass1 { static class InnerBTestClass { public static void throwSomething() { innerThrowSomething(); } public static void innerThrowSomething() { try { TestClass2.InnerCTestClass.cThrows(); } catch ( Exception e ) { throw new RuntimeException( e ); } } } } TestClass2.java000066400000000000000000000020711330756104600402260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/reportpackage org.apache.maven.surefire.report; /* * 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. */ class TestClass2 { static class InnerCTestClass { public static void cThrows() throws Exception { throw new Exception( "Hey ho, hey ho, a throwable we throw!" ); } } } maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/000077500000000000000000000000001330756104600247155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/pom.xml000066400000000000000000000030531330756104600262330ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire-providers 2.22.0 common-junit3 Shared JUnit3 Provider Code Shared JUnit3 Provider Code junit junit 3.8.1 provided maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/000077500000000000000000000000001330756104600255045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/main/000077500000000000000000000000001330756104600264305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/main/java/000077500000000000000000000000001330756104600273515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/main/java/org/000077500000000000000000000000001330756104600301405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/main/java/org/apache/000077500000000000000000000000001330756104600313615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600324675ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600342345ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/main/java/org/apache/mavencommon/000077500000000000000000000000001330756104600355245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/main/java/org/apache/maven/surefirejunit3/000077500000000000000000000000001330756104600367405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/main/java/org/apache/maven/surefire/commonJUnit3Reflector.java000066400000000000000000000151701330756104600425710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/main/java/org/apache/maven/surefire/common/junit3package org.apache.maven.surefire.common.junit3; /* * 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. */ import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import org.apache.maven.surefire.util.ReflectionUtils; /** * Reflection facade for JUnit3 classes * */ public final class JUnit3Reflector { private static final String TEST_CASE = "junit.framework.Test"; private static final String TEST_RESULT = "junit.framework.TestResult"; private static final String TEST_LISTENER = "junit.framework.TestListener"; private static final String TEST = "junit.framework.Test"; private static final String ADD_LISTENER_METHOD = "addListener"; private static final String RUN_METHOD = "run"; private static final String TEST_SUITE = "junit.framework.TestSuite"; private final Class[] interfacesImplementedByDynamicProxy; private final Class testResultClass; private final Method addListenerMethod; private final Method testInterfaceRunMethod; private static final Class[] EMPTY_CLASS_ARRAY = new Class[0]; private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0]; private final Class testInterface; private final Class testCase; private final Constructor testsSuiteConstructor; public JUnit3Reflector( ClassLoader testClassLoader ) { testResultClass = ReflectionUtils.tryLoadClass( testClassLoader, TEST_RESULT ); testCase = ReflectionUtils.tryLoadClass( testClassLoader, TEST_CASE ); testInterface = ReflectionUtils.tryLoadClass( testClassLoader, TEST ); interfacesImplementedByDynamicProxy = new Class[]{ ReflectionUtils.tryLoadClass( testClassLoader, TEST_LISTENER ) }; Class[] constructorParamTypes = { Class.class }; Class testSuite = ReflectionUtils.tryLoadClass( testClassLoader, TEST_SUITE ); // The interface implemented by the dynamic proxy (TestListener), happens to be // the same as the param types of TestResult.addTestListener Class[] addListenerParamTypes = interfacesImplementedByDynamicProxy; if ( isJUnit3Available() ) { testsSuiteConstructor = ReflectionUtils.getConstructor( testSuite, constructorParamTypes ); addListenerMethod = tryGetMethod( testResultClass, ADD_LISTENER_METHOD, addListenerParamTypes ); testInterfaceRunMethod = getMethod( testInterface, RUN_METHOD, testResultClass ); } else { testsSuiteConstructor = null; addListenerMethod = null; testInterfaceRunMethod = null; } } // Switch to reflectionutils when building with 2.7.2 private static Method tryGetMethod( Class clazz, String methodName, Class... parameters ) { try { return clazz.getMethod( methodName, parameters ); } catch ( NoSuchMethodException e ) { return null; } } private static Method getMethod( Class clazz, String methodName, Class... parameters ) { try { return clazz.getMethod( methodName, parameters ); } catch ( NoSuchMethodException e ) { throw new RuntimeException( "When finding method " + methodName, e ); } } public Object constructTestObject( Class testClass ) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException, InstantiationException { Object testObject = createInstanceFromSuiteMethod( testClass ); if ( testObject == null && testCase.isAssignableFrom( testClass ) ) { testObject = testsSuiteConstructor.newInstance( testClass ); } if ( testObject == null ) { Constructor testConstructor = getTestConstructor( testClass ); if ( testConstructor.getParameterTypes().length == 0 ) { testObject = testConstructor.newInstance( EMPTY_OBJECT_ARRAY ); } else { testObject = testConstructor.newInstance( testClass.getName() ); } } return testObject; } private static Object createInstanceFromSuiteMethod( Class testClass ) throws IllegalAccessException, InvocationTargetException { Object testObject = null; try { Method suiteMethod = testClass.getMethod( "suite", EMPTY_CLASS_ARRAY ); if ( Modifier.isPublic( suiteMethod.getModifiers() ) && Modifier.isStatic( suiteMethod.getModifiers() ) ) { testObject = suiteMethod.invoke( null, EMPTY_CLASS_ARRAY ); } } catch ( NoSuchMethodException e ) { // No suite method } return testObject; } private static Constructor getTestConstructor( Class testClass ) throws NoSuchMethodException { try { return testClass.getConstructor( String.class ); } catch ( NoSuchMethodException e ) { return testClass.getConstructor( EMPTY_CLASS_ARRAY ); } } public Class[] getInterfacesImplementedByDynamicProxy() { return interfacesImplementedByDynamicProxy; } public Class getTestResultClass() { return testResultClass; } public Method getAddListenerMethod() { return addListenerMethod; } public Method getTestInterfaceRunMethod() { return testInterfaceRunMethod; } public Class getTestInterface() { return testInterface; } public Method getRunMethod( Class testClass ) { return getMethod( testClass, RUN_METHOD, getTestResultClass() ); } public boolean isJUnit3Available() { return testResultClass != null; } } JUnit3TestChecker.java000066400000000000000000000054261330756104600430530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/main/java/org/apache/maven/surefire/common/junit3package org.apache.maven.surefire.common.junit3; /* * 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. */ import java.lang.reflect.Method; import org.apache.maven.surefire.NonAbstractClassFilter; import org.apache.maven.surefire.util.ScannerFilter; import static java.lang.reflect.Modifier.isPublic; import static java.lang.reflect.Modifier.isStatic; import static org.apache.maven.surefire.util.ReflectionUtils.tryGetMethod; import static org.apache.maven.surefire.util.ReflectionUtils.tryLoadClass; /** * Missing tests ? This class is basically a subset of the JUnit4TestChecker, which is tested * to boredom and back. Unfortunately we don't have any common module between these providers, * so this stuff is duplicated. We should probably make some modules and just shade the content * into the providers. * * @author Kristian Rosenvold */ public class JUnit3TestChecker implements ScannerFilter { private static final Class[] EMPTY_CLASS_ARRAY = new Class[0]; private final Class junitClass; private final NonAbstractClassFilter nonAbstractClassFilter = new NonAbstractClassFilter(); public JUnit3TestChecker( ClassLoader testClassLoader ) { junitClass = tryLoadClass( testClassLoader, "junit.framework.Test" ); } @Override public boolean accept( Class testClass ) { return nonAbstractClassFilter.accept( testClass ) && isValidJUnit3Test( testClass ); } private boolean isValidJUnit3Test( Class testClass ) { return junitClass != null && ( junitClass.isAssignableFrom( testClass ) || isSuiteOnly( testClass ) ); } private boolean isSuiteOnly( Class testClass ) { final Method suite = tryGetMethod( testClass, "suite", EMPTY_CLASS_ARRAY ); if ( suite != null ) { final int modifiers = suite.getModifiers(); if ( isPublic( modifiers ) && isStatic( modifiers ) ) { return junit.framework.Test.class.isAssignableFrom( suite.getReturnType() ); } } return false; } } maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/test/000077500000000000000000000000001330756104600264635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/test/java/000077500000000000000000000000001330756104600274045ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/test/java/org/000077500000000000000000000000001330756104600301735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/test/java/org/apache/000077500000000000000000000000001330756104600314145ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600325225ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600342675ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/test/java/org/apache/mavencommon/000077500000000000000000000000001330756104600355575ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/test/java/org/apache/maven/surefirejunit3/000077500000000000000000000000001330756104600367735ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/test/java/org/apache/maven/surefire/commonJUnit3TestCheckerTest.java000066400000000000000000000071011330756104600437360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit3/src/test/java/org/apache/maven/surefire/common/junit3package org.apache.maven.surefire.common.junit3; /* * 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. */ import org.apache.maven.surefire.testset.TestSetFailedException; import junit.framework.TestCase; import junit.framework.TestResult; /** * @author Kristian Rosenvold */ public class JUnit3TestCheckerTest extends TestCase { private final JUnit3TestChecker jUnit3TestChecker = new JUnit3TestChecker( this.getClass().getClassLoader() ); public void testValidJunit4Annotated() throws TestSetFailedException { assertTrue( jUnit3TestChecker.accept( JUnit3TestCheckerTest.class ) ); } public void testValidJunit4itsAJunit3Test() throws TestSetFailedException { assertTrue( jUnit3TestChecker.accept( AlsoValid.class ) ); } public void testValidJunitSubclassWithoutOwnTestmethods() throws TestSetFailedException { assertTrue( jUnit3TestChecker.accept( SubClassWithoutOwnTestMethods.class ) ); } public void testInvalidTest() throws TestSetFailedException { assertFalse( jUnit3TestChecker.accept( NotValidTest.class ) ); } public void testDontAcceptAbstractClasses() { assertFalse( jUnit3TestChecker.accept( BaseClassWithTest.class ) ); } public void testSuiteOnlyTest() { assertTrue( jUnit3TestChecker.accept( SuiteOnlyTest.class ) ); } public void testCustomSuiteOnlyTest() { assertTrue( jUnit3TestChecker.accept( CustomSuiteOnlyTest.class ) ); } public void testIinnerClassNotAutomaticallyTc() { assertTrue( jUnit3TestChecker.accept( NestedTC.class ) ); assertFalse( jUnit3TestChecker.accept( NestedTC.Inner.class ) ); } public static class AlsoValid extends TestCase { public void testSomething() { } } public static class SuiteOnlyTest { public static junit.framework.Test suite() { return null; } } public static class CustomSuiteOnlyTest { public static MySuite2 suite() { return null; } } public static class MySuite2 implements junit.framework.Test { @Override public int countTestCases() { return 0; } @Override public void run( TestResult testResult ) { } } public static class NotValidTest { public void testSomething() { } } public abstract static class BaseClassWithTest extends TestCase { public void testWeAreAlsoATest() { } } public static class SubClassWithoutOwnTestMethods extends BaseClassWithTest { } class NestedTC extends TestCase { public class Inner { } } } maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/000077500000000000000000000000001330756104600247165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/pom.xml000066400000000000000000000041261330756104600262360ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire-providers 2.22.0 common-junit4 Shared JUnit4 Provider Code Shared JUnit4 Provider Code junit junit 4.0 provided org.apache.maven.surefire common-junit3 ${project.version} org.apache.maven.surefire common-java5 ${project.version} org.apache.maven.shared maven-shared-utils compile maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/000077500000000000000000000000001330756104600255055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/000077500000000000000000000000001330756104600264315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/000077500000000000000000000000001330756104600273525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/000077500000000000000000000000001330756104600301415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/000077500000000000000000000000001330756104600313625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600324705ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600342355ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/mavencommon/000077500000000000000000000000001330756104600355255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefirejunit4/000077500000000000000000000000001330756104600367425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/commonClassMethod.java000066400000000000000000000026661330756104600420250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4package org.apache.maven.surefire.common.junit4; /* * 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. */ import org.apache.maven.surefire.util.internal.StringUtils; /** * Data transfer object of class and method literals. */ public final class ClassMethod { private final String clazz; private final String method; public ClassMethod( String clazz, String method ) { this.clazz = clazz; this.method = method; } public boolean isValid() { return !StringUtils.isBlank( clazz ) && !StringUtils.isBlank( method ); } public String getClazz() { return clazz; } public String getMethod() { return method; } } JUnit4ProviderUtil.java000066400000000000000000000070121330756104600432730ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4package org.apache.maven.surefire.common.junit4; /* * 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. */ import java.util.HashSet; import java.util.List; import java.util.Set; import org.junit.runner.Description; import org.junit.runner.manipulation.Filter; import org.junit.runner.notification.Failure; import static org.apache.maven.surefire.util.internal.StringUtils.isBlank; import static org.junit.runner.Description.TEST_MECHANISM; /** * * Utility method used among all JUnit4 providers * * @author Qingzhou Luo * */ public final class JUnit4ProviderUtil { private JUnit4ProviderUtil() { throw new IllegalStateException( "Cannot instantiate." ); } /** * Get all descriptions from a list of Failures * * @param allFailures the list of failures for a given test class * @return the list of descriptions */ public static Set generateFailingTestDescriptions( List allFailures ) { Set failingTestDescriptions = new HashSet(); for ( Failure failure : allFailures ) { Description description = failure.getDescription(); if ( description.isTest() && !isFailureInsideJUnitItself( description ) ) { failingTestDescriptions.add( description ); } } return failingTestDescriptions; } public static boolean isFailureInsideJUnitItself( Description failure ) { return TEST_MECHANISM.equals( failure ); } /** * Java Patterns of regex is slower than cutting a substring. * @param description method(class) or method[#](class) or method[#whatever-literals](class) * @return method JUnit test method */ public static ClassMethod cutTestClassAndMethod( Description description ) { String name = description.getDisplayName(); String clazz = null; String method = null; if ( name != null ) { // The order is : 1.method and then 2.class // method(class) name = name.trim(); if ( name.endsWith( ")" ) ) { int classBracket = name.lastIndexOf( '(' ); if ( classBracket != -1 ) { clazz = tryBlank( name.substring( classBracket + 1, name.length() - 1 ) ); method = tryBlank( name.substring( 0, classBracket ) ); } } } return new ClassMethod( clazz, method ); } private static String tryBlank( String s ) { s = s.trim(); return isBlank( s ) ? null : s; } public static Filter createMatchAnyDescriptionFilter( Iterable descriptions ) { return new MatchDescriptions( descriptions ); } } JUnit4Reflector.java000066400000000000000000000122271330756104600425740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4package org.apache.maven.surefire.common.junit4; /* * 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. */ import org.apache.maven.surefire.util.SurefireReflectionException; import org.junit.Ignore; import org.junit.runner.Description; import org.junit.runner.Request; import java.lang.annotation.Annotation; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import static org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray; import static org.apache.maven.surefire.util.ReflectionUtils.tryGetMethod; /** * JUnit4 reflection helper * */ public final class JUnit4Reflector { private static final Class[] PARAMS = { Class.class }; private static final Class[] IGNORE_PARAMS = { Ignore.class }; private static final Class[] PARAMS_WITH_ANNOTATIONS = { String.class, Annotation[].class }; private JUnit4Reflector() { throw new IllegalStateException( "not instantiable constructor" ); } public static Ignore getAnnotatedIgnore( Description d ) { Method getAnnotation = tryGetMethod( d.getClass(), "getAnnotation", PARAMS ); return getAnnotation == null ? null : (Ignore) invokeMethodWithArray( d, getAnnotation, IGNORE_PARAMS ); } public static String getAnnotatedIgnoreValue( Description description ) { final Ignore ignore = getAnnotatedIgnore( description ); return ignore != null ? ignore.value() : null; } public static Request createRequest( Class... classes ) { try { return (Request) Request.class.getDeclaredMethod( "classes", Class[].class )// Since of JUnit 4.5 .invoke( null, new Object[]{ classes } ); } catch ( NoSuchMethodException e ) { return Request.classes( null, classes ); // Since of JUnit 4.0 } catch ( InvocationTargetException e ) { throw new SurefireReflectionException( e.getCause() ); } catch ( IllegalAccessException e ) { // probably JUnit 5.x throw new SurefireReflectionException( e ); } } public static Description createDescription( String description ) { try { return Description.createSuiteDescription( description ); } catch ( NoSuchMethodError e ) { Method method = tryGetMethod( Description.class, "createSuiteDescription", PARAMS_WITH_ANNOTATIONS ); // may throw exception probably with JUnit 5.x return (Description) invokeMethodWithArray( null, method, description, new Annotation[0] ); } } public static Description createDescription( String description, Annotation... annotations ) { Method method = tryGetMethod( Description.class, "createSuiteDescription", PARAMS_WITH_ANNOTATIONS ); return method == null ? Description.createSuiteDescription( description ) : (Description) invokeMethodWithArray( null, method, description, annotations ); } public static Ignore createIgnored( String value ) { return new IgnoredWithUserError( value ); } private static class IgnoredWithUserError implements Annotation, Ignore { private final String value; IgnoredWithUserError( String value ) { this.value = value; } IgnoredWithUserError() { this( "" ); } @Override public String value() { return value; } @Override public Class annotationType() { return Ignore.class; } @Override public int hashCode() { return value == null ? 0 : value.hashCode(); } @Override public boolean equals( Object obj ) { return obj instanceof Annotation && obj instanceof Ignore && equalValue( ( Ignore ) obj ); } @Override public String toString() { return String.format( "%s(%s)", Ignore.class, value ); } private boolean equalValue( Ignore ignore ) { if ( ignore == null ) { return false; } else { String val = ignore.value(); return val == null ? value == null : val.equals( value ); } } } } JUnit4RunListener.java000066400000000000000000000171261330756104600431240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4package org.apache.maven.surefire.common.junit4; /* * 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. */ import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.SimpleReportEntry; import org.apache.maven.surefire.report.StackTraceWriter; import org.apache.maven.surefire.testset.TestSetFailedException; import org.junit.runner.Description; import org.junit.runner.Result; import org.junit.runner.notification.Failure; import static org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil.isFailureInsideJUnitItself; import static org.apache.maven.surefire.common.junit4.JUnit4Reflector.getAnnotatedIgnoreValue; import static org.apache.maven.surefire.report.SimpleReportEntry.assumption; import static org.apache.maven.surefire.report.SimpleReportEntry.ignored; import static org.apache.maven.surefire.report.SimpleReportEntry.withException; import static org.apache.maven.surefire.util.internal.TestClassMethodNameUtils.extractClassName; import static org.apache.maven.surefire.util.internal.TestClassMethodNameUtils.extractMethodName; /** * RunListener for JUnit4, delegates to our own RunListener * */ public class JUnit4RunListener extends org.junit.runner.notification.RunListener { protected final RunListener reporter; /** * This flag is set after a failure has occurred so that a {@link RunListener#testSucceeded} event is not fired. * This is necessary because JUnit4 always fires a {@link org.junit.runner.notification.RunListener#testRunFinished} * event-- even if there was a failure. */ private final ThreadLocal failureFlag = new InheritableThreadLocal(); /** * Constructor. * * @param reporter the reporter to log testing events to */ public JUnit4RunListener( RunListener reporter ) { this.reporter = reporter; } // Testrun methods are not invoked when using the runner /** * Called when a specific test has been skipped (for whatever reason). * * @see org.junit.runner.notification.RunListener#testIgnored(org.junit.runner.Description) */ @Override public void testIgnored( Description description ) throws Exception { String reason = getAnnotatedIgnoreValue( description ); reporter.testSkipped( ignored( getClassName( description ), description.getDisplayName(), reason ) ); } /** * Called when a specific test has started. * * @see org.junit.runner.notification.RunListener#testStarted(org.junit.runner.Description) */ @Override public void testStarted( Description description ) throws Exception { try { reporter.testStarting( createReportEntry( description ) ); } finally { failureFlag.remove(); } } /** * Called when a specific test has failed. * * @see org.junit.runner.notification.RunListener#testFailure(org.junit.runner.notification.Failure) */ @Override @SuppressWarnings( { "ThrowableResultOfMethodCallIgnored" } ) public void testFailure( Failure failure ) throws Exception { try { String testHeader = failure.getTestHeader(); if ( isInsaneJunitNullString( testHeader ) ) { testHeader = "Failure when constructing test"; } String testClassName = getClassName( failure.getDescription() ); StackTraceWriter stackTrace = createStackTraceWriter( failure ); ReportEntry report = withException( testClassName, testHeader, stackTrace ); if ( failure.getException() instanceof AssertionError ) { reporter.testFailed( report ); } else { reporter.testError( report ); } } finally { failureFlag.set( true ); } } @SuppressWarnings( "UnusedDeclaration" ) public void testAssumptionFailure( Failure failure ) { try { Description desc = failure.getDescription(); String test = getClassName( desc ); reporter.testAssumptionFailure( assumption( test, desc.getDisplayName(), failure.getMessage() ) ); } finally { failureFlag.set( true ); } } /** * Called after a specific test has finished. * * @see org.junit.runner.notification.RunListener#testFinished(org.junit.runner.Description) */ @Override public void testFinished( Description description ) throws Exception { Boolean failure = failureFlag.get(); if ( failure == null ) { reporter.testSucceeded( createReportEntry( description ) ); } } /** * Delegates to {@link RunListener#testExecutionSkippedByUser()}. */ public void testExecutionSkippedByUser() { reporter.testExecutionSkippedByUser(); } private String getClassName( Description description ) { String name = extractDescriptionClassName( description ); if ( name == null || isInsaneJunitNullString( name ) ) { // This can happen upon early failures (class instantiation error etc) Description subDescription = description.getChildren().get( 0 ); if ( subDescription != null ) { name = extractDescriptionClassName( subDescription ); } if ( name == null ) { name = "Test Instantiation Error"; } } return name; } protected StackTraceWriter createStackTraceWriter( Failure failure ) { return new JUnit4StackTraceWriter( failure ); } protected SimpleReportEntry createReportEntry( Description description ) { return new SimpleReportEntry( getClassName( description ), description.getDisplayName() ); } protected String extractDescriptionClassName( Description description ) { return extractClassName( description.getDisplayName() ); } protected String extractDescriptionMethodName( Description description ) { return extractMethodName( description.getDisplayName() ); } public static void rethrowAnyTestMechanismFailures( Result run ) throws TestSetFailedException { for ( Failure failure : run.getFailures() ) { if ( isFailureInsideJUnitItself( failure.getDescription() ) ) { throw new TestSetFailedException( failure.getTestHeader() + " :: " + failure.getMessage(), failure.getException() ); } } } private static boolean isInsaneJunitNullString( String value ) { return "null".equals( value ); } } JUnit4RunListenerFactory.java000066400000000000000000000033401330756104600444450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4package org.apache.maven.surefire.common.junit4; /* * 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. */ import java.util.LinkedList; import java.util.List; import org.apache.maven.shared.utils.StringUtils; import org.apache.maven.surefire.util.ReflectionUtils; import org.junit.runner.notification.RunListener; /** * @author Kristian Rosenvold */ public class JUnit4RunListenerFactory { public static List createCustomListeners( String listeners ) { List result = new LinkedList(); if ( StringUtils.isNotBlank( listeners ) ) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); for ( String listener : listeners.split( "," ) ) { if ( StringUtils.isNotBlank( listener ) ) { result.add( ReflectionUtils.instantiate( cl, listener, RunListener.class ) ); } } } return result; } } JUnit4StackTraceWriter.java000066400000000000000000000114351330756104600440700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4package org.apache.maven.surefire.common.junit4; /* * 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. */ import org.apache.maven.surefire.report.SafeThrowable; import org.apache.maven.surefire.report.SmartStackTraceParser; import org.apache.maven.surefire.report.StackTraceWriter; import org.junit.runner.notification.Failure; import static org.apache.maven.surefire.util.internal.TestClassMethodNameUtils.extractClassName; import static org.apache.maven.surefire.util.internal.TestClassMethodNameUtils.extractMethodName; import static org.apache.maven.surefire.report.SmartStackTraceParser.stackTraceWithFocusOnClassAsString; /** * Writes out a specific {@link org.junit.runner.notification.Failure} for * surefire as a stacktrace. * * @author Karl M. Davis */ public class JUnit4StackTraceWriter implements StackTraceWriter { // Member Variables protected final Failure junitFailure; /** * Constructor. * * @param junitFailure the {@link Failure} that this will be operating on */ public JUnit4StackTraceWriter( Failure junitFailure ) { this.junitFailure = junitFailure; } /* * (non-Javadoc) * * @see org.apache.maven.surefire.report.StackTraceWriter#writeTraceToString() */ @Override public String writeTraceToString() { Throwable t = junitFailure.getException(); if ( t != null ) { String originalTrace = junitFailure.getTrace(); if ( isMultiLineExceptionMessage( t ) ) { // SUREFIRE-986 StringBuilder builder = new StringBuilder( originalTrace ); String exc = t.getClass().getName() + ": "; if ( originalTrace.startsWith( exc ) ) { builder.insert( exc.length(), '\n' ); } return builder.toString(); } return originalTrace; } return ""; } protected String getTestClassName() { return extractClassName( junitFailure.getDescription().getDisplayName() ); } protected String getTestMethodName() { return extractMethodName( junitFailure.getDescription().getDisplayName() ); } @Override @SuppressWarnings( "ThrowableResultOfMethodCallIgnored" ) public String smartTrimmedStackTrace() { Throwable exception = junitFailure.getException(); return exception == null ? junitFailure.getMessage() : new SmartStackTraceParser( getTestClassName(), exception, getTestMethodName() ).getString(); } /** * At the moment, returns the same as {@link #writeTraceToString()}. * * @see org.apache.maven.surefire.report.StackTraceWriter#writeTrimmedTraceToString() */ @Override public String writeTrimmedTraceToString() { String testClass = getTestClassName(); try { Throwable e = junitFailure.getException(); return stackTraceWithFocusOnClassAsString( e, testClass ); } catch ( Throwable t ) { return stackTraceWithFocusOnClassAsString( t, testClass ); } } /** * Returns the exception associated with this failure. * * @see org.apache.maven.surefire.report.StackTraceWriter#getThrowable() */ @Override public SafeThrowable getThrowable() { return new SafeThrowable( junitFailure.getException() ); } private static boolean isMultiLineExceptionMessage( Throwable t ) { String msg = t.getLocalizedMessage(); if ( msg != null ) { int countNewLines = 0; for ( int i = 0, length = msg.length(); i < length; i++ ) { if ( msg.charAt( i ) == '\n' ) { if ( ++countNewLines == 2 ) { break; } } } return countNewLines > 1 || countNewLines == 1 && !msg.trim().endsWith( "\n" ); } return false; } } JUnit4TestChecker.java000066400000000000000000000064221330756104600430530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4package org.apache.maven.surefire.common.junit4; /* * 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. */ import java.lang.annotation.Annotation; import java.lang.reflect.Method; import org.apache.maven.surefire.NonAbstractClassFilter; import org.apache.maven.surefire.common.junit3.JUnit3TestChecker; import org.apache.maven.surefire.util.ScannerFilter; import static org.apache.maven.surefire.util.ReflectionUtils.tryLoadClass; /** * @author Kristian Rosenvold */ public class JUnit4TestChecker implements ScannerFilter { private final NonAbstractClassFilter nonAbstractClassFilter; private final Class runWith; private final JUnit3TestChecker jUnit3TestChecker; public JUnit4TestChecker( ClassLoader testClassLoader ) { jUnit3TestChecker = new JUnit3TestChecker( testClassLoader ); runWith = tryLoadClass( testClassLoader, org.junit.runner.RunWith.class.getName() ); nonAbstractClassFilter = new NonAbstractClassFilter(); } @Override public boolean accept( Class testClass ) { return jUnit3TestChecker.accept( testClass ) || isValidJUnit4Test( testClass ); } @SuppressWarnings( { "unchecked" } ) private boolean isValidJUnit4Test( Class testClass ) { if ( !nonAbstractClassFilter.accept( testClass ) ) { return false; } if ( isRunWithPresentInClassLoader() ) { Annotation runWithAnnotation = testClass.getAnnotation( runWith ); if ( runWithAnnotation != null ) { return true; } } return lookForTestAnnotatedMethods( testClass ); } private boolean lookForTestAnnotatedMethods( Class testClass ) { Class classToCheck = testClass; while ( classToCheck != null ) { if ( checkforTestAnnotatedMethod( classToCheck ) ) { return true; } classToCheck = classToCheck.getSuperclass(); } return false; } public boolean checkforTestAnnotatedMethod( Class testClass ) { for ( Method lMethod : testClass.getDeclaredMethods() ) { for ( Annotation lAnnotation : lMethod.getAnnotations() ) { if ( org.junit.Test.class.isAssignableFrom( lAnnotation.annotationType() ) ) { return true; } } } return false; } public boolean isRunWithPresentInClassLoader() { return runWith != null; } } JUnitTestFailureListener.java000066400000000000000000000030551330756104600445170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4package org.apache.maven.surefire.common.junit4; /* * 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. */ import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunListener; import java.util.ArrayList; import java.util.List; /** * Test listener to record all the failures during one run * * @author Qingzhou Luo */ public class JUnitTestFailureListener extends RunListener { private final List allFailures = new ArrayList(); @Override public void testFailure( Failure failure ) throws Exception { if ( failure != null ) { allFailures.add( failure ); } } public List getAllFailures() { return allFailures; } public void reset() { allFailures.clear(); } } MatchDescriptions.java000066400000000000000000000056341330756104600432400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4package org.apache.maven.surefire.common.junit4; /* * 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. */ import org.junit.runner.Description; import org.junit.runner.manipulation.Filter; import java.util.ArrayList; import java.util.List; /** * Only run test methods in the given failure set. * * @author mpkorstanje */ public final class MatchDescriptions extends Filter { private final List filters = new ArrayList(); public MatchDescriptions( Iterable descriptions ) { for ( Description description : descriptions ) { filters.add( matchDescription( description ) ); } } @Override public boolean shouldRun( Description description ) { for ( Filter filter : filters ) { if ( filter.shouldRun( description ) ) { return true; } } return false; } @Override public String describe() { StringBuilder description = new StringBuilder( "Matching description " ); for ( int i = 0; i < filters.size(); i++ ) { description.append( filters.get( i ).describe() ); if ( i != filters.size() - 1 ) { description.append( " OR " ); } } return description.toString(); } private static Filter matchDescription( final Description desiredDescription ) { return new Filter() { @Override public boolean shouldRun( Description description ) { if ( description.isTest() ) { return desiredDescription.equals( description ); } for ( Description each : description.getChildren() ) { if ( shouldRun( each ) ) { return true; } } return false; } @Override public String describe() { return String.format( "Method %s", desiredDescription.getDisplayName() ); } }; } } Notifier.java000066400000000000000000000124771330756104600413770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/common/junit4package org.apache.maven.surefire.common.junit4; /* * 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. */ import org.junit.runner.Description; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunListener; import org.junit.runner.notification.RunNotifier; import org.junit.runner.notification.StoppedByUserException; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicInteger; import static org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil.cutTestClassAndMethod; import static org.apache.maven.surefire.util.internal.ConcurrencyUtils.countDownToZero; /** * Extends {@link RunNotifier JUnit notifier}, * encapsulates several different types of {@link RunListener JUnit listeners}, and * fires events to listeners. * * @author Tibor Digana (tibor17) * @since 2.19 */ public class Notifier extends RunNotifier { private final Collection listeners = new ArrayList(); private final Queue testClassNames = new ConcurrentLinkedQueue(); private final AtomicInteger skipAfterFailureCount; private final JUnit4RunListener reporter; private volatile boolean failFast; public Notifier( JUnit4RunListener reporter, int skipAfterFailureCount ) { addListener( reporter ); this.reporter = reporter; this.skipAfterFailureCount = new AtomicInteger( skipAfterFailureCount ); } private Notifier() { reporter = null; skipAfterFailureCount = null; } public static Notifier pureNotifier() { return new Notifier() { @Override public void asFailFast( @SuppressWarnings( { "unused", "checkstyle:hiddenfieldcheck" } ) boolean failFast ) { throw new UnsupportedOperationException( "pure notifier" ); } }; } public void asFailFast( boolean enableFailFast ) { failFast = enableFailFast; } public final boolean isFailFast() { return failFast; } @Override @SuppressWarnings( "checkstyle:redundantthrowscheck" ) // checkstyle is wrong here, see super.fireTestStarted() public final void fireTestStarted( Description description ) throws StoppedByUserException { // If fireTestStarted() throws exception (== skipped test), the class must not be removed from testClassNames. // Therefore this class will be removed only if test class started with some test method. super.fireTestStarted( description ); if ( !testClassNames.isEmpty() ) { testClassNames.remove( cutTestClassAndMethod( description ).getClazz() ); } } @Override public final void fireTestFailure( Failure failure ) { if ( failFast ) { fireStopEvent(); } super.fireTestFailure( failure ); } @Override public final void addListener( RunListener listener ) { listeners.add( listener ); super.addListener( listener ); } public final Notifier addListeners( Collection given ) { for ( RunListener listener : given ) { addListener( listener ); } return this; } @SuppressWarnings( "unused" ) public final Notifier addListeners( RunListener... given ) { for ( RunListener listener : given ) { addListener( listener ); } return this; } @Override public final void removeListener( RunListener listener ) { listeners.remove( listener ); super.removeListener( listener ); } public final void removeListeners() { for ( Iterator it = listeners.iterator(); it.hasNext(); ) { RunListener listener = it.next(); it.remove(); super.removeListener( listener ); } } public final Queue getRemainingTestClasses() { return failFast ? testClassNames : null; } public final void copyListenersTo( Notifier copyTo ) { copyTo.addListeners( listeners ); } /** * Fire stop even to plugin process and/or call {@link org.junit.runner.notification.RunNotifier#pleaseStop()}. */ private void fireStopEvent() { if ( countDownToZero( skipAfterFailureCount ) ) { pleaseStop(); } reporter.testExecutionSkippedByUser(); } } junit4/000077500000000000000000000000001330756104600354525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefireMockReporter.java000066400000000000000000000064111330756104600407330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/main/java/org/apache/maven/surefire/junit4package org.apache.maven.surefire.junit4; /* * 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. */ import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.TestSetReportEntry; /** * Internal tests use only. */ public class MockReporter implements RunListener { private final List events = new ArrayList(); public static final String SET_STARTED = "SET_STARTED"; public static final String SET_COMPLETED = "SET_COMPLETED"; public static final String TEST_STARTED = "TEST_STARTED"; public static final String TEST_COMPLETED = "TEST_COMPLETED"; public static final String TEST_SKIPPED = "TEST_SKIPPED"; private final AtomicInteger testSucceeded = new AtomicInteger(); private final AtomicInteger testIgnored = new AtomicInteger(); private final AtomicInteger testFailed = new AtomicInteger(); private final AtomicInteger testError = new AtomicInteger(); public MockReporter() { } @Override public void testSetStarting( TestSetReportEntry report ) { events.add( SET_STARTED ); } @Override public void testSetCompleted( TestSetReportEntry report ) { events.add( SET_COMPLETED ); } @Override public void testStarting( ReportEntry report ) { events.add( TEST_STARTED ); } @Override public void testSucceeded( ReportEntry report ) { events.add( TEST_COMPLETED ); testSucceeded.incrementAndGet(); } @Override public void testSkipped( ReportEntry report ) { events.add( TEST_SKIPPED ); testIgnored.incrementAndGet(); } @Override public void testExecutionSkippedByUser() { } public void testSkippedByUser( ReportEntry report ) { testSkipped( report ); } public int getTestSucceeded() { return testSucceeded.get(); } public int getTestFailed() { return testFailed.get(); } @Override public void testError( ReportEntry report ) { testError.incrementAndGet(); } @Override public void testFailed( ReportEntry report ) { testFailed.incrementAndGet(); } @Override public void testAssumptionFailure( ReportEntry report ) { } public boolean containsNotification( String event ) { return events.contains( event ); } } maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/test/000077500000000000000000000000001330756104600264645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/test/java/000077500000000000000000000000001330756104600274055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/test/java/org/000077500000000000000000000000001330756104600301745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/test/java/org/apache/000077500000000000000000000000001330756104600314155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600325235ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600342705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/test/java/org/apache/mavencommon/000077500000000000000000000000001330756104600355605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefirejunit4/000077500000000000000000000000001330756104600367755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/commonJUnit4ProviderUtilTest.java000066400000000000000000000075071330756104600441770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4package org.apache.maven.surefire.common.junit4; /* * 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. */ import junit.framework.TestCase; import org.junit.runner.Description; import org.junit.runner.notification.Failure; import java.util.ArrayList; import java.util.List; import java.util.Set; import static org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil.*; /** * @author Qingzhou Luo */ public class JUnit4ProviderUtilTest extends TestCase { public void testGenerateFailingTestDescriptions() { List failures = new ArrayList(); Description test1Description = Description.createTestDescription( T1.class, "testOne" ); Description test2Description = Description.createTestDescription( T1.class, "testTwo" ); Description test3Description = Description.createTestDescription( T2.class, "testThree" ); Description test4Description = Description.createTestDescription( T2.class, "testFour" ); Description test5Description = Description.createSuiteDescription( "Test mechanism" ); failures.add( new Failure( test1Description, new AssertionError() ) ); failures.add( new Failure( test2Description, new AssertionError() ) ); failures.add( new Failure( test3Description, new RuntimeException() ) ); failures.add( new Failure( test4Description, new AssertionError() ) ); failures.add( new Failure( test5Description, new RuntimeException() ) ); Set result = generateFailingTestDescriptions( failures ); assertEquals( 4, result.size() ); assertTrue( result.contains( test1Description) ); assertTrue( result.contains( test2Description) ); assertTrue( result.contains( test3Description) ); assertTrue( result.contains( test4Description) ); } public void testIllegalTestDescription$NegativeTest() { Description test = Description.createSuiteDescription( "someTestMethod" ); ClassMethod classMethod = cutTestClassAndMethod( test ); assertFalse( classMethod.isValid() ); } public void testOldJUnitParameterizedDescriptionParser() { Description test = Description.createTestDescription( T1.class, " \n testMethod[5] " ); assertEquals( " \n testMethod[5] (" + T1.class.getName() + ")", test.getDisplayName() ); ClassMethod classMethod = cutTestClassAndMethod( test ); assertTrue( classMethod.isValid() ); assertEquals( "testMethod[5]", classMethod.getMethod() ); assertEquals( T1.class.getName(), classMethod.getClazz() ); } public void testNewJUnitParameterizedDescriptionParser() { Description test = Description.createTestDescription( T1.class, "flakyTest[3: (Test11); Test12; Test13;]" ); ClassMethod classMethod = cutTestClassAndMethod( test ); assertTrue( classMethod.isValid() ); assertEquals( "flakyTest[3: (Test11); Test12; Test13;]", classMethod.getMethod() ); assertEquals( T1.class.getName(), classMethod.getClazz() ); } private static class T1 { } private static class T2 { } } JUnit4Reflector40Test.java000066400000000000000000000052471330756104600436370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4package org.apache.maven.surefire.common.junit4; /* * 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. */ import junit.framework.TestCase; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.Description; /** * @author Kristian Rosenvold */ public class JUnit4Reflector40Test extends TestCase { public void testGetAnnotatedIgnore() { Description desc = Description.createTestDescription( IgnoreWithDescription.class, "testSomething2" ); Ignore annotatedIgnore = JUnit4Reflector.getAnnotatedIgnore( desc ); assertNull( annotatedIgnore ); } private static final String reason = "Ignorance is bliss"; public static class IgnoreWithDescription { @Test @Ignore( reason ) public void testSomething2() { } } public void testCreateIgnored() { Ignore ignore = JUnit4Reflector.createIgnored( "error" ); assertNotNull( ignore ); assertNotNull( ignore.value() ); assertEquals( "error", ignore.value() ); } public void testCreateDescription() { Ignore ignore = JUnit4Reflector.createIgnored( "error" ); Description description = JUnit4Reflector.createDescription( "exception", ignore ); assertEquals( "exception", description.getDisplayName() ); assertEquals( "exception", description.toString() ); assertEquals( 0, description.getChildren().size() ); // JUnit 4 description does not get annotations Ignore annotatedIgnore = JUnit4Reflector.getAnnotatedIgnore( description ); assertNull( annotatedIgnore ); } public void testCreatePureDescription() { Description description = JUnit4Reflector.createDescription( "exception" ); assertEquals( "exception", description.getDisplayName() ); assertEquals( "exception", description.toString() ); assertEquals( 0, description.getChildren().size() ); } } JUnit4RunListenerTest.java000066400000000000000000000070301330756104600440100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4package org.apache.maven.surefire.common.junit4; /* * 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. */ import java.util.concurrent.CountDownLatch; import junit.framework.TestCase; import org.apache.maven.surefire.junit4.MockReporter; import junit.framework.Assert; import org.apache.maven.surefire.util.internal.DaemonThreadFactory; import org.junit.Test; import org.junit.runner.Description; import org.junit.runner.Request; import org.junit.runner.Runner; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunListener; import org.junit.runner.notification.RunNotifier; /** * @author Kristian Rosenvold */ public class JUnit4RunListenerTest extends TestCase { public void testTestStarted() throws Exception { RunListener jUnit4TestSetReporter = new JUnit4RunListener( new MockReporter() ); Runner junitTestRunner = Request.classes( "abc", STest1.class, STest2.class ).getRunner(); RunNotifier runNotifier = new RunNotifier(); runNotifier.addListener( jUnit4TestSetReporter ); junitTestRunner.run( runNotifier ); } public void testParallelInvocations() throws Exception { final MockReporter reporter = new MockReporter(); final RunListener jUnit4TestSetReporter = new JUnit4RunListener( reporter ); final CountDownLatch countDownLatch = new CountDownLatch( 1 ); final Description testSomething = Description.createTestDescription( STest1.class, "testSomething" ); final Description testSomething2 = Description.createTestDescription( STest2.class, "testSomething2" ); jUnit4TestSetReporter.testStarted( testSomething ); DaemonThreadFactory.newDaemonThread( new Runnable() { @Override public void run() { try { jUnit4TestSetReporter.testStarted( testSomething2 ); jUnit4TestSetReporter.testFailure( new Failure( testSomething2, new AssertionError( "Fud" ) ) ); jUnit4TestSetReporter.testFinished( testSomething2 ); countDownLatch.countDown(); } catch ( Exception e ) { throw new RuntimeException( e ); } } } ).start(); countDownLatch.await(); jUnit4TestSetReporter.testFinished( testSomething ); Assert.assertEquals( "Failing tests", 1, reporter.getTestFailed() ); Assert.assertEquals( "Succeeded tests", 1, reporter.getTestSucceeded() ); } public static class STest1 { @Test public void testSomething() { } } public static class STest2 { @Test public void testSomething2() { } } } junit4/000077500000000000000000000000001330756104600355055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefireJUnit4TestCheckerTest.java000066400000000000000000000144161330756104600424600ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/junit4package org.apache.maven.surefire.junit4; /* * 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. */ import java.util.Collections; import java.util.Set; import org.apache.maven.surefire.common.junit4.JUnit4TestChecker; import org.apache.maven.surefire.testset.TestSetFailedException; import junit.framework.TestCase; import junit.framework.TestResult; import org.junit.Test; import org.junit.internal.runners.InitializationError; import org.junit.runner.Description; import org.junit.runner.RunWith; import org.junit.runner.Runner; import org.junit.runner.notification.RunNotifier; import org.junit.runners.Suite; /** * @author Kristian Rosenvold */ public class JUnit4TestCheckerTest extends TestCase { private final JUnit4TestChecker jUnit4TestChecker = new JUnit4TestChecker( this.getClass().getClassLoader() ); public void testValidJunit4Annotated() throws TestSetFailedException { assertTrue( jUnit4TestChecker.accept( JUnit4TestCheckerTest.class ) ); } public void testValidJunit4itsAJunit3Test() throws TestSetFailedException { assertTrue( jUnit4TestChecker.accept( AlsoValid.class ) ); } public void testValidJunitSubclassWithoutOwnTestmethods() throws TestSetFailedException { assertTrue( jUnit4TestChecker.accept( SubClassWithoutOwnTestMethods.class ) ); } public void testValidSuite() throws TestSetFailedException { assertTrue( jUnit4TestChecker.accept( SuiteValid1.class ) ); } public void testValidCustomSuite() throws TestSetFailedException { assertTrue( jUnit4TestChecker.accept( SuiteValid2.class ) ); } public void testValidCustomRunner() throws TestSetFailedException { assertTrue( jUnit4TestChecker.accept( SuiteValidCustomRunner.class ) ); } public void testInvalidTest() throws TestSetFailedException { assertFalse( jUnit4TestChecker.accept( NotValidTest.class ) ); } public void testDontAcceptAbstractClasses() { assertFalse( jUnit4TestChecker.accept( BaseClassWithTest.class ) ); } public void testSuiteOnlyTest() { assertTrue( jUnit4TestChecker.accept( SuiteOnlyTest.class ) ); } public void testCustomSuiteOnlyTest() { assertTrue( jUnit4TestChecker.accept( CustomSuiteOnlyTest.class ) ); } public void testInnerClassNotAutomaticallyTc() { assertTrue( jUnit4TestChecker.accept( NestedTC.class ) ); assertFalse( jUnit4TestChecker.accept( NestedTC.Inner.class ) ); } public void testCannotLoadRunWithAnnotation() throws Exception { Class testClass = SimpleJUnit4TestClass.class; ClassLoader testClassLoader = testClass.getClassLoader(); // Emulate an OSGi classloader which filters on package level. // Use a classloader which can only load classes in package org.junit, // e.g. org.junit.Test, but no classes from other packages, // in particular org.junit.runner.RunWith can't be loaded Set visiblePackages = Collections.singleton( "org.junit" ); PackageFilteringClassLoader filteringTestClassloader = new PackageFilteringClassLoader( testClassLoader, visiblePackages ); JUnit4TestChecker checker = new JUnit4TestChecker( filteringTestClassloader ); assertTrue( checker.accept( testClass ) ); } public static class AlsoValid extends TestCase { public void testSomething() { } } public static class SuiteOnlyTest { public static junit.framework.Test suite() { return null; } } public static class CustomSuiteOnlyTest { public static MySuite2 suite() { return null; } } public static class MySuite2 implements junit.framework.Test { @Override public int countTestCases() { return 0; } @Override public void run( TestResult testResult ) { } } @SuppressWarnings( { "UnusedDeclaration" } ) public static class NotValidTest { public void testSomething() { } } public abstract static class BaseClassWithTest { @Test public void weAreAlsoATest() { } } public static class SubClassWithoutOwnTestMethods extends BaseClassWithTest { } @RunWith( Suite.class ) public static class SuiteValid1 { public void testSomething() { } } class CustomRunner extends Runner { @Override public Description getDescription() { return Description.createSuiteDescription( "CustomRunner" ); } @Override public void run( RunNotifier runNotifier ) { } } @RunWith( CustomRunner.class ) public static class SuiteValidCustomRunner { public void testSomething() { } } @RunWith( MySuite.class ) public static class SuiteValid2 { public void testSomething() { } } public static class SimpleJUnit4TestClass { @Test public void testMethod() { } } class MySuite extends Suite { MySuite( Class klass ) throws InitializationError { super( klass ); } } class NestedTC extends TestCase { public class Inner { } } } PackageFilteringClassLoader.java000066400000000000000000000035041330756104600436660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/junit4package org.apache.maven.surefire.junit4; /* * 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. */ import java.util.Set; /** * Emulate an OSGi classloader which only loads packages that have been imported via Import-Package MANIFEST header. */ public class PackageFilteringClassLoader extends ClassLoader { private ClassLoader wrapped; private Set visiblePackages; public PackageFilteringClassLoader( ClassLoader wrapped, Set visiblePackages ) { this.wrapped = wrapped; this.visiblePackages = visiblePackages; } @Override public Class loadClass( String className ) throws ClassNotFoundException { String packageName = ""; int lastDot = className.lastIndexOf( '.' ); if ( lastDot != -1 ) { packageName = className.substring( 0, lastDot ); } if ( visiblePackages.contains( packageName ) ) { return wrapped.loadClass( className ); } else { throw new ClassNotFoundException( className ); } } } maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/000077500000000000000000000000001330756104600250065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/pom.xml000066400000000000000000000062471330756104600263340ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire-providers 2.22.0 common-junit48 Shared JUnit48 Provider Code Shared JUnit48 Provider Code junit junit 4.8.1 provided org.apache.maven.surefire common-junit4 ${project.version} junit junit org.apache.maven.surefire surefire-grouper org.apache.maven.plugins maven-shade-plugin package shade true org.codehaus.plexus:plexus-utils org.codehaus.plexus.util org.apache.maven.surefire.commonjunit48.org.codehaus.plexus.util maven-surefire-plugin **/JUnit4SuiteTest.java maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/000077500000000000000000000000001330756104600255755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/000077500000000000000000000000001330756104600265215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/000077500000000000000000000000001330756104600274425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/000077500000000000000000000000001330756104600302315ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/000077500000000000000000000000001330756104600314525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600325605ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600343255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/mavencommon/000077500000000000000000000000001330756104600356155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefirejunit48/000077500000000000000000000000001330756104600371225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/commonAndFilter.java000066400000000000000000000033621330756104600416410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; /* * 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. */ import org.junit.runner.Description; import org.junit.runner.manipulation.Filter; final class AndFilter extends Filter { private final Filter[] filters; AndFilter( Filter... filters ) { this.filters = filters; } @Override public boolean shouldRun( Description description ) { for ( Filter filter : filters ) { if ( !filter.shouldRun( description ) ) { return false; } } return true; } @Override public String describe() { StringBuilder description = new StringBuilder(); for ( int i = 0; i < filters.length; i++ ) { description.append( filters[i].describe() ); if ( i != filters.length - 1 ) { description.append( " AND " ); } } return description.toString(); } } CombinedCategoryFilter.java000066400000000000000000000063161330756104600443570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; /* * 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. */ import org.junit.runner.Description; import org.junit.runner.manipulation.Filter; import java.util.Collection; final class CombinedCategoryFilter extends Filter { private final Collection includedFilters; private final Collection excludedFilters; CombinedCategoryFilter( Collection includedFilters, Collection excludedFilters ) { this.includedFilters = includedFilters; this.excludedFilters = excludedFilters; } @Override public boolean shouldRun( Description description ) { return ( includedFilters.isEmpty() || anyFilterMatchesDescription( includedFilters, description ) ) && ( excludedFilters.isEmpty() || allFiltersMatchDescription( excludedFilters, description ) ); } private boolean anyFilterMatchesDescription( Collection filters, Description description ) { for ( Filter f : filters ) { if ( f.shouldRun( description ) ) { return true; } } return false; } private boolean allFiltersMatchDescription( Collection filters, Description description ) { for ( Filter f : filters ) { if ( !f.shouldRun( description ) ) { return false; } } return true; } @Override public String describe() { StringBuilder sb = new StringBuilder(); if ( !includedFilters.isEmpty() ) { sb.append( "(" ); sb.append( joinFilters( includedFilters, " OR " ) ); sb.append( ")" ); if ( !excludedFilters.isEmpty() ) { sb.append( " AND " ); } } if ( !excludedFilters.isEmpty() ) { sb.append( "NOT (" ); sb.append( joinFilters( includedFilters, " OR " ) ); sb.append( ")" ); } return sb.toString(); } private String joinFilters( Collection filters, String sep ) { boolean isFirst = true; StringBuilder sb = new StringBuilder(); for ( Filter f : filters ) { if ( !isFirst ) { sb.append( sep ); } sb.append( f.describe() ); isFirst = false; } return sb.toString(); } } FilterFactory.java000066400000000000000000000110261330756104600425420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; /* * 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. */ import org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil; import org.apache.maven.surefire.group.match.GroupMatcher; import org.apache.maven.surefire.group.parse.GroupMatcherParser; import org.apache.maven.surefire.group.parse.ParseException; import org.apache.maven.surefire.testset.TestListResolver; import org.junit.runner.Description; import org.junit.runner.manipulation.Filter; import java.util.Map; import static org.apache.maven.surefire.booter.ProviderParameterNames.TESTNG_EXCLUDEDGROUPS_PROP; import static org.apache.maven.surefire.booter.ProviderParameterNames.TESTNG_GROUPS_PROP; import static org.apache.maven.surefire.util.internal.StringUtils.isNotBlank; /** * @author Todd Lipcon */ public class FilterFactory { private final ClassLoader testClassLoader; public FilterFactory( ClassLoader testClassLoader ) { this.testClassLoader = testClassLoader; } /** * @return {@code true} if non-blank * {@link org.apache.maven.surefire.booter.ProviderParameterNames#TESTNG_GROUPS_PROP} and/or * {@link org.apache.maven.surefire.booter.ProviderParameterNames#TESTNG_EXCLUDEDGROUPS_PROP} exists. */ public boolean canCreateGroupFilter( Map providerProperties ) { String groups = providerProperties.get( TESTNG_GROUPS_PROP ); String excludedGroups = providerProperties.get( TESTNG_EXCLUDEDGROUPS_PROP ); return isNotBlank( groups ) || isNotBlank( excludedGroups ); } /** * Creates filter using he key * {@link org.apache.maven.surefire.booter.ProviderParameterNames#TESTNG_GROUPS_PROP} and/or * {@link org.apache.maven.surefire.booter.ProviderParameterNames#TESTNG_EXCLUDEDGROUPS_PROP}. */ public Filter createGroupFilter( Map providerProperties ) { String groups = providerProperties.get( TESTNG_GROUPS_PROP ); GroupMatcher included = null; if ( isNotBlank( groups ) ) { try { included = new GroupMatcherParser( groups ).parse(); } catch ( ParseException e ) { throw new IllegalArgumentException( "Invalid group expression: '" + groups + "'. Reason: " + e.getMessage(), e ); } } String excludedGroups = providerProperties.get( TESTNG_EXCLUDEDGROUPS_PROP ); GroupMatcher excluded = null; if ( isNotBlank( excludedGroups ) ) { try { excluded = new GroupMatcherParser( excludedGroups ).parse(); } catch ( ParseException e ) { throw new IllegalArgumentException( "Invalid group expression: '" + excludedGroups + "'. Reason: " + e.getMessage(), e ); } } if ( included != null && testClassLoader != null ) { included.loadGroupClasses( testClassLoader ); } if ( excluded != null && testClassLoader != null ) { excluded.loadGroupClasses( testClassLoader ); } return new GroupMatcherCategoryFilter( included, excluded ); } public Filter createMethodFilter( String requestedTestMethod ) { return new MethodFilter( requestedTestMethod ); } public Filter createMethodFilter( TestListResolver resolver ) { return new MethodFilter( resolver ); } public Filter createMatchAnyDescriptionFilter( Iterable descriptions ) { return JUnit4ProviderUtil.createMatchAnyDescriptionFilter( descriptions ); } public Filter and( Filter filter1, Filter filter2 ) { return new AndFilter( filter1, filter2 ); } } GroupMatcherCategoryFilter.java000066400000000000000000000115141330756104600452330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; /* * 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. */ import org.apache.maven.surefire.group.match.AndGroupMatcher; import org.apache.maven.surefire.group.match.GroupMatcher; import org.apache.maven.surefire.group.match.InverseGroupMatcher; import org.junit.experimental.categories.Category; import org.junit.runner.Description; import org.junit.runner.manipulation.Filter; import java.util.ArrayList; import java.util.HashSet; import java.util.Set; import static java.util.Collections.addAll; import static org.junit.runner.Description.createSuiteDescription; final class GroupMatcherCategoryFilter extends Filter { private final AndGroupMatcher matcher; GroupMatcherCategoryFilter( GroupMatcher included, GroupMatcher excluded ) { GroupMatcher invertedExclude = excluded == null ? null : new InverseGroupMatcher( excluded ); if ( included != null || invertedExclude != null ) { matcher = new AndGroupMatcher(); if ( included != null ) { matcher.addMatcher( included ); } if ( invertedExclude != null ) { matcher.addMatcher( invertedExclude ); } } else { matcher = null; } } @Override public boolean shouldRun( Description description ) { if ( description.getMethodName() == null || description.getTestClass() == null ) { return shouldRun( description, null, null ); } else { Class testClass = description.getTestClass(); return shouldRun( description, createSuiteDescription( testClass ), testClass ); } } private static void findSuperclassCategories( Set> cats, Class clazz ) { if ( clazz != null && clazz.getSuperclass() != null ) { Category cat = clazz.getSuperclass().getAnnotation( Category.class ); if ( cat != null ) { addAll( cats, cat.value() ); } else { findSuperclassCategories( cats, clazz.getSuperclass() ); } } } private boolean shouldRun( Description description, Description parent, Class parentClass ) { if ( matcher == null ) { return true; } else { Set> cats = new HashSet>(); Category cat = description.getAnnotation( Category.class ); if ( cat != null ) { addAll( cats, cat.value() ); } if ( parent != null ) { cat = parent.getAnnotation( Category.class ); if ( cat != null ) { addAll( cats, cat.value() ); } } if ( parentClass != null ) { findSuperclassCategories( cats, parentClass ); } Class testClass = description.getTestClass(); if ( testClass != null ) { cat = testClass.getAnnotation( Category.class ); if ( cat != null ) { addAll( cats, cat.value() ); } } cats.remove( null ); boolean result = matcher.enabled( cats.toArray( new Class[cats.size()] ) ); if ( !result ) { ArrayList children = description.getChildren(); if ( children != null ) { for ( Description child : children ) { if ( shouldRun( child, description, null ) ) { result = true; break; } } } } return result; } } @Override public String describe() { return matcher == null ? "ANY" : matcher.toString(); } } InvertedFilter.java000066400000000000000000000024611330756104600427160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; /* * 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. */ import org.junit.runner.Description; import org.junit.runner.manipulation.Filter; final class InvertedFilter extends Filter { private final Filter filter; InvertedFilter( Filter filter ) { this.filter = filter; } @Override public boolean shouldRun( Description description ) { return !filter.shouldRun( description ); } @Override public String describe() { return filter.describe(); } } JUnit46StackTraceWriter.java000066400000000000000000000035071330756104600443370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; /* * 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. */ import org.apache.maven.surefire.common.junit4.JUnit4StackTraceWriter; import org.junit.runner.notification.Failure; /** * A stacktrace writer that requires at least junit 4.6 to run. Note that we only use this for 4.8 and higher *
* Writes out a specific {@link org.junit.runner.notification.Failure} for * surefire as a stacktrace. * * @author Karl M. Davis * @author Kristian Rosenvold */ public class JUnit46StackTraceWriter extends JUnit4StackTraceWriter { /** * Constructor. * * @param junitFailure the {@link org.junit.runner.notification.Failure} that this will be operating on */ public JUnit46StackTraceWriter( Failure junitFailure ) { super( junitFailure ); } @Override protected final String getTestClassName() { return junitFailure.getDescription().getClassName(); } @Override protected String getTestMethodName() { return junitFailure.getDescription().getMethodName(); } } JUnit48Reflector.java000066400000000000000000000034111330756104600430370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; /* * 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. */ import static org.apache.maven.surefire.util.ReflectionUtils.tryLoadClass; /** * @author Kristian Rosenvold */ public final class JUnit48Reflector { private static final String CATEGORIES = "org.junit.experimental.categories.Categories"; private static final String CATEGORY = "org.junit.experimental.categories.Category"; private final Class categories; private final Class category; public JUnit48Reflector( ClassLoader testClassLoader ) { categories = tryLoadClass( testClassLoader, CATEGORIES ); category = tryLoadClass( testClassLoader, CATEGORY ); } public boolean isJUnit48Available() { return categories != null; } boolean isCategoryAnnotationPresent( Class clazz ) { return clazz != null && category != null && ( clazz.getAnnotation( category ) != null || isCategoryAnnotationPresent( clazz.getSuperclass() ) ); } } JUnit48TestChecker.java000066400000000000000000000050001330756104600433120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; /* * 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. */ import org.apache.maven.surefire.NonAbstractClassFilter; import org.apache.maven.surefire.common.junit4.JUnit4TestChecker; import org.apache.maven.surefire.util.ScannerFilter; import org.junit.experimental.runners.Enclosed; /** * Looks for additional junit48-like features * @author Geoff Denning * @author Kristian Rosenvold */ public class JUnit48TestChecker implements ScannerFilter { private final NonAbstractClassFilter nonAbstractClassFilter; private final JUnit4TestChecker jUnit4TestChecker; public JUnit48TestChecker( ClassLoader testClassLoader ) { this.jUnit4TestChecker = new JUnit4TestChecker( testClassLoader ); this.nonAbstractClassFilter = new NonAbstractClassFilter(); } @Override public boolean accept( Class testClass ) { return jUnit4TestChecker.accept( testClass ) || isAbstractWithEnclosedRunner( testClass ); } @SuppressWarnings( { "unchecked" } ) private boolean isAbstractWithEnclosedRunner( Class testClass ) { return jUnit4TestChecker.isRunWithPresentInClassLoader() && isAbstract( testClass ) && isRunWithEnclosedRunner( testClass ); } private boolean isRunWithEnclosedRunner( Class testClass ) { @SuppressWarnings( "unchecked" ) org.junit.runner.RunWith runWithAnnotation = (org.junit.runner.RunWith) testClass.getAnnotation( org.junit.runner.RunWith.class ); return ( runWithAnnotation != null && Enclosed.class.equals( runWithAnnotation.value() ) ); } private boolean isAbstract( Class testClass ) { return !nonAbstractClassFilter.accept( testClass ); } } MethodFilter.java000066400000000000000000000051041330756104600423530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; /* * 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. */ import org.apache.maven.surefire.testset.ResolvedTest; import org.apache.maven.surefire.testset.TestListResolver; import org.junit.runner.Description; import org.junit.runner.manipulation.Filter; import java.util.Collection; import java.util.LinkedHashSet; final class MethodFilter extends Filter { private final CombinedCategoryFilter combinedFilter; MethodFilter( String requestString ) { this( new TestListResolver( requestString ) ); } MethodFilter( TestListResolver testResolver ) { Collection includedFilters = new LinkedHashSet(); Collection excludedFilters = new LinkedHashSet(); for ( ResolvedTest test : testResolver.getIncludedPatterns() ) { includedFilters.add( new RequestedTest( test, true ) ); } for ( ResolvedTest test : testResolver.getExcludedPatterns() ) { excludedFilters.add( new RequestedTest( test, false ) ); } combinedFilter = new CombinedCategoryFilter( includedFilters, excludedFilters ); } @Override public boolean shouldRun( Description description ) { if ( description.isEmpty() ) { return false; } else if ( description.isTest() ) { return combinedFilter.shouldRun( description ); } else { for ( Description o : description.getChildren() ) { if ( combinedFilter.shouldRun( o ) || shouldRun( o ) ) { return true; } } return false; } } @Override public String describe() { return combinedFilter.describe(); } } OrFilter.java000066400000000000000000000033551330756104600415210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; /* * 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. */ import org.junit.runner.Description; import org.junit.runner.manipulation.Filter; final class OrFilter extends Filter { private final Filter[] filters; OrFilter( Filter[] filters ) { this.filters = filters; } @Override public boolean shouldRun( Description description ) { for ( Filter filter : filters ) { if ( filter.shouldRun( description ) ) { return true; } } return false; } @Override public String describe() { StringBuilder description = new StringBuilder(); for ( int i = 0; i < filters.length; i++ ) { description.append( filters[i].describe() ); if ( i != filters.length - 1 ) { description.append( " OR " ); } } return description.toString(); } } RequestedTest.java000066400000000000000000000051261330756104600425720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/main/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; /* * 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. */ import org.apache.maven.surefire.testset.ResolvedTest; import org.junit.runner.Description; import org.junit.runner.manipulation.Filter; final class RequestedTest extends Filter { private static final String CLASS_FILE_EXTENSION = ".class"; private final ResolvedTest test; private final boolean isPositiveFilter; RequestedTest( ResolvedTest test, boolean isPositiveFilter ) { this.test = test; this.isPositiveFilter = isPositiveFilter; } @Override public boolean shouldRun( Description description ) { Class realTestClass = description.getTestClass(); String methodName = description.getMethodName(); if ( realTestClass == null && methodName == null ) { return true; } else { String testClass = classFile( realTestClass ); return isPositiveFilter ? test.matchAsInclusive( testClass, methodName ) : !test.matchAsExclusive( testClass, methodName ); } } @Override public String describe() { String description = test.toString(); return description.isEmpty() ? "*" : description; } @Override public boolean equals( Object o ) { return this == o || o != null && getClass() == o.getClass() && equals( (RequestedTest) o ); } private boolean equals( RequestedTest o ) { return isPositiveFilter == o.isPositiveFilter && test.equals( o.test ); } @Override public int hashCode() { return test.hashCode(); } private String classFile( Class realTestClass ) { return realTestClass == null ? null : realTestClass.getName().replace( '.', '/' ) + CLASS_FILE_EXTENSION; } } maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/000077500000000000000000000000001330756104600265545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/000077500000000000000000000000001330756104600274755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/000077500000000000000000000000001330756104600302645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/000077500000000000000000000000001330756104600315055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600326135ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600343605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/mavencommon/000077500000000000000000000000001330756104600356505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefirejunit48/000077500000000000000000000000001330756104600371555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/commonFilterFactoryTest.java000066400000000000000000001306251330756104600434440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; /* * 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. */ import org.apache.maven.shared.utils.io.MatchPatterns; import org.apache.maven.surefire.common.junit48.tests.pt.PT; import org.apache.maven.surefire.testset.ResolvedTest; import org.apache.maven.surefire.testset.TestListResolver; import org.junit.Test; import org.junit.runner.Description; import org.junit.runner.JUnitCore; import org.junit.runner.Request; import org.junit.runner.Result; import org.junit.runner.RunWith; import org.junit.runner.manipulation.Filter; import java.io.File; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import static org.junit.runner.Description.createSuiteDescription; import static org.junit.runner.Description.createTestDescription; import static org.junit.Assert.*; public class FilterFactoryTest { @RunWith( org.junit.runners.Suite.class ) @org.junit.runners.Suite.SuiteClasses( { FirstClass.class, SecondClass.class } ) static public class Suite { } static public class FirstClass { @Test public void testMethod() { //System.out.println( "FirstClass#testMethod" ); } @Test public void secondTestMethod() { //System.out.println( "FirstClass#secondTestMethod" ); } @Test public void otherMethod() { //System.out.println( "FirstClass#otherMethod" ); } } static public class SecondClass { @Test public void testMethod() { //System.out.println( "SecondClass#testMethod" ); } @Test public void secondTestMethod() { //System.out.println( "SecondClass#secondTestMethod" ); } } static public class ThirdClass { @Test public void testMethod() { //System.out.println( "ThirdClass#testMethod" ); } @Test public void secondTestMethod() { //System.out.println( "ThirdClass#secondTestMethod" ); } } private static final Description testMethod = createTestDescription( FirstClass.class, "testMethod" ); private static final Description secondTestMethod = createTestDescription( FirstClass.class, "secondTestMethod" ); private static final Description otherMethod = createTestDescription( FirstClass.class, "otherMethod" ); private static final Description testMethodInSecondClass = createTestDescription( SecondClass.class, "testMethod" ); private static final Description secondTestMethodInSecondClass = createTestDescription( SecondClass.class, "secondTestMethod" ); private static final String firstClassName = FirstClass.class.getName().replace( '.', '/' ); private static final String secondClassName = SecondClass.class.getName().replace( '.', '/' ); private static final String firstClassRegex = FirstClass.class.getName().replace( "$", "\\$" ); private static final String secondClassRegex = SecondClass.class.getName().replace( "$", "\\$" ); private Filter createMethodFilter( String requestString ) { return new FilterFactory( getClass().getClassLoader() ).createMethodFilter( requestString ); } @Test public void testSanity() { ResolvedTest test = new ResolvedTest( ResolvedTest.Type.CLASS, " \t \n ", true ); assertNull( test.getTestClassPattern() ); assertNull( test.getTestMethodPattern() ); assertFalse( test.hasTestClassPattern() ); assertFalse( test.hasTestMethodPattern() ); assertTrue( test.isEmpty() ); assertTrue( test.isRegexTestClassPattern() ); assertFalse( test.isRegexTestMethodPattern() ); test = new ResolvedTest( ResolvedTest.Type.METHOD, " \n \t ", true ); assertNull( test.getTestClassPattern() ); assertNull( test.getTestMethodPattern() ); assertFalse( test.hasTestClassPattern() ); assertFalse( test.hasTestMethodPattern() ); assertTrue( test.isEmpty() ); assertFalse( test.isRegexTestClassPattern() ); assertTrue( test.isRegexTestMethodPattern() ); test = new ResolvedTest( ResolvedTest.Type.METHOD, " \n ", false ); assertNull( test.getTestClassPattern() ); assertNull( test.getTestMethodPattern() ); assertFalse( test.hasTestClassPattern() ); assertFalse( test.hasTestMethodPattern() ); assertTrue( test.isEmpty() ); assertFalse( test.isRegexTestClassPattern() ); assertFalse( test.isRegexTestMethodPattern() ); test = new ResolvedTest( " \n \t ", " \n \t ", false ); assertNull( test.getTestClassPattern() ); assertNull( test.getTestMethodPattern() ); assertFalse( test.hasTestClassPattern() ); assertFalse( test.hasTestMethodPattern() ); assertTrue( test.isEmpty() ); assertFalse( test.isRegexTestClassPattern() ); assertFalse( test.isRegexTestMethodPattern() ); } @Test public void testNegativeIllegalRegex() { try { new TestListResolver( "#%regex[.*.Test.class]" ); } catch ( IllegalArgumentException e ) { // expected in junit 3.x } } @Test public void testNegativeIllegalRegex2() { try { new TestListResolver( "%regex[.*.Test.class]#" ); } catch ( IllegalArgumentException e ) { // expected in junit 3.x } } @Test public void testNegativeEmptyRegex() { TestListResolver resolver = new TestListResolver( "%regex[ ]" ); assertTrue( resolver.getExcludedPatterns().isEmpty() ); assertTrue( resolver.getIncludedPatterns().isEmpty() ); assertTrue( resolver.isEmpty() ); assertEquals( 0, resolver.getPluginParameterTest().length() ); assertFalse( resolver.hasExcludedMethodPatterns() ); assertFalse( resolver.hasIncludedMethodPatterns() ); assertFalse( resolver.hasMethodPatterns() ); } @Test public void testNegativeEmptyRegexWithHash() { TestListResolver resolver = new TestListResolver( "%regex[# ]" ); assertTrue( resolver.getExcludedPatterns().isEmpty() ); assertTrue( resolver.getIncludedPatterns().isEmpty() ); assertTrue( resolver.isEmpty() ); assertEquals( 0, resolver.getPluginParameterTest().length() ); assertFalse( resolver.hasExcludedMethodPatterns() ); assertFalse( resolver.hasIncludedMethodPatterns() ); assertFalse( resolver.hasMethodPatterns() ); } @Test public void testNegativeRegexWithEmptyMethod() { TestListResolver resolver = new TestListResolver( "%regex[.*.Test.class# ]" ); assertFalse( resolver.isEmpty() ); assertTrue( resolver.getExcludedPatterns().isEmpty() ); assertFalse( resolver.getIncludedPatterns().isEmpty() ); assertEquals( 1, resolver.getIncludedPatterns().size() ); assertEquals( "%regex[.*.Test.class]", resolver.getPluginParameterTest() ); assertFalse( resolver.hasExcludedMethodPatterns() ); assertFalse( resolver.hasIncludedMethodPatterns() ); assertFalse( resolver.hasMethodPatterns() ); } @Test public void testBackwardsCompatibilityNullMethodFilter() { Filter filter = createMethodFilter( null ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 5, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testBackwardsCompatibilityEmptyMethodFilter() { Filter filter = createMethodFilter( "" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 5, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testBackwardsCompatibilityBlankMethodFilter() { Filter filter = createMethodFilter( " \n" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 5, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testBackwardsCompatibilityTestParameterClass() { Filter filter = createMethodFilter( firstClassName ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 3, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testBackwardsCompatibilityTestParameterJavaClass() { Filter filter = createMethodFilter( firstClassName + ".java" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 3, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testBackwardsCompatibilityTestParameterMethod1() { Filter filter = createMethodFilter( firstClassName + ".java#testMethod" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 1, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testBackwardsCompatibilityTestParameterMethod2() { Filter filter = createMethodFilter( firstClassName + "#testMethod" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 1, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testBackwardsCompatibilityTestParameterMethod3() { Filter filter = createMethodFilter( firstClassName + "#testMethod" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 1, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testRegexWithWildcard() { Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".*]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 3, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testRegexWithWildcardClass() { Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".*.class]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 3, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testRegexWithExactClass() { Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".class]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 3, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testRegexWithWildcardJavaClassNegativeTest() { Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".*.class]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 3, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testRegexWithTwoClasses() { Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".*|" + secondClassRegex + ".*]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 5, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testRegexWithTwoClassesComplement() { Filter filter = createMethodFilter( "!%regex[" + firstClassRegex + ".*|" + secondClassRegex + ".*]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 2, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testRegexWithTwoClassesAndOneMethod() { Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".*|" + secondClassRegex + ".* # otherMethod]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 1, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testRegexWithTwoClassesAndOneMethodComplement() { Filter filter = createMethodFilter( "!%regex[" + firstClassRegex + ".*|" + secondClassRegex + ".*# otherMethod]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 6, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testRegexWithTwoClassesAndWildcardMethod() { Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".*|" + secondClassRegex + ".*#test.* ]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 2, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testRegexWithTwoClassesAndRegexMethodComplement() { Filter filter = createMethodFilter( "!%regex[" + firstClassRegex + ".*|" + secondClassRegex + ".*#test.*]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 5, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testRegexWithTwoClassesAndRegexMethods() { Filter filter = createMethodFilter( "%regex[ " + firstClassRegex + ".*|" + secondClassRegex + ".* # test.*|other.* ]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 3, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testRegexWithTwoClassesAndRegexMethodsComplement() { Filter filter = createMethodFilter( "!%regex[" + firstClassRegex + ".*|" + secondClassRegex + ".* # test.*|other.* ]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 4, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testMultipleRegexClasses() { Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".*], %regex[" + secondClassRegex + ".*]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 5, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testMultipleRegexClassesComplement() { Filter filter = createMethodFilter( "!%regex[" + firstClassRegex + ".*] , !%regex[" + secondClassRegex + ".*]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 2, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testMultipleClasses() { Filter filter = createMethodFilter( firstClassName + "," + secondClassName ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 5, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testMultipleClassesMethods() { Filter filter = createMethodFilter( firstClassName + "#other*," + secondClassName + "#*TestMethod" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 2, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testMultipleClassesAndMultipleMethodsWithWildcards() { Filter filter = createMethodFilter( firstClassName + "#other*+second*Method," + secondClassName + "#*TestMethod" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 3, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testMultipleClassesAndMultipleMethodsWithRegex() { Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".class#other.*|second.*Method]," + "%regex[" + secondClassRegex + ".class#.*TestMethod]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 3, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testMultipleClassesAndMultipleMethodsMix() { Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".class # other.*|second.*Method]," + secondClassName + "#*TestMethod" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 3, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testMultipleClassesAndMultipleMethods() { Filter filter = createMethodFilter( firstClassName + "#other*+secondTestMethod," + secondClassName + "#*TestMethod" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 3, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testMultipleClassesComplement() { Filter filter = createMethodFilter( "!" + firstClassName + ",!" + secondClassName ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 2, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testMultipleRegexClassesMethods() { Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".* # test.*|other.*]," + "%regex[" + secondClassRegex + ".*#second.*]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 3, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testMultipleRegexClassesMethodsComplement() { Filter filter = createMethodFilter( "!%regex[" + firstClassRegex + ".* # test.*|other.*]," + "!%regex[" + secondClassRegex + ".*#second.*]" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 4, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testShouldMatchExactMethodName() { Filter exactFilter = createMethodFilter( "#testMethod" ); assertTrue( "exact match on name should run", exactFilter.shouldRun( testMethod ) ); } @Test public void testShouldMatchExactMethodNameComplement() { Filter exactFilter = createMethodFilter( "!#testMethod" ); assertFalse( "should not run testMethod", exactFilter.shouldRun( testMethod ) ); assertTrue( "should run other than testMethod", exactFilter.shouldRun( secondTestMethod ) ); assertFalse( "should not run testMethod", exactFilter.shouldRun( testMethodInSecondClass ) ); assertTrue( "should run other than testMethod", exactFilter.shouldRun( secondTestMethodInSecondClass ) ); exactFilter = createMethodFilter( "!FilterFactoryTest$FirstClass#testMethod" ); assertFalse( "should not run testMethod", exactFilter.shouldRun( testMethod ) ); assertTrue( "should run other than testMethod", exactFilter.shouldRun( secondTestMethod ) ); assertTrue( "should not run testMethod", exactFilter.shouldRun( testMethodInSecondClass ) ); assertTrue( "should run other than testMethod", exactFilter.shouldRun( secondTestMethodInSecondClass ) ); exactFilter = createMethodFilter( "!FilterFactoryTest$FirstClass#testMethod, !FilterFactoryTest$SecondClass#testMethod" ); assertFalse( "should not run testMethod", exactFilter.shouldRun( testMethod ) ); assertTrue( "should run other than testMethod", exactFilter.shouldRun( secondTestMethod ) ); assertFalse( "should not run testMethod", exactFilter.shouldRun( testMethodInSecondClass ) ); assertTrue( "should run other than testMethod", exactFilter.shouldRun( secondTestMethodInSecondClass ) ); } @Test public void testShouldMatchExactMethodNameWithHash() { final Filter exactFilter = createMethodFilter( "#testMethod" ); assertTrue( "exact match on name should run", exactFilter.shouldRun( testMethod ) ); } @Test public void testShouldRunSuiteWithIncludedMethod() { String sourceFile = "pkg" + File.separator + "XMyTest.class"; assertTrue( new TestListResolver( "#testMethod" ).shouldRun( sourceFile, null ) ); } @Test public void testShouldNotRunDifferentMethods() { final Filter exactFilter = createMethodFilter( "#testMethod" ); Description testCase = createSuiteDescription( FirstClass.class ); testCase.addChild( otherMethod ); assertFalse( "exact match test case", exactFilter.shouldRun( testCase ) ); } @Test public void testShouldNotRunExactMethodWithoutClass() { Filter exactFilter = createMethodFilter( "#testMethod" ); assertFalse( "should run containing matching method", exactFilter.shouldRun( secondTestMethod ) ); } @Test public void testShouldNotMatchExactOnOtherMethod() { Filter exactFilter = createMethodFilter( "#testMethod" ); assertFalse( "should not run other methods", exactFilter.shouldRun( otherMethod ) ); } @Test public void testShouldMatchWildCardsInMethodName() { Filter starAtEnd = createMethodFilter( "#test*" ); assertTrue( "match ending with star should run", starAtEnd.shouldRun( testMethod ) ); Filter starAtBeginning = createMethodFilter( "#*Method" ); assertTrue( "match starting with star should run", starAtBeginning.shouldRun( testMethod ) ); Filter starInMiddle = createMethodFilter( "#test*thod" ); assertTrue( "match containing star should run", starInMiddle.shouldRun( testMethod ) ); Filter questionAtEnd = createMethodFilter( "#testMetho?" ); assertTrue( "match ending with question mark should run", questionAtEnd.shouldRun( testMethod ) ); Filter questionAtBeginning = createMethodFilter( "#????Method" ); assertTrue( "match starting with question mark should run", questionAtBeginning.shouldRun( testMethod ) ); Filter questionInMiddle = createMethodFilter( "#testM?thod" ); assertTrue( "match containing question mark should run", questionInMiddle.shouldRun( testMethod ) ); Filter starAndQuestion = createMethodFilter( "#t?st*thod" ); assertTrue( "match containing star and question mark should run", starAndQuestion.shouldRun( testMethod ) ); } @Test public void testShouldMatchExactClassAndMethod() { Filter exactFilter = createMethodFilter( firstClassName + "#testMethod" ); assertTrue( "exact match on name should run", exactFilter.shouldRun( testMethod ) ); } @Test public void testShouldMatchSimpleClassNameWithMethod() { Filter exactFilter = createMethodFilter( "FilterFactoryTest$FirstClass#testMethod" ); assertTrue( "exact match on name should run", exactFilter.shouldRun( testMethod ) ); assertFalse( "other method should not match", exactFilter.shouldRun( otherMethod ) ); } @Test public void testShouldMatchNestedClassAsRegexWithMethod() { Filter exactFilter = createMethodFilter( "%regex[.*.common.junit48.FilterFactoryTest\\$FirstClass.class#testMethod]" ); assertTrue( "exact match on name should run", exactFilter.shouldRun( testMethod ) ); assertFalse( "other method should not match", exactFilter.shouldRun( otherMethod ) ); } @Test public void testShouldMatchNestedCanonicalClassAsRegexWithMethod() { Filter exactFilter = createMethodFilter( "%regex[.*.common.junit48.FilterFactoryTest.FirstClass.class#testMethod]" ); assertTrue( "exact match on name should run", exactFilter.shouldRun( testMethod ) ); assertFalse( "other method should not match", exactFilter.shouldRun( otherMethod ) ); } @Test public void testShouldMatchClassNameWithWildcardAndMethod() { Filter exactFilter = createMethodFilter( "*First*#testMethod" ); assertTrue( "exact match on name should run", exactFilter.shouldRun( testMethod ) ); assertFalse( "other method should not match", exactFilter.shouldRun( otherMethod ) ); } @Test public void testShouldMatchClassNameWithWildcardCompletely() { Filter exactFilter = createMethodFilter( "First*#testMethod" ); assertFalse( "other method should not match", exactFilter.shouldRun( testMethod ) ); assertFalse( "other method should not match", exactFilter.shouldRun( otherMethod ) ); } @Test public void testShouldMatchMultipleMethodsSeparatedByComma() { Filter exactFilter = createMethodFilter( firstClassName + "#testMethod,#secondTestMethod" ); assertTrue( "exact match on name should run", exactFilter.shouldRun( testMethod ) ); assertTrue( "exact match on name should run", exactFilter.shouldRun( secondTestMethod ) ); assertTrue( "exact match on name should run", exactFilter.shouldRun( secondTestMethodInSecondClass ) ); assertFalse( "other method should not match", exactFilter.shouldRun( otherMethod ) ); } @Test public void testShouldMatchMultipleMethodsInSameClassSeparatedByPlus() { Filter exactFilter = createMethodFilter( firstClassName + "#testMethod+secondTestMethod" ); assertTrue( "exact match on name should run", exactFilter.shouldRun( testMethod ) ); assertTrue( "exact match on name should run", exactFilter.shouldRun( secondTestMethod ) ); assertFalse( "method in another class should not match", exactFilter.shouldRun( secondTestMethodInSecondClass ) ); assertFalse( "other method should not match", exactFilter.shouldRun( otherMethod ) ); } @Test public void testShouldRunCompleteClassWhenSeparatedByCommaWithoutHash() { Filter exactFilter = createMethodFilter( firstClassName + "#testMethod," + secondClassName ); assertTrue( "exact match on name should run", exactFilter.shouldRun( testMethod ) ); assertFalse( "other method should not match", exactFilter.shouldRun( secondTestMethod ) ); assertFalse( "other method should not match", exactFilter.shouldRun( otherMethod ) ); assertTrue( "should run complete second class", exactFilter.shouldRun( testMethodInSecondClass ) ); assertTrue( "should run complete second class", exactFilter.shouldRun( secondTestMethodInSecondClass ) ); } @Test public void testShouldRunSuitesContainingExactMethodName() { Description suite = Description.createSuiteDescription( Suite.class ); suite.addChild( testMethod ); suite.addChild( secondTestMethod ); Filter exactFilter = createMethodFilter( "#testMethod" ); assertTrue( "should run suites containing matching method", exactFilter.shouldRun( suite ) ); } @Test public void testShouldSkipSuitesNotContainingExactMethodName() { Filter exactFilter = createMethodFilter( "#otherMethod" ); assertFalse( "should not run method", exactFilter.shouldRun( testMethod ) ); assertFalse( "should not run method", exactFilter.shouldRun( secondTestMethod ) ); Description suite = Description.createSuiteDescription( Suite.class ); suite.addChild( testMethod ); suite.addChild( secondTestMethod ); assertFalse( "should not run suites containing no matches", exactFilter.shouldRun( suite ) ); } @Test public void testSingleMethodWithJUnitCoreSuite() { Filter filter = createMethodFilter( "#testMethod" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( Suite.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 2, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testShouldNotRunNonExistingMethodJUnitCoreSuite() { Filter filter = createMethodFilter( "#nonExisting" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( Suite.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 0, result.getRunCount() );//running the Suite assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testShouldRunNonExistingMethodJUnitCoreSuite() { Filter filter = createMethodFilter( "!#nonExisting" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( Suite.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 5, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testClassAndMethodJUnitCoreSuite() { Filter filter = createMethodFilter( "FilterFactoryTest$FirstClass#testMethod" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( Suite.class, FirstClass.class, SecondClass.class ) .filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 2, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testSingleMethodWithJUnitCoreFirstClass() { Filter filter = createMethodFilter( "#testMethod" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 1, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testWithJUnitCoreFirstClassAndSingleMethod() { Filter filter = createMethodFilter( "FilterFactoryTest$FirstClass#testMethod" ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( FirstClass.class ).filterWith( filter ) ); assertTrue( result.wasSuccessful() ); assertEquals( 1, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testShouldRunSuite() { TestListResolver filter = new TestListResolver( "Su?te" ); filter = TestListResolver.optionallyWildcardFilter( filter ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( Suite.class ).filterWith( new MethodFilter( filter ) ) ); assertTrue( result.wasSuccessful() ); assertEquals( 5, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testShouldRunParameterized() { TestListResolver filter = new TestListResolver( "#testAA[?]+testB?[?], " + "PT#testC*, " + "!PT.java#testCY[?]," + "%regex[.*.tests.pt.PT.class#w.*|x.*T.*]" ); filter = TestListResolver.optionallyWildcardFilter( filter ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( PT.class ).filterWith( new MethodFilter( filter ) ) ); assertTrue( result.wasSuccessful() ); assertEquals( 12, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testShouldRunParameterizedWithPlusDelimiter() { // Running parameterized tests: w12T34, x12T34 and x12T35. // Two parameters "x" and "y" in the test case PT.java change the method descriptions to the following ones: // w12T34[0], w12T34[1] // x12T34[0], x12T34[1] // x12T35[0], x12T35[1] TestListResolver filter = new TestListResolver( "%regex[.*.PT.* # w.*|x(\\d+)T(\\d+)\\[(\\d+)\\]]" ); filter = TestListResolver.optionallyWildcardFilter( filter ); JUnitCore core = new JUnitCore(); Result result = core.run( Request.classes( PT.class ).filterWith( new MethodFilter( filter ) ) ); assertTrue( result.wasSuccessful() ); assertEquals( 6, result.getRunCount() ); assertEquals( 0, result.getFailureCount() ); assertEquals( 0, result.getIgnoreCount() ); } @Test public void testTestListResolver() { assertFalse( new TestListResolver( "b/ATest.java" ).shouldRun( "tests/a/ATest.class", null ) ); assertFalse( new TestListResolver( "b/Test.java" ).shouldRun( "a/ATest.class", null ) ); assertTrue( new TestListResolver( "ATest.java" ).shouldRun( "tests/a/ATest.class", null ) ); assertTrue( new TestListResolver( "a/ATest.java" ).shouldRun( "a/ATest.class", null ) ); assertTrue( new TestListResolver( "**/ATest.java" ).shouldRun( "a/ATest.class", null ) ); Class testsATest = org.apache.maven.surefire.common.junit48.tests.ATest.class; Class aTest = org.apache.maven.surefire.common.junit48.tests.a.ATest.class; assertFalse( new TestListResolver( "b/ATest.java" ).shouldRun( testsATest, null ) ); assertFalse( new TestListResolver( "b/ATest.java" ).shouldRun( aTest, null ) ); assertTrue( new TestListResolver( "ATest.java" ).shouldRun( testsATest, null ) ); assertTrue( new TestListResolver( "a/ATest.java" ).shouldRun( aTest, null ) ); assertTrue( new TestListResolver( "**/ATest.java" ).shouldRun( aTest, null ) ); } @Test public void testShouldRunClassOnly() { Class testsATest = org.apache.maven.surefire.common.junit48.tests.ATest.class; TestListResolver resolver = new TestListResolver( "**/ATest.java#testSuccessTwo" ); assertTrue( resolver.shouldRun( testsATest, null ) ); resolver = new TestListResolver( "**/BTest.java#testSuccessTwo" ); assertFalse( resolver.shouldRun( testsATest, null ) ); } @Test public void testMatchPatterns() { String sourceFile = "pkg" + File.separator + "MyTest.class"; boolean matchPattern = MatchPatterns.from( "**" + File.separator + "MyTest.class" ).matches( sourceFile, true ); assertTrue( matchPattern ); matchPattern = MatchPatterns.from( "MyTest.class" ).matches( sourceFile, true ); assertFalse( matchPattern ); matchPattern = MatchPatterns.from( "MyTest.class" ).matches( "MyTest.class", true ); assertTrue( matchPattern ); matchPattern = MatchPatterns.from( "**" + File.separator + "MyTest.class" ).matches( "MyTest.class", true ); assertTrue( matchPattern ); } @Test public void testNegativePatternOnPackageLessClass() { String sourceFile = "pkg" + File.separator + "XMyTest.class"; assertFalse( new TestListResolver( "**/MyTest.java" ).shouldRun( sourceFile, null ) ); assertFalse( new TestListResolver( "MyTest.java" ).shouldRun( sourceFile, null ) ); assertFalse( new TestListResolver( "MyTest.java" ).shouldRun( "XMyTest.class", null ) ); assertFalse( new TestListResolver( "**/MyTest.java" ).shouldRun( "XMyTest.class", null ) ); } @Test public void testPatternOnPackageLessClass() { String sourceFile = "pkg" + File.separator + "MyTest.class"; assertTrue( new TestListResolver( "**/MyTest.java" ).shouldRun( sourceFile, null ) ); assertTrue( new TestListResolver( "MyTest.java" ).shouldRun( sourceFile, null ) ); assertTrue( new TestListResolver( "MyTest.java" ).shouldRun( "MyTest.class", null ) ); assertTrue( new TestListResolver( "**/MyTest.java" ).shouldRun( "MyTest.class", null ) ); } @Test public void testIncludesExcludes() { Collection inc = Arrays.asList( "**/NotIncludedByDefault.java", "**/*Test.java" ); Collection exc = Collections.singletonList( "**/DontRunTest.*" ); TestListResolver resolver = new TestListResolver( inc, exc ); assertFalse( resolver.shouldRun( "org/test/DontRunTest.class", null ) ); assertTrue( resolver.shouldRun( "org/test/DefaultTest.class", null ) ); assertTrue( resolver.shouldRun( "org/test/NotIncludedByDefault.class", null ) ); } @Test public void testSimple() { TestListResolver resolver = new TestListResolver( "NotIncludedByDefault" ); assertTrue( resolver.shouldRun( "org/test/NotIncludedByDefault.class", null ) ); } @Test public void testFullyQualifiedClass() { TestListResolver resolver = new TestListResolver( "my.package.MyTest" ); assertFalse( resolver.shouldRun( "my/package/AnotherTest.class", null ) ); assertTrue( resolver.shouldRun( "my/package/MyTest.class", null ) ); } } JUnit48ReflectorTest.java000066400000000000000000000034731330756104600437420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; /* * 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. */ import junit.framework.TestCase; import org.junit.experimental.categories.Category; /** * @author Kristian Rosenvold */ public class JUnit48ReflectorTest extends TestCase { public void testIsJUnit48Available() { JUnit48Reflector jUnit48Reflector = new JUnit48Reflector( getClass().getClassLoader() ); assertTrue( jUnit48Reflector.isJUnit48Available() ); } public void testCategoryAnnotation() { JUnit48Reflector jUnit48Reflector = new JUnit48Reflector( getClass().getClassLoader() ); assertTrue( jUnit48Reflector.isCategoryAnnotationPresent( Test1.class ) ); assertTrue( jUnit48Reflector.isCategoryAnnotationPresent( Test3.class ) ); assertFalse( jUnit48Reflector.isCategoryAnnotationPresent( Test2.class ) ); } interface Foo { } @Category( Foo.class ) private class Test1 { } private class Test2 { } private class Test3 extends Test1 { } } JUnit48TestCheckerTest.java000066400000000000000000000040541330756104600442150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; import org.junit.Test; import org.junit.experimental.runners.Enclosed; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /* * 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. */ /** * @author Kristian Rosenvold */ public class JUnit48TestCheckerTest { @Test public void valid48Class() throws Exception { JUnit48TestChecker tc = new JUnit48TestChecker( this.getClass().getClassLoader() ); assertTrue( tc.accept( BasicTest.class ) ); } @Test public void notValid48Class() throws Exception { JUnit48TestChecker tc = new JUnit48TestChecker( this.getClass().getClassLoader() ); assertFalse( tc.accept( BasicTest2.class ) ); } @RunWith( Enclosed.class ) public abstract static class BasicTest { public static class InnerTest { @Test public void testSomething() { } } } @RunWith( Parameterized.class ) public abstract static class BasicTest2 { public static class InnerTest { @Test public void testSomething() { } } } } JUnit4SuiteTest.java000066400000000000000000000026161330756104600430140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48package org.apache.maven.surefire.common.junit48; /* * 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. */ import junit.framework.JUnit4TestAdapter; import junit.framework.Test; import org.junit.runner.RunWith; import org.junit.runners.Suite; /** * Adapt the JUnit4 tests which use only annotations to the JUnit3 test suite. * * @author Tibor Digana (tibor17) * @since 2.19 */ @Suite.SuiteClasses( { FilterFactoryTest.class, JUnit48ReflectorTest.class, JUnit48TestCheckerTest.class } ) @RunWith( Suite.class ) public class JUnit4SuiteTest { public static Test suite() { return new JUnit4TestAdapter( JUnit4SuiteTest.class ); } } tests/000077500000000000000000000000001330756104600403175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48ATest.java000066400000000000000000000015721330756104600422070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/testspackage org.apache.maven.surefire.common.junit48.tests; /* * 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. */ public class ATest { } a/000077500000000000000000000000001330756104600405375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/testsATest.java000066400000000000000000000015741330756104600424310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/tests/apackage org.apache.maven.surefire.common.junit48.tests.a; /* * 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. */ public class ATest { } pt/000077500000000000000000000000001330756104600407425ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/testsPT.java000066400000000000000000000032101330756104600421240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/tests/ptpackage org.apache.maven.surefire.common.junit48.tests.pt; /* * 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. */ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import java.util.Arrays; @RunWith( Parameterized.class ) public class PT { public PT( String x ) { } @Parameterized.Parameters public static Iterable data() { return Arrays.asList( new Object[][]{ { "x" }, { "y" } } ); } @Test public void testAA() { } @Test public void testB5() { } @Test public void testCX() { } @Test public void testCY() { } @Test public void w12T34() { } @Test public void x12T34() { } @Test public void x12T35() { } @Test public void x12t36() { } @Test public void y12t34() { } } maven-surefire-surefire-2.22.0/surefire-providers/pom.xml000066400000000000000000000046701330756104600235370ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire 2.22.0 surefire-providers pom SureFire Providers SureFire Providers Aggregator POM common-junit3 common-java5 common-junit4 common-junit48 surefire-junit3 surefire-junit4 surefire-junit47 surefire-junit-platform surefire-testng-utils surefire-testng org.apache.maven.surefire surefire-api maven-surefire-plugin org.apache.maven.surefire surefire-shadefire 2.12.4 maven-surefire-surefire-2.22.0/surefire-providers/src/000077500000000000000000000000001330756104600230025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/src/site/000077500000000000000000000000001330756104600237465ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/src/site/site.xml000066400000000000000000000021521330756104600254340ustar00rootroot00000000000000 maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/000077500000000000000000000000001330756104600270105ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/pom.xml000066400000000000000000000155161330756104600303350ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire-providers 2.22.0 surefire-junit-platform SureFire JUnit Platform Runner SureFire JUnit Platform Runner 8 Konstantin Lutovich Contributed to the original provider implementation Shintaro Katafuchi Contributed to the original provider implementation Sam Brannen Contributed to the original provider implementation Stefan Bechtold Contributed to the original provider implementation Marc Philipp Contributed to the original provider implementation Matthias Merdes Contributed to the original provider implementation Johannes Link Contributed to the original provider implementation org.apache.maven.surefire common-java5 ${project.version} org.junit.platform junit-platform-launcher 1.2.0 org.junit.jupiter junit-jupiter-engine 5.2.0 test org.mockito mockito-core test org.assertj assertj-core test org.codehaus.mojo animal-sniffer-maven-plugin signature-check check org.codehaus.mojo.signature java18 1.0 org.junit.platform:junit-platform-commons org.junit.platform.commons.* org.apache.maven.plugins maven-surefire-plugin ${java.home}/bin/java org.apache.maven.plugins maven-shade-plugin package shade true org.apache.maven.surefire:common-java5 javax.annotation org.apache.maven.surefire.javax.annotation org.apache.maven.shared org.apache.maven.surefire.org.apache.maven.shared maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/000077500000000000000000000000001330756104600275775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/000077500000000000000000000000001330756104600305235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/java/000077500000000000000000000000001330756104600314445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/java/org/000077500000000000000000000000001330756104600322335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/java/org/apache/000077500000000000000000000000001330756104600334545ustar00rootroot00000000000000maven/000077500000000000000000000000001330756104600345035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/java/org/apachesurefire/000077500000000000000000000000001330756104600363275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/java/org/apache/mavenjunitplatform/000077500000000000000000000000001330756104600412255ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefireJUnitPlatformProvider.java000066400000000000000000000176711330756104600463550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatformpackage org.apache.maven.surefire.junitplatform; /* * 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. */ import static java.util.Arrays.stream; import static java.util.Collections.emptyMap; import static java.util.Optional.empty; import static java.util.Optional.of; import static java.util.logging.Level.WARNING; import static java.util.stream.Collectors.toList; import static org.apache.maven.surefire.booter.ProviderParameterNames.TESTNG_EXCLUDEDGROUPS_PROP; import static org.apache.maven.surefire.booter.ProviderParameterNames.TESTNG_GROUPS_PROP; import static org.junit.platform.commons.util.StringUtils.isBlank; import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request; import java.io.IOException; import java.io.StringReader; import java.io.UncheckedIOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Properties; import java.util.logging.Logger; import org.apache.maven.surefire.providerapi.AbstractProvider; import org.apache.maven.surefire.providerapi.ProviderParameters; import org.apache.maven.surefire.report.ConsoleOutputCapture; import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.ReporterException; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.ScanResult; import org.apache.maven.surefire.util.TestsToRun; import org.junit.platform.commons.util.StringUtils; import org.junit.platform.engine.Filter; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.TagFilter; import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.platform.launcher.core.LauncherFactory; /** * JUnit 5 Platform Provider. * * @since 2.22.0 */ public class JUnitPlatformProvider extends AbstractProvider { static final String CONFIGURATION_PARAMETERS = "configurationParameters"; private final ProviderParameters parameters; private final Launcher launcher; private final Filter[] filters; private final Map configurationParameters; public JUnitPlatformProvider( ProviderParameters parameters ) { this( parameters, LauncherFactory.create() ); } JUnitPlatformProvider( ProviderParameters parameters, Launcher launcher ) { this.parameters = parameters; this.launcher = launcher; filters = newFilters(); configurationParameters = newConfigurationParameters(); Logger.getLogger( "org.junit" ).setLevel( WARNING ); } @Override public Iterable> getSuites() { return scanClasspath(); } @Override public RunResult invoke( Object forkTestSet ) throws TestSetFailedException, ReporterException { if ( forkTestSet instanceof TestsToRun ) { return invokeAllTests( (TestsToRun) forkTestSet ); } else if ( forkTestSet instanceof Class ) { return invokeAllTests( TestsToRun.fromClass( (Class) forkTestSet ) ); } else if ( forkTestSet == null ) { return invokeAllTests( scanClasspath() ); } else { throw new IllegalArgumentException( "Unexpected value of forkTestSet: " + forkTestSet ); } } private TestsToRun scanClasspath() { TestPlanScannerFilter filter = new TestPlanScannerFilter( launcher, filters ); ScanResult scanResult = parameters.getScanResult(); TestsToRun scannedClasses = scanResult.applyFilter( filter, parameters.getTestClassLoader() ); return parameters.getRunOrderCalculator().orderTestClasses( scannedClasses ); } private RunResult invokeAllTests( TestsToRun testsToRun ) { RunResult runResult; ReporterFactory reporterFactory = parameters.getReporterFactory(); try { RunListener runListener = reporterFactory.createReporter(); ConsoleOutputCapture.startCapture( (ConsoleOutputReceiver) runListener ); LauncherDiscoveryRequest discoveryRequest = buildLauncherDiscoveryRequest( testsToRun ); launcher.execute( discoveryRequest, new RunListenerAdapter( runListener ) ); } finally { runResult = reporterFactory.close(); } return runResult; } private LauncherDiscoveryRequest buildLauncherDiscoveryRequest( TestsToRun testsToRun ) { LauncherDiscoveryRequestBuilder builder = request().filters( filters ).configurationParameters( configurationParameters ); for ( Class testClass : testsToRun ) { builder.selectors( selectClass( testClass ) ); } return builder.build(); } private Filter[] newFilters() { List> filters = new ArrayList<>(); getPropertiesList( TESTNG_GROUPS_PROP ) .map( TagFilter::includeTags ) .ifPresent( filters::add ); getPropertiesList( TESTNG_EXCLUDEDGROUPS_PROP ) .map( TagFilter::excludeTags ) .ifPresent( filters::add ); TestListResolver testListResolver = parameters.getTestRequest().getTestListResolver(); if ( !testListResolver.isEmpty() ) { filters.add( new TestMethodFilter( testListResolver ) ); } return filters.toArray( new Filter[ filters.size() ] ); } Filter[] getFilters() { return filters; } private Map newConfigurationParameters() { String content = parameters.getProviderProperties().get( CONFIGURATION_PARAMETERS ); if ( content == null ) { return emptyMap(); } try ( StringReader reader = new StringReader( content ) ) { Map result = new HashMap<>(); Properties props = new Properties(); props.load( reader ); props.stringPropertyNames() .forEach( key -> result.put( key, props.getProperty( key ) ) ); return result; } catch ( IOException e ) { throw new UncheckedIOException( "Error reading " + CONFIGURATION_PARAMETERS, e ); } } Map getConfigurationParameters() { return configurationParameters; } private Optional> getPropertiesList( String key ) { String property = parameters.getProviderProperties().get( key ); return isBlank( property ) ? empty() : of( stream( property.split( "[,]+" ) ) .filter( StringUtils::isNotBlank ) .map( String::trim ) .collect( toList() ) ); } } RunListenerAdapter.java000066400000000000000000000230611330756104600456450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatformpackage org.apache.maven.surefire.junitplatform; /* * 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. */ import static org.apache.maven.surefire.report.SimpleReportEntry.ignored; import static org.junit.platform.engine.TestExecutionResult.Status.ABORTED; import static org.junit.platform.engine.TestExecutionResult.Status.FAILED; import java.util.Optional; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import org.apache.maven.surefire.report.PojoStackTraceWriter; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.SimpleReportEntry; import org.apache.maven.surefire.report.StackTraceWriter; import org.junit.platform.engine.TestExecutionResult; import org.junit.platform.engine.TestSource; import org.junit.platform.engine.support.descriptor.ClassSource; import org.junit.platform.engine.support.descriptor.MethodSource; import org.junit.platform.launcher.TestExecutionListener; import org.junit.platform.launcher.TestIdentifier; import org.junit.platform.launcher.TestPlan; import org.junit.platform.launcher.listeners.LegacyReportingUtils; /** * @since 2.22.0 */ final class RunListenerAdapter implements TestExecutionListener { private final RunListener runListener; private TestPlan testPlan; private Set testSetNodes = ConcurrentHashMap.newKeySet(); RunListenerAdapter( RunListener runListener ) { this.runListener = runListener; } @Override public void testPlanExecutionStarted( TestPlan testPlan ) { updateTestPlan( testPlan ); } @Override public void testPlanExecutionFinished( TestPlan testPlan ) { updateTestPlan( null ); } @Override public void executionStarted( TestIdentifier testIdentifier ) { if ( testIdentifier.isContainer() && testIdentifier.getSource().filter( ClassSource.class::isInstance ).isPresent() ) { startTestSetIfPossible( testIdentifier ); } if ( testIdentifier.isTest() ) { ensureTestSetStarted( testIdentifier ); runListener.testStarting( createReportEntry( testIdentifier ) ); } } @Override public void executionSkipped( TestIdentifier testIdentifier, String reason ) { ensureTestSetStarted( testIdentifier ); String source = getLegacyReportingClassName( testIdentifier ); runListener.testSkipped( ignored( source, getLegacyReportingName( testIdentifier ), reason ) ); completeTestSetIfNecessary( testIdentifier ); } @Override public void executionFinished( TestIdentifier testIdentifier, TestExecutionResult testExecutionResult ) { if ( testExecutionResult.getStatus() == ABORTED ) { runListener.testAssumptionFailure( createReportEntry( testIdentifier, testExecutionResult ) ); } else if ( testExecutionResult.getStatus() == FAILED ) { reportFailedTest( testIdentifier, testExecutionResult ); } else if ( testIdentifier.isTest() ) { runListener.testSucceeded( createReportEntry( testIdentifier ) ); } completeTestSetIfNecessary( testIdentifier ); } private void updateTestPlan( TestPlan testPlan ) { this.testPlan = testPlan; testSetNodes.clear(); } private void ensureTestSetStarted( TestIdentifier testIdentifier ) { if ( isTestSetStarted( testIdentifier ) ) { return; } if ( testIdentifier.isTest() ) { startTestSet( testPlan.getParent( testIdentifier ).orElse( testIdentifier ) ); } else { startTestSet( testIdentifier ); } } private boolean isTestSetStarted( TestIdentifier testIdentifier ) { return testSetNodes.contains( testIdentifier ) || testPlan.getParent( testIdentifier ).map( this::isTestSetStarted ).orElse( false ); } private void startTestSetIfPossible( TestIdentifier testIdentifier ) { if ( !isTestSetStarted( testIdentifier ) ) { startTestSet( testIdentifier ); } } private void completeTestSetIfNecessary( TestIdentifier testIdentifier ) { if ( testSetNodes.contains( testIdentifier ) ) { completeTestSet( testIdentifier ); } } private void startTestSet( TestIdentifier testIdentifier ) { runListener.testSetStarting( createTestSetReportEntry( testIdentifier ) ); testSetNodes.add( testIdentifier ); } private void completeTestSet( TestIdentifier testIdentifier ) { runListener.testSetCompleted( createTestSetReportEntry( testIdentifier ) ); testSetNodes.remove( testIdentifier ); } private void reportFailedTest( TestIdentifier testIdentifier, TestExecutionResult testExecutionResult ) { SimpleReportEntry reportEntry = createReportEntry( testIdentifier, testExecutionResult ); if ( testExecutionResult.getThrowable().filter( AssertionError.class::isInstance ).isPresent() ) { runListener.testFailed( reportEntry ); } else { runListener.testError( reportEntry ); } } private SimpleReportEntry createTestSetReportEntry( TestIdentifier testIdentifier ) { return new SimpleReportEntry( JUnitPlatformProvider.class.getName(), testIdentifier.getLegacyReportingName() ); } private SimpleReportEntry createReportEntry( TestIdentifier testIdentifier ) { return createReportEntry( testIdentifier, (StackTraceWriter) null ); } private SimpleReportEntry createReportEntry( TestIdentifier testIdentifier, TestExecutionResult testExecutionResult ) { return createReportEntry( testIdentifier, getStackTraceWriter( testIdentifier, testExecutionResult ) ); } private SimpleReportEntry createReportEntry( TestIdentifier testIdentifier, StackTraceWriter stackTraceWriter ) { String source = getLegacyReportingClassName( testIdentifier ); String name = getLegacyReportingName( testIdentifier ); return SimpleReportEntry.withException( source, name, stackTraceWriter ); } private String getLegacyReportingName( TestIdentifier testIdentifier ) { // Surefire cuts off the name at the first '(' character. Thus, we have to pick a different // character to represent parentheses. "()" are removed entirely to maximize compatibility with // existing reporting tools because in the old days test methods used to not have parameters. return testIdentifier .getLegacyReportingName() .replace( "()", "" ) .replace( '(', '{' ) .replace( ')', '}' ); } private String getLegacyReportingClassName( TestIdentifier testIdentifier ) { return LegacyReportingUtils.getClassName( testPlan, testIdentifier ); } private StackTraceWriter getStackTraceWriter( TestIdentifier testIdentifier, TestExecutionResult testExecutionResult ) { Optional throwable = testExecutionResult.getThrowable(); if ( testExecutionResult.getStatus() == FAILED ) { // Failed tests must have a StackTraceWriter, otherwise Surefire will fail return getStackTraceWriter( testIdentifier, throwable.orElse( null ) ); } return throwable.map( t -> getStackTraceWriter( testIdentifier, t ) ).orElse( null ); } private StackTraceWriter getStackTraceWriter( TestIdentifier testIdentifier, Throwable throwable ) { String className = getClassName( testIdentifier ); String methodName = getMethodName( testIdentifier ).orElse( "" ); return new PojoStackTraceWriter( className, methodName, throwable ); } private String getClassName( TestIdentifier testIdentifier ) { TestSource testSource = testIdentifier.getSource().orElse( null ); if ( testSource instanceof ClassSource ) { return ( (ClassSource) testSource ).getJavaClass().getName(); } if ( testSource instanceof MethodSource ) { return ( (MethodSource) testSource ).getClassName(); } return testPlan.getParent( testIdentifier ).map( this::getClassName ).orElse( "" ); } private Optional getMethodName( TestIdentifier testIdentifier ) { TestSource testSource = testIdentifier.getSource().orElse( null ); if ( testSource instanceof MethodSource ) { return Optional.of( ( (MethodSource) testSource ).getMethodName() ); } return Optional.empty(); } } TestMethodFilter.java000066400000000000000000000041311330756104600453150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatformpackage org.apache.maven.surefire.junitplatform; /* * 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. */ import org.apache.maven.surefire.testset.TestListResolver; import org.junit.platform.engine.FilterResult; import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.support.descriptor.MethodSource; import org.junit.platform.launcher.PostDiscoveryFilter; /** * @since 2.22.0 */ class TestMethodFilter implements PostDiscoveryFilter { private final TestListResolver testListResolver; TestMethodFilter( TestListResolver testListResolver ) { this.testListResolver = testListResolver; } @Override public FilterResult apply( TestDescriptor descriptor ) { boolean shouldRun = descriptor.getSource() .filter( MethodSource.class::isInstance ) .map( MethodSource.class::cast ) .map( this::shouldRun ) .orElse( true ); return FilterResult.includedIf( shouldRun ); } private boolean shouldRun( MethodSource source ) { String testClass = TestListResolver.toClassFileName( source.getClassName() ); String testMethod = source.getMethodName(); return this.testListResolver.shouldRun( testClass, testMethod ); } } TestPlanScannerFilter.java000066400000000000000000000040341330756104600463030ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatformpackage org.apache.maven.surefire.junitplatform; /* * 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. */ import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request; import org.apache.maven.surefire.util.ScannerFilter; import org.junit.platform.engine.Filter; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.TestPlan; /** * @since 2.22.0 */ final class TestPlanScannerFilter implements ScannerFilter { private final Launcher launcher; private final Filter[] includeAndExcludeFilters; TestPlanScannerFilter( Launcher launcher, Filter[] includeAndExcludeFilters ) { this.launcher = launcher; this.includeAndExcludeFilters = includeAndExcludeFilters; } @Override @SuppressWarnings( "rawtypes" ) public boolean accept( Class testClass ) { LauncherDiscoveryRequest discoveryRequest = request() .selectors( selectClass( testClass ) ) .filters( includeAndExcludeFilters ).build(); TestPlan testPlan = launcher.discover( discoveryRequest ); return testPlan.containsTests(); } } maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/resources/000077500000000000000000000000001330756104600325355ustar00rootroot00000000000000META-INF/000077500000000000000000000000001330756104600336165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/resourcesservices/000077500000000000000000000000001330756104600354415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/resources/META-INForg.apache.maven.surefire.providerapi.SurefireProvider000066400000000000000000000000761330756104600501470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/main/resources/META-INF/servicesorg.apache.maven.surefire.junitplatform.JUnitPlatformProvider maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/test/000077500000000000000000000000001330756104600305565ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/test/java/000077500000000000000000000000001330756104600314775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/test/java/org/000077500000000000000000000000001330756104600322665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/test/java/org/apache/000077500000000000000000000000001330756104600335075ustar00rootroot00000000000000maven/000077500000000000000000000000001330756104600345365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/test/java/org/apachesurefire/000077500000000000000000000000001330756104600363625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/test/java/org/apache/mavenjunitplatform/000077500000000000000000000000001330756104600412605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefireJUnitPlatformProviderTest.java000066400000000000000000000660411330756104600472430ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatformpackage org.apache.maven.surefire.junitplatform; /* * 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. */ import static java.util.Collections.emptyMap; import static java.util.Collections.singletonMap; import static java.util.stream.Collectors.toSet; import static org.apache.maven.surefire.booter.ProviderParameterNames.TESTNG_EXCLUDEDGROUPS_PROP; import static org.apache.maven.surefire.booter.ProviderParameterNames.TESTNG_GROUPS_PROP; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assumptions.assumeTrue; import static org.mockito.AdditionalMatchers.gt; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.mockito.Mockito.withSettings; import java.io.PrintStream; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.maven.surefire.providerapi.ProviderParameters; import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.SimpleReportEntry; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.testset.TestRequest; import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.RunOrderCalculator; import org.apache.maven.surefire.util.ScanResult; import org.apache.maven.surefire.util.TestsToRun; import org.junit.Test; import org.junit.jupiter.api.Disabled; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.TestIdentifier; import org.junit.platform.launcher.TestPlan; import org.junit.platform.launcher.core.LauncherFactory; import org.junit.platform.launcher.listeners.SummaryGeneratingListener; import org.junit.platform.launcher.listeners.TestExecutionSummary; import org.junit.platform.launcher.listeners.TestExecutionSummary.Failure; import org.mockito.ArgumentCaptor; import org.mockito.InOrder; /** * Unit tests for {@link JUnitPlatformProvider}. * * @since 2.22.0 */ public class JUnitPlatformProviderTest { @Test public void getSuitesReturnsScannedClasses() { ProviderParameters providerParameters = providerParametersMock( TestClass1.class, TestClass2.class ); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParameters ); assertThat( provider.getSuites() ) .containsOnly( TestClass1.class, TestClass2.class ); } @Test public void invokeThrowsForWrongForkTestSet() { ProviderParameters providerParameters = providerParametersMock( Integer.class ); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParameters ); assertThrows( IllegalArgumentException.class, () -> invokeProvider( provider, "wrong forkTestSet" ) ); } @Test public void allGivenTestsToRunAreInvoked() throws Exception { Launcher launcher = LauncherFactory.create(); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParametersMock(), launcher ); TestPlanSummaryListener executionListener = new TestPlanSummaryListener(); launcher.registerTestExecutionListeners( executionListener ); TestsToRun testsToRun = newTestsToRun( TestClass1.class, TestClass2.class ); invokeProvider( provider, testsToRun ); assertThat( executionListener.summaries ).hasSize( 1 ); TestExecutionSummary summary = executionListener.summaries.get( 0 ); assertEquals( TestClass1.TESTS_FOUND + TestClass2.TESTS_FOUND, summary.getTestsFoundCount() ); assertEquals( TestClass1.TESTS_STARTED + TestClass2.TESTS_STARTED, summary.getTestsStartedCount() ); assertEquals( TestClass1.TESTS_SKIPPED + TestClass2.TESTS_SKIPPED, summary.getTestsSkippedCount() ); assertEquals( TestClass1.TESTS_SUCCEEDED + TestClass2.TESTS_SUCCEEDED, summary.getTestsSucceededCount() ); assertEquals( TestClass1.TESTS_ABORTED + TestClass2.TESTS_ABORTED, summary.getTestsAbortedCount() ); assertEquals( TestClass1.TESTS_FAILED + TestClass2.TESTS_FAILED, summary.getTestsFailedCount() ); } @Test public void singleTestClassIsInvoked() throws Exception { Launcher launcher = LauncherFactory.create(); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParametersMock(), launcher ); TestPlanSummaryListener executionListener = new TestPlanSummaryListener(); launcher.registerTestExecutionListeners( executionListener ); invokeProvider( provider, TestClass1.class ); assertThat( executionListener.summaries ).hasSize( 1 ); TestExecutionSummary summary = executionListener.summaries.get( 0 ); assertEquals( TestClass1.TESTS_FOUND, summary.getTestsFoundCount() ); assertEquals( TestClass1.TESTS_STARTED, summary.getTestsStartedCount() ); assertEquals( TestClass1.TESTS_SKIPPED, summary.getTestsSkippedCount() ); assertEquals( TestClass1.TESTS_SUCCEEDED, summary.getTestsSucceededCount() ); assertEquals( TestClass1.TESTS_ABORTED, summary.getTestsAbortedCount() ); assertEquals( TestClass1.TESTS_FAILED, summary.getTestsFailedCount() ); } @Test public void allDiscoveredTestsAreInvokedForNullArgument() throws Exception { RunListener runListener = runListenerMock(); ProviderParameters providerParameters = providerParametersMock( runListener, TestClass1.class, TestClass2.class ); Launcher launcher = LauncherFactory.create(); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParameters, launcher ); TestPlanSummaryListener executionListener = new TestPlanSummaryListener(); launcher.registerTestExecutionListeners( executionListener ); invokeProvider( provider, null ); InOrder inOrder = inOrder( runListener ); inOrder .verify( runListener ) .testSetStarting( new SimpleReportEntry( JUnitPlatformProvider.class.getName(), TestClass1.class.getName() ) ); inOrder .verify( runListener ) .testSetCompleted( new SimpleReportEntry( JUnitPlatformProvider.class.getName(), TestClass1.class.getName() ) ); inOrder .verify( runListener ) .testSetStarting( new SimpleReportEntry( JUnitPlatformProvider.class.getName(), TestClass2.class.getName() ) ); inOrder .verify( runListener ) .testSetCompleted( new SimpleReportEntry( JUnitPlatformProvider.class.getName(), TestClass2.class.getName() ) ); assertThat( executionListener.summaries ).hasSize( 1 ); TestExecutionSummary summary = executionListener.summaries.get( 0 ); assertEquals( TestClass1.TESTS_FOUND + TestClass2.TESTS_FOUND, summary.getTestsFoundCount() ); assertEquals( TestClass1.TESTS_STARTED + TestClass2.TESTS_STARTED, summary.getTestsStartedCount() ); assertEquals( TestClass1.TESTS_SKIPPED + TestClass2.TESTS_SKIPPED, summary.getTestsSkippedCount() ); assertEquals( TestClass1.TESTS_SUCCEEDED + TestClass2.TESTS_SUCCEEDED, summary.getTestsSucceededCount() ); assertEquals( TestClass1.TESTS_ABORTED + TestClass2.TESTS_ABORTED, summary.getTestsAbortedCount() ); assertEquals( TestClass1.TESTS_FAILED + TestClass2.TESTS_FAILED, summary.getTestsFailedCount() ); } @Test public void outputIsCaptured() throws Exception { Launcher launcher = LauncherFactory.create(); RunListener runListener = runListenerMock(); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParametersMock( runListener ), launcher ); invokeProvider( provider, VerboseTestClass.class ); ArgumentCaptor captor = ArgumentCaptor.forClass( byte[].class ); // @formatter:off verify( (ConsoleOutputReceiver) runListener ) .writeTestOutput( captor.capture(), eq( 0 ), gt( 6 ), eq( true ) ); verify( (ConsoleOutputReceiver) runListener ) .writeTestOutput( captor.capture(), eq( 0 ), gt( 6 ), eq( false ) ); assertThat( captor.getAllValues() ) .extracting( bytes -> new String( bytes, 0, 6 ) ) .containsExactly( "stdout", "stderr" ); // @formatter:on } @Test public void onlyGroupsIsDeclared() { Map properties = singletonMap( TESTNG_GROUPS_PROP, "groupOne, groupTwo" ); ProviderParameters providerParameters = providerParametersMock( TestClass1.class ); when( providerParameters.getProviderProperties() ).thenReturn( properties ); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParameters ); assertEquals( 1, provider.getFilters().length ); } @Test public void onlyExcludeTagsIsDeclared() { Map properties = singletonMap( TESTNG_EXCLUDEDGROUPS_PROP, "tagOne, tagTwo" ); ProviderParameters providerParameters = providerParametersMock( TestClass1.class ); when( providerParameters.getProviderProperties() ).thenReturn( properties ); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParameters ); assertEquals( 1, provider.getFilters().length ); } @Test public void noFiltersAreCreatedIfTagsAreEmpty() { Map properties = singletonMap( TESTNG_GROUPS_PROP, "" ); ProviderParameters providerParameters = providerParametersMock( TestClass1.class ); when( providerParameters.getProviderProperties() ).thenReturn( properties ); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParameters ); assertEquals( 0, provider.getFilters().length ); } @Test public void filtersWithEmptyTagsAreNotRegistered() { // Here only tagOne is registered as a valid tag and other tags are ignored as they are empty Map properties = singletonMap( TESTNG_EXCLUDEDGROUPS_PROP, "tagOne," ); ProviderParameters providerParameters = providerParametersMock( TestClass1.class ); when( providerParameters.getProviderProperties() ).thenReturn( properties ); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParameters ); assertEquals( 1, provider.getFilters().length ); } @Test public void bothIncludeAndExcludeAreAllowed() { Map properties = new HashMap<>(); properties.put( TESTNG_GROUPS_PROP, "tagOne, tagTwo" ); properties.put( TESTNG_EXCLUDEDGROUPS_PROP, "tagThree, tagFour" ); ProviderParameters providerParameters = providerParametersMock( TestClass1.class ); when( providerParameters.getProviderProperties() ).thenReturn( properties ); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParameters ); assertEquals( 2, provider.getFilters().length ); } @Test public void tagExpressionsAreSupportedForIncludeTagsContainingVerticalBar() { Map properties = new HashMap<>(); properties.put( TESTNG_GROUPS_PROP, "tagOne | tagTwo" ); properties.put( TESTNG_EXCLUDEDGROUPS_PROP, "tagThree | tagFour" ); ProviderParameters providerParameters = providerParametersMock( TestClass1.class ); when( providerParameters.getProviderProperties() ).thenReturn( properties ); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParameters ); assertEquals( 2, provider.getFilters().length ); } @Test public void tagExpressionsAreSupportedForIncludeTagsContainingAmpersand() { Map properties = new HashMap<>(); properties.put( TESTNG_GROUPS_PROP, "tagOne & !tagTwo" ); properties.put( TESTNG_EXCLUDEDGROUPS_PROP, "tagThree & !tagFour" ); ProviderParameters providerParameters = providerParametersMock( TestClass1.class ); when( providerParameters.getProviderProperties() ).thenReturn( properties ); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParameters ); assertEquals( 2, provider.getFilters().length ); } @Test public void noFiltersAreCreatedIfNoPropertiesAreDeclared() { ProviderParameters providerParameters = providerParametersMock( TestClass1.class ); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParameters ); assertEquals( 0, provider.getFilters().length ); } @Test public void defaultConfigurationParametersAreEmpty() { ProviderParameters providerParameters = providerParametersMock( TestClass1.class ); when( providerParameters.getProviderProperties() ).thenReturn( emptyMap() ); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParameters ); assertTrue( provider.getConfigurationParameters().isEmpty() ); } @Test public void parsesConfigurationParameters() { ProviderParameters providerParameters = providerParametersMock( TestClass1.class ); when( providerParameters.getProviderProperties() ) .thenReturn( singletonMap( JUnitPlatformProvider.CONFIGURATION_PARAMETERS, "foo = true\nbar 42\rbaz: *\r\nqux: EOF" ) ); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParameters ); assertEquals( 4, provider.getConfigurationParameters().size() ); assertEquals( "true", provider.getConfigurationParameters().get( "foo" ) ); assertEquals( "42", provider.getConfigurationParameters().get( "bar" ) ); assertEquals( "*", provider.getConfigurationParameters().get( "baz" ) ); assertEquals( "EOF", provider.getConfigurationParameters().get( "qux" ) ); } @Test public void executesSingleTestIncludedByName() throws Exception { // following is equivalent of adding '-Dtest=TestClass3#prefix1Suffix1' // '*' needed because it's a nested class and thus has name prefixed with '$' String pattern = "*TestClass3#prefix1Suffix1"; testExecutionOfMatchingTestMethods( TestClass3.class, pattern, "prefix1Suffix1()" ); } @Test public void executesMultipleTestsIncludedByName() throws Exception { // following is equivalent of adding '-Dtest=TestClass3#prefix1Suffix1+prefix2Suffix1' // '*' needed because it's a nested class and thus has name prefixed with '$' String pattern = "*TestClass3#prefix1Suffix1+prefix2Suffix1"; testExecutionOfMatchingTestMethods( TestClass3.class, pattern, "prefix1Suffix1()", "prefix2Suffix1()" ); } @Test public void executesMultipleTestsIncludedByNamePattern() throws Exception { // following is equivalent of adding '-Dtest=TestClass3#prefix1*' // '*' needed because it's a nested class and thus has name prefixed with '$' String pattern = "*TestClass3#prefix1*"; testExecutionOfMatchingTestMethods( TestClass3.class, pattern, "prefix1Suffix1()", "prefix1Suffix2()" ); } @Test public void executesMultipleTestsIncludedByNamePatternWithQuestionMark() throws Exception { // following is equivalent of adding '-Dtest=TestClass3#prefix?Suffix2' // '*' needed because it's a nested class and thus has name prefixed with '$' String pattern = "*TestClass3#prefix?Suffix2"; testExecutionOfMatchingTestMethods( TestClass3.class, pattern, "prefix1Suffix2()", "prefix2Suffix2()" ); } @Test public void doesNotExecuteTestsExcludedByName() throws Exception { // following is equivalent of adding '-Dtest=!TestClass3#prefix1Suffix2' // '*' needed because it's a nested class and thus has name prefixed with '$' String pattern = "!*TestClass3#prefix1Suffix2"; testExecutionOfMatchingTestMethods( TestClass3.class, pattern, "prefix1Suffix1()", "prefix2Suffix1()", "prefix2Suffix2()" ); } @Test public void doesNotExecuteTestsExcludedByNamePattern() throws Exception { // following is equivalent of adding '-Dtest=!TestClass3#prefix2*' // '*' needed because it's a nested class and thus has name prefixed with '$' String pattern = "!*TestClass3#prefix2*"; testExecutionOfMatchingTestMethods( TestClass3.class, pattern, "prefix1Suffix1()", "prefix1Suffix2()" ); } private static void testExecutionOfMatchingTestMethods( Class testClass, String pattern, String... expectedTestNames ) throws Exception { TestListResolver testListResolver = new TestListResolver( pattern ); ProviderParameters providerParameters = providerParametersMock( testListResolver, testClass ); Launcher launcher = LauncherFactory.create(); JUnitPlatformProvider provider = new JUnitPlatformProvider( providerParameters, launcher ); TestPlanSummaryListener executionListener = new TestPlanSummaryListener(); launcher.registerTestExecutionListeners( executionListener ); invokeProvider( provider, null ); assertEquals( 1, executionListener.summaries.size() ); TestExecutionSummary summary = executionListener.summaries.get( 0 ); int expectedCount = expectedTestNames.length; assertEquals( expectedCount, summary.getTestsFoundCount() ); assertEquals( expectedCount, summary.getTestsFailedCount() ); assertEquals( expectedCount, summary.getFailures().size() ); assertThat( failedTestDisplayNames( summary ) ).contains( expectedTestNames ); } private static ProviderParameters providerParametersMock( Class... testClasses ) { return providerParametersMock( runListenerMock(), testClasses ); } private static ProviderParameters providerParametersMock( RunListener runListener, Class... testClasses ) { TestListResolver testListResolver = new TestListResolver( "" ); return providerParametersMock( runListener, testListResolver, testClasses ); } private static ProviderParameters providerParametersMock( TestListResolver testListResolver, Class... testClasses ) { return providerParametersMock( runListenerMock(), testListResolver, testClasses ); } private static ProviderParameters providerParametersMock( RunListener runListener, TestListResolver testListResolver, Class... testClasses ) { TestsToRun testsToRun = newTestsToRun( testClasses ); ScanResult scanResult = mock( ScanResult.class ); when( scanResult.applyFilter( any(), any() ) ).thenReturn( testsToRun ); RunOrderCalculator runOrderCalculator = mock( RunOrderCalculator.class ); when( runOrderCalculator.orderTestClasses( any() ) ).thenReturn( testsToRun ); ReporterFactory reporterFactory = mock( ReporterFactory.class ); when( reporterFactory.createReporter() ).thenReturn( runListener ); TestRequest testRequest = mock( TestRequest.class ); when( testRequest.getTestListResolver() ).thenReturn( testListResolver ); ProviderParameters providerParameters = mock( ProviderParameters.class ); when( providerParameters.getScanResult() ).thenReturn( scanResult ); when( providerParameters.getRunOrderCalculator() ).thenReturn( runOrderCalculator ); when( providerParameters.getReporterFactory() ).thenReturn( reporterFactory ); when( providerParameters.getTestRequest() ).thenReturn( testRequest ); return providerParameters; } private static RunListener runListenerMock() { return mock( RunListener.class, withSettings().extraInterfaces( ConsoleOutputReceiver.class ) ); } private static Set failedTestDisplayNames( TestExecutionSummary summary ) { // @formatter:off return summary.getFailures() .stream() .map( Failure::getTestIdentifier ) .map( TestIdentifier::getDisplayName ) .collect( toSet() ); // @formatter:on } private static TestsToRun newTestsToRun( Class... testClasses ) { List> classesList = Arrays.asList( testClasses ); return new TestsToRun( new LinkedHashSet<>( classesList ) ); } private static class TestPlanSummaryListener extends SummaryGeneratingListener { private final List summaries = new ArrayList<>(); @Override public void testPlanExecutionFinished( TestPlan testPlan ) { super.testPlanExecutionFinished( testPlan ); summaries.add( getSummary() ); } } /** * Invokes the provider, then restores system out and system error. * * @see #986 */ private static void invokeProvider( JUnitPlatformProvider provider, Object forkTestSet ) throws TestSetFailedException { PrintStream systemOut = System.out; PrintStream systemErr = System.err; try { provider.invoke( forkTestSet ); } finally { System.setOut( systemOut ); System.setErr( systemErr ); } } static class TestClass1 { static final int TESTS_FOUND = 4; static final int TESTS_STARTED = 3; static final int TESTS_SKIPPED = 1; static final int TESTS_SUCCEEDED = 2; static final int TESTS_ABORTED = 0; static final int TESTS_FAILED = 1; @org.junit.jupiter.api.Test void test1() { } @org.junit.jupiter.api.Test void test2() { } @Disabled @org.junit.jupiter.api.Test void test3() { } @org.junit.jupiter.api.Test void test4() { throw new RuntimeException(); } } static class TestClass2 { static final int TESTS_FOUND = 3; static final int TESTS_STARTED = 3; static final int TESTS_SKIPPED = 0; static final int TESTS_SUCCEEDED = 1; static final int TESTS_ABORTED = 1; static final int TESTS_FAILED = 1; @org.junit.jupiter.api.Test void test1() { } @org.junit.jupiter.api.Test void test2() { throw new RuntimeException(); } @org.junit.jupiter.api.Test void test3() { assumeTrue( false ); } } static class VerboseTestClass { @org.junit.jupiter.api.Test void test() { System.out.println( "stdout" ); System.err.println( "stderr" ); } } @Test public void usesClassNamesForXmlReport() throws TestSetFailedException { String[] classNames = { Sub1Tests.class.getName(), Sub2Tests.class.getName() }; ProviderParameters providerParameters = providerParametersMock( Sub1Tests.class, Sub2Tests.class ); JUnitPlatformProvider jUnitPlatformProvider = new JUnitPlatformProvider( providerParameters ); TestsToRun testsToRun = newTestsToRun( Sub1Tests.class, Sub2Tests.class ); invokeProvider( jUnitPlatformProvider, testsToRun ); RunListener reporter = providerParameters.getReporterFactory().createReporter(); ArgumentCaptor reportEntryArgumentCaptor = ArgumentCaptor.forClass( ReportEntry.class ); verify( reporter, times( 2 ) ).testSucceeded( reportEntryArgumentCaptor.capture() ); List allValues = reportEntryArgumentCaptor.getAllValues(); assertThat( allValues ).extracting( ReportEntry::getSourceName ).containsExactly( classNames ); } static class AbstractTestClass { @org.junit.jupiter.api.Test void test() { } } static class Sub1Tests extends AbstractTestClass { } static class Sub2Tests extends AbstractTestClass { } static class TestClass3 { @org.junit.jupiter.api.Test void prefix1Suffix1() { throw new RuntimeException(); } @org.junit.jupiter.api.Test void prefix2Suffix1() { throw new RuntimeException(); } @org.junit.jupiter.api.Test void prefix1Suffix2() { throw new RuntimeException(); } @org.junit.jupiter.api.Test void prefix2Suffix2() { throw new RuntimeException(); } } } RunListenerAdapterTest.java000066400000000000000000000541101330756104600465370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatformpackage org.apache.maven.surefire.junitplatform; /* * 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. */ import static java.util.Collections.emptyList; import static java.util.Collections.singleton; import static java.util.Collections.singletonList; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.platform.engine.TestDescriptor.Type.CONTAINER; import static org.junit.platform.engine.TestDescriptor.Type.TEST; import static org.junit.platform.engine.TestExecutionResult.successful; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; import java.util.Optional; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.SimpleReportEntry; import org.junit.Before; import org.junit.Test; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.engine.descriptor.ClassTestDescriptor; import org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor; import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.TestDescriptor.Type; import org.junit.platform.engine.TestExecutionResult; import org.junit.platform.engine.TestSource; import org.junit.platform.engine.UniqueId; import org.junit.platform.engine.support.descriptor.AbstractTestDescriptor; import org.junit.platform.engine.support.descriptor.ClassSource; import org.junit.platform.engine.support.descriptor.EngineDescriptor; import org.junit.platform.launcher.TestIdentifier; import org.junit.platform.launcher.TestPlan; import org.mockito.ArgumentCaptor; import org.mockito.InOrder; /** * Unit tests for {@link RunListenerAdapter}. * * @since 2.22.0 */ public class RunListenerAdapterTest { private RunListener listener; private RunListenerAdapter adapter; @Before public void setUp() { listener = mock( RunListener.class ); adapter = new RunListenerAdapter( listener ); adapter.testPlanExecutionStarted( TestPlan.from( emptyList() ) ); } @Test public void notifiedWithCorrectNamesWhenMethodExecutionStarted() throws Exception { ArgumentCaptor entryCaptor = ArgumentCaptor.forClass( ReportEntry.class ); TestPlan testPlan = TestPlan.from( singletonList( new EngineDescriptor( newId(), "Luke's Plan" ) ) ); adapter.testPlanExecutionStarted( testPlan ); TestIdentifier methodIdentifier = identifiersAsParentOnTestPlan( testPlan, newClassDescriptor(), newMethodDescriptor() ); adapter.executionStarted( methodIdentifier ); verify( listener ).testStarting( entryCaptor.capture() ); ReportEntry entry = entryCaptor.getValue(); assertEquals( MY_TEST_METHOD_NAME, entry.getName() ); assertEquals( MyTestClass.class.getName(), entry.getSourceName() ); assertNull( entry.getStackTraceWriter() ); } @Test public void notifiedWithCompatibleNameForMethodWithArguments() throws Exception { ArgumentCaptor entryCaptor = ArgumentCaptor.forClass( ReportEntry.class ); TestPlan testPlan = TestPlan.from( singletonList( new EngineDescriptor( newId(), "Luke's Plan" ) ) ); adapter.testPlanExecutionStarted( testPlan ); TestIdentifier methodIdentifier = identifiersAsParentOnTestPlan( testPlan, newClassDescriptor(), newMethodDescriptor( String.class ) ); adapter.executionStarted( methodIdentifier ); verify( listener ).testStarting( entryCaptor.capture() ); ReportEntry entry = entryCaptor.getValue(); assertEquals( MY_TEST_METHOD_NAME + "{String}", entry.getName() ); assertEquals( MyTestClass.class.getName(), entry.getSourceName() ); assertNull( entry.getStackTraceWriter() ); } @Test public void notifiedEagerlyForTestSetWhenClassExecutionStarted() throws Exception { EngineDescriptor engine = newEngineDescriptor(); TestDescriptor parent = newClassDescriptor(); engine.addChild( parent ); TestDescriptor child = newMethodDescriptor(); parent.addChild( child ); TestPlan plan = TestPlan.from( singletonList( engine ) ); adapter.testPlanExecutionStarted( plan ); adapter.executionStarted( TestIdentifier.from( engine ) ); adapter.executionStarted( TestIdentifier.from( parent ) ); verify( listener ).testSetStarting( new SimpleReportEntry( JUnitPlatformProvider.class.getName(), MyTestClass.class.getName() ) ); verifyNoMoreInteractions( listener ); adapter.executionStarted( TestIdentifier.from( child ) ); verify( listener ).testStarting( new SimpleReportEntry( MyTestClass.class.getName(), MY_TEST_METHOD_NAME ) ); verifyNoMoreInteractions( listener ); adapter.executionFinished( TestIdentifier.from( child ), successful() ); verify( listener ).testSucceeded( new SimpleReportEntry( MyTestClass.class.getName(), MY_TEST_METHOD_NAME ) ); verifyNoMoreInteractions( listener ); adapter.executionFinished( TestIdentifier.from( parent ), successful() ); verify( listener ).testSetCompleted( new SimpleReportEntry( JUnitPlatformProvider.class.getName(), MyTestClass.class.getName() ) ); verifyNoMoreInteractions( listener ); adapter.executionFinished( TestIdentifier.from( engine ), successful() ); verifyNoMoreInteractions( listener ); } @Test public void notifiedLazilyForTestSetWhenFirstTestWithoutClassDescriptorParentStarted() { EngineDescriptor engine = newEngineDescriptor(); TestDescriptor parent = newTestDescriptor( engine.getUniqueId().append( "container", "noClass" ), "parent", CONTAINER ); engine.addChild( parent ); TestDescriptor child1 = newTestDescriptor( parent.getUniqueId().append( "test", "child1" ), "child1", TEST ); parent.addChild( child1 ); TestDescriptor child2 = newTestDescriptor( parent.getUniqueId().append( "test", "child2" ), "child2", TEST ); parent.addChild( child2 ); TestPlan plan = TestPlan.from( singletonList( engine ) ); adapter.testPlanExecutionStarted( plan ); adapter.executionStarted( TestIdentifier.from( engine ) ); adapter.executionStarted( TestIdentifier.from( parent ) ); verifyZeroInteractions( listener ); adapter.executionStarted( TestIdentifier.from( child1 ) ); InOrder inOrder = inOrder( listener ); inOrder.verify( listener ) .testSetStarting( new SimpleReportEntry( JUnitPlatformProvider.class.getName(), "parent" ) ); inOrder.verify( listener ).testStarting( new SimpleReportEntry( "parent", "child1" ) ); inOrder.verifyNoMoreInteractions(); adapter.executionFinished( TestIdentifier.from( child1 ), successful() ); verify( listener ).testSucceeded( new SimpleReportEntry( "parent", "child1" ) ); verifyNoMoreInteractions( listener ); adapter.executionStarted( TestIdentifier.from( child2 ) ); verify( listener ).testStarting( new SimpleReportEntry( "parent", "child2" ) ); verifyNoMoreInteractions( listener ); adapter.executionFinished( TestIdentifier.from( child2 ), successful() ); verify( listener ).testSucceeded( new SimpleReportEntry( "parent", "child2" ) ); verifyNoMoreInteractions( listener ); adapter.executionFinished( TestIdentifier.from( parent ), successful() ); verify( listener ) .testSetCompleted( new SimpleReportEntry( JUnitPlatformProvider.class.getName(), "parent" ) ); verifyNoMoreInteractions( listener ); adapter.executionFinished( TestIdentifier.from( engine ), successful() ); verifyNoMoreInteractions( listener ); } @Test public void notifiedForTestSetForSingleNodeEngine() { EngineDescriptor engine = new EngineDescriptor( UniqueId.forEngine( "engine" ), "engine" ) { @Override public Type getType() { return TEST; } }; TestPlan plan = TestPlan.from( singletonList( engine ) ); adapter.testPlanExecutionStarted( plan ); adapter.executionStarted( TestIdentifier.from( engine ) ); InOrder inOrder = inOrder( listener ); inOrder.verify( listener ) .testSetStarting( new SimpleReportEntry( JUnitPlatformProvider.class.getName(), "engine" ) ); inOrder.verify( listener ).testStarting( new SimpleReportEntry( "", "engine" ) ); inOrder.verifyNoMoreInteractions(); adapter.executionFinished( TestIdentifier.from( engine ), successful() ); inOrder = inOrder( listener ); inOrder.verify( listener ).testSucceeded( new SimpleReportEntry( "", "engine" ) ); inOrder.verify( listener ) .testSetCompleted( new SimpleReportEntry( JUnitPlatformProvider.class.getName(), "engine" ) ); inOrder.verifyNoMoreInteractions(); } @Test public void notNotifiedWhenEngineExecutionStarted() { adapter.executionStarted( newEngineIdentifier() ); verify( listener, never() ).testStarting( any() ); } @Test public void notifiedWhenMethodExecutionSkipped() throws Exception { adapter.executionSkipped( newMethodIdentifier(), "test" ); verify( listener ).testSkipped( any() ); } @Test public void notifiedWithCorrectNamesWhenClassExecutionSkipped() { ArgumentCaptor entryCaptor = ArgumentCaptor.forClass( ReportEntry.class ); TestPlan testPlan = TestPlan.from( singletonList( new EngineDescriptor( newId(), "Luke's Plan" ) ) ); adapter.testPlanExecutionStarted( testPlan ); TestIdentifier classIdentifier = identifiersAsParentOnTestPlan( testPlan, newEngineDescriptor(), newClassDescriptor() ); adapter.executionSkipped( classIdentifier, "test" ); verify( listener ).testSkipped( entryCaptor.capture() ); ReportEntry entry = entryCaptor.getValue(); assertTrue( MyTestClass.class.getTypeName().contains( entry.getName() ) ); assertEquals( MyTestClass.class.getTypeName(), entry.getSourceName() ); } @Test public void notifiedWhenEngineExecutionSkipped() { adapter.executionSkipped( newEngineIdentifier(), "test" ); verify( listener ).testSkipped( any() ); } @Test public void notifiedWhenMethodExecutionAborted() throws Exception { adapter.executionFinished( newMethodIdentifier(), TestExecutionResult.aborted( null ) ); verify( listener ).testAssumptionFailure( any() ); } @Test public void notifiedWhenClassExecutionAborted() { adapter.executionFinished( newClassIdentifier(), TestExecutionResult.aborted( null ) ); verify( listener ).testAssumptionFailure( any() ); } @Test public void notifiedWhenMethodExecutionFailedWithAnAssertionError() throws Exception { adapter.executionFinished( newMethodIdentifier(), TestExecutionResult.failed( new AssertionError() ) ); verify( listener ).testFailed( any() ); } @Test public void notifiedWhenMethodExecutionFailedWithANonAssertionError() throws Exception { adapter.executionFinished( newMethodIdentifier(), TestExecutionResult.failed( new RuntimeException() ) ); verify( listener ).testError( any() ); } @Test public void notifiedWithCorrectNamesWhenClassExecutionFailed() { ArgumentCaptor entryCaptor = ArgumentCaptor.forClass( ReportEntry.class ); TestPlan testPlan = TestPlan.from( singletonList( new EngineDescriptor( newId(), "Luke's Plan" ) ) ); adapter.testPlanExecutionStarted( testPlan ); adapter.executionFinished( identifiersAsParentOnTestPlan( testPlan, newEngineDescriptor(), newClassDescriptor() ), TestExecutionResult.failed( new AssertionError() ) ); verify( listener ).testFailed( entryCaptor.capture() ); ReportEntry entry = entryCaptor.getValue(); assertEquals( MyTestClass.class.getTypeName(), entry.getSourceName() ); assertNotNull( entry.getStackTraceWriter() ); } @Test public void notifiedWhenMethodExecutionSucceeded() throws Exception { adapter.executionFinished( newMethodIdentifier(), successful() ); verify( listener ).testSucceeded( any() ); } @Test public void notifiedForTestSetWhenClassExecutionSucceeded() { EngineDescriptor engineDescriptor = newEngineDescriptor(); TestDescriptor classDescriptor = newClassDescriptor(); engineDescriptor.addChild( classDescriptor ); adapter.testPlanExecutionStarted( TestPlan.from( singleton( engineDescriptor ) ) ); adapter.executionStarted( TestIdentifier.from( classDescriptor ) ); adapter.executionFinished( TestIdentifier.from( classDescriptor ), successful() ); verify( listener ).testSetCompleted( new SimpleReportEntry( JUnitPlatformProvider.class.getName(), MyTestClass.class.getName() ) ); verify( listener, never() ).testSucceeded( any() ); } @Test public void notifiedWithParentDisplayNameWhenTestClassUnknown() { // Set up a test plan TestPlan plan = TestPlan.from( singletonList( new EngineDescriptor( newId(), "Luke's Plan" ) ) ); adapter.testPlanExecutionStarted( plan ); // Use the test plan to set up child with parent. final String parentDisplay = "I am your father"; TestIdentifier child = newSourcelessChildIdentifierWithParent( plan, parentDisplay, null ); adapter.executionStarted( child ); // Check that the adapter has informed Surefire that the test has been invoked, // with the parent name as source (since the test case itself had no source). ArgumentCaptor entryCaptor = ArgumentCaptor.forClass( ReportEntry.class ); verify( listener ).testStarting( entryCaptor.capture() ); assertEquals( parentDisplay, entryCaptor.getValue().getSourceName() ); } @Test public void stackTraceWriterPresentWhenParentHasSource() { TestPlan plan = TestPlan.from( singletonList( new EngineDescriptor( newId(), "Some Plan" ) ) ); adapter.testPlanExecutionStarted( plan ); TestIdentifier child = newSourcelessChildIdentifierWithParent( plan, "Parent", ClassSource.from( MyTestClass.class ) ); adapter.executionFinished( child, TestExecutionResult.failed( new RuntimeException() ) ); ArgumentCaptor entryCaptor = ArgumentCaptor.forClass( ReportEntry.class ); verify( listener ).testError( entryCaptor.capture() ); assertNotNull( entryCaptor.getValue().getStackTraceWriter() ); } @Test public void stackTraceWriterDefaultsToTestClass() { TestPlan plan = TestPlan.from( singletonList( new EngineDescriptor( newId(), "Some Plan" ) ) ); adapter.testPlanExecutionStarted( plan ); TestIdentifier child = newSourcelessChildIdentifierWithParent( plan, "Parent", null ); adapter.executionFinished( child, TestExecutionResult.failed( new RuntimeException( "message" ) ) ); ArgumentCaptor entryCaptor = ArgumentCaptor.forClass( ReportEntry.class ); verify( listener ).testError( entryCaptor.capture() ); assertNotNull( entryCaptor.getValue().getStackTraceWriter() ); assertNotNull( entryCaptor.getValue().getStackTraceWriter().smartTrimmedStackTrace() ); assertNotNull( entryCaptor.getValue().getStackTraceWriter().writeTraceToString() ); assertNotNull( entryCaptor.getValue().getStackTraceWriter().writeTrimmedTraceToString() ); } @Test public void stackTraceWriterPresentEvenWithoutException() throws Exception { adapter.executionFinished( newMethodIdentifier(), TestExecutionResult.failed( null ) ); ArgumentCaptor entryCaptor = ArgumentCaptor.forClass( ReportEntry.class ); verify( listener ).testError( entryCaptor.capture() ); assertNotNull( entryCaptor.getValue().getStackTraceWriter() ); } @Test public void displayNamesIgnoredInReport() throws NoSuchMethodException { TestMethodTestDescriptor descriptor = new TestMethodTestDescriptor( newId(), MyTestClass.class, MyTestClass.class.getDeclaredMethod( "myNamedTestMethod" ) ); TestIdentifier factoryIdentifier = TestIdentifier.from( descriptor ); ArgumentCaptor entryCaptor = ArgumentCaptor.forClass( ReportEntry.class ); adapter.executionSkipped( factoryIdentifier, "" ); verify( listener ).testSkipped( entryCaptor.capture() ); ReportEntry value = entryCaptor.getValue(); assertEquals( "myNamedTestMethod", value.getName() ); } private static TestIdentifier newMethodIdentifier() throws Exception { return TestIdentifier.from( newMethodDescriptor() ); } private static TestDescriptor newMethodDescriptor( Class... parameterTypes ) throws Exception { return new TestMethodTestDescriptor( UniqueId.forEngine( "method" ), MyTestClass.class, MyTestClass.class.getDeclaredMethod( MY_TEST_METHOD_NAME, parameterTypes ) ); } private static TestIdentifier newClassIdentifier() { return TestIdentifier.from( newClassDescriptor() ); } private static TestDescriptor newClassDescriptor() { return new ClassTestDescriptor( UniqueId.root( "class", MyTestClass.class.getName() ), MyTestClass.class ); } private static TestIdentifier newSourcelessChildIdentifierWithParent( TestPlan testPlan, String parentDisplay, TestSource parentTestSource ) { // A parent test identifier with a name. TestDescriptor parent = mock( TestDescriptor.class ); when( parent.getUniqueId() ).thenReturn( newId() ); when( parent.getDisplayName() ).thenReturn( parentDisplay ); when( parent.getLegacyReportingName() ).thenReturn( parentDisplay ); when( parent.getSource() ).thenReturn( Optional.ofNullable( parentTestSource ) ); when( parent.getType() ).thenReturn( CONTAINER ); TestIdentifier parentId = TestIdentifier.from( parent ); // The (child) test case that is to be executed as part of a test plan. TestDescriptor child = mock( TestDescriptor.class ); when( child.getUniqueId() ).thenReturn( newId() ); when( child.getType() ).thenReturn( TEST ); when( child.getLegacyReportingName() ).thenReturn( "child" ); // Ensure the child source is null yet that there is a parent -- the special case to be tested. when( child.getSource() ).thenReturn( Optional.empty() ); when( child.getParent() ).thenReturn( Optional.of( parent ) ); TestIdentifier childId = TestIdentifier.from( child ); testPlan.add( childId ); testPlan.add( parentId ); return childId; } private static TestIdentifier newEngineIdentifier() { TestDescriptor testDescriptor = newEngineDescriptor(); return TestIdentifier.from( testDescriptor ); } private static EngineDescriptor newEngineDescriptor() { return new EngineDescriptor( UniqueId.forEngine( "engine" ), "engine" ); } private TestDescriptor newTestDescriptor( UniqueId uniqueId, String displayName, Type type ) { return new AbstractTestDescriptor( uniqueId, displayName ) { @Override public Type getType() { return type; } }; } private static TestIdentifier identifiersAsParentOnTestPlan( TestPlan plan, TestDescriptor parent, TestDescriptor child ) { child.setParent( parent ); TestIdentifier parentIdentifier = TestIdentifier.from( parent ); TestIdentifier childIdentifier = TestIdentifier.from( child ); plan.add( parentIdentifier ); plan.add( childIdentifier ); return childIdentifier; } private static UniqueId newId() { return UniqueId.forEngine( "engine" ); } private static final String MY_TEST_METHOD_NAME = "myTestMethod"; private static class MyTestClass { @org.junit.jupiter.api.Test void myTestMethod() { } @org.junit.jupiter.api.Test void myTestMethod( String foo ) { } @DisplayName( "name" ) @org.junit.jupiter.api.Test void myNamedTestMethod() { } } } TestMethodFilterTest.java000066400000000000000000000065411330756104600462170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatformpackage org.apache.maven.surefire.junitplatform; /* * 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. */ import static org.apache.maven.surefire.testset.TestListResolver.toClassFileName; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.lang.reflect.Method; import org.apache.maven.surefire.testset.TestListResolver; import org.junit.Test; import org.junit.jupiter.engine.descriptor.ClassTestDescriptor; import org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor; import org.junit.platform.engine.FilterResult; import org.junit.platform.engine.UniqueId; /** * Unit tests for {@link TestMethodFilter}. * * @since 2.22.0 */ public class TestMethodFilterTest { private final TestListResolver resolver = mock( TestListResolver.class ); private final TestMethodFilter filter = new TestMethodFilter( this.resolver ); @Test public void includesBasedOnTestListResolver() throws Exception { when( resolver.shouldRun( toClassFileName( TestClass.class ), "testMethod" ) ).thenReturn( true ); FilterResult result = filter.apply( newTestMethodDescriptor() ); assertTrue( result.included() ); assertFalse( result.excluded() ); } @Test public void excludesBasedOnTestListResolver() throws Exception { when( resolver.shouldRun( toClassFileName( TestClass.class ), "testMethod" ) ).thenReturn( false ); FilterResult result = filter.apply( newTestMethodDescriptor() ); assertFalse( result.included() ); assertTrue( result.excluded() ); } @Test public void includesTestDescriptorWithClassSource() { FilterResult result = filter.apply( newClassTestDescriptor() ); assertTrue( result.included() ); assertFalse( result.excluded() ); } private static TestMethodTestDescriptor newTestMethodDescriptor() throws Exception { UniqueId uniqueId = UniqueId.forEngine( "method" ); Class testClass = TestClass.class; Method testMethod = testClass.getMethod( "testMethod" ); return new TestMethodTestDescriptor( uniqueId, testClass, testMethod ); } private static ClassTestDescriptor newClassTestDescriptor() { UniqueId uniqueId = UniqueId.forEngine( "class" ); return new ClassTestDescriptor( uniqueId, TestClass.class ); } public static class TestClass { public void testMethod() { } } } TestPlanScannerFilterTest.java000066400000000000000000000100741330756104600471770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatformpackage org.apache.maven.surefire.junitplatform; /* * 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. */ import static java.util.Collections.emptyList; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.List; import java.util.stream.Stream; import org.junit.Test; import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.TestFactory; import org.junit.platform.engine.Filter; import org.junit.platform.launcher.core.LauncherFactory; /** * Unit tests for {@link TestPlanScannerFilter}. * * @since 2.22.0 */ public class TestPlanScannerFilterTest { @Test public void emptyClassIsNotAccepted() { assertFalse( newFilter().accept( EmptyClass.class ), "does not accept empty class" ); } @Test public void classWithNoTestMethodsIsNotAccepted() { assertFalse( newFilter().accept( ClassWithMethods.class ), "does not accept class with no @Test methods" ); } @Test public void classWithTestMethodsIsAccepted() { assertTrue( newFilter().accept( ClassWithTestMethods.class ) ); } @Test public void classWithNestedTestClassIsAccepted() { assertTrue( newFilter().accept( ClassWithNestedTestClass.class ) ); } @Test public void classWithDeeplyNestedTestClassIsAccepted() { assertTrue( newFilter().accept( ClassWithDeeplyNestedTestClass.class ) ); } @Test public void classWithTestFactoryIsAccepted() { assertTrue( newFilter().accept( ClassWithTestFactory.class ) ); } @Test public void classWithNestedTestFactoryIsAccepted() { assertTrue( newFilter().accept( ClassWithNestedTestFactory.class ) ); } private static TestPlanScannerFilter newFilter() { return new TestPlanScannerFilter( LauncherFactory.create(), new Filter[0] ); } static class EmptyClass { } static class ClassWithMethods { void method1() { } void method2() { } } static class ClassWithTestMethods { @Test void test1() { } @org.junit.jupiter.api.Test public void test2() { } } static class ClassWithNestedTestClass { void method() { } @Nested class TestClass { @org.junit.jupiter.api.Test void test1() { } } } static class ClassWithDeeplyNestedTestClass { @Nested class Level1 { @Nested class Level2 { @Nested class TestClass { @org.junit.jupiter.api.Test void test1() { } } } } } static class ClassWithTestFactory { @TestFactory Stream tests() { return Stream.empty(); } } static class ClassWithNestedTestFactory { @Nested class TestClass { @TestFactory List tests() { return emptyList(); } } } } maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/000077500000000000000000000000001330756104600252515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/pom.xml000066400000000000000000000047571330756104600266030ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire-providers 2.22.0 surefire-junit3 SureFire JUnit Runner SureFire JUnit3 Runner junit junit 3.8.1 provided org.apache.maven.surefire common-junit3 ${project.version} src/main/resources/META-INF META-INF org.apache.maven.plugins maven-shade-plugin package shade org.apache.maven.surefire:common-junit3 maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/000077500000000000000000000000001330756104600260405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/000077500000000000000000000000001330756104600267645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/java/000077500000000000000000000000001330756104600277055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/java/org/000077500000000000000000000000001330756104600304745ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/java/org/apache/000077500000000000000000000000001330756104600317155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600330235ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600345705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/java/org/apache/mavenjunit/000077500000000000000000000000001330756104600357215ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefireJUnit3Provider.java000066400000000000000000000130451330756104600414160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junitpackage org.apache.maven.surefire.junit; /* * 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. */ import org.apache.maven.surefire.common.junit3.JUnit3Reflector; import org.apache.maven.surefire.common.junit3.JUnit3TestChecker; import org.apache.maven.surefire.providerapi.AbstractProvider; import org.apache.maven.surefire.providerapi.ProviderParameters; import org.apache.maven.surefire.report.ConsoleOutputCapture; import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.SimpleReportEntry; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.ReflectionUtils; import org.apache.maven.surefire.util.RunOrderCalculator; import org.apache.maven.surefire.util.ScanResult; import org.apache.maven.surefire.util.TestsToRun; import java.util.Map; import static org.apache.maven.surefire.util.internal.ObjectUtils.systemProps; /** * @author Kristian Rosenvold */ public class JUnit3Provider extends AbstractProvider { private final ClassLoader testClassLoader; private final PojoAndJUnit3Checker testChecker; private final JUnit3TestChecker jUnit3TestChecker; private final JUnit3Reflector reflector; private final ProviderParameters providerParameters; private final RunOrderCalculator runOrderCalculator; private final ScanResult scanResult; private TestsToRun testsToRun; public JUnit3Provider( ProviderParameters booterParameters ) { this.providerParameters = booterParameters; testClassLoader = booterParameters.getTestClassLoader(); scanResult = booterParameters.getScanResult(); runOrderCalculator = booterParameters.getRunOrderCalculator(); reflector = new JUnit3Reflector( testClassLoader ); jUnit3TestChecker = new JUnit3TestChecker( testClassLoader ); testChecker = new PojoAndJUnit3Checker( jUnit3TestChecker ); // Todo; use reflector } @Override public RunResult invoke( Object forkTestSet ) throws TestSetFailedException { if ( testsToRun == null ) { if ( forkTestSet instanceof TestsToRun ) { testsToRun = (TestsToRun) forkTestSet; } else if ( forkTestSet instanceof Class ) { testsToRun = TestsToRun.fromClass( (Class) forkTestSet ); } else { testsToRun = scanClassPath(); } } ReporterFactory reporterFactory = providerParameters.getReporterFactory(); RunResult runResult; try { final RunListener reporter = reporterFactory.createReporter(); ConsoleOutputCapture.startCapture( (ConsoleOutputReceiver) reporter ); final Map systemProperties = systemProps(); final String smClassName = systemProperties.get( "surefire.security.manager" ); if ( smClassName != null ) { SecurityManager securityManager = ReflectionUtils.instantiate( getClass().getClassLoader(), smClassName, SecurityManager.class ); System.setSecurityManager( securityManager ); } for ( Class clazz : testsToRun ) { SurefireTestSet surefireTestSet = createTestSet( clazz ); executeTestSet( surefireTestSet, reporter, testClassLoader, systemProperties ); } } finally { runResult = reporterFactory.close(); } return runResult; } private SurefireTestSet createTestSet( Class clazz ) throws TestSetFailedException { return reflector.isJUnit3Available() && jUnit3TestChecker.accept( clazz ) ? new JUnitTestSet( clazz, reflector ) : new PojoTestSet( clazz ); } private void executeTestSet( SurefireTestSet testSet, RunListener reporter, ClassLoader classLoader, Map systemProperties ) throws TestSetFailedException { SimpleReportEntry report = new SimpleReportEntry( getClass().getName(), testSet.getName(), systemProperties ); reporter.testSetStarting( report ); testSet.execute( reporter, classLoader ); reporter.testSetCompleted( report ); } private TestsToRun scanClassPath() { final TestsToRun testsToRun = scanResult.applyFilter( testChecker, testClassLoader ); return runOrderCalculator.orderTestClasses( testsToRun ); } @Override public Iterable> getSuites() { testsToRun = scanClassPath(); return testsToRun; } } JUnitTestSet.java000066400000000000000000000105151330756104600411330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junitpackage org.apache.maven.surefire.junit; /* * 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. */ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import org.apache.maven.surefire.common.junit3.JUnit3Reflector; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.testset.TestSetFailedException; /** * JUnit3 test set * */ public final class JUnitTestSet implements SurefireTestSet { private final Class testClass; private final JUnit3Reflector reflector; public JUnitTestSet( Class testClass, JUnit3Reflector reflector ) throws TestSetFailedException { if ( testClass == null ) { throw new NullPointerException( "testClass is null" ); } this.testClass = testClass; this.reflector = reflector; // ---------------------------------------------------------------------- // Strategy for executing JUnit tests // // o look for the suite method and if that is present execute that method // to get the test object. // // o look for test classes that are assignable from TestCase // // o look for test classes that only implement the Test interface // ---------------------------------------------------------------------- // The interface implemented by the dynamic proxy (TestListener), happens to be // the same as the param types of TestResult.addTestListener } @Override public void execute( RunListener reporter, ClassLoader loader ) throws TestSetFailedException { Class testClass = getTestClass(); try { Object testObject = reflector.constructTestObject( testClass ); final Method runMethod; if ( reflector.getTestInterface().isAssignableFrom( testObject.getClass() ) ) { runMethod = reflector.getTestInterfaceRunMethod(); } else { runMethod = reflector.getRunMethod( testClass ); } Object instanceOfTestResult = reflector.getTestResultClass().newInstance(); TestListenerInvocationHandler invocationHandler = new TestListenerInvocationHandler( reporter ); Object testListener = Proxy.newProxyInstance( loader, reflector.getInterfacesImplementedByDynamicProxy(), invocationHandler ); Object[] addTestListenerParams = { testListener }; reflector.getAddListenerMethod().invoke( instanceOfTestResult, addTestListenerParams ); Object[] runParams = { instanceOfTestResult }; runMethod.invoke( testObject, runParams ); } catch ( IllegalArgumentException e ) { throw new TestSetFailedException( testClass.getName(), e ); } catch ( InstantiationException e ) { throw new TestSetFailedException( testClass.getName(), e ); } catch ( IllegalAccessException e ) { throw new TestSetFailedException( testClass.getName(), e ); } catch ( InvocationTargetException e ) { throw new TestSetFailedException( testClass.getName(), e.getTargetException() ); } catch ( NoSuchMethodException e ) { throw new TestSetFailedException( "Class is not a JUnit TestCase", e ); } } @Override public String getName() { return testClass.getName(); } Class getTestClass() { return testClass; } } PojoAndJUnit3Checker.java000066400000000000000000000035221330756104600424420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junitpackage org.apache.maven.surefire.junit; /* * 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. */ import org.apache.maven.surefire.NonAbstractClassFilter; import org.apache.maven.surefire.common.junit3.JUnit3TestChecker; import org.apache.maven.surefire.util.ScannerFilter; /** * @author Kristian Rosenvold */ public class PojoAndJUnit3Checker implements ScannerFilter { private final JUnit3TestChecker jUnit3TestChecker; private final NonAbstractClassFilter nonAbstractClassFilter = new NonAbstractClassFilter(); public PojoAndJUnit3Checker( JUnit3TestChecker jUnit3TestChecker ) { this.jUnit3TestChecker = jUnit3TestChecker; } @Override public boolean accept( Class testClass ) { return jUnit3TestChecker.accept( testClass ) || nonAbstractClassFilter.accept( testClass ) && isPojoTest( testClass ); } private boolean isPojoTest( Class testClass ) { try { testClass.getConstructor(); return true; } catch ( Exception e ) { return false; } } } PojoTestSet.java000066400000000000000000000217361330756104600410200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junitpackage org.apache.maven.surefire.junit; /* * 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. */ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.List; import org.apache.maven.surefire.report.LegacyPojoStackTraceWriter; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.SimpleReportEntry; import org.apache.maven.surefire.report.StackTraceWriter; import org.apache.maven.surefire.testset.TestSetFailedException; import static org.apache.maven.surefire.report.SimpleReportEntry.withException; /** * Executes a JUnit3 test class * */ public class PojoTestSet implements SurefireTestSet { private static final String TEST_METHOD_PREFIX = "test"; private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0]; private final Object testObject; private final Class testClass; private List testMethods; private Method setUpMethod; private Method tearDownMethod; public PojoTestSet( final Class testClass ) throws TestSetFailedException { if ( testClass == null ) { throw new IllegalArgumentException( "testClass is null" ); } this.testClass = testClass; try { testObject = testClass.newInstance(); } catch ( InstantiationException e ) { throw new TestSetFailedException( "Unable to instantiate POJO '" + testClass + "'", e ); } catch ( IllegalAccessException e ) { throw new TestSetFailedException( "Unable to instantiate POJO '" + testClass + "'", e ); } } @Override public void execute( RunListener reportManager, ClassLoader loader ) throws TestSetFailedException { if ( reportManager == null ) { throw new NullPointerException( "reportManager is null" ); } executeTestMethods( reportManager ); } private void executeTestMethods( RunListener reportManager ) { if ( reportManager == null ) { throw new NullPointerException( "reportManager is null" ); } if ( testMethods == null ) { discoverTestMethods(); } boolean abort = false; for ( int i = 0; i < testMethods.size() && !abort; ++i ) { abort = executeTestMethod( testMethods.get( i ), EMPTY_OBJECT_ARRAY, reportManager ); } } private boolean executeTestMethod( Method method, Object[] args, RunListener reportManager ) { if ( method == null || args == null || reportManager == null ) { throw new NullPointerException(); } final String testClassName = getTestClass().getName(); final String methodName = method.getName(); final String userFriendlyMethodName = methodName + '(' + ( args.length == 0 ? "" : "Reporter" ) + ')'; final String testName = getTestName( userFriendlyMethodName ); reportManager.testStarting( new SimpleReportEntry( testClassName, testName ) ); try { setUpFixture(); } catch ( Throwable e ) { StackTraceWriter stackTraceWriter = new LegacyPojoStackTraceWriter( testClassName, methodName, e ); reportManager.testFailed( withException( testClassName, testName, stackTraceWriter ) ); // A return value of true indicates to this class's executeTestMethods // method that it should abort and not attempt to execute // any other test methods. The other caller of this method, // TestRerunner.rerun, ignores this return value, because it is // only running one test. return true; } // Make sure that tearDownFixture try { method.invoke( testObject, args ); reportManager.testSucceeded( new SimpleReportEntry( testClassName, testName ) ); } catch ( InvocationTargetException e ) { Throwable t = e.getTargetException(); StackTraceWriter stackTraceWriter = new LegacyPojoStackTraceWriter( testClassName, methodName, t ); reportManager.testFailed( withException( testClassName, testName, stackTraceWriter ) ); // Don't return here, because tearDownFixture should be called even // if the test method throws an exception. } catch ( Throwable t ) { StackTraceWriter stackTraceWriter = new LegacyPojoStackTraceWriter( testClassName, methodName, t ); reportManager.testFailed( withException( testClassName, testName, stackTraceWriter ) ); // Don't return here, because tearDownFixture should be called even // if the test method throws an exception. } try { tearDownFixture(); } catch ( Throwable t ) { StackTraceWriter stackTraceWriter = new LegacyPojoStackTraceWriter( testClassName, methodName, t ); // Treat any exception from tearDownFixture as a failure of the test. reportManager.testFailed( withException( testClassName, testName, stackTraceWriter ) ); // A return value of true indicates to this class's executeTestMethods // method that it should abort and not attempt to execute // any other test methods. The other caller of this method, // TestRerunner.rerun, ignores this return value, because it is // only running one test. return true; } // A return value of false indicates to this class's executeTestMethods // method that it should keep plowing ahead and invoke more test methods. // The other caller of this method, // TestRerunner.rerun, ignores this return value, because it is // only running one test. return false; } private String getTestName( String testMethodName ) { if ( testMethodName == null ) { throw new NullPointerException( "testMethodName is null" ); } return getTestClass().getName() + "." + testMethodName; } private void setUpFixture() throws Throwable { if ( setUpMethod != null ) { setUpMethod.invoke( testObject ); } } private void tearDownFixture() throws Throwable { if ( tearDownMethod != null ) { tearDownMethod.invoke( testObject ); } } private void discoverTestMethods() { if ( testMethods == null ) { testMethods = new ArrayList(); Method[] methods = getTestClass().getMethods(); for ( Method m : methods ) { if ( isValidTestMethod( m ) ) { String simpleName = m.getName(); // name must have 5 or more chars if ( simpleName.length() > 4 ) { String firstFour = simpleName.substring( 0, 4 ); // name must start with "test" if ( firstFour.equals( TEST_METHOD_PREFIX ) ) { testMethods.add( m ); } } } else if ( m.getName().equals( "setUp" ) && m.getParameterTypes().length == 0 ) { setUpMethod = m; } else if ( m.getName().equals( "tearDown" ) && m.getParameterTypes().length == 0 ) { tearDownMethod = m; } } } } private static boolean isValidTestMethod( Method m ) { boolean isInstanceMethod = !Modifier.isStatic( m.getModifiers() ); boolean returnsVoid = m.getReturnType().equals( void.class ); boolean hasNoParams = m.getParameterTypes().length == 0; return isInstanceMethod && returnsVoid && hasNoParams; } @Override public String getName() { return getTestClass().getName(); } private Class getTestClass() { return testClass; } } SurefireTestSet.java000066400000000000000000000022331330756104600416640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junitpackage org.apache.maven.surefire.junit; /* * 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. */ import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.testset.TestSetFailedException; /** * Describes a single test set * */ public interface SurefireTestSet { void execute( RunListener reportManager, ClassLoader loader ) throws TestSetFailedException; String getName(); } TestListenerInvocationHandler.java000066400000000000000000000145321330756104600445460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/java/org/apache/maven/surefire/junitpackage org.apache.maven.surefire.junit; /* * 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. */ import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashSet; import java.util.Set; import org.apache.maven.surefire.report.LegacyPojoStackTraceWriter; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.SimpleReportEntry; /** * Invocation Handler for TestListener proxies to delegate to our {@link RunListener} * */ public class TestListenerInvocationHandler implements InvocationHandler { // The String names of the four methods in interface junit.framework.TestListener private static final String START_TEST = "startTest"; private static final String ADD_FAILURE = "addFailure"; private static final String ADD_ERROR = "addError"; private static final String END_TEST = "endTest"; private final Set failedTestsSet = new HashSet(); private RunListener reporter; private static final Class[] EMPTY_CLASS_ARRAY = new Class[]{ }; private static final String[] EMPTY_STRING_ARRAY = new String[]{ }; private static class FailedTest { private Object testThatFailed; private Thread threadOnWhichTestFailed; FailedTest( Object testThatFailed, Thread threadOnWhichTestFailed ) { if ( testThatFailed == null ) { throw new NullPointerException( "testThatFailed is null" ); } if ( threadOnWhichTestFailed == null ) { throw new NullPointerException( "threadOnWhichTestFailed is null" ); } this.testThatFailed = testThatFailed; this.threadOnWhichTestFailed = threadOnWhichTestFailed; } @Override public boolean equals( Object obj ) { boolean retVal = true; if ( obj == null || getClass() != obj.getClass() ) { retVal = false; } else { FailedTest ft = (FailedTest) obj; if ( ft.testThatFailed != testThatFailed ) { retVal = false; } else if ( !ft.threadOnWhichTestFailed.equals( threadOnWhichTestFailed ) ) { retVal = false; } } return retVal; } @Override public int hashCode() { return threadOnWhichTestFailed.hashCode(); } } public TestListenerInvocationHandler( RunListener reporter ) { if ( reporter == null ) { throw new NullPointerException( "reporter is null" ); } this.reporter = reporter; } @Override public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable { String methodName = method.getName(); if ( methodName.equals( START_TEST ) ) { handleStartTest( args ); } else if ( methodName.equals( ADD_ERROR ) ) { handleAddError( args ); } else if ( methodName.equals( ADD_FAILURE ) ) { handleAddFailure( args ); } else if ( methodName.equals( END_TEST ) ) { handleEndTest( args ); } return null; } // Handler for TestListener.startTest(Test) public void handleStartTest( Object[] args ) { ReportEntry report = new SimpleReportEntry( args[0].getClass().getName(), args[0].toString() ); reporter.testStarting( report ); } // Handler for TestListener.addFailure(Test, Throwable) private void handleAddError( Object[] args ) throws IllegalAccessException, InvocationTargetException { ReportEntry report = SimpleReportEntry.withException( args[0].getClass().getName(), args[0].toString(), getStackTraceWriter( args ) ); reporter.testError( report ); failedTestsSet.add( new FailedTest( args[0], Thread.currentThread() ) ); } private LegacyPojoStackTraceWriter getStackTraceWriter( Object[] args ) throws IllegalAccessException, InvocationTargetException { String testName; try { Method m = args[0].getClass().getMethod( "getName", EMPTY_CLASS_ARRAY ); testName = (String) m.invoke( args[0], EMPTY_STRING_ARRAY ); } catch ( NoSuchMethodException e ) { testName = "UNKNOWN"; } return new LegacyPojoStackTraceWriter( args[0].getClass().getName(), testName, (Throwable) args[1] ); } private void handleAddFailure( Object[] args ) throws IllegalAccessException, InvocationTargetException { ReportEntry report = SimpleReportEntry.withException( args[0].getClass().getName(), args[0].toString(), getStackTraceWriter( args ) ); reporter.testFailed( report ); failedTestsSet.add( new FailedTest( args[0], Thread.currentThread() ) ); } private void handleEndTest( Object[] args ) { boolean testHadFailed = failedTestsSet.remove( new FailedTest( args[0], Thread.currentThread() ) ); if ( !testHadFailed ) { ReportEntry report = new SimpleReportEntry( args[0].getClass().getName(), args[0].toString() ); reporter.testSucceeded( report ); } } } maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/resources/000077500000000000000000000000001330756104600307765ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/resources/META-INF/000077500000000000000000000000001330756104600321365ustar00rootroot00000000000000services/000077500000000000000000000000001330756104600337025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/resources/META-INForg.apache.maven.surefire.providerapi.SurefireProvider000066400000000000000000000000571330756104600464070ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/main/resources/META-INF/servicesorg.apache.maven.surefire.junit.JUnit3Provider maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/test/000077500000000000000000000000001330756104600270175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/test/java/000077500000000000000000000000001330756104600277405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/test/java/org/000077500000000000000000000000001330756104600305275ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/test/java/org/apache/000077500000000000000000000000001330756104600317505ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600330565ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600346235ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/test/java/org/apache/mavenjunit/000077500000000000000000000000001330756104600357545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefireJUnitTestSetTest.java000066400000000000000000000075471330756104600420410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junitpackage org.apache.maven.surefire.junit; /* * 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. */ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import org.apache.maven.surefire.common.junit3.JUnit3Reflector; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.TestSetReportEntry; import org.apache.maven.surefire.testset.TestSetFailedException; import java.util.ArrayList; import java.util.List; public class JUnitTestSetTest extends TestCase { public void testExecuteSuiteClass() throws TestSetFailedException { ClassLoader testClassLoader = this.getClass().getClassLoader(); JUnit3Reflector reflector = new JUnit3Reflector( testClassLoader ); JUnitTestSet testSet = new JUnitTestSet( Suite.class, reflector ); SuccessListener listener = new SuccessListener(); testSet.execute( listener, testClassLoader ); List succeededTests = listener.getSucceededTests(); assertEquals( 1, succeededTests.size() ); assertEquals( "testSuccess(org.apache.maven.surefire.junit.JUnitTestSetTest$AlwaysSucceeds)", ( (ReportEntry) succeededTests.get( 0 ) ).getName() ); } public static final class AlwaysSucceeds extends TestCase { public void testSuccess() { assertTrue( true ); } } public static class SuccessListener implements RunListener { private List succeededTests = new ArrayList(); @Override public void testSetStarting( TestSetReportEntry report ) { } @Override public void testSetCompleted( TestSetReportEntry report ) { } @Override public void testStarting( ReportEntry report ) { } @Override public void testSucceeded( ReportEntry report ) { this.succeededTests.add( report ); } @Override public void testAssumptionFailure( ReportEntry report ) { throw new IllegalStateException(); } @Override public void testError( ReportEntry report ) { throw new IllegalStateException(); } @Override public void testFailed( ReportEntry report ) { throw new IllegalStateException(); } @Override public void testSkipped( ReportEntry report ) { throw new IllegalStateException(); } @Override public void testExecutionSkippedByUser() { } public void testSkippedByUser( ReportEntry report ) { testSkipped( report ); } public List getSucceededTests() { return succeededTests; } } public static class Suite { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTestSuite( AlwaysSucceeds.class ); return suite; } } } maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/000077500000000000000000000000001330756104600252525ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/pom.xml000066400000000000000000000061021330756104600265660ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire-providers 2.22.0 surefire-junit4 SureFire JUnit4 Runner SureFire JUnit 4.0+ Runner junit junit 4.0 provided org.apache.maven.surefire common-junit4 ${project.version} src/main/resources/META-INF META-INF org.apache.maven.plugins maven-shade-plugin 1.4 package shade true org.apache.maven.surefire:common-junit3 org.apache.maven.surefire:common-junit4 org.apache.maven.surefire:common-java5 org.apache.maven.shared:maven-shared-utils org.apache.maven.shared org.apache.maven.surefire.shade.org.apache.maven.shared maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/000077500000000000000000000000001330756104600260415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/main/000077500000000000000000000000001330756104600267655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/main/java/000077500000000000000000000000001330756104600277065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/main/java/org/000077500000000000000000000000001330756104600304755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/main/java/org/apache/000077500000000000000000000000001330756104600317165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600330245ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600345715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/main/java/org/apache/mavenjunit4/000077500000000000000000000000001330756104600360065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefireJUnit4Provider.java000066400000000000000000000370041330756104600415050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4package org.apache.maven.surefire.junit4; /* * 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. */ import org.apache.maven.surefire.booter.Command; import org.apache.maven.surefire.booter.CommandListener; import org.apache.maven.surefire.booter.CommandReader; import org.apache.maven.surefire.common.junit4.JUnit4RunListener; import org.apache.maven.surefire.common.junit4.JUnit4TestChecker; import org.apache.maven.surefire.common.junit4.JUnitTestFailureListener; import org.apache.maven.surefire.common.junit4.Notifier; import org.apache.maven.surefire.providerapi.AbstractProvider; import org.apache.maven.surefire.providerapi.ProviderParameters; import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.PojoStackTraceWriter; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.SimpleReportEntry; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.testset.TestRequest; import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.RunOrderCalculator; import org.apache.maven.surefire.util.ScanResult; import org.apache.maven.surefire.util.TestsToRun; import org.junit.runner.Description; import org.junit.runner.Request; import org.junit.runner.Result; import org.junit.runner.Runner; import org.junit.runner.manipulation.Filter; import org.junit.runner.notification.StoppedByUserException; import java.util.Collection; import java.util.Set; import static java.lang.reflect.Modifier.isAbstract; import static java.lang.reflect.Modifier.isInterface; import static org.apache.maven.surefire.booter.CommandReader.getReader; import static org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil.createMatchAnyDescriptionFilter; import static org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil.generateFailingTestDescriptions; import static org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil.isFailureInsideJUnitItself; import static org.apache.maven.surefire.common.junit4.JUnit4Reflector.createDescription; import static org.apache.maven.surefire.common.junit4.JUnit4Reflector.createIgnored; import static org.apache.maven.surefire.common.junit4.JUnit4RunListener.rethrowAnyTestMechanismFailures; import static org.apache.maven.surefire.common.junit4.JUnit4RunListenerFactory.createCustomListeners; import static org.apache.maven.surefire.common.junit4.Notifier.pureNotifier; import static org.apache.maven.surefire.report.ConsoleOutputCapture.startCapture; import static org.apache.maven.surefire.report.SimpleReportEntry.withException; import static org.apache.maven.surefire.testset.TestListResolver.optionallyWildcardFilter; import static org.apache.maven.surefire.util.TestsToRun.fromClass; import static org.apache.maven.surefire.util.internal.ObjectUtils.systemProps; import static org.junit.runner.Request.aClass; /** * @author Kristian Rosenvold */ public class JUnit4Provider extends AbstractProvider { private static final String UNDETERMINED_TESTS_DESCRIPTION = "cannot determine test in forked JVM with surefire"; private final ClassLoader testClassLoader; private final String customRunListeners; private final JUnit4TestChecker jUnit4TestChecker; private final TestListResolver testResolver; private final ProviderParameters providerParameters; private final RunOrderCalculator runOrderCalculator; private final ScanResult scanResult; private final int rerunFailingTestsCount; private final CommandReader commandsReader; private TestsToRun testsToRun; public JUnit4Provider( ProviderParameters bootParams ) { // don't start a thread in CommandReader while we are in in-plugin process commandsReader = bootParams.isInsideFork() ? getReader().setShutdown( bootParams.getShutdown() ) : null; providerParameters = bootParams; testClassLoader = bootParams.getTestClassLoader(); scanResult = bootParams.getScanResult(); runOrderCalculator = bootParams.getRunOrderCalculator(); customRunListeners = bootParams.getProviderProperties().get( "listener" ); jUnit4TestChecker = new JUnit4TestChecker( testClassLoader ); TestRequest testRequest = bootParams.getTestRequest(); testResolver = testRequest.getTestListResolver(); rerunFailingTestsCount = testRequest.getRerunFailingTestsCount(); } @Override public RunResult invoke( Object forkTestSet ) throws TestSetFailedException { upgradeCheck(); ReporterFactory reporterFactory = providerParameters.getReporterFactory(); RunResult runResult; try { RunListener reporter = reporterFactory.createReporter(); startCapture( (ConsoleOutputReceiver) reporter ); // startCapture() called in prior to setTestsToRun() if ( testsToRun == null ) { setTestsToRun( forkTestSet ); } Notifier notifier = new Notifier( new JUnit4RunListener( reporter ), getSkipAfterFailureCount() ); Result result = new Result(); notifier.addListeners( createCustomListeners( customRunListeners ) ) .addListener( result.createListener() ); if ( isFailFast() && commandsReader != null ) { registerPleaseStopJUnitListener( notifier ); } try { notifier.fireTestRunStarted( testsToRun.allowEagerReading() ? createTestsDescription( testsToRun ) : createDescription( UNDETERMINED_TESTS_DESCRIPTION ) ); if ( commandsReader != null ) { registerShutdownListener( testsToRun ); commandsReader.awaitStarted(); } for ( Class testToRun : testsToRun ) { executeTestSet( testToRun, reporter, notifier ); } } finally { notifier.fireTestRunFinished( result ); notifier.removeListeners(); } rethrowAnyTestMechanismFailures( result ); } finally { runResult = reporterFactory.close(); } return runResult; } private void setTestsToRun( Object forkTestSet ) throws TestSetFailedException { if ( forkTestSet instanceof TestsToRun ) { testsToRun = (TestsToRun) forkTestSet; } else if ( forkTestSet instanceof Class ) { testsToRun = fromClass( (Class) forkTestSet ); } else { testsToRun = scanClassPath(); } } private boolean isRerunFailingTests() { return rerunFailingTestsCount > 0; } private boolean isFailFast() { return providerParameters.getSkipAfterFailureCount() > 0; } private int getSkipAfterFailureCount() { return isFailFast() ? providerParameters.getSkipAfterFailureCount() : 0; } private void registerShutdownListener( final TestsToRun testsToRun ) { commandsReader.addShutdownListener( new CommandListener() { @Override public void update( Command command ) { testsToRun.markTestSetFinished(); } } ); } private void registerPleaseStopJUnitListener( final Notifier notifier ) { commandsReader.addSkipNextTestsListener( new CommandListener() { @Override public void update( Command command ) { notifier.pleaseStop(); } } ); } private void executeTestSet( Class clazz, RunListener reporter, Notifier notifier ) { final SimpleReportEntry report = new SimpleReportEntry( getClass().getName(), clazz.getName(), systemProps() ); reporter.testSetStarting( report ); try { executeWithRerun( clazz, notifier ); } catch ( Throwable e ) { if ( isFailFast() && e instanceof StoppedByUserException ) { String reason = e.getClass().getName(); Description skippedTest = createDescription( clazz.getName(), createIgnored( reason ) ); notifier.fireTestIgnored( skippedTest ); } else { String reportName = report.getName(); String reportSourceName = report.getSourceName(); PojoStackTraceWriter stackWriter = new PojoStackTraceWriter( reportSourceName, reportName, e ); reporter.testError( withException( reportSourceName, reportName, stackWriter ) ); } } finally { reporter.testSetCompleted( report ); } } private void executeWithRerun( Class clazz, Notifier notifier ) { JUnitTestFailureListener failureListener = new JUnitTestFailureListener(); notifier.addListener( failureListener ); boolean hasMethodFilter = testResolver != null && testResolver.hasMethodPatterns(); try { try { notifier.asFailFast( isFailFast() ); execute( clazz, notifier, hasMethodFilter ? createMethodFilter() : null ); } finally { notifier.asFailFast( false ); } // Rerun failing tests if rerunFailingTestsCount is larger than 0 if ( isRerunFailingTests() ) { Notifier rerunNotifier = pureNotifier(); notifier.copyListenersTo( rerunNotifier ); for ( int i = 0; i < rerunFailingTestsCount && !failureListener.getAllFailures().isEmpty(); i++ ) { Set failures = generateFailingTestDescriptions( failureListener.getAllFailures() ); failureListener.reset(); Filter failureDescriptionFilter = createMatchAnyDescriptionFilter( failures ); execute( clazz, rerunNotifier, failureDescriptionFilter ); } } } finally { notifier.removeListener( failureListener ); } } @Override public Iterable> getSuites() { testsToRun = scanClassPath(); return testsToRun; } private TestsToRun scanClassPath() { final TestsToRun scannedClasses = scanResult.applyFilter( jUnit4TestChecker, testClassLoader ); return runOrderCalculator.orderTestClasses( scannedClasses ); } private void upgradeCheck() throws TestSetFailedException { if ( isJUnit4UpgradeCheck() ) { Collection> classesSkippedByValidation = scanResult.getClassesSkippedByValidation( jUnit4TestChecker, testClassLoader ); if ( !classesSkippedByValidation.isEmpty() ) { StringBuilder reason = new StringBuilder(); reason.append( "Updated check failed\n" ); reason.append( "There are tests that would be run with junit4 / surefire 2.6 but not with [2.7,):\n" ); for ( Class testClass : classesSkippedByValidation ) { reason.append( " " ); reason.append( testClass.getName() ); reason.append( "\n" ); } throw new TestSetFailedException( reason.toString() ); } } } static Description createTestsDescription( Iterable> classes ) { // "null" string rather than null; otherwise NPE in junit:4.0 Description description = createDescription( "null" ); for ( Class clazz : classes ) { description.addChild( createDescription( clazz.getName() ) ); } return description; } private static boolean isJUnit4UpgradeCheck() { return System.getProperty( "surefire.junit4.upgradecheck" ) != null; } private static void execute( Class testClass, Notifier notifier, Filter filter ) { final int classModifiers = testClass.getModifiers(); if ( !isAbstract( classModifiers ) && !isInterface( classModifiers ) ) { Request request = aClass( testClass ); if ( filter != null ) { request = request.filterWith( filter ); } Runner runner = request.getRunner(); if ( countTestsInRunner( runner.getDescription() ) != 0 ) { runner.run( notifier ); } } } /** * JUnit error: test count includes one test-class as a suite which has filtered out all children. * Then the child test has a description "initializationError0(org.junit.runner.manipulation.Filter)" * for JUnit 4.0 or "initializationError(org.junit.runner.manipulation.Filter)" for JUnit 4.12 * and Description#isTest() returns true, but this description is not a real test * and therefore it should not be included in the entire test count. */ private static int countTestsInRunner( Description description ) { if ( description.isSuite() ) { int count = 0; for ( Description child : description.getChildren() ) { if ( !hasFilteredOutAllChildren( child ) ) { count += countTestsInRunner( child ); } } return count; } else if ( description.isTest() ) { return hasFilteredOutAllChildren( description ) ? 0 : 1; } else { return 0; } } private static boolean hasFilteredOutAllChildren( Description description ) { if ( isFailureInsideJUnitItself( description ) ) { return true; } String name = description.getDisplayName(); // JUnit 4.0: initializationError0; JUnit 4.12: initializationError. if ( name == null ) { return true; } else { name = name.trim(); return name.startsWith( "initializationError0(org.junit.runner.manipulation.Filter)" ) || name.startsWith( "initializationError(org.junit.runner.manipulation.Filter)" ); } } private Filter createMethodFilter() { TestListResolver methodFilter = optionallyWildcardFilter( testResolver ); return methodFilter.isEmpty() || methodFilter.isWildcard() ? null : new TestResolverFilter( methodFilter ); } } TestResolverFilter.java000066400000000000000000000042061330756104600424620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/main/java/org/apache/maven/surefire/junit4package org.apache.maven.surefire.junit4; /* * 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. */ import org.apache.maven.surefire.common.junit4.ClassMethod; import org.apache.maven.surefire.testset.TestListResolver; import org.junit.runner.Description; import org.junit.runner.manipulation.Filter; import static org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil.cutTestClassAndMethod; import static org.apache.maven.surefire.testset.TestListResolver.toClassFileName; /** * Method filter used in {@link JUnit4Provider}. */ final class TestResolverFilter extends Filter { private final TestListResolver methodFilter; TestResolverFilter( TestListResolver methodFilter ) { this.methodFilter = methodFilter; } @Override public boolean shouldRun( Description description ) { // class: Java class name; method: 1. "testMethod" or 2. "testMethod[5+whatever]" in @Parameterized final ClassMethod cm = cutTestClassAndMethod( description ); final boolean isSuite = description.isSuite(); final boolean isValidTest = description.isTest() && cm.isValid(); final String clazz = cm.getClazz(); final String method = cm.getMethod(); return isSuite || isValidTest && methodFilter.shouldRun( toClassFileName( clazz ), method ); } @Override public String describe() { return methodFilter.toString(); } } maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/main/resources/000077500000000000000000000000001330756104600307775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/main/resources/META-INF/000077500000000000000000000000001330756104600321375ustar00rootroot00000000000000services/000077500000000000000000000000001330756104600337035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/main/resources/META-INForg.apache.maven.surefire.providerapi.SurefireProvider000066400000000000000000000000601330756104600464020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/main/resources/META-INF/servicesorg.apache.maven.surefire.junit4.JUnit4Provider maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/test/000077500000000000000000000000001330756104600270205ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/test/java/000077500000000000000000000000001330756104600277415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/test/java/org/000077500000000000000000000000001330756104600305305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/test/java/org/apache/000077500000000000000000000000001330756104600317515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600330575ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600346245ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/test/java/org/apache/mavenjunit4/000077500000000000000000000000001330756104600360415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/test/java/org/apache/maven/surefireJUnit4ProviderTest.java000066400000000000000000000047231330756104600424020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit4/src/test/java/org/apache/maven/surefire/junit4package org.apache.maven.surefire.junit4; /* * 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. */ import junit.framework.TestCase; import org.apache.maven.surefire.booter.BaseProviderFactory; import org.apache.maven.surefire.testset.TestRequest; import org.junit.runner.Description; import java.util.HashMap; import static java.util.Arrays.asList; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; import static org.junit.runner.Description.createSuiteDescription; /** * @author Kristian Rosenvold */ public class JUnit4ProviderTest extends TestCase { public void testCreateProvider() { assertNotNull( getJUnit4Provider() ); } private JUnit4Provider getJUnit4Provider() { BaseProviderFactory providerParameters = new BaseProviderFactory( null, true ); providerParameters.setProviderProperties( new HashMap() ); providerParameters.setClassLoaders( getClass().getClassLoader() ); providerParameters.setTestRequest( new TestRequest( null, null, null ) ); return new JUnit4Provider( providerParameters ); } public void testShouldCreateDescription() { class A { } class B { } Description d = JUnit4Provider.createTestsDescription( asList( A.class, B.class ) ); assertThat( d, is( notNullValue() ) ); assertThat( d.getDisplayName(), not( isEmptyOrNullString() ) ); assertThat( d.getDisplayName(), is( "null" ) ); assertThat( d.getChildren(), hasSize( 2 ) ); Description a = createSuiteDescription( A.class ); Description b = createSuiteDescription( B.class ); assertThat( d.getChildren(), contains( a, b ) ); } } maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/000077500000000000000000000000001330756104600253415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/pom.xml000066400000000000000000000142101330756104600266540ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire-providers 2.22.0 surefire-junit47 SureFire JUnitCore Runner SureFire JUnitCore (JUnit 4.7+) Runner com.github.stephenc.jcip jcip-annotations 1.0-1 test junit junit 4.12 provided org.apache.maven.surefire maven-surefire-common test org.apache.maven.surefire common-junit48 ${project.version} src/main/resources/META-INF META-INF maven-dependency-plugin main process-sources copy ${project.build.directory}/endorsed false true junit junit 4.7 jar test process-sources copy ${project.build.directory}/endorsed-test false true junit junit 4.12 jar maven-compiler-plugin ${project.build.directory}/endorsed ${project.build.directory}/endorsed-test maven-surefire-plugin true **/JUnit47SuiteTest.java org.apache.maven.plugins maven-shade-plugin package shade true org.apache.maven.surefire:common-junit3 org.apache.maven.surefire:common-junit4 org.apache.maven.surefire:common-java5 javax.annotation org.apache.maven.surefire.javax.annotation org.apache.maven.shared org.apache.maven.surefire.org.apache.maven.shared org.apache.maven.surefire.junitcore.ThreadSafe org.junit.runner.notification.RunListener.ThreadSafe org.apache.maven.surefire.junitcore.ThreadSafe maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/000077500000000000000000000000001330756104600261305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/000077500000000000000000000000001330756104600270545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/000077500000000000000000000000001330756104600277755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/000077500000000000000000000000001330756104600305645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/000077500000000000000000000000001330756104600320055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600331135ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600346605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/mavenjunitcore/000077500000000000000000000000001330756104600366625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefireAsynchronousRunner.java000066400000000000000000000046271330756104600434230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import org.junit.runners.model.RunnerScheduler; /** * Since SUREFIRE 2.18 this class is deprecated. * Please use {@link org.apache.maven.surefire.junitcore.pc.ParallelComputerBuilder} instead. * * @author Kristian Rosenvold */ @Deprecated public class AsynchronousRunner implements RunnerScheduler { private final List> futures = Collections.synchronizedList( new ArrayList>() ); private final ExecutorService fService; public AsynchronousRunner( ExecutorService fService ) { this.fService = fService; } @Override public void schedule( final Runnable childStatement ) { futures.add( fService.submit( Executors.callable( childStatement ) ) ); } @Override public void finished() { try { waitForCompletion(); } catch ( ExecutionException e ) { throw new RuntimeException( e ); } } public void waitForCompletion() throws ExecutionException { for ( Future each : futures ) { try { each.get(); } catch ( InterruptedException e ) { throw new RuntimeException( e ); } } } } ClassesParallelRunListener.java000066400000000000000000000034371330756104600450010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import java.util.Map; import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.testset.TestSetFailedException; /** * @author Kristian Rosenvold */ @ThreadSafe public class ClassesParallelRunListener extends ConcurrentRunListener { public ClassesParallelRunListener( Map classMethodCounts, ReporterFactory reporterFactory, ConsoleStream consoleStream ) throws TestSetFailedException { super( reporterFactory, consoleStream, false, classMethodCounts ); } @Override protected void checkIfTestSetCanBeReported( TestSet testSetForTest ) { TestSet currentlyAttached = TestSet.getThreadTestSet(); if ( currentlyAttached != null && currentlyAttached != testSetForTest ) { currentlyAttached.setAllScheduled( getRunListener() ); } } } ConcurrentRunListener.java000066400000000000000000000171441330756104600440510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import java.util.Map; import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.StackTraceWriter; import org.apache.maven.surefire.report.TestSetReportEntry; import org.apache.maven.surefire.testset.TestSetFailedException; import static org.apache.maven.surefire.junitcore.TestMethod.getThreadTestMethod; /** * Handles responses from concurrent junit *
* Stuff to remember about JUnit threading: * parallel=classes; beforeClass/afterClass, constructor and all tests method run on same thread * parallel=methods; beforeClass/afterClass run on main thread, constructor + each test method run on same thread * parallel=both; same as parallel=methods * * @see org.apache.maven.surefire.junitcore.JUnitCoreRunListener for details about regular junit run listening * @author Kristian Rosenvold */ public abstract class ConcurrentRunListener implements RunListener, ConsoleOutputReceiver { private final Map classMethodCounts; private final ThreadLocal reporterManagerThreadLocal; private final boolean reportImmediately; private final ConsoleStream consoleStream; ConcurrentRunListener( final ReporterFactory reporterFactory, ConsoleStream consoleStream, boolean reportImmediately, Map classMethodCounts ) throws TestSetFailedException { this.reportImmediately = reportImmediately; this.classMethodCounts = classMethodCounts; this.consoleStream = consoleStream; reporterManagerThreadLocal = new ThreadLocal() { @Override protected RunListener initialValue() { return reporterFactory.createReporter(); } }; } @Override public void testSetStarting( TestSetReportEntry description ) { } @Override public void testSetCompleted( TestSetReportEntry result ) { final RunListener reporterManager = getRunListener(); for ( TestSet testSet : classMethodCounts.values() ) { testSet.replay( reporterManager ); } reporterManagerThreadLocal.remove(); } @Override public void testFailed( ReportEntry failure ) { final TestMethod testMethod = getOrCreateThreadAttachedTestMethod( failure ); if ( testMethod != null ) { testMethod.testFailure( failure ); testMethod.detachFromCurrentThread(); } } @Override public void testError( ReportEntry failure ) { final TestMethod testMethod = getOrCreateThreadAttachedTestMethod( failure ); if ( testMethod != null ) { testMethod.testError( failure ); testMethod.detachFromCurrentThread(); } } @Override public void testSkipped( ReportEntry description ) { TestSet testSet = getTestSet( description ); TestMethod testMethod = testSet.createThreadAttachedTestMethod( description ); testMethod.testIgnored( description ); testSet.incrementFinishedTests( getRunListener(), reportImmediately ); testMethod.detachFromCurrentThread(); } @Override public void testExecutionSkippedByUser() { // cannot guarantee proper call to all listeners getRunListener().testExecutionSkippedByUser(); } @Override public void testAssumptionFailure( ReportEntry failure ) { final TestMethod testMethod = getOrCreateThreadAttachedTestMethod( failure ); if ( testMethod != null ) { testMethod.testAssumption( failure ); testMethod.detachFromCurrentThread(); } } @Override public void testStarting( ReportEntry description ) { TestSet testSet = getTestSet( description ); testSet.createThreadAttachedTestMethod( description ); checkIfTestSetCanBeReported( testSet ); testSet.attachToThread(); } @Override public void testSucceeded( ReportEntry report ) { TestMethod testMethod = getThreadTestMethod(); if ( testMethod != null ) { testMethod.testFinished(); testMethod.getTestSet().incrementFinishedTests( getRunListener(), reportImmediately ); testMethod.detachFromCurrentThread(); } } private TestMethod getOrCreateThreadAttachedTestMethod( ReportEntry description ) { TestMethod threadTestMethod = getThreadTestMethod(); if ( threadTestMethod != null ) { return threadTestMethod; } TestSet testSet = getTestSet( description ); if ( testSet == null ) { consoleStream.println( description.getName() ); StackTraceWriter writer = description.getStackTraceWriter(); if ( writer != null ) { consoleStream.println( writer.writeTraceToString() ); } return null; } else { return testSet.createThreadAttachedTestMethod( description ); } } protected abstract void checkIfTestSetCanBeReported( TestSet testSetForTest ); private TestSet getTestSet( ReportEntry description ) { return classMethodCounts.get( description.getSourceName() ); } RunListener getRunListener() { return reporterManagerThreadLocal.get(); } public static ConcurrentRunListener createInstance( Map classMethodCounts, ReporterFactory reporterFactory, boolean parallelClasses, boolean parallelBoth, ConsoleStream consoleStream ) throws TestSetFailedException { return parallelClasses ? new ClassesParallelRunListener( classMethodCounts, reporterFactory, consoleStream ) : new MethodsParallelRunListener( classMethodCounts, reporterFactory, !parallelBoth, consoleStream ); } @Override public void writeTestOutput( byte[] buf, int off, int len, boolean stdout ) { TestMethod threadTestMethod = getThreadTestMethod(); if ( threadTestMethod != null ) { LogicalStream logicalStream = threadTestMethod.getLogicalStream(); logicalStream.write( stdout, buf, off, len ); } else { // Not able to associate output with any thread. Just dump to console consoleStream.println( buf, off, len ); } } } ConfigurableParallelComputer.java000066400000000000000000000131631330756104600453250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import org.apache.maven.surefire.util.internal.DaemonThreadFactory; import org.junit.runner.Computer; import org.junit.runner.Runner; import org.junit.runners.ParentRunner; import org.junit.runners.Suite; import org.junit.runners.model.InitializationError; import org.junit.runners.model.RunnerBuilder; import org.junit.runners.model.RunnerScheduler; /** * Since SUREFIRE 2.18 this class is deprecated. * Please use {@link org.apache.maven.surefire.junitcore.pc.ParallelComputerBuilder} instead. * * @author Kristian Rosenvold */ @Deprecated public class ConfigurableParallelComputer extends Computer { private static final ThreadFactory DAEMON_THREAD_FACTORY = DaemonThreadFactory.newDaemonThreadFactory(); private final boolean fClasses; private final boolean fMethods; private final boolean fixedPool; private final ExecutorService fService; private final List nonBlockers = Collections.synchronizedList( new ArrayList() ); public ConfigurableParallelComputer() { this( true, true, Executors.newCachedThreadPool( DAEMON_THREAD_FACTORY ), false ); } public ConfigurableParallelComputer( boolean fClasses, boolean fMethods ) { this( fClasses, fMethods, Executors.newCachedThreadPool( DAEMON_THREAD_FACTORY ), false ); } public ConfigurableParallelComputer( boolean fClasses, boolean fMethods, Integer numberOfThreads, boolean perCore ) { this( fClasses, fMethods, Executors.newFixedThreadPool( numberOfThreads * ( perCore ? Runtime.getRuntime().availableProcessors() : 1 ), DAEMON_THREAD_FACTORY ), true ); } private ConfigurableParallelComputer( boolean fClasses, boolean fMethods, ExecutorService executorService, boolean fixedPool ) { this.fClasses = fClasses; this.fMethods = fMethods; fService = executorService; this.fixedPool = fixedPool; } @SuppressWarnings( { "UnusedDeclaration" } ) public void close() throws ExecutionException { for ( AsynchronousRunner nonBlocker : nonBlockers ) { nonBlocker.waitForCompletion(); } fService.shutdown(); try { if ( !fService.awaitTermination( 10, java.util.concurrent.TimeUnit.SECONDS ) ) { throw new RuntimeException( "Executor did not shut down within timeout" ); } } catch ( InterruptedException e ) { throw new RuntimeException( e ); } } private Runner parallelize( Runner runner, RunnerScheduler runnerInterceptor ) { if ( runner instanceof ParentRunner ) { ( (ParentRunner) runner ).setScheduler( runnerInterceptor ); } return runner; } private RunnerScheduler getMethodInterceptor() { if ( fClasses && fMethods ) { final AsynchronousRunner blockingAsynchronousRunner = new AsynchronousRunner( fService ); nonBlockers.add( blockingAsynchronousRunner ); return blockingAsynchronousRunner; } return fMethods ? new AsynchronousRunner( fService ) : new SynchronousRunner(); } private RunnerScheduler getClassInterceptor() { if ( fClasses ) { return fMethods ? new SynchronousRunner() : new AsynchronousRunner( fService ); } return new SynchronousRunner(); } @Override public Runner getSuite( RunnerBuilder builder, java.lang.Class[] classes ) throws InitializationError { Runner suite = super.getSuite( builder, classes ); return fClasses ? parallelize( suite, getClassInterceptor() ) : suite; } @Override protected Runner getRunner( RunnerBuilder builder, Class testClass ) throws Throwable { Runner runner = super.getRunner( builder, testClass ); return fMethods && !isTestSuite( testClass ) ? parallelize( runner, getMethodInterceptor() ) : runner; } private boolean isTestSuite( Class testClass ) { // Todo: Find out how/if this is enough final Suite.SuiteClasses annotation = testClass.getAnnotation( Suite.SuiteClasses.class ); return ( annotation != null ); } @Override public String toString() { return "ConfigurableParallelComputer{" + "classes=" + fClasses + ", methods=" + fMethods + ", fixedPool=" + fixedPool + '}'; } } FilteringRequest.java000066400000000000000000000030521330756104600430210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import org.junit.runner.Request; import org.junit.runner.Runner; import org.junit.runner.manipulation.Filter; import org.junit.runner.manipulation.NoTestsRemainException; /** * Moved nested class from {@link JUnitCoreWrapper}. */ final class FilteringRequest extends Request { private Runner filteredRunner; FilteringRequest( Request req, Filter filter ) { try { Runner runner = req.getRunner(); filter.apply( runner ); filteredRunner = runner; } catch ( NoTestsRemainException e ) { filteredRunner = null; } } @Override public Runner getRunner() { return filteredRunner; } } JUnitCore.java000066400000000000000000000046461330756104600414010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import org.apache.maven.surefire.common.junit4.Notifier; import org.apache.maven.surefire.testset.TestSetFailedException; import org.junit.runner.Result; import org.junit.runner.Runner; import org.junit.runner.notification.RunListener; /** * JUnitCore solves bugs in original junit class {@link org.junit.runner.JUnitCore}.

* The notifier method {@link org.junit.runner.notification.RunNotifier#fireTestRunFinished} * is called anyway in finally block. * * @author Tibor Digana (tibor17) * @since 2.19 * @see JUnit issue 1186 */ class JUnitCore { private final Notifier notifier; JUnitCore( Notifier notifier ) { this.notifier = notifier; } Result run( Runner runner ) throws TestSetFailedException { Result result = new Result(); RunListener listener = result.createListener(); notifier.addFirstListener( listener ); try { notifier.fireTestRunStarted( runner.getDescription() ); runner.run( notifier ); } catch ( Throwable e ) { afterException( e ); } finally { notifier.fireTestRunFinished( result ); notifier.removeListener( listener ); afterFinished(); } return result; } protected void afterException( Throwable e ) throws TestSetFailedException { throw new TestSetFailedException( e ); } protected void afterFinished() { } } JUnitCoreParameters.java000066400000000000000000000156321330756104600434220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import java.util.ArrayList; import java.util.Collection; import java.util.Map; import org.apache.maven.surefire.booter.ProviderParameterNames; /** * @author Kristian Rosenvold */ public final class JUnitCoreParameters { public static final String PARALLEL_KEY = ProviderParameterNames.PARALLEL_PROP; public static final String PERCORETHREADCOUNT_KEY = "perCoreThreadCount"; public static final String THREADCOUNT_KEY = ProviderParameterNames.THREADCOUNT_PROP; public static final String THREADCOUNTSUITES_KEY = ProviderParameterNames.THREADCOUNTSUITES_PROP; public static final String THREADCOUNTCLASSES_KEY = ProviderParameterNames.THREADCOUNTCLASSES_PROP; public static final String THREADCOUNTMETHODS_KEY = ProviderParameterNames.THREADCOUNTMETHODS_PROP; public static final String USEUNLIMITEDTHREADS_KEY = "useUnlimitedThreads"; public static final String PARALLEL_TIMEOUT_KEY = ProviderParameterNames.PARALLEL_TIMEOUT_PROP; public static final String PARALLEL_TIMEOUTFORCED_KEY = ProviderParameterNames.PARALLEL_TIMEOUTFORCED_PROP; public static final String PARALLEL_OPTIMIZE_KEY = ProviderParameterNames.PARALLEL_OPTIMIZE_PROP; private final String parallel; private final boolean perCoreThreadCount; private final int threadCount; private final int threadCountSuites; private final int threadCountClasses; private final int threadCountMethods; private final double parallelTestsTimeoutInSeconds; private final double parallelTestsTimeoutForcedInSeconds; private final boolean useUnlimitedThreads; private final boolean parallelOptimization; public JUnitCoreParameters( Map properties ) { parallel = property( properties, PARALLEL_KEY, "none" ).toLowerCase(); perCoreThreadCount = property( properties, PERCORETHREADCOUNT_KEY, true ); threadCount = property( properties, THREADCOUNT_KEY, 0 ); threadCountMethods = property( properties, THREADCOUNTMETHODS_KEY, 0 ); threadCountClasses = property( properties, THREADCOUNTCLASSES_KEY, 0 ); threadCountSuites = property( properties, THREADCOUNTSUITES_KEY, 0 ); useUnlimitedThreads = property( properties, USEUNLIMITEDTHREADS_KEY, false ); parallelTestsTimeoutInSeconds = Math.max( property( properties, PARALLEL_TIMEOUT_KEY, 0d ), 0 ); parallelTestsTimeoutForcedInSeconds = Math.max( property( properties, PARALLEL_TIMEOUTFORCED_KEY, 0d ), 0 ); parallelOptimization = property( properties, PARALLEL_OPTIMIZE_KEY, true ); } private static Collection lowerCase( String... elements ) { ArrayList lowerCase = new ArrayList(); for ( String element : elements ) { lowerCase.add( element.toLowerCase() ); } return lowerCase; } private boolean isAllParallel() { return "all".equals( parallel ); } public boolean isParallelMethods() { return isAllParallel() || lowerCase( "both", "methods", "suitesAndMethods", "classesAndMethods" ).contains( parallel ); } public boolean isParallelClasses() { return isAllParallel() || lowerCase( "both", "classes", "suitesAndClasses", "classesAndMethods" ).contains( parallel ); } public boolean isParallelSuites() { return isAllParallel() || lowerCase( "suites", "suitesAndClasses", "suitesAndMethods" ).contains( parallel ); } /** * @deprecated Instead use the expression isParallelMethods() && isParallelClasses(). * @return {@code true} if classes and methods are both parallel */ @Deprecated @SuppressWarnings( "unused" ) public boolean isParallelBoth() { return isParallelMethods() && isParallelClasses(); } public boolean isPerCoreThreadCount() { return perCoreThreadCount; } public int getThreadCount() { return threadCount; } public int getThreadCountMethods() { return threadCountMethods; } public int getThreadCountClasses() { return threadCountClasses; } public int getThreadCountSuites() { return threadCountSuites; } public boolean isUseUnlimitedThreads() { return useUnlimitedThreads; } public double getParallelTestsTimeoutInSeconds() { return parallelTestsTimeoutInSeconds; } public double getParallelTestsTimeoutForcedInSeconds() { return parallelTestsTimeoutForcedInSeconds; } public boolean isNoThreading() { return !isParallelismSelected(); } public boolean isParallelismSelected() { return isParallelSuites() || isParallelClasses() || isParallelMethods(); } public boolean isParallelOptimization() { return parallelOptimization; } @Override public String toString() { return "parallel='" + parallel + '\'' + ", perCoreThreadCount=" + perCoreThreadCount + ", threadCount=" + threadCount + ", useUnlimitedThreads=" + useUnlimitedThreads + ", threadCountSuites=" + threadCountSuites + ", threadCountClasses=" + threadCountClasses + ", threadCountMethods=" + threadCountMethods + ", parallelOptimization=" + parallelOptimization; } private static boolean property( Map properties, String key, boolean fallback ) { return properties.containsKey( key ) ? Boolean.valueOf( properties.get( key ) ) : fallback; } private static String property( Map properties, String key, String fallback ) { return properties.containsKey( key ) ? properties.get( key ) : fallback; } private static int property( Map properties, String key, int fallback ) { return properties.containsKey( key ) ? Integer.valueOf( properties.get( key ) ) : fallback; } private static double property( Map properties, String key, double fallback ) { return properties.containsKey( key ) ? Double.valueOf( properties.get( key ) ) : fallback; } } JUnitCoreProvider.java000066400000000000000000000255331330756104600431120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import org.apache.maven.surefire.booter.Command; import org.apache.maven.surefire.booter.CommandListener; import org.apache.maven.surefire.booter.CommandReader; import org.apache.maven.surefire.common.junit4.JUnit4RunListener; import org.apache.maven.surefire.common.junit4.JUnitTestFailureListener; import org.apache.maven.surefire.common.junit4.Notifier; import org.apache.maven.surefire.common.junit48.FilterFactory; import org.apache.maven.surefire.common.junit48.JUnit48Reflector; import org.apache.maven.surefire.common.junit48.JUnit48TestChecker; import org.apache.maven.surefire.providerapi.AbstractProvider; import org.apache.maven.surefire.providerapi.ProviderParameters; import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.RunOrderCalculator; import org.apache.maven.surefire.util.ScanResult; import org.apache.maven.surefire.util.ScannerFilter; import org.apache.maven.surefire.util.TestsToRun; import org.junit.runner.Description; import org.junit.runner.manipulation.Filter; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import static org.apache.maven.surefire.booter.CommandReader.getReader; import static org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil.generateFailingTestDescriptions; import static org.apache.maven.surefire.common.junit4.JUnit4RunListenerFactory.createCustomListeners; import static org.apache.maven.surefire.common.junit4.Notifier.pureNotifier; import static org.apache.maven.surefire.junitcore.ConcurrentRunListener.createInstance; import static org.apache.maven.surefire.report.ConsoleOutputCapture.startCapture; import static org.apache.maven.surefire.testset.TestListResolver.optionallyWildcardFilter; import static org.apache.maven.surefire.util.TestsToRun.fromClass; /** * @author Kristian Rosenvold */ @SuppressWarnings( { "UnusedDeclaration" } ) public class JUnitCoreProvider extends AbstractProvider { private final ClassLoader testClassLoader; private final JUnitCoreParameters jUnitCoreParameters; private final ScannerFilter scannerFilter; private final String customRunListeners; private final ProviderParameters providerParameters; private final ScanResult scanResult; private final int rerunFailingTestsCount; private final JUnit48Reflector jUnit48Reflector; private final RunOrderCalculator runOrderCalculator; private final TestListResolver testResolver; private final CommandReader commandsReader; private TestsToRun testsToRun; public JUnitCoreProvider( ProviderParameters bootParams ) { // don't start a thread in CommandReader while we are in in-plugin process commandsReader = bootParams.isInsideFork() ? getReader().setShutdown( bootParams.getShutdown() ) : null; providerParameters = bootParams; testClassLoader = bootParams.getTestClassLoader(); scanResult = bootParams.getScanResult(); runOrderCalculator = bootParams.getRunOrderCalculator(); jUnitCoreParameters = new JUnitCoreParameters( bootParams.getProviderProperties() ); scannerFilter = new JUnit48TestChecker( testClassLoader ); testResolver = bootParams.getTestRequest().getTestListResolver(); rerunFailingTestsCount = bootParams.getTestRequest().getRerunFailingTestsCount(); customRunListeners = bootParams.getProviderProperties().get( "listener" ); jUnit48Reflector = new JUnit48Reflector( testClassLoader ); } @Override public Iterable> getSuites() { testsToRun = scanClassPath(); return testsToRun; } private boolean isSingleThreaded() { return jUnitCoreParameters.isNoThreading(); } @Override public RunResult invoke( Object forkTestSet ) throws TestSetFailedException { final ReporterFactory reporterFactory = providerParameters.getReporterFactory(); final ConsoleStream consoleStream = providerParameters.getConsoleLogger(); Notifier notifier = new Notifier( createRunListener( reporterFactory, consoleStream ), getSkipAfterFailureCount() ); // startCapture() called in createRunListener() in prior to setTestsToRun() Filter filter = jUnit48Reflector.isJUnit48Available() ? createJUnit48Filter() : null; if ( testsToRun == null ) { setTestsToRun( forkTestSet ); } // Add test failure listener JUnitTestFailureListener testFailureListener = new JUnitTestFailureListener(); notifier.addListener( testFailureListener ); if ( isFailFast() && commandsReader != null ) { registerPleaseStopJUnitListener( notifier ); } final RunResult runResult; try { JUnitCoreWrapper core = new JUnitCoreWrapper( notifier, jUnitCoreParameters, consoleStream ); if ( commandsReader != null ) { registerShutdownListener( testsToRun ); commandsReader.awaitStarted(); } notifier.asFailFast( isFailFast() ); core.execute( testsToRun, createCustomListeners( customRunListeners ), filter ); notifier.asFailFast( false ); // Rerun failing tests if rerunFailingTestsCount is larger than 0 if ( isRerunFailingTests() ) { Notifier rerunNotifier = pureNotifier(); notifier.copyListenersTo( rerunNotifier ); JUnitCoreWrapper rerunCore = new JUnitCoreWrapper( rerunNotifier, jUnitCoreParameters, consoleStream ); for ( int i = 0; i < rerunFailingTestsCount && !testFailureListener.getAllFailures().isEmpty(); i++ ) { Set failures = generateFailingTestDescriptions( testFailureListener.getAllFailures() ); testFailureListener.reset(); FilterFactory filterFactory = new FilterFactory( testClassLoader ); Filter failureDescriptionFilter = filterFactory.createMatchAnyDescriptionFilter( failures ); rerunCore.execute( testsToRun, failureDescriptionFilter ); } } } finally { runResult = reporterFactory.close(); notifier.removeListeners(); } return runResult; } private void setTestsToRun( Object forkTestSet ) throws TestSetFailedException { if ( forkTestSet instanceof TestsToRun ) { testsToRun = (TestsToRun) forkTestSet; } else if ( forkTestSet instanceof Class ) { Class theClass = (Class) forkTestSet; testsToRun = fromClass( theClass ); } else { testsToRun = scanClassPath(); } } private boolean isRerunFailingTests() { return rerunFailingTestsCount > 0; } private boolean isFailFast() { return providerParameters.getSkipAfterFailureCount() > 0; } private int getSkipAfterFailureCount() { return isFailFast() ? providerParameters.getSkipAfterFailureCount() : 0; } private void registerShutdownListener( final TestsToRun testsToRun ) { commandsReader.addShutdownListener( new CommandListener() { @Override public void update( Command command ) { testsToRun.markTestSetFinished(); } } ); } private void registerPleaseStopJUnitListener( final Notifier stoppable ) { commandsReader.addSkipNextTestsListener( new CommandListener() { @Override public void update( Command command ) { stoppable.pleaseStop(); } } ); } private JUnit4RunListener createRunListener( ReporterFactory reporterFactory, ConsoleStream consoleStream ) throws TestSetFailedException { if ( isSingleThreaded() ) { NonConcurrentRunListener rm = new NonConcurrentRunListener( reporterFactory.createReporter() ); startCapture( rm ); return rm; } else { final Map testSetMap = new ConcurrentHashMap(); ConcurrentRunListener listener = createInstance( testSetMap, reporterFactory, isParallelTypes(), isParallelMethodsAndTypes(), consoleStream ); startCapture( listener ); return new JUnitCoreRunListener( listener, testSetMap ); } } private boolean isParallelMethodsAndTypes() { return jUnitCoreParameters.isParallelMethods() && isParallelTypes(); } private boolean isParallelTypes() { return jUnitCoreParameters.isParallelClasses() || jUnitCoreParameters.isParallelSuites(); } private Filter createJUnit48Filter() { final FilterFactory factory = new FilterFactory( testClassLoader ); Map props = providerParameters.getProviderProperties(); Filter groupFilter = factory.canCreateGroupFilter( props ) ? factory.createGroupFilter( props ) : null; TestListResolver methodFilter = optionallyWildcardFilter( testResolver ); boolean onlyGroups = methodFilter.isEmpty() || methodFilter.isWildcard(); if ( onlyGroups ) { return groupFilter; } else { Filter jUnitMethodFilter = factory.createMethodFilter( methodFilter ); return groupFilter == null ? jUnitMethodFilter : factory.and( groupFilter, jUnitMethodFilter ); } } private TestsToRun scanClassPath() { TestsToRun scanned = scanResult.applyFilter( scannerFilter, testClassLoader ); return runOrderCalculator.orderTestClasses( scanned ); } } JUnitCoreRunListener.java000066400000000000000000000103731330756104600435660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import org.apache.maven.surefire.common.junit4.JUnit4RunListener; import org.apache.maven.surefire.common.junit48.JUnit46StackTraceWriter; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.StackTraceWriter; import org.junit.runner.Description; import org.junit.runner.Result; import org.junit.runner.notification.Failure; import java.util.Map; /** * Noteworthy things about JUnit4 listening: *
* A class that is annotated with @Ignore will have one invocation of "testSkipped" with source==name * A method that is annotated with @Ignore will have a invocation of testSkipped with source and name distinct * Methods annotated with @Ignore trigger no further events. * * @see org.apache.maven.surefire.junitcore.ConcurrentRunListener for details about parallel running */ public class JUnitCoreRunListener extends JUnit4RunListener { private final Map classMethodCounts; /** * @param reporter the report manager to log testing events to * @param classMethodCounts A map of methods */ public JUnitCoreRunListener( RunListener reporter, Map classMethodCounts ) { super( reporter ); this.classMethodCounts = classMethodCounts; } /** * Called right before any tests from a specific class are run. * * @see org.junit.runner.notification.RunListener#testRunStarted(org.junit.runner.Description) */ @Override public void testRunStarted( Description description ) throws Exception { fillTestCountMap( description ); reporter.testSetStarting( null ); // Not entirely meaningful as we can see } @Override public void testRunFinished( Result result ) throws Exception { try { reporter.testSetCompleted( null ); } finally { classMethodCounts.clear(); } } private void fillTestCountMap( Description testDesc ) { for ( Description child : testDesc.getChildren() ) { if ( !asTestLeaf( child ) ) { fillTestCountMap( child ); } } } private boolean asTestLeaf( Description description ) { if ( description.isTest() ) { final String testClassName = extractDescriptionClassName( description ); if ( testClassName != null ) { final TestSet testSet; if ( classMethodCounts.containsKey( testClassName ) ) { testSet = classMethodCounts.get( testClassName ); } else { testSet = new TestSet( testClassName ); classMethodCounts.put( testClassName, testSet ); } testSet.incrementTestMethodCount(); } return true; } else { return false; } } @Override protected StackTraceWriter createStackTraceWriter( Failure failure ) { return new JUnit46StackTraceWriter( failure ); } @Override protected String extractDescriptionClassName( Description description ) { return description.getClassName(); } @Override protected String extractDescriptionMethodName( Description description ) { return description.getMethodName(); } } JUnitCoreWrapper.java000066400000000000000000000167441330756104600427440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import org.apache.maven.surefire.common.junit4.Notifier; import org.apache.maven.surefire.junitcore.pc.ParallelComputer; import org.apache.maven.surefire.junitcore.pc.ParallelComputerBuilder; import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.TestsToRun; import org.junit.Ignore; import org.junit.runner.Computer; import org.junit.runner.Description; import org.junit.runner.Request; import org.junit.runner.Result; import org.junit.runner.manipulation.Filter; import org.junit.runner.notification.RunListener; import org.junit.runner.notification.StoppedByUserException; import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.Queue; import static org.apache.maven.surefire.common.junit4.JUnit4Reflector.createDescription; import static org.apache.maven.surefire.common.junit4.JUnit4Reflector.createIgnored; import static org.apache.maven.surefire.common.junit4.JUnit4RunListener.rethrowAnyTestMechanismFailures; import static org.junit.runner.Computer.serial; import static org.junit.runner.Request.classes; /** * Encapsulates access to JUnitCore * * @author Kristian Rosenvold */ final class JUnitCoreWrapper { private final Notifier notifier; private final JUnitCoreParameters jUnitCoreParameters; private final ConsoleStream consoleStream; JUnitCoreWrapper( Notifier notifier, JUnitCoreParameters jUnitCoreParameters, ConsoleStream consoleStream ) { this.notifier = notifier; this.jUnitCoreParameters = jUnitCoreParameters; this.consoleStream = consoleStream; } void execute( TestsToRun testsToRun, Filter filter ) throws TestSetFailedException { execute( testsToRun, true, Collections.emptyList(), filter ); } void execute( TestsToRun testsToRun, Collection listeners, Filter filter ) throws TestSetFailedException { execute( testsToRun, false, listeners, filter ); } private void execute( TestsToRun testsToRun, boolean useIterated, Collection listeners, Filter filter ) throws TestSetFailedException { if ( testsToRun.allowEagerReading() ) { executeEager( testsToRun, filter, listeners ); } else { executeLazy( testsToRun, useIterated, filter, listeners ); } } private JUnitCore createJUnitCore( Notifier notifier, Collection listeners ) { JUnitCore junitCore = new JUnitCore(); // custom listeners added last notifier.addListeners( listeners ); return junitCore; } private void executeEager( TestsToRun testsToRun, Filter filter, Collection listeners ) throws TestSetFailedException { JUnitCore junitCore = createJUnitCore( notifier, listeners ); Class[] tests = testsToRun.getLocatedClasses(); Computer computer = createComputer(); createRequestAndRun( filter, computer, junitCore.withReportedTests( tests ), tests ); } private void executeLazy( TestsToRun testsToRun, boolean useIterated, Filter filter, Collection listeners ) throws TestSetFailedException { JUnitCore junitCore = createJUnitCore( notifier, listeners ); for ( Iterator> it = useIterated ? testsToRun.iterated() : testsToRun.iterator(); it.hasNext(); ) { Class clazz = it.next(); Computer computer = createComputer(); createRequestAndRun( filter, computer, junitCore.withReportedTests( clazz ), clazz ); } } private void createRequestAndRun( Filter filter, Computer computer, JUnitCore junitCore, Class... classesToRun ) throws TestSetFailedException { Request req = classes( computer, classesToRun ); if ( filter != null ) { req = new FilteringRequest( req, filter ); if ( req.getRunner() == null ) { // nothing to run return; } } Result run = junitCore.run( req.getRunner() ); rethrowAnyTestMechanismFailures( run ); if ( computer instanceof ParallelComputer ) { String timeoutMessage = ( (ParallelComputer) computer ).describeElapsedTimeout(); if ( !timeoutMessage.isEmpty() ) { throw new TestSetFailedException( timeoutMessage ); } } } private Computer createComputer() { return jUnitCoreParameters.isNoThreading() ? serial() : new ParallelComputerBuilder( consoleStream, jUnitCoreParameters ).buildComputer(); } private final class JUnitCore extends org.apache.maven.surefire.junitcore.JUnitCore { JUnitCore() { super( JUnitCoreWrapper.this.notifier ); } JUnitCore withReportedTests( Class... tests ) { Queue stoppedTests = JUnitCoreWrapper.this.notifier.getRemainingTestClasses(); if ( stoppedTests != null ) { for ( Class test : tests ) { stoppedTests.add( test.getName() ); } } return this; } @Override @SuppressWarnings( "checkstyle:innerassignment" ) protected void afterException( Throwable e ) throws TestSetFailedException { if ( JUnitCoreWrapper.this.notifier.isFailFast() && e instanceof StoppedByUserException ) { Queue stoppedTests = JUnitCoreWrapper.this.notifier.getRemainingTestClasses(); if ( stoppedTests != null ) { String reason = e.getClass().getName(); Ignore reasonForSkippedTest = createIgnored( reason ); for ( String clazz; ( clazz = stoppedTests.poll() ) != null; ) { Description skippedTest = createDescription( clazz, reasonForSkippedTest ); JUnitCoreWrapper.this.notifier.fireTestIgnored( skippedTest ); } } } else { super.afterException( e ); } } @Override protected void afterFinished() { Queue stoppedTests = JUnitCoreWrapper.this.notifier.getRemainingTestClasses(); if ( stoppedTests != null ) { stoppedTests.clear(); } } } } LogicalStream.java000066400000000000000000000045101330756104600422530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import org.apache.maven.surefire.report.ConsoleOutputReceiver; import java.util.Arrays; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; /** * A stream-like object that preserves ordering between stdout/stderr */ public final class LogicalStream { private final Queue output = new ConcurrentLinkedQueue(); private static final class Entry { private final boolean stdout; private final byte[] b; private final int off; private final int len; private Entry( boolean stdout, byte[] b, int off, int len ) { this.stdout = stdout; this.b = Arrays.copyOfRange( b, off, off + len ); this.off = 0; this.len = len; } private void writeDetails( ConsoleOutputReceiver outputReceiver ) { outputReceiver.writeTestOutput( b, off, len, stdout ); } } public void write( boolean stdout, byte b[], int off, int len ) { if ( !isBlankLine( b, len ) ) { Entry entry = new Entry( stdout, b, off, len ); output.add( entry ); } } public void writeDetails( ConsoleOutputReceiver outputReceiver ) { for ( Entry entry = output.poll(); entry != null; entry = output.poll() ) { entry.writeDetails( outputReceiver ); } } private static boolean isBlankLine( byte[] b, int len ) { return b == null || len == 0; } } MethodsParallelRunListener.java000066400000000000000000000037721330756104600450110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import java.util.Map; import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.testset.TestSetFailedException; /** * @author Kristian Rosenvold */ @ThreadSafe public class MethodsParallelRunListener extends ConcurrentRunListener { private volatile TestSet lastStarted; private final Object lock = new Object(); public MethodsParallelRunListener( Map classMethodCounts, ReporterFactory reporterFactory, boolean reportImmediately, ConsoleStream consoleStream ) throws TestSetFailedException { super( reporterFactory, consoleStream, reportImmediately, classMethodCounts ); } @Override protected void checkIfTestSetCanBeReported( TestSet testSetForTest ) { synchronized ( lock ) { if ( testSetForTest != lastStarted ) { if ( lastStarted != null ) { lastStarted.setAllScheduled( getRunListener() ); } lastStarted = testSetForTest; } } } } NonConcurrentRunListener.java000066400000000000000000000142351330756104600445220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import org.apache.maven.surefire.common.junit4.JUnit4RunListener; import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.SimpleReportEntry; import org.apache.maven.surefire.report.TestSetReportEntry; import org.apache.maven.surefire.testset.TestSetFailedException; import org.junit.runner.Description; import org.junit.runner.Result; import org.junit.runner.notification.Failure; import java.util.Collections; import java.util.Map; import static org.apache.maven.surefire.util.internal.ObjectUtils.systemProps; /** * A class to be used when there is no JUnit parallelism (methods or/and class). This allow to workaround JUnit * limitation a la Junit4 provider. Specifically, we can redirect properly the output even if we don't have class * demarcation in JUnit. It works when if there is a JVM instance per test run, i.e. with forkMode=always or perthread. */ public class NonConcurrentRunListener extends JUnit4RunListener implements ConsoleOutputReceiver { private Description currentTestSetDescription; private Description lastFinishedDescription; public NonConcurrentRunListener( RunListener reporter ) throws TestSetFailedException { super( reporter ); } @Override public void writeTestOutput( byte[] buf, int off, int len, boolean stdout ) { // We can write immediately: no parallelism and a single class. ( (ConsoleOutputReceiver) reporter ).writeTestOutput( buf, off, len, stdout ); } @Override protected SimpleReportEntry createReportEntry( Description description ) { return new SimpleReportEntry( extractDescriptionClassName( description ), description.getDisplayName() ); } private TestSetReportEntry createReportEntryForTestSet( Description description, Map systemProps ) { String testClassName = extractDescriptionClassName( description ); return new SimpleReportEntry( testClassName, testClassName, systemProps ); } private TestSetReportEntry createTestSetReportEntryStarted( Description description ) { return createReportEntryForTestSet( description, Collections.emptyMap() ); } private TestSetReportEntry createTestSetReportEntryFinished( Description description ) { return createReportEntryForTestSet( description, systemProps() ); } @Override protected String extractDescriptionClassName( Description description ) { return description.getClassName(); } @Override protected String extractDescriptionMethodName( Description description ) { return description.getMethodName(); } @Override public void testStarted( Description description ) throws Exception { finishLastTestSetIfNecessary( description ); super.testStarted( description ); } private void finishLastTestSetIfNecessary( Description description ) { if ( describesNewTestSet( description ) ) { currentTestSetDescription = description; if ( lastFinishedDescription != null ) { TestSetReportEntry reportEntry = createTestSetReportEntryFinished( lastFinishedDescription ); reporter.testSetCompleted( reportEntry ); lastFinishedDescription = null; } reporter.testSetStarting( createTestSetReportEntryStarted( description ) ); } } private boolean describesNewTestSet( Description description ) { if ( currentTestSetDescription != null ) { if ( null != description.getTestClass() ) { return !description.getTestClass().equals( currentTestSetDescription.getTestClass() ); } else if ( description.isSuite() ) { return description.getChildren().equals( currentTestSetDescription.getChildren() ); } return false; } return true; } @Override public void testFinished( Description description ) throws Exception { super.testFinished( description ); lastFinishedDescription = description; } @Override public void testIgnored( Description description ) throws Exception { finishLastTestSetIfNecessary( description ); super.testIgnored( description ); lastFinishedDescription = description; } @Override public void testFailure( Failure failure ) throws Exception { finishLastTestSetIfNecessary( failure.getDescription() ); super.testFailure( failure ); lastFinishedDescription = failure.getDescription(); } @Override public void testAssumptionFailure( Failure failure ) { super.testAssumptionFailure( failure ); lastFinishedDescription = failure.getDescription(); } @Override public void testRunStarted( Description description ) throws Exception { } @Override public void testRunFinished( Result result ) throws Exception { if ( lastFinishedDescription != null ) { reporter.testSetCompleted( createTestSetReportEntryFinished( lastFinishedDescription ) ); lastFinishedDescription = null; } } } SynchronousRunner.java000066400000000000000000000025311330756104600432520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import org.junit.runners.model.RunnerScheduler; /** * Since SUREFIRE 2.18 this class is deprecated. * Please use {@link org.apache.maven.surefire.junitcore.pc.ParallelComputerBuilder} instead. * * @author Kristian Rosenvold */ @Deprecated class SynchronousRunner implements RunnerScheduler { @Override public void schedule( final Runnable childStatement ) { childStatement.run(); } @Override public void finished() { } } TestMethod.java000066400000000000000000000124151330756104600416100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import org.apache.maven.surefire.report.CategorizedReportEntry; import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.ConsoleOutputReceiverForCurrentThread; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.RunListener; import java.util.concurrent.atomic.AtomicReference; /** * Represents the test-state of a single test method that is run. *
* Notes about thread safety: This instance is serially confined to 1-3 threads (construction, test-run, reporting), * without any actual parallel access */ class TestMethod implements ConsoleOutputReceiver { private static final InheritableThreadLocal TEST_METHOD = new InheritableThreadLocal(); private final AtomicReference output = new AtomicReference(); private final ReportEntry description; private final TestSet testSet; private final long startTime; private volatile long endTime; private volatile ReportEntry testFailure; private volatile ReportEntry testError; private volatile ReportEntry testIgnored; private volatile ReportEntry testAssumption; TestMethod( ReportEntry description, TestSet testSet ) { this.description = description; this.testSet = testSet; startTime = System.currentTimeMillis(); } void testFinished() { setEndTime(); } void testIgnored( ReportEntry description ) { testIgnored = description; setEndTime(); } void testFailure( ReportEntry failure ) { this.testFailure = failure; setEndTime(); } void testError( ReportEntry failure ) { this.testError = failure; setEndTime(); } void testAssumption( ReportEntry failure ) { this.testAssumption = failure; setEndTime(); } private void setEndTime() { this.endTime = System.currentTimeMillis(); } int getElapsed() { return endTime > 0 ? (int) ( endTime - startTime ) : 0; } long getStartTime() { return startTime; } long getEndTime() { return endTime; } void replay( RunListener reporter ) { if ( testIgnored != null ) { reporter.testSkipped( createReportEntry( testIgnored ) ); } else { ReportEntry descriptionReport = createReportEntry( description ); reporter.testStarting( descriptionReport ); LogicalStream ls = output.get(); if ( ls != null ) { ls.writeDetails( (ConsoleOutputReceiver) reporter ); } if ( testFailure != null ) { reporter.testFailed( createReportEntry( testFailure ) ); } else if ( testError != null ) { reporter.testError( createReportEntry( testError ) ); } else if ( testAssumption != null ) { reporter.testAssumptionFailure( createReportEntry( testAssumption ) ); } else { reporter.testSucceeded( descriptionReport ); } } } private ReportEntry createReportEntry( ReportEntry reportEntry ) { return new CategorizedReportEntry( reportEntry.getSourceName(), reportEntry.getName(), reportEntry.getGroup(), reportEntry.getStackTraceWriter(), getElapsed(), reportEntry.getMessage() ); } void attachToThread() { TEST_METHOD.set( this ); ConsoleOutputReceiverForCurrentThread.set( this ); } void detachFromCurrentThread() { TEST_METHOD.remove(); ConsoleOutputReceiverForCurrentThread.remove(); } static TestMethod getThreadTestMethod() { return TEST_METHOD.get(); } LogicalStream getLogicalStream() { LogicalStream ls = output.get(); if ( ls == null ) { ls = new LogicalStream(); if ( !output.compareAndSet( null, ls ) ) { ls = output.get(); } } return ls; } @Override public void writeTestOutput( byte[] buf, int off, int len, boolean stdout ) { getLogicalStream().write( stdout, buf, off, len ); } public TestSet getTestSet() { return testSet; } } TestSet.java000066400000000000000000000121401330756104600411160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.SimpleReportEntry; import org.apache.maven.surefire.report.TestSetReportEntry; import java.util.Collection; import java.util.Collections; import java.util.Map; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import static org.apache.maven.surefire.util.internal.ObjectUtils.systemProps; /** * * Represents the test-state of a testset that is run. */ public class TestSet { private static final InheritableThreadLocal TEST_SET = new InheritableThreadLocal(); private final String testClassName; private final Collection testMethods = new ConcurrentLinkedQueue(); private final AtomicBoolean played = new AtomicBoolean(); private final AtomicInteger numberOfCompletedChildren = new AtomicInteger(); // While the two parameters may seem duplicated, it is not entirely the case, // since numberOfTests has the correct value from the start, while testMethods grows as method execution starts. private final AtomicInteger numberOfTests = new AtomicInteger(); private volatile boolean allScheduled; public TestSet( String testClassName ) { this.testClassName = testClassName; } public void replay( RunListener target ) { if ( played.compareAndSet( false, true ) ) { try { TestSetReportEntry report = createReportEntryStarted(); target.testSetStarting( report ); long startTime = 0; long endTime = 0; for ( TestMethod testMethod : testMethods ) { if ( startTime == 0 || testMethod.getStartTime() < startTime ) { startTime = testMethod.getStartTime(); } if ( endTime == 0 || testMethod.getEndTime() > endTime ) { endTime = testMethod.getEndTime(); } testMethod.replay( target ); } int elapsed = (int) ( endTime - startTime ); report = createReportEntryCompleted( elapsed ); target.testSetCompleted( report ); } catch ( Exception e ) { throw new RuntimeException( e ); } } } public TestMethod createThreadAttachedTestMethod( ReportEntry description ) { TestMethod testMethod = new TestMethod( description, this ); addTestMethod( testMethod ); testMethod.attachToThread(); return testMethod; } private TestSetReportEntry createReportEntryStarted() { return createReportEntry( null, Collections.emptyMap() ); } private TestSetReportEntry createReportEntryCompleted( int elapsed ) { return createReportEntry( elapsed, systemProps() ); } private TestSetReportEntry createReportEntry( Integer elapsed, Map systemProps ) { return new SimpleReportEntry( testClassName, testClassName, null, elapsed, systemProps ); } public void incrementTestMethodCount() { numberOfTests.incrementAndGet(); } private void addTestMethod( TestMethod testMethod ) { testMethods.add( testMethod ); } public void incrementFinishedTests( RunListener reporterManager, boolean reportImmediately ) { numberOfCompletedChildren.incrementAndGet(); if ( allScheduled && isAllTestsDone() && reportImmediately ) { replay( reporterManager ); } } public void setAllScheduled( RunListener reporterManager ) { allScheduled = true; if ( isAllTestsDone() ) { replay( reporterManager ); } } private boolean isAllTestsDone() { return numberOfTests.get() == numberOfCompletedChildren.get(); } public void attachToThread() { TEST_SET.set( this ); } public static TestSet getThreadTestSet() { return TEST_SET.get(); } } ThreadSafe.java000066400000000000000000000024411330756104600415340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * After compiling sources under endorsed junit:4.7, this annotation * is relocated in org.junit.runner.notification.RunListener.ThreadSafe. */ @Documented @Target( ElementType.TYPE ) @Retention( RetentionPolicy.RUNTIME ) @interface ThreadSafe { } pc/000077500000000000000000000000001330756104600372645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcoreAbstractThreadPoolStrategy.java000066400000000000000000000077241330756104600454110ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.apache.maven.surefire.report.ConsoleStream; import java.util.Collection; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * Abstract parallel scheduling strategy in private package. * The remaining abstract methods have to be implemented differently * depending if the thread pool is shared with other strategies or not. * * @author Tibor Digana (tibor17) * @see SchedulingStrategy * @see SharedThreadPoolStrategy * @see NonSharedThreadPoolStrategy * @since 2.16 */ abstract class AbstractThreadPoolStrategy extends SchedulingStrategy { private final ExecutorService threadPool; private final Collection> futureResults; private volatile boolean isDestroyed; AbstractThreadPoolStrategy( ConsoleStream logger, ExecutorService threadPool ) { this( logger, threadPool, null ); } AbstractThreadPoolStrategy( ConsoleStream logger, ExecutorService threadPool, Collection> futureResults ) { super( logger ); this.threadPool = threadPool; this.futureResults = futureResults; } protected final ExecutorService getThreadPool() { return threadPool; } protected final Collection> getFutureResults() { return futureResults; } @Override public void schedule( Runnable task ) { if ( canSchedule() ) { Future futureResult = threadPool.submit( task ); if ( futureResults != null ) { futureResults.add( futureResult ); } } } @Override protected boolean stop() { boolean wasRunning = disable(); if ( threadPool.isShutdown() ) { wasRunning = false; } else { threadPool.shutdown(); } return wasRunning; } @Override protected boolean stopNow() { boolean wasRunning = disable(); if ( threadPool.isShutdown() ) { wasRunning = false; } else { threadPool.shutdownNow(); } return wasRunning; } /** * @see Scheduler.ShutdownHandler */ @Override protected void setDefaultShutdownHandler( Scheduler.ShutdownHandler handler ) { if ( threadPool instanceof ThreadPoolExecutor ) { ThreadPoolExecutor pool = (ThreadPoolExecutor) threadPool; handler.setRejectedExecutionHandler( pool.getRejectedExecutionHandler() ); pool.setRejectedExecutionHandler( handler ); } } @Override public boolean destroy() { try { if ( !isDestroyed )//just an optimization { disable(); threadPool.shutdown(); this.isDestroyed |= threadPool.awaitTermination( Long.MAX_VALUE, TimeUnit.NANOSECONDS ); } return isDestroyed; } catch ( InterruptedException e ) { return false; } } }Balancer.java000066400000000000000000000034071330756104600416420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ /** * The Balancer controls the maximum of concurrent threads in the current Scheduler(s) and prevents * from own thread resources exhaustion if other group of schedulers share the same pool of threads. *
* If a permit is available, {@link #acquirePermit()} simply returns and a new test is scheduled * by {@link Scheduler#schedule(Runnable)} in the current runner. Otherwise waiting for a release. * One permit is released as soon as the child thread has finished. * * @author Tibor Digana (tibor17) * @since 2.16 */ public interface Balancer { /** * Acquires a permit from this balancer, blocking until one is available. * * @return {@code true} if current thread is NOT interrupted * while waiting for a permit. */ boolean acquirePermit(); /** * Releases a permit, returning it to the balancer. */ void releasePermit(); void releaseAllPermits(); } BalancerFactory.java000066400000000000000000000044241330756104600431720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ /** * @author Tibor Digana (tibor17) * @see Balancer * @since 2.16 */ public class BalancerFactory { private BalancerFactory() { } /** * Infinite permits. * @return Balancer wih infinite permits */ public static Balancer createInfinitePermitsBalancer() { return balancer( 0, false ); } /** * Balancer without fairness. * Fairness guarantees the waiting schedulers to wake up in order they acquired a permit. * * @param concurrency number of permits to acquire when maintaining concurrency on tests * @return Balancer with given number of permits */ public static Balancer createBalancer( int concurrency ) { return balancer( concurrency, false ); } /** * Balancer with fairness. * Fairness guarantees the waiting schedulers to wake up in order they acquired a permit. * * @param concurrency number of permits to acquire when maintaining concurrency on tests * @return Balancer with given number of permits */ public static Balancer createBalancerWithFairness( int concurrency ) { return balancer( concurrency, true ); } private static Balancer balancer( int concurrency, boolean fairness ) { boolean shouldBalance = concurrency > 0 && concurrency < Integer.MAX_VALUE; return shouldBalance ? new ThreadResourcesBalancer( concurrency, fairness ) : new NullBalancer(); } }Concurrency.java000066400000000000000000000017341330756104600424260ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ /** * @author tibor17 (Tibor Digana) * @since 2.17 */ final class Concurrency { int suites, classes, methods, capacity; }Destroyable.java000066400000000000000000000025251330756104600424100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ /** * Destroys the embedded thread-pool. * * @author Tibor Digana (tibor17) * @see ParallelComputerBuilder * @since 2.18 */ public interface Destroyable { /** * Calling {@link java.util.concurrent.ThreadPoolExecutor#shutdown()} * and {@link java.util.concurrent.ThreadPoolExecutor#awaitTermination(long, java.util.concurrent.TimeUnit)}. * * @return {@code true} if not interrupted in current thread */ boolean destroy(); }ExecutionStatus.java000066400000000000000000000022061330756104600432760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ /** * Status of {@link ParallelComputer ParallelComputer runtime}.
* Used together with shutdown hook. * * @author Tibor Digana (tibor17) * @see ParallelComputer * @since 2.18 */ enum ExecutionStatus { STARTED, FINISHED, TIMEOUT } InvokerStrategy.java000066400000000000000000000046361330756104600433000ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.apache.maven.surefire.report.ConsoleStream; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; /** * The sequentially executing strategy in private package. * * @author Tibor Digana (tibor17) * @see SchedulingStrategy * @since 2.16 */ final class InvokerStrategy extends SchedulingStrategy { private final Queue activeThreads = new ConcurrentLinkedQueue(); protected InvokerStrategy( ConsoleStream logger ) { super( logger ); } @Override public void schedule( Runnable task ) { if ( canSchedule() ) { final Thread currentThread = Thread.currentThread(); try { activeThreads.add( currentThread ); task.run(); } finally { activeThreads.remove( currentThread ); } } } @Override protected boolean stop() { return disable(); } @Override protected boolean stopNow() { final boolean stopped = disable(); for ( Thread activeThread = activeThreads.poll(); activeThread != null; activeThread = activeThreads.poll() ) { activeThread.interrupt(); } return stopped; } @Override public boolean hasSharedThreadPool() { return false; } @Override public boolean finished() throws InterruptedException { return disable(); } @Override public boolean destroy() { return stop(); } } NonSharedThreadPoolStrategy.java000066400000000000000000000033231330756104600455160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.apache.maven.surefire.report.ConsoleStream; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; /** * Parallel strategy for non-shared thread pool in private package. * * @author Tibor Digana (tibor17) * @see AbstractThreadPoolStrategy * @since 2.16 */ final class NonSharedThreadPoolStrategy extends AbstractThreadPoolStrategy { NonSharedThreadPoolStrategy( ConsoleStream logger, ExecutorService threadPool ) { super( logger, threadPool ); } @Override public boolean hasSharedThreadPool() { return false; } @Override public boolean finished() throws InterruptedException { boolean wasRunning = disable(); getThreadPool().shutdown(); getThreadPool().awaitTermination( Long.MAX_VALUE, TimeUnit.NANOSECONDS ); return wasRunning; } } NullBalancer.java000066400000000000000000000024071330756104600424740ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ /** * This balancer implements {@link Balancer} and does not do anything -no blocking operation. * * @author Tibor Digana (tibor17) * @see Balancer * @since 2.16 */ final class NullBalancer implements Balancer { @Override public boolean acquirePermit() { return true; } @Override public void releasePermit() { } @Override public void releaseAllPermits() { } }ParallelComputer.java000066400000000000000000000223651330756104600434120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.internal.DaemonThreadFactory; import org.junit.runner.Computer; import org.junit.runner.Description; import java.util.Collection; import java.util.TreeSet; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ThreadFactory; import static java.util.concurrent.TimeUnit.NANOSECONDS; /** * ParallelComputer extends JUnit {@link Computer} and has a shutdown functionality. * * @author Tibor Digana (tibor17) * @see ParallelComputerBuilder * @since 2.16 */ public abstract class ParallelComputer extends Computer { private static final ThreadFactory DAEMON_THREAD_FACTORY = DaemonThreadFactory.newDaemonThreadFactory(); private static final double NANOS_IN_A_SECOND = 1E9; private final ShutdownStatus shutdownStatus = new ShutdownStatus(); private final ShutdownStatus forcedShutdownStatus = new ShutdownStatus(); private final long timeoutNanos; private final long timeoutForcedNanos; private ScheduledExecutorService shutdownScheduler; public ParallelComputer( double timeoutInSeconds, double timeoutForcedInSeconds ) { this.timeoutNanos = secondsToNanos( timeoutInSeconds ); this.timeoutForcedNanos = secondsToNanos( timeoutForcedInSeconds ); } protected abstract ShutdownResult describeStopped( boolean shutdownNow ); protected abstract boolean shutdownThreadPoolsAwaitingKilled(); protected final void beforeRunQuietly() { shutdownStatus.setDescriptionsBeforeShutdown( hasTimeout() ? scheduleShutdown() : null ); forcedShutdownStatus.setDescriptionsBeforeShutdown( hasTimeoutForced() ? scheduleForcedShutdown() : null ); } protected final boolean afterRunQuietly() { shutdownStatus.tryFinish(); forcedShutdownStatus.tryFinish(); boolean notInterrupted = true; if ( shutdownScheduler != null ) { shutdownScheduler.shutdownNow(); /** * Clear interrupted status of the (main) Thread. * Could be previously interrupted by {@link InvokerStrategy} after triggering immediate shutdown. */ Thread.interrupted(); try { shutdownScheduler.awaitTermination( Long.MAX_VALUE, NANOSECONDS ); } catch ( InterruptedException e ) { notInterrupted = false; } } notInterrupted &= shutdownThreadPoolsAwaitingKilled(); return notInterrupted; } public String describeElapsedTimeout() throws TestSetFailedException { final StringBuilder msg = new StringBuilder(); final boolean isShutdownTimeout = shutdownStatus.isTimeoutElapsed(); final boolean isForcedShutdownTimeout = forcedShutdownStatus.isTimeoutElapsed(); if ( isShutdownTimeout || isForcedShutdownTimeout ) { msg.append( "The test run has finished abruptly after timeout of " ); msg.append( nanosToSeconds( minTimeout( timeoutNanos, timeoutForcedNanos ) ) ); msg.append( " seconds.\n" ); try { final TreeSet executedTests = new TreeSet(); final TreeSet incompleteTests = new TreeSet(); if ( isShutdownTimeout ) { printShutdownHook( executedTests, incompleteTests, shutdownStatus.getDescriptionsBeforeShutdown() ); } if ( isForcedShutdownTimeout ) { printShutdownHook( executedTests, incompleteTests, forcedShutdownStatus.getDescriptionsBeforeShutdown() ); } if ( !executedTests.isEmpty() ) { msg.append( "These tests were executed in prior to the shutdown operation:\n" ); for ( String executedTest : executedTests ) { msg.append( executedTest ).append( '\n' ); } } if ( !incompleteTests.isEmpty() ) { msg.append( "These tests are incomplete:\n" ); for ( String incompleteTest : incompleteTests ) { msg.append( incompleteTest ).append( '\n' ); } } } catch ( InterruptedException e ) { throw new TestSetFailedException( "Timed termination was interrupted.", e ); } catch ( ExecutionException e ) { throw new TestSetFailedException( e.getLocalizedMessage(), e.getCause() ); } } return msg.toString(); } private Future scheduleShutdown() { return getShutdownScheduler().schedule( createShutdownTask(), timeoutNanos, NANOSECONDS ); } private Future scheduleForcedShutdown() { return getShutdownScheduler().schedule( createForcedShutdownTask(), timeoutForcedNanos, NANOSECONDS ); } private ScheduledExecutorService getShutdownScheduler() { if ( shutdownScheduler == null ) { shutdownScheduler = Executors.newScheduledThreadPool( 2, DAEMON_THREAD_FACTORY ); } return shutdownScheduler; } private Callable createShutdownTask() { return new Callable() { @Override public ShutdownResult call() throws Exception { boolean stampedStatusWithTimeout = ParallelComputer.this.shutdownStatus.tryTimeout(); return stampedStatusWithTimeout ? ParallelComputer.this.describeStopped( false ) : null; } }; } private Callable createForcedShutdownTask() { return new Callable() { @Override public ShutdownResult call() throws Exception { boolean stampedStatusWithTimeout = ParallelComputer.this.forcedShutdownStatus.tryTimeout(); return stampedStatusWithTimeout ? ParallelComputer.this.describeStopped( true ) : null; } }; } private double nanosToSeconds( long nanos ) { return (double) nanos / NANOS_IN_A_SECOND; } private boolean hasTimeout() { return timeoutNanos > 0; } private boolean hasTimeoutForced() { return timeoutForcedNanos > 0; } private static long secondsToNanos( double seconds ) { double nanos = seconds > 0 ? seconds * NANOS_IN_A_SECOND : 0; return Double.isInfinite( nanos ) || nanos >= Long.MAX_VALUE ? 0 : (long) nanos; } private static long minTimeout( long timeout1, long timeout2 ) { if ( timeout1 == 0 ) { return timeout2; } else if ( timeout2 == 0 ) { return timeout1; } else { return Math.min( timeout1, timeout2 ); } } private static void printShutdownHook( Collection executedTests, Collection incompleteTests, Future testsBeforeShutdown ) throws ExecutionException, InterruptedException { if ( testsBeforeShutdown != null ) { final ShutdownResult shutdownResult = testsBeforeShutdown.get(); if ( shutdownResult != null ) { for ( final Description test : shutdownResult.getTriggeredTests() ) { if ( test != null && test.getDisplayName() != null ) { executedTests.add( test.getDisplayName() ); } } for ( final Description test : shutdownResult.getIncompleteTests() ) { if ( test != null && test.getDisplayName() != null ) { incompleteTests.add( test.getDisplayName() ); } } } } } }ParallelComputerBuilder.java000077500000000000000000000611121330756104600447150ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.EnumMap; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import org.apache.maven.surefire.junitcore.JUnitCoreParameters; import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.internal.DaemonThreadFactory; import org.junit.internal.runners.ErrorReportingRunner; import org.junit.runner.Description; import org.junit.runner.Runner; import org.junit.runner.manipulation.Filter; import org.junit.runner.manipulation.NoTestsRemainException; import org.junit.runner.notification.RunNotifier; import org.junit.runners.ParentRunner; import org.junit.runners.Suite; import org.junit.runners.model.InitializationError; import org.junit.runners.model.RunnerBuilder; import static org.apache.maven.surefire.junitcore.pc.ParallelComputerUtil.resolveConcurrency; import static org.apache.maven.surefire.junitcore.pc.SchedulingStrategies.createParallelStrategy; import static org.apache.maven.surefire.junitcore.pc.SchedulingStrategies.createParallelStrategyUnbounded; import static org.apache.maven.surefire.junitcore.pc.Type.CLASSES; import static org.apache.maven.surefire.junitcore.pc.Type.METHODS; import static org.apache.maven.surefire.junitcore.pc.Type.SUITES; @SuppressWarnings( { "javadoc", "checkstyle:javadoctype" } ) /* * Executing suites, classes and methods with defined concurrency. In this example the threads which completed * the suites and classes can be reused in parallel methods. *

 * JUnitCoreParameters parameters = ...;
 * ParallelComputerBuilder builder = new ParallelComputerBuilder(parameters);
 * builder.useOnePool(8).parallelSuites(2).parallelClasses(4).parallelMethods();
 * ParallelComputerBuilder.ParallelComputer computer = builder.buildComputer();
 * Class[] tests = {...};
 * new JUnitCore().run(computer, tests);
 * 
* Note that the type has always at least one thread even if unspecified. The capacity in * {@link ParallelComputerBuilder#useOnePool(int)} must be greater than the number of concurrent suites and classes * altogether. *
* The Computer can be stopped in a separate thread. Pending tests will be interrupted if the argument is * {@code true}. *
 * computer.describeStopped(true);
 * 
* * @author Tibor Digana (tibor17) * @since 2.16 */ public final class ParallelComputerBuilder { private static final ThreadFactory DAEMON_THREAD_FACTORY = DaemonThreadFactory.newDaemonThreadFactory(); private static final Class JCIP_NOT_THREAD_SAFE = loadNotThreadSafeAnnotations(); private static final Set NULL_SINGLETON = Collections.singleton( null ); static final int TOTAL_POOL_SIZE_UNDEFINED = 0; private final Map parallelGroups = new EnumMap( Type.class ); private final ConsoleStream logger; private boolean useSeparatePools; private int totalPoolSize; private JUnitCoreParameters parameters; private boolean optimize; private boolean runningInTests; /** * Calling {@link #useSeparatePools()}. * Can be used only in unit tests. * Do NOT call this constructor in production. */ ParallelComputerBuilder( ConsoleStream logger ) { this.logger = logger; runningInTests = true; useSeparatePools(); parallelGroups.put( SUITES, 0 ); parallelGroups.put( CLASSES, 0 ); parallelGroups.put( METHODS, 0 ); } public ParallelComputerBuilder( ConsoleStream logger, JUnitCoreParameters parameters ) { this( logger ); runningInTests = false; this.parameters = parameters; } public ParallelComputer buildComputer() { return new PC(); } ParallelComputerBuilder useSeparatePools() { totalPoolSize = TOTAL_POOL_SIZE_UNDEFINED; useSeparatePools = true; return this; } ParallelComputerBuilder useOnePool() { totalPoolSize = TOTAL_POOL_SIZE_UNDEFINED; useSeparatePools = false; return this; } /** * @param totalPoolSize Pool size where suites, classes and methods are executed in parallel. * If the totalPoolSize is {@link Integer#MAX_VALUE}, the pool capacity is not * limited. * @throws IllegalArgumentException If totalPoolSize is < 1. */ ParallelComputerBuilder useOnePool( int totalPoolSize ) { if ( totalPoolSize < 1 ) { throw new IllegalArgumentException( "Size of common pool is less than 1." ); } this.totalPoolSize = totalPoolSize; useSeparatePools = false; return this; } boolean isOptimized() { return optimize; } ParallelComputerBuilder optimize( boolean optimize ) { this.optimize = optimize; return this; } ParallelComputerBuilder parallelSuites() { return parallel( SUITES ); } ParallelComputerBuilder parallelSuites( int nThreads ) { return parallel( nThreads, SUITES ); } ParallelComputerBuilder parallelClasses() { return parallel( CLASSES ); } ParallelComputerBuilder parallelClasses( int nThreads ) { return parallel( nThreads, CLASSES ); } ParallelComputerBuilder parallelMethods() { return parallel( METHODS ); } ParallelComputerBuilder parallelMethods( int nThreads ) { return parallel( nThreads, METHODS ); } private ParallelComputerBuilder parallel( int nThreads, Type parallelType ) { if ( nThreads < 0 ) { throw new IllegalArgumentException( "negative nThreads " + nThreads ); } if ( parallelType == null ) { throw new IllegalArgumentException( "null parallelType" ); } parallelGroups.put( parallelType, nThreads ); return this; } private ParallelComputerBuilder parallel( Type parallelType ) { return parallel( Integer.MAX_VALUE, parallelType ); } private double parallelTestsTimeoutInSeconds() { return parameters == null ? 0d : parameters.getParallelTestsTimeoutInSeconds(); } private double parallelTestsTimeoutForcedInSeconds() { return parameters == null ? 0d : parameters.getParallelTestsTimeoutForcedInSeconds(); } @SuppressWarnings( "unchecked" ) private static Class loadNotThreadSafeAnnotations() { try { Class c = Class.forName( "net.jcip.annotations.NotThreadSafe" ); return c.isAnnotation() ? (Class) c : null; } catch ( ClassNotFoundException e ) { return null; } } final class PC extends ParallelComputer { private final SingleThreadScheduler notThreadSafeTests = new SingleThreadScheduler( ParallelComputerBuilder.this.logger ); private final Collection suites = new LinkedHashSet(); private final Collection nestedSuites = new LinkedHashSet(); private final Collection classes = new LinkedHashSet(); private final Collection nestedClasses = new LinkedHashSet(); private final Collection notParallelRunners = new LinkedHashSet(); private int poolCapacity; private boolean splitPool; private final Map allGroups; private long nestedClassesChildren; private volatile Scheduler master; private PC() { super( parallelTestsTimeoutInSeconds(), parallelTestsTimeoutForcedInSeconds() ); allGroups = new EnumMap( ParallelComputerBuilder.this.parallelGroups ); poolCapacity = ParallelComputerBuilder.this.totalPoolSize; splitPool = ParallelComputerBuilder.this.useSeparatePools; } Collection getSuites() { return suites; } Collection getNestedSuites() { return nestedSuites; } Collection getClasses() { return classes; } Collection getNestedClasses() { return nestedClasses; } Collection getNotParallelRunners() { return notParallelRunners; } int getPoolCapacity() { return poolCapacity; } boolean isSplitPool() { return splitPool; } @Override protected ShutdownResult describeStopped( boolean shutdownNow ) { ShutdownResult shutdownResult = notThreadSafeTests.describeStopped( shutdownNow ); final Scheduler m = master; if ( m != null ) { ShutdownResult shutdownResultOfMaster = m.describeStopped( shutdownNow ); shutdownResult.getTriggeredTests().addAll( shutdownResultOfMaster.getTriggeredTests() ); shutdownResult.getIncompleteTests().addAll( shutdownResultOfMaster.getIncompleteTests() ); } return shutdownResult; } @Override protected boolean shutdownThreadPoolsAwaitingKilled() { boolean notInterrupted = notThreadSafeTests.shutdownThreadPoolsAwaitingKilled(); final Scheduler m = master; if ( m != null ) { notInterrupted &= m.shutdownThreadPoolsAwaitingKilled(); } return notInterrupted; } @Override public Runner getSuite( RunnerBuilder builder, Class[] cls ) throws InitializationError { try { super.getSuite( builder, cls ); populateChildrenFromSuites(); WrappedRunners suiteSuites = wrapRunners( suites ); WrappedRunners suiteClasses = wrapRunners( classes ); long suitesCount = suites.size(); long classesCount = classes.size() + nestedClasses.size(); long methodsCount = suiteClasses.embeddedChildrenCount + nestedClassesChildren; if ( !ParallelComputerBuilder.this.runningInTests ) { determineThreadCounts( suitesCount, classesCount, methodsCount ); } return setSchedulers( suiteSuites.wrappingSuite, suiteClasses.wrappingSuite ); } catch ( TestSetFailedException e ) { throw new InitializationError( Collections.singletonList( e ) ); } } @Override protected Runner getRunner( RunnerBuilder builder, Class testClass ) throws Throwable { Runner runner = super.getRunner( builder, testClass ); if ( canSchedule( runner ) ) { if ( !isThreadSafe( runner ) ) { ( ( ParentRunner ) runner ).setScheduler( notThreadSafeTests.newRunnerScheduler() ); notParallelRunners.add( runner ); } else if ( runner instanceof Suite ) { suites.add( (Suite) runner ); } else { classes.add( (ParentRunner) runner ); } } else { notParallelRunners.add( runner ); } return runner; } private void determineThreadCounts( long suites, long classes, long methods ) throws TestSetFailedException { RunnerCounter counts = ParallelComputerBuilder.this.optimize ? new RunnerCounter( suites, classes, methods ) : null; Concurrency concurrency = resolveConcurrency( ParallelComputerBuilder.this.parameters, counts ); allGroups.put( SUITES, concurrency.suites ); allGroups.put( CLASSES, concurrency.classes ); allGroups.put( METHODS, concurrency.methods ); poolCapacity = concurrency.capacity; splitPool &= concurrency.capacity <= 0; // fault if negative; should not happen } private WrappedRunners wrapRunners( Collection runners ) throws InitializationError { // Do NOT use allGroups here. long childrenCounter = 0; ArrayList runs = new ArrayList(); for ( T runner : runners ) { if ( runner != null ) { int children = countChildren( runner ); childrenCounter += children; runs.add( runner ); } } return runs.isEmpty() ? new WrappedRunners() : new WrappedRunners( createSuite( runs ), childrenCounter ); } private int countChildren( Runner runner ) { Description description = runner.getDescription(); Collection children = description == null ? null : description.getChildren(); return children == null ? 0 : children.size(); } private ExecutorService createPool( int poolSize ) { return poolSize < Integer.MAX_VALUE ? Executors.newFixedThreadPool( poolSize, DAEMON_THREAD_FACTORY ) : Executors.newCachedThreadPool( DAEMON_THREAD_FACTORY ); } private Scheduler createMaster( ExecutorService pool, int poolSize ) { // can be 0, 1, 2 or 3 final int finalRunnersCounter = countFinalRunners(); final SchedulingStrategy strategy; if ( finalRunnersCounter <= 1 || poolSize <= 1 ) { strategy = new InvokerStrategy( ParallelComputerBuilder.this.logger ); } else if ( pool != null && poolSize == Integer.MAX_VALUE ) { strategy = new SharedThreadPoolStrategy( ParallelComputerBuilder.this.logger, pool ); } else { strategy = createParallelStrategy( ParallelComputerBuilder.this.logger, finalRunnersCounter ); } return new Scheduler( ParallelComputerBuilder.this.logger, null, strategy ); } private int countFinalRunners() { int counter = notParallelRunners.isEmpty() ? 0 : 1; if ( !suites.isEmpty() && allGroups.get( SUITES ) > 0 ) { ++counter; } if ( !classes.isEmpty() && allGroups.get( CLASSES ) > 0 ) { ++counter; } return counter; } private void populateChildrenFromSuites() { // Do NOT use allGroups here. Filter filter = new SuiteFilter(); for ( Iterator it = suites.iterator(); it.hasNext(); ) { ParentRunner suite = it.next(); try { suite.filter( filter ); } catch ( NoTestsRemainException e ) { it.remove(); } } } private int totalPoolSize() { if ( poolCapacity == TOTAL_POOL_SIZE_UNDEFINED ) { int total = 0; for ( int nThreads : allGroups.values() ) { total += nThreads; if ( total < 0 ) { total = Integer.MAX_VALUE; break; } } return total; } else { return poolCapacity; } } private Runner setSchedulers( ParentRunner suiteSuites, ParentRunner suiteClasses ) throws InitializationError { int parallelSuites = allGroups.get( SUITES ); int parallelClasses = allGroups.get( CLASSES ); int parallelMethods = allGroups.get( METHODS ); int poolSize = totalPoolSize(); ExecutorService commonPool = splitPool || poolSize == 0 ? null : createPool( poolSize ); master = createMaster( commonPool, poolSize ); if ( suiteSuites != null ) { // a scheduler for parallel suites if ( commonPool != null && parallelSuites > 0 ) { Balancer balancer = BalancerFactory.createBalancerWithFairness( parallelSuites ); suiteSuites.setScheduler( createScheduler( null, commonPool, true, balancer ) ); } else { suiteSuites.setScheduler( createScheduler( parallelSuites ) ); } } // schedulers for parallel classes ArrayList allSuites = new ArrayList( suites ); allSuites.addAll( nestedSuites ); if ( suiteClasses != null ) { allSuites.add( suiteClasses ); } if ( !allSuites.isEmpty() ) { setSchedulers( allSuites, parallelClasses, commonPool ); } // schedulers for parallel methods ArrayList allClasses = new ArrayList( classes ); allClasses.addAll( nestedClasses ); if ( !allClasses.isEmpty() ) { setSchedulers( allClasses, parallelMethods, commonPool ); } // resulting runner for Computer#getSuite() scheduled by master scheduler ParentRunner all = createFinalRunner( removeNullRunners( Arrays.asList( suiteSuites, suiteClasses, createSuite( notParallelRunners ) ) ) ); all.setScheduler( master ); return all; } private ParentRunner createFinalRunner( List runners ) throws InitializationError { return new Suite( null, runners ) { @Override public void run( RunNotifier notifier ) { try { beforeRunQuietly(); super.run( notifier ); } finally { afterRunQuietly(); } } }; } private void setSchedulers( Iterable runners, int poolSize, ExecutorService commonPool ) { if ( commonPool != null ) { Balancer concurrencyLimit = BalancerFactory.createBalancerWithFairness( poolSize ); boolean doParallel = poolSize > 0; for ( ParentRunner runner : runners ) { runner.setScheduler( createScheduler( runner.getDescription(), commonPool, doParallel, concurrencyLimit ) ); } } else { ExecutorService pool = null; if ( poolSize == Integer.MAX_VALUE ) { pool = Executors.newCachedThreadPool( DAEMON_THREAD_FACTORY ); } else if ( poolSize > 0 ) { pool = Executors.newFixedThreadPool( poolSize, DAEMON_THREAD_FACTORY ); } boolean doParallel = pool != null; for ( ParentRunner runner : runners ) { runner.setScheduler( createScheduler( runner.getDescription(), pool, doParallel, BalancerFactory.createInfinitePermitsBalancer() ) ); } } } private Scheduler createScheduler( Description desc, ExecutorService pool, boolean doParallel, Balancer concurrency ) { SchedulingStrategy strategy = doParallel & pool != null ? new SharedThreadPoolStrategy( ParallelComputerBuilder.this.logger, pool ) : new InvokerStrategy( ParallelComputerBuilder.this.logger ); return new Scheduler( ParallelComputerBuilder.this.logger, desc, master, strategy, concurrency ); } private Scheduler createScheduler( int poolSize ) { final SchedulingStrategy strategy; if ( poolSize == Integer.MAX_VALUE ) { strategy = createParallelStrategyUnbounded( ParallelComputerBuilder.this.logger ); } else if ( poolSize == 0 ) { strategy = new InvokerStrategy( ParallelComputerBuilder.this.logger ); } else { strategy = createParallelStrategy( ParallelComputerBuilder.this.logger, poolSize ); } return new Scheduler( ParallelComputerBuilder.this.logger, null, master, strategy ); } private boolean canSchedule( Runner runner ) { return !( runner instanceof ErrorReportingRunner ) && runner instanceof ParentRunner; } private boolean isThreadSafe( Runner runner ) { return runner.getDescription().getAnnotation( JCIP_NOT_THREAD_SAFE ) == null; } private class SuiteFilter extends Filter { // Do NOT use allGroups in SuiteFilter. @Override public boolean shouldRun( Description description ) { return true; } @Override public void apply( Object child ) throws NoTestsRemainException { super.apply( child ); if ( child instanceof ParentRunner ) { ParentRunner runner = ( ParentRunner ) child; if ( !isThreadSafe( runner ) ) { runner.setScheduler( notThreadSafeTests.newRunnerScheduler() ); } else if ( child instanceof Suite ) { nestedSuites.add( (Suite) child ); } else { ParentRunner parentRunner = (ParentRunner) child; nestedClasses.add( parentRunner ); nestedClassesChildren += parentRunner.getDescription().getChildren().size(); } } } @Override public String describe() { return ""; } } } private static Suite createSuite( Collection runners ) throws InitializationError { final List onlyRunners = removeNullRunners( runners ); return onlyRunners.isEmpty() ? null : new Suite( null, onlyRunners ) { }; } private static List removeNullRunners( Collection runners ) { final List onlyRunners = new ArrayList( runners ); onlyRunners.removeAll( NULL_SINGLETON ); return onlyRunners; } } ParallelComputerUtil.java000066400000000000000000000365721330756104600442550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.apache.maven.surefire.junitcore.JUnitCoreParameters; import org.apache.maven.surefire.testset.TestSetFailedException; import org.junit.runner.Description; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; /** * An algorithm which configures {@link ParallelComputer} with allocated thread resources by given * {@link org.apache.maven.surefire.junitcore.JUnitCoreParameters}. * The {@code AbstractSurefireMojo} has to provide correct combinations of thread-counts and * configuration parameter {@code parallel}. * * @author Tibor Digana (tibor17) * @see org.apache.maven.surefire.junitcore.pc.ParallelComputerBuilder * @since 2.16 */ final class ParallelComputerUtil { private static final Collection UNUSED_DESCRIPTIONS = Arrays.asList( null, Description.createSuiteDescription( "null" ), Description.TEST_MECHANISM, Description.EMPTY ); private static int availableProcessors = Runtime.getRuntime().availableProcessors(); private ParallelComputerUtil() { throw new IllegalStateException( "Suppresses calling constructor, ensuring non-instantiability." ); } /* * For testing purposes. */ static void overrideAvailableProcessors( int availableProcessors ) { ParallelComputerUtil.availableProcessors = availableProcessors; } /* * For testing purposes. */ static void setDefaultAvailableProcessors() { ParallelComputerUtil.availableProcessors = Runtime.getRuntime().availableProcessors(); } static Concurrency resolveConcurrency( JUnitCoreParameters params, RunnerCounter counts ) throws TestSetFailedException { if ( !params.isParallelismSelected() ) { throw new TestSetFailedException( "Unspecified parameter '" + JUnitCoreParameters.PARALLEL_KEY + "'." ); } if ( !params.isUseUnlimitedThreads() && !hasThreadCount( params ) && !hasThreadCounts( params ) ) { throw new TestSetFailedException( "Unspecified thread-count(s). " + "See the parameters " + JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY + ", " + JUnitCoreParameters.THREADCOUNT_KEY + ", " + JUnitCoreParameters.THREADCOUNTSUITES_KEY + ", " + JUnitCoreParameters.THREADCOUNTCLASSES_KEY + ", " + JUnitCoreParameters.THREADCOUNTMETHODS_KEY + "." ); } if ( params.isUseUnlimitedThreads() ) { return concurrencyForUnlimitedThreads( params ); } else if ( hasThreadCount( params ) ) { if ( hasThreadCounts( params ) ) { return isLeafUnspecified( params ) ? concurrencyFromAllThreadCountsButUnspecifiedLeafCount( params, counts ) : concurrencyFromAllThreadCounts( params ); } else { return estimateConcurrency( params, counts ); } } else { return concurrencyFromThreadCounts( params ); } } static boolean isUnusedDescription( Description examined ) { if ( UNUSED_DESCRIPTIONS.contains( examined ) ) { return true; } else { // UNUSED_DESCRIPTIONS ensures that "examined" cannot be null for ( Description unused : UNUSED_DESCRIPTIONS ) { if ( unused != null && unused.getDisplayName().equals( examined.getDisplayName() ) ) { return true; } } return false; } } static void removeUnusedDescriptions( Collection examined ) { for ( Iterator it = examined.iterator(); it.hasNext(); ) { if ( isUnusedDescription( it.next() ) ) { it.remove(); } } } private static Concurrency concurrencyForUnlimitedThreads( JUnitCoreParameters params ) { Concurrency concurrency = new Concurrency(); concurrency.suites = params.isParallelSuites() ? threadCountSuites( params ) : 0; concurrency.classes = params.isParallelClasses() ? threadCountClasses( params ) : 0; concurrency.methods = params.isParallelMethods() ? threadCountMethods( params ) : 0; concurrency.capacity = Integer.MAX_VALUE; return concurrency; } private static Concurrency estimateConcurrency( JUnitCoreParameters params, RunnerCounter counts ) { final Concurrency concurrency = new Concurrency(); final int parallelEntities = countParallelEntities( params ); concurrency.capacity = multiplyByCoreCount( params, params.getThreadCount() ); if ( parallelEntities == 1 || counts == null || counts.classes == 0 ) { // Estimate parallel thread counts. double ratio = 1d / parallelEntities; int threads = multiplyByCoreCount( params, ratio * params.getThreadCount() ); concurrency.suites = params.isParallelSuites() ? minSuites( threads, counts ) : 0; concurrency.classes = params.isParallelClasses() ? minClasses( threads, counts ) : 0; concurrency.methods = params.isParallelMethods() ? minMethods( threads, counts ) : 0; if ( parallelEntities == 1 ) { concurrency.capacity = 0; } else { adjustLeaf( params, concurrency ); } } else { // Try to allocate suites+classes+methods within threadCount, concurrency.suites = params.isParallelSuites() ? toNonNegative( counts.suites ) : 0; concurrency.classes = params.isParallelClasses() ? toNonNegative( counts.classes ) : 0; concurrency.methods = params.isParallelMethods() ? toNonNegative( Math.ceil( counts.methods / (double) counts.classes ) ) : 0; double sum = toNonNegative( concurrency.suites + concurrency.classes + concurrency.methods ); if ( concurrency.capacity < sum && sum != 0 ) { // otherwise allocate them using the weighting factor < 1. double weight = concurrency.capacity / sum; concurrency.suites *= weight; concurrency.classes *= weight; concurrency.methods *= weight; } adjustLeaf( params, concurrency ); } return concurrency; } private static Concurrency concurrencyFromAllThreadCountsButUnspecifiedLeafCount( JUnitCoreParameters params, RunnerCounter counts ) { Concurrency concurrency = new Concurrency(); concurrency.suites = params.isParallelSuites() ? params.getThreadCountSuites() : 0; concurrency.suites = params.isParallelSuites() ? multiplyByCoreCount( params, concurrency.suites ) : 0; concurrency.classes = params.isParallelClasses() ? params.getThreadCountClasses() : 0; concurrency.classes = params.isParallelClasses() ? multiplyByCoreCount( params, concurrency.classes ) : 0; concurrency.methods = params.isParallelMethods() ? params.getThreadCountMethods() : 0; concurrency.methods = params.isParallelMethods() ? multiplyByCoreCount( params, concurrency.methods ) : 0; concurrency.capacity = multiplyByCoreCount( params, params.getThreadCount() ); if ( counts != null ) { concurrency.suites = toNonNegative( Math.min( concurrency.suites, counts.suites ) ); concurrency.classes = toNonNegative( Math.min( concurrency.classes, counts.classes ) ); } setLeafInfinite( params, concurrency ); return concurrency; } private static Concurrency concurrencyFromAllThreadCounts( JUnitCoreParameters params ) { Concurrency concurrency = new Concurrency(); concurrency.suites = params.isParallelSuites() ? params.getThreadCountSuites() : 0; concurrency.classes = params.isParallelClasses() ? params.getThreadCountClasses() : 0; concurrency.methods = params.isParallelMethods() ? params.getThreadCountMethods() : 0; concurrency.capacity = params.getThreadCount(); double all = sumThreadCounts( concurrency ); concurrency.suites = params.isParallelSuites() ? multiplyByCoreCount( params, concurrency.capacity * ( concurrency.suites / all ) ) : 0; concurrency.classes = params.isParallelClasses() ? multiplyByCoreCount( params, concurrency.capacity * ( concurrency.classes / all ) ) : 0; concurrency.methods = params.isParallelMethods() ? multiplyByCoreCount( params, concurrency.capacity * ( concurrency.methods / all ) ) : 0; concurrency.capacity = multiplyByCoreCount( params, concurrency.capacity ); adjustPrecisionInLeaf( params, concurrency ); return concurrency; } private static Concurrency concurrencyFromThreadCounts( JUnitCoreParameters params ) { Concurrency concurrency = new Concurrency(); concurrency.suites = params.isParallelSuites() ? threadCountSuites( params ) : 0; concurrency.classes = params.isParallelClasses() ? threadCountClasses( params ) : 0; concurrency.methods = params.isParallelMethods() ? threadCountMethods( params ) : 0; concurrency.capacity = toNonNegative( sumThreadCounts( concurrency ) ); return concurrency; } private static int countParallelEntities( JUnitCoreParameters params ) { int count = 0; if ( params.isParallelSuites() ) { count++; } if ( params.isParallelClasses() ) { count++; } if ( params.isParallelMethods() ) { count++; } return count; } private static void adjustPrecisionInLeaf( JUnitCoreParameters params, Concurrency concurrency ) { if ( params.isParallelMethods() ) { concurrency.methods = concurrency.capacity - concurrency.suites - concurrency.classes; } else if ( params.isParallelClasses() ) { concurrency.classes = concurrency.capacity - concurrency.suites; } } private static void adjustLeaf( JUnitCoreParameters params, Concurrency concurrency ) { if ( params.isParallelMethods() ) { concurrency.methods = Integer.MAX_VALUE; } else if ( params.isParallelClasses() ) { concurrency.classes = Integer.MAX_VALUE; } } private static void setLeafInfinite( JUnitCoreParameters params, Concurrency concurrency ) { if ( params.isParallelMethods() ) { concurrency.methods = Integer.MAX_VALUE; } else if ( params.isParallelClasses() ) { concurrency.classes = Integer.MAX_VALUE; } else if ( params.isParallelSuites() ) { concurrency.suites = Integer.MAX_VALUE; } } private static boolean isLeafUnspecified( JUnitCoreParameters params ) { int maskOfParallel = params.isParallelSuites() ? 4 : 0; maskOfParallel |= params.isParallelClasses() ? 2 : 0; maskOfParallel |= params.isParallelMethods() ? 1 : 0; int maskOfConcurrency = params.getThreadCountSuites() > 0 ? 4 : 0; maskOfConcurrency |= params.getThreadCountClasses() > 0 ? 2 : 0; maskOfConcurrency |= params.getThreadCountMethods() > 0 ? 1 : 0; maskOfConcurrency &= maskOfParallel; int leaf = Integer.lowestOneBit( maskOfParallel ); return maskOfConcurrency == maskOfParallel - leaf; } private static double sumThreadCounts( Concurrency concurrency ) { double sum = concurrency.suites; sum += concurrency.classes; sum += concurrency.methods; return sum; } private static boolean hasThreadCounts( JUnitCoreParameters jUnitCoreParameters ) { return ( jUnitCoreParameters.isParallelSuites() && jUnitCoreParameters.getThreadCountSuites() > 0 ) || ( jUnitCoreParameters.isParallelClasses() && jUnitCoreParameters.getThreadCountClasses() > 0 ) || ( jUnitCoreParameters.isParallelMethods() && jUnitCoreParameters.getThreadCountMethods() > 0 ); } private static boolean hasThreadCount( JUnitCoreParameters jUnitCoreParameters ) { return jUnitCoreParameters.getThreadCount() > 0; } private static int threadCountMethods( JUnitCoreParameters jUnitCoreParameters ) { return multiplyByCoreCount( jUnitCoreParameters, jUnitCoreParameters.getThreadCountMethods() ); } private static int threadCountClasses( JUnitCoreParameters jUnitCoreParameters ) { return multiplyByCoreCount( jUnitCoreParameters, jUnitCoreParameters.getThreadCountClasses() ); } private static int threadCountSuites( JUnitCoreParameters jUnitCoreParameters ) { return multiplyByCoreCount( jUnitCoreParameters, jUnitCoreParameters.getThreadCountSuites() ); } private static int multiplyByCoreCount( JUnitCoreParameters jUnitCoreParameters, double threadsPerCore ) { double numberOfThreads = jUnitCoreParameters.isPerCoreThreadCount() ? threadsPerCore * (double) availableProcessors : threadsPerCore; return numberOfThreads > 0 ? toNonNegative( numberOfThreads ) : Integer.MAX_VALUE; } private static int minSuites( int threads, RunnerCounter counts ) { long count = counts == null ? Integer.MAX_VALUE : counts.suites; return Math.min( threads, toNonNegative( count ) ); } private static int minClasses( int threads, RunnerCounter counts ) { long count = counts == null ? Integer.MAX_VALUE : counts.classes; return Math.min( threads, toNonNegative( count ) ); } private static int minMethods( int threads, RunnerCounter counts ) { long count = counts == null ? Integer.MAX_VALUE : counts.methods; return Math.min( threads, toNonNegative( count ) ); } private static int toNonNegative( long num ) { return (int) Math.min( num > 0 ? num : 0, Integer.MAX_VALUE ); } private static int toNonNegative( double num ) { return (int) Math.min( num > 0 ? num : 0, Integer.MAX_VALUE ); } }RunnerCounter.java000066400000000000000000000023751330756104600427470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ /** * Counts number of JUnit suites, classes and methods. * * @author tibor17 (Tibor Digana) * @see ParallelComputerBuilder * @since 2.17 */ final class RunnerCounter { final long suites; final long classes; final long methods; RunnerCounter( long suites, long classes, long methods ) { this.suites = suites; this.classes = classes; this.methods = methods; } }Scheduler.java000066400000000000000000000440171330756104600420530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.apache.maven.surefire.report.ConsoleStream; import org.junit.runner.Description; import org.junit.runners.model.RunnerScheduler; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.Collection; import java.util.Set; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.ThreadPoolExecutor; /** * Schedules tests, controls thread resources, awaiting tests and other schedulers finished, and * a master scheduler can shutdown slaves. *
* The scheduler objects should be first created (and wired) and set in runners * {@link org.junit.runners.ParentRunner#setScheduler(org.junit.runners.model.RunnerScheduler)}. *
* A new instance of scheduling strategy should be passed to the constructor of this scheduler. * * @author Tibor Digana (tibor17) * @since 2.16 */ public class Scheduler implements RunnerScheduler { private final Balancer balancer; private final SchedulingStrategy strategy; private final Set slaves = new CopyOnWriteArraySet(); private final Description description; private final ConsoleStream logger; private volatile boolean shutdown = false; private volatile boolean started = false; private volatile boolean finished = false; private volatile Controller masterController; /** * Use e.g. parallel classes have own non-shared thread pool, and methods another pool. *
* You can use it with one infinite thread pool shared in strategies across all * suites, class runners, etc. * * @param logger console logger * @param description JUnit description of class * @param strategy scheduling strategy */ public Scheduler( ConsoleStream logger, Description description, SchedulingStrategy strategy ) { this( logger, description, strategy, -1 ); } /** * Should be used if schedulers in parallel children and parent use one instance of bounded thread pool. *
* Set this scheduler in a e.g. one suite of classes, then every individual class runner should reference * {@link #Scheduler(ConsoleStream, org.junit.runner.Description, Scheduler, SchedulingStrategy)} * or {@link #Scheduler(ConsoleStream, org.junit.runner.Description, Scheduler, SchedulingStrategy, int)}. * * @param logger current logger implementation * @param description description of current runner * @param strategy scheduling strategy with a shared thread pool * @param concurrency determines maximum concurrent children scheduled a time via {@link #schedule(Runnable)} * @throws NullPointerException if null strategy */ public Scheduler( ConsoleStream logger, Description description, SchedulingStrategy strategy, int concurrency ) { this( logger, description, strategy, BalancerFactory.createBalancer( concurrency ) ); } /** * New instances should be used by schedulers with limited concurrency by balancer * against other groups of schedulers. The schedulers share one pool. *
* Unlike in {@link #Scheduler(ConsoleStream, org.junit.runner.Description, SchedulingStrategy, int)} which was * limiting the concurrency of children of a runner where this scheduler was set, {@code this} * balancer is limiting the concurrency of all children in runners having schedulers created by this * constructor. * * @param logger current logger implementation * @param description description of current runner * @param strategy scheduling strategy which may share threads with other strategy * @param balancer determines maximum concurrent children scheduled a time via {@link #schedule(Runnable)} * @throws NullPointerException if null strategy or balancer */ public Scheduler( ConsoleStream logger, Description description, SchedulingStrategy strategy, Balancer balancer ) { strategy.setDefaultShutdownHandler( newShutdownHandler() ); this.logger = logger; this.description = description; this.strategy = strategy; this.balancer = balancer; masterController = null; } /** * Can be used by e.g. a runner having parallel classes in use case with parallel * suites, classes and methods sharing the same thread pool. * * @param logger current logger implementation * @param description description of current runner * @param masterScheduler scheduler sharing own threads with this slave * @param strategy scheduling strategy for this scheduler * @param balancer determines maximum concurrent children scheduled a time via {@link #schedule(Runnable)} * @throws NullPointerException if null masterScheduler, strategy or balancer */ public Scheduler( ConsoleStream logger, Description description, Scheduler masterScheduler, SchedulingStrategy strategy, Balancer balancer ) { this( logger, description, strategy, balancer ); strategy.setDefaultShutdownHandler( newShutdownHandler() ); masterScheduler.register( this ); } /** * @param logger console logger * @param description JUnit description of class * @param masterScheduler a reference to * {@link #Scheduler(ConsoleStream, org.junit.runner.Description, SchedulingStrategy, int)} * or {@link #Scheduler(ConsoleStream, org.junit.runner.Description, SchedulingStrategy)} * @param strategy scheduling strategy * @param concurrency determines maximum concurrent children scheduled a time via {@link #schedule(Runnable)} * * @see #Scheduler(ConsoleStream, org.junit.runner.Description, SchedulingStrategy) * @see #Scheduler(ConsoleStream, org.junit.runner.Description, SchedulingStrategy, int) */ public Scheduler( ConsoleStream logger, Description description, Scheduler masterScheduler, SchedulingStrategy strategy, int concurrency ) { this( logger, description, strategy, concurrency ); strategy.setDefaultShutdownHandler( newShutdownHandler() ); masterScheduler.register( this ); } /** * Should be used with individual pools on suites, classes and methods, see * {@link org.apache.maven.surefire.junitcore.pc.ParallelComputerBuilder#useSeparatePools()}. *
* Cached thread pool is infinite and can be always shared. * * @param logger console logger * @param description JUnit description of class * @param masterScheduler parent scheduler * @param strategy scheduling strategy */ public Scheduler( ConsoleStream logger, Description description, Scheduler masterScheduler, SchedulingStrategy strategy ) { this( logger, description, masterScheduler, strategy, 0 ); } private void setController( Controller masterController ) { if ( masterController == null ) { throw new NullPointerException( "null ExecutionController" ); } this.masterController = masterController; } /** * @param slave a slave scheduler to register * @return {@code true} if successfully registered the slave. */ private boolean register( Scheduler slave ) { boolean canRegister = slave != null && slave != this; if ( canRegister ) { Controller controller = new Controller( slave ); canRegister = !slaves.contains( controller ); if ( canRegister ) { slaves.add( controller ); slave.setController( controller ); } } return canRegister; } /** * @return {@code true} if new tasks can be scheduled. */ private boolean canSchedule() { return !shutdown && ( masterController == null || masterController.canSchedule() ); } protected void logQuietly( Throwable t ) { ByteArrayOutputStream out = new ByteArrayOutputStream(); PrintStream stream = new PrintStream( out ); try { t.printStackTrace( stream ); } finally { stream.close(); } logger.println( out.toString() ); } protected void logQuietly( String msg ) { logger.println( msg ); } /** * Attempts to stop all actively executing tasks and immediately returns a collection * of descriptions of those tasks which have started prior to this call. *
* This scheduler and other registered schedulers will stop, see {@link #register(Scheduler)}. * If shutdownNow is set, waiting methods will be interrupted via {@link Thread#interrupt}. * * @param stopNow if {@code true} interrupts waiting test methods * @return collection of descriptions started before shutting down */ protected ShutdownResult describeStopped( boolean stopNow ) { Collection executedTests = new ConcurrentLinkedQueue(); Collection incompleteTests = new ConcurrentLinkedQueue(); stop( executedTests, incompleteTests, false, stopNow ); return new ShutdownResult( executedTests, incompleteTests ); } /** * Stop/Shutdown/Interrupt scheduler and its children (if any). * * @param executedTests Started tests which have finished normally or abruptly till called this method. * @param incompleteTests Started tests which have finished incomplete due to shutdown. * @param tryCancelFutures Useful to set to {@code false} if a timeout is specified in plugin config. * When the runner of * {@link ParallelComputer#getSuite(org.junit.runners.model.RunnerBuilder, Class[])} * is finished in * {@link org.junit.runners.Suite#run(org.junit.runner.notification.RunNotifier)} * all the thread-pools created by {@link ParallelComputerBuilder.PC} are already dead. * See the unit test {@code ParallelComputerBuilder#timeoutAndForcedShutdown()}. * @param stopNow Interrupting tests by {@link java.util.concurrent.ExecutorService#shutdownNow()} or * {@link java.util.concurrent.Future#cancel(boolean) Future#cancel(true)} or * {@link Thread#interrupt()}. */ private void stop( Collection executedTests, Collection incompleteTests, boolean tryCancelFutures, boolean stopNow ) { shutdown = true; try { if ( started && !ParallelComputerUtil.isUnusedDescription( description ) ) { if ( executedTests != null ) { executedTests.add( description ); } if ( incompleteTests != null && !finished ) { incompleteTests.add( description ); } } for ( Controller slave : slaves ) { slave.stop( executedTests, incompleteTests, tryCancelFutures, stopNow ); } } finally { try { balancer.releaseAllPermits(); } finally { if ( stopNow ) { strategy.stopNow(); } else if ( tryCancelFutures ) { strategy.stop(); } else { strategy.disable(); } } } } protected boolean shutdownThreadPoolsAwaitingKilled() { if ( masterController == null ) { stop( null, null, true, false ); boolean isNotInterrupted = true; if ( strategy != null ) { isNotInterrupted = strategy.destroy(); } for ( Controller slave : slaves ) { isNotInterrupted &= slave.destroy(); } return isNotInterrupted; } else { throw new UnsupportedOperationException( "cannot call this method if this is not a master scheduler" ); } } protected void beforeExecute() { } protected void afterExecute() { } @Override public void schedule( Runnable childStatement ) { if ( childStatement == null ) { logQuietly( "cannot schedule null" ); } else if ( canSchedule() && strategy.canSchedule() ) { try { boolean isNotInterrupted = balancer.acquirePermit(); if ( isNotInterrupted && !shutdown ) { Runnable task = wrapTask( childStatement ); strategy.schedule( task ); started = true; } } catch ( RejectedExecutionException e ) { stop( null, null, true, false ); } catch ( Throwable t ) { balancer.releasePermit(); logQuietly( t ); } } } @Override public void finished() { try { strategy.finished(); } catch ( InterruptedException e ) { logQuietly( e ); } finally { finished = true; } } private Runnable wrapTask( final Runnable task ) { return new Runnable() { @Override public void run() { try { beforeExecute(); task.run(); } finally { try { afterExecute(); } finally { balancer.releasePermit(); } } } }; } protected ShutdownHandler newShutdownHandler() { return new ShutdownHandler(); } /** * If this is a master scheduler, the slaves can stop scheduling by the master through the controller. */ private final class Controller { private final Scheduler slave; private Controller( Scheduler slave ) { this.slave = slave; } /** * @return {@code true} if new children can be scheduled. */ boolean canSchedule() { return Scheduler.this.canSchedule(); } void stop( Collection executedTests, Collection incompleteTests, boolean tryCancelFutures, boolean shutdownNow ) { slave.stop( executedTests, incompleteTests, tryCancelFutures, shutdownNow ); } /** * @see org.apache.maven.surefire.junitcore.pc.Destroyable#destroy() */ boolean destroy() { return slave.strategy.destroy(); } @Override public int hashCode() { return slave.hashCode(); } @Override public boolean equals( Object o ) { return o == this || ( o instanceof Controller ) && slave.equals( ( (Controller) o ).slave ); } } /** * There is a way to shutdown the hierarchy of schedulers. You can do it in master scheduler via * {@link #shutdownThreadPoolsAwaitingKilled()} which kills the current master and children recursively. * If alternatively a shared {@link java.util.concurrent.ExecutorService} used by the master and children * schedulers is shutdown from outside, then the {@link ShutdownHandler} is a hook calling current * {@link #describeStopped(boolean)}. The method {@link #describeStopped(boolean)} is again shutting down children * schedulers recursively as well. */ public class ShutdownHandler implements RejectedExecutionHandler { private volatile RejectedExecutionHandler poolHandler; protected ShutdownHandler() { poolHandler = null; } public void setRejectedExecutionHandler( RejectedExecutionHandler poolHandler ) { this.poolHandler = poolHandler; } @Override public void rejectedExecution( Runnable r, ThreadPoolExecutor executor ) { if ( executor.isShutdown() ) { Scheduler.this.stop( null, null, true, false ); } final RejectedExecutionHandler poolHandler = this.poolHandler; if ( poolHandler != null ) { poolHandler.rejectedExecution( r, executor ); } } } } SchedulingStrategies.java000066400000000000000000000066031330756104600442540ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.util.internal.DaemonThreadFactory; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; /** * The factory of {@link SchedulingStrategy}. * * @author Tibor Digana (tibor17) * @since 2.16 */ public class SchedulingStrategies { private static final ThreadFactory DAEMON_THREAD_FACTORY = DaemonThreadFactory.newDaemonThreadFactory(); /** * @param logger current error logger * @return sequentially executing strategy */ public static SchedulingStrategy createInvokerStrategy( ConsoleStream logger ) { return new InvokerStrategy( logger ); } /** * @param logger current error logger * @param nThreads fixed pool capacity * @return parallel scheduling strategy */ public static SchedulingStrategy createParallelStrategy( ConsoleStream logger, int nThreads ) { return new NonSharedThreadPoolStrategy( logger, Executors.newFixedThreadPool( nThreads, DAEMON_THREAD_FACTORY ) ); } /** * @param logger current error logger * @return parallel scheduling strategy with unbounded capacity */ public static SchedulingStrategy createParallelStrategyUnbounded( ConsoleStream logger ) { return new NonSharedThreadPoolStrategy( logger, Executors.newCachedThreadPool( DAEMON_THREAD_FACTORY ) ); } /** * The threadPool passed to this strategy can be shared in other strategies. *
* The call {@link SchedulingStrategy#finished()} is waiting until own tasks have finished. * New tasks will not be scheduled by this call in this strategy. This strategy is not * waiting for other strategies to finish. The {@link org.junit.runners.model.RunnerScheduler#finished()} may * freely use {@link SchedulingStrategy#finished()}. * * @param logger current error logger * @param threadPool thread pool possibly shared with other strategies * @return parallel strategy with shared thread pool * @throws NullPointerException if threadPool is null */ public static SchedulingStrategy createParallelSharedStrategy( ConsoleStream logger, ExecutorService threadPool ) { if ( threadPool == null ) { throw new NullPointerException( "null threadPool in #createParallelSharedStrategy" ); } return new SharedThreadPoolStrategy( logger, threadPool ); } } SchedulingStrategy.java000066400000000000000000000123071330756104600437420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.apache.maven.surefire.report.ConsoleStream; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.concurrent.atomic.AtomicBoolean; /** * Specifies the strategy of scheduling whether sequential, or parallel. * The strategy may use a thread pool shared with other strategies. *
* One instance of strategy can be used just by one {@link Scheduler}. *
* The strategy is scheduling tasks in {@link #schedule(Runnable)} and awaiting them * completed in {@link #finished()}. Both methods should be used in one thread. * * @author Tibor Digana (tibor17) * @since 2.16 */ public abstract class SchedulingStrategy implements Destroyable { private final AtomicBoolean canSchedule = new AtomicBoolean( true ); private final ConsoleStream logger; protected SchedulingStrategy( ConsoleStream logger ) { this.logger = logger; } /** * Schedules tasks if {@link #canSchedule()}. * * @param task runnable to schedule in a thread pool or invoke * @throws java.util.concurrent.RejectedExecutionException if task * cannot be scheduled for execution * @throws NullPointerException if task is null * @see org.junit.runners.model.RunnerScheduler#schedule(Runnable) * @see java.util.concurrent.Executor#execute(Runnable) */ protected abstract void schedule( Runnable task ); /** * Waiting for scheduled tasks to finish. * New tasks will not be scheduled by calling this method. * * @return {@code true} if successfully stopped the scheduler, else * {@code false} if already stopped (a shared thread * pool was shutdown externally). * @throws InterruptedException if interrupted while waiting * for scheduled tasks to finish * @see org.junit.runners.model.RunnerScheduler#finished() */ protected abstract boolean finished() throws InterruptedException; /** * Stops scheduling new tasks (e.g. by {@link java.util.concurrent.ExecutorService#shutdown()} * on a private thread pool which cannot be shared with other strategy). * * @return {@code true} if successfully stopped the scheduler, else * {@code false} if already stopped (a shared thread * pool was shutdown externally). * @see java.util.concurrent.ExecutorService#shutdown() */ protected abstract boolean stop(); /** * Stops scheduling new tasks and {@code interrupts} running tasks * (e.g. by {@link java.util.concurrent.ExecutorService#shutdownNow()} on a private thread pool * which cannot be shared with other strategy). *
* This method calls {@link #stop()} by default. * * @return {@code true} if successfully stopped the scheduler, else * {@code false} if already stopped (a shared thread * pool was shutdown externally). * @see java.util.concurrent.ExecutorService#shutdownNow() */ protected boolean stopNow() { return stop(); } /** * Persistently disables this strategy. Atomically ignores {@link Balancer} to acquire a new permit.
* The method {@link #canSchedule()} atomically returns {@code false}. * @return {@code true} if {@link #canSchedule()} has return {@code true} on the beginning of this method call. */ protected boolean disable() { return canSchedule.getAndSet( false ); } protected void setDefaultShutdownHandler( Scheduler.ShutdownHandler handler ) { } /** * @return {@code true} if a thread pool associated with this strategy * can be shared with other strategies. */ protected abstract boolean hasSharedThreadPool(); /** * @return {@code true} unless stopped, finished or disabled. */ protected boolean canSchedule() { return canSchedule.get(); } protected void logQuietly( Throwable t ) { ByteArrayOutputStream out = new ByteArrayOutputStream(); PrintStream stream = new PrintStream( out ); try { t.printStackTrace( stream ); stream.flush(); } finally { stream.close(); } logger.println( out.toString() ); } } SharedThreadPoolStrategy.java000066400000000000000000000057531330756104600450540ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.apache.maven.surefire.report.ConsoleStream; import java.util.concurrent.CancellationException; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; /** * Parallel strategy for shared thread pool in private package. * * @author Tibor Digana (tibor17) * @see AbstractThreadPoolStrategy * @since 2.16 */ final class SharedThreadPoolStrategy extends AbstractThreadPoolStrategy { SharedThreadPoolStrategy( ConsoleStream logger, ExecutorService threadPool ) { super( logger, threadPool, new ConcurrentLinkedQueue>() ); } @Override public boolean hasSharedThreadPool() { return true; } @Override public boolean finished() throws InterruptedException { boolean wasRunningAll = disable(); for ( Future futureResult : getFutureResults() ) { try { futureResult.get(); } catch ( InterruptedException e ) { // after called external ExecutorService#shutdownNow() wasRunningAll = false; } catch ( ExecutionException e ) { // JUnit core throws exception. if ( e.getCause() != null ) { logQuietly( e.getCause() ); } } catch ( CancellationException e ) { /** * Cancelled by {@link Future#cancel(boolean)} in {@link stop()} and {@link stopNow()}. */ } } return wasRunningAll; } @Override protected boolean stop() { return stop( false ); } @Override protected boolean stopNow() { return stop( true ); } private boolean stop( boolean interrupt ) { final boolean wasRunning = disable(); for ( Future futureResult : getFutureResults() ) { futureResult.cancel( interrupt ); } return wasRunning; } }ShutdownResult.java000066400000000000000000000040421330756104600431410ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.junit.runner.Description; import java.util.Collection; import java.util.Collections; /** * Populates collection {@code triggeredTests} of descriptions started before shutting down. * Populates collection {@code incompleteTests} which describes started tests but unfinished due to abrupt shutdown. * The collection {@code triggeredTests} contains all elements from {@code incompleteTests}. * * @author Tibor Digana (tibor17) * @see Scheduler * @since 2.18 */ public final class ShutdownResult { private final Collection triggeredTests; private final Collection incompleteTests; public ShutdownResult( Collection triggeredTests, Collection incompleteTests ) { this.triggeredTests = triggeredTests == null ? Collections.emptySet() : triggeredTests; this.incompleteTests = incompleteTests == null ? Collections.emptySet() : incompleteTests; } public Collection getTriggeredTests() { return triggeredTests; } public Collection getIncompleteTests() { return incompleteTests; } } ShutdownStatus.java000066400000000000000000000040571330756104600431540ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicReference; /** * Wrapper of {@link ParallelComputer ParallelComputer status information} and tests been populated before * a shutdown hook has been triggered. * * @author Tibor Digana (tibor17) * @see ParallelComputer * @since 2.18 */ final class ShutdownStatus { private final AtomicReference status = new AtomicReference( ExecutionStatus.STARTED ); private Future descriptionsBeforeShutdown; boolean tryFinish() { return status.compareAndSet( ExecutionStatus.STARTED, ExecutionStatus.FINISHED ); } boolean tryTimeout() { return status.compareAndSet( ExecutionStatus.STARTED, ExecutionStatus.TIMEOUT ); } boolean isTimeoutElapsed() { return status.get() == ExecutionStatus.TIMEOUT; } Future getDescriptionsBeforeShutdown() { return descriptionsBeforeShutdown; } void setDescriptionsBeforeShutdown( Future descriptionsBeforeShutdown ) { this.descriptionsBeforeShutdown = descriptionsBeforeShutdown; } }SingleThreadScheduler.java000066400000000000000000000065331330756104600443460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.util.internal.DaemonThreadFactory; import org.junit.runner.Description; import org.junit.runners.model.RunnerScheduler; import java.util.Collection; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * Used to execute tests annotated with net.jcip.annotations.NotThreadSafe. *
* * @author Tibor Digana (tibor17) * @see ParallelComputerBuilder * @since 2.18 */ final class SingleThreadScheduler { private final ConsoleStream logger; private final ExecutorService pool = newPool(); private final Scheduler master; private static ExecutorService newPool() { ThreadFactory tf = DaemonThreadFactory.newDaemonThreadFactory( "maven-surefire-plugin@NotThreadSafe" ); return new ThreadPoolExecutor( 1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(), tf ); } SingleThreadScheduler( ConsoleStream logger ) { this.logger = logger; SchedulingStrategy strategy = SchedulingStrategies.createParallelSharedStrategy( logger, pool ); master = new Scheduler( logger, null, strategy ); } RunnerScheduler newRunnerScheduler() { SchedulingStrategy strategy = SchedulingStrategies.createParallelSharedStrategy( logger, pool ); return new Scheduler( logger, null, master, strategy ); } /** * @see Scheduler#describeStopped(boolean) */ ShutdownResult describeStopped( boolean shutdownNow ) { ShutdownResult shutdownResult = master.describeStopped( shutdownNow ); return new ShutdownResult( copyExisting( shutdownResult.getTriggeredTests() ), copyExisting( shutdownResult.getIncompleteTests() ) ); } /** * @see Scheduler#shutdownThreadPoolsAwaitingKilled() */ boolean shutdownThreadPoolsAwaitingKilled() { return master.shutdownThreadPoolsAwaitingKilled(); } private Collection copyExisting( Collection descriptions ) { Collection activeChildren = new ConcurrentLinkedQueue( descriptions ); ParallelComputerUtil.removeUnusedDescriptions( activeChildren ); return activeChildren; } }ThreadResourcesBalancer.java000066400000000000000000000055701330756104600446700ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import java.util.concurrent.Semaphore; /** * @author Tibor Digana (tibor17) * @see Balancer * @since 2.16 */ final class ThreadResourcesBalancer implements Balancer { private final Semaphore balancer; private final int numPermits; /** * fair set to false. * * @param numPermits number of permits to acquire when maintaining concurrency on tests. * Must be >0 and < {@link Integer#MAX_VALUE}. * @see #ThreadResourcesBalancer(int, boolean) */ ThreadResourcesBalancer( int numPermits ) { this( numPermits, false ); } /** * @param numPermits number of permits to acquire when maintaining concurrency on tests. * Must be >0 and < {@link Integer#MAX_VALUE}. * @param fair {@code true} guarantees the waiting schedulers to wake up in order they acquired a permit * @throws IllegalArgumentException if numPermits is not positive number */ ThreadResourcesBalancer( int numPermits, boolean fair ) { if ( numPermits <= 0 ) { throw new IllegalArgumentException( String.format( "numPermits=%d should be positive number", numPermits ) ); } balancer = new Semaphore( numPermits, fair ); this.numPermits = numPermits; } /** * Acquires a permit from this balancer, blocking until one is available. * * @return {@code true} if current thread is NOT interrupted * while waiting for a permit. */ @Override public boolean acquirePermit() { try { balancer.acquire(); return true; } catch ( InterruptedException e ) { return false; } } /** * Releases a permit, returning it to the balancer. */ @Override public void releasePermit() { balancer.release(); } @Override public void releaseAllPermits() { balancer.release( numPermits ); } }Type.java000066400000000000000000000017071330756104600410550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ /** * @author tibor17 (Tibor Digana) * @since 2.17 */ enum Type { SUITES, CLASSES, METHODS }WrappedRunners.java000066400000000000000000000031441330756104600431100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.junit.runners.ParentRunner; /** * We need to wrap runners in a suite and count children of these runners. *
* Old JUnit versions do not cache children after the first call of * {@link org.junit.runners.ParentRunner#getChildren()}. * Due to performance reasons, the children have to be observed just once. * * @author tibor17 (Tibor Digana) * @see ParallelComputerBuilder * @since 2.17 */ final class WrappedRunners { final ParentRunner wrappingSuite; final long embeddedChildrenCount; WrappedRunners( ParentRunner wrappingSuite, long embeddedChildrenCount ) { this.wrappingSuite = wrappingSuite; this.embeddedChildrenCount = embeddedChildrenCount; } WrappedRunners() { this( null, 0 ); } } maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/resources/000077500000000000000000000000001330756104600310665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/resources/META-INF/000077500000000000000000000000001330756104600322265ustar00rootroot00000000000000services/000077500000000000000000000000001330756104600337725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/resources/META-INForg.apache.maven.surefire.providerapi.SurefireProvider000066400000000000000000000000661330756104600464770ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/main/resources/META-INF/servicesorg.apache.maven.surefire.junitcore.JUnitCoreProvider maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/000077500000000000000000000000001330756104600271075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/000077500000000000000000000000001330756104600300305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/000077500000000000000000000000001330756104600306175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/000077500000000000000000000000001330756104600320405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600331465ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600347135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/mavenjunitcore/000077500000000000000000000000001330756104600367155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefireConcurrentRunListenerTest.java000066400000000000000000000261461330756104600447460ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.HashMap; import java.util.Map; import org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.report.DefaultDirectConsoleReporter; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.RunStatistics; import org.apache.maven.surefire.testset.TestSetFailedException; import junit.framework.Assert; import junit.framework.TestCase; import junit.framework.TestSuite; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.Computer; import org.junit.runner.JUnitCore; /* * @author Kristian Rosenvold */ public class ConcurrentRunListenerTest extends TestCase { // Tests are in order of increasing complexity public void testNoErrorsCounting() throws Exception { runClasses( 3, 0, 0, DummyAllOk.class ); } public void testNoErrorsCounting2() throws Exception { runClasses( 2, 0, 0, Dummy3.class ); } public void testOneIgnoreCounting() throws Exception { runClasses( 3, 1, 0, DummyWithOneIgnore.class ); } public void testOneFailureCounting() throws Exception { runClasses( 3, 0, 1, DummyWithFailure.class ); } public void testWithErrorsCountingDemultiplexed() throws Exception { runClasses( 6, 1, 1, DummyWithOneIgnore.class, DummyWithFailure.class ); } public void testJunitResultCountingDemultiplexed() throws Exception { runClasses( 8, 1, 1, DummyWithOneIgnore.class, DummyWithFailure.class, Dummy3.class ); } public void testJunitResultCountingJUnit3Demultiplexed() throws Exception { runClasses( 3, 0, 0, Junit3Tc1.class, Junit3Tc2.class ); } public void testJunitResultCountingJUnit3OddTest() throws Exception { runClasses( 2, 0, 0, Junit3OddTest1.class ); } public void testJunit3WithNestedSuite() throws TestSetFailedException { runClasses( 4, 0, 0, Junit3WithNestedSuite.class ); } public void testJunit3NestedSuite() throws Exception { runClasses( 2, 0, 0, Junit3OddTest1.class ); } public void testSimpleOutput() throws Exception { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); PrintStream collector = new PrintStream( byteArrayOutputStream ); PrintStream orgOur = System.out; System.setOut( collector ); RunStatistics result = runClasses( Dummy3.class ); assertReporter( result, 2, 0, 0, "msgs" ); String foo = new String( byteArrayOutputStream.toByteArray() ); assertNotNull( foo ); System.setOut( orgOur ); } public void testOutputOrdering() throws Exception { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); PrintStream collector = new PrintStream( byteArrayOutputStream ); PrintStream orgOur = System.out; System.setOut( collector ); RunStatistics result = runClasses( DummyWithOneIgnore.class, DummyWithFailure.class, Dummy3.class ); assertReporter( result, 8, 1, 1, "msgs" ); String foo = new String( byteArrayOutputStream.toByteArray() ); assertNotNull( foo ); System.setOut( orgOur ); // final List stringList = result.getEvents(); // assertEquals( 23, stringList.size() ); } private void runClasses( int success, int ignored, int failure, Class... classes ) throws TestSetFailedException { DefaultReporterFactory reporterFactory = createReporterFactory(); HashMap classMethodCounts = new HashMap(); final ConsoleStream defaultConsoleReporter = new DefaultDirectConsoleReporter( System.out ); RunListener reporter = new ClassesParallelRunListener( classMethodCounts, reporterFactory, defaultConsoleReporter ); JUnitCoreRunListener runListener = new JUnitCoreRunListener( reporter, classMethodCounts ); RunStatistics result = runClasses( reporterFactory, runListener, classes ); assertReporter( result, success, ignored, failure, "classes" ); classMethodCounts.clear(); reporterFactory = createReporterFactory(); reporter = new MethodsParallelRunListener( classMethodCounts, reporterFactory, true, defaultConsoleReporter ); runListener = new JUnitCoreRunListener( reporter, classMethodCounts ); result = runClasses( reporterFactory, runListener, classes ); assertReporter( result, success, ignored, failure, "methods" ); } private RunStatistics runClasses( Class... classes ) throws TestSetFailedException { HashMap classMethodCounts = new HashMap(); final DefaultReporterFactory reporterManagerFactory = createReporterFactory(); org.junit.runner.notification.RunListener demultiplexingRunListener = createRunListener( reporterManagerFactory, classMethodCounts ); JUnitCore jUnitCore = new JUnitCore(); jUnitCore.addListener( demultiplexingRunListener ); Computer computer = new Computer(); jUnitCore.run( computer, classes ); reporterManagerFactory.close(); return reporterManagerFactory.getGlobalRunStatistics(); } private RunStatistics runClasses( DefaultReporterFactory reporterManagerFactory, org.junit.runner.notification.RunListener demultiplexingRunListener, Class... classes ) throws TestSetFailedException { JUnitCore jUnitCore = new JUnitCore(); jUnitCore.addListener( demultiplexingRunListener ); Computer computer = new Computer(); jUnitCore.run( computer, classes ); return reporterManagerFactory.getGlobalRunStatistics(); } private org.junit.runner.notification.RunListener createRunListener( ReporterFactory reporterFactory, Map testSetMap ) throws TestSetFailedException { return new JUnitCoreRunListener( new ClassesParallelRunListener( testSetMap, reporterFactory, new DefaultDirectConsoleReporter( System.out ) ), testSetMap ); } public static class DummyWithOneIgnore { @Test public void testNotMuch() { } @Ignore @Test public void testStub1() { } @Test public void testStub2() { } } public static class DummyWithFailure { @Test public void testBeforeFail() { } @Test public void testWillFail() { Assert.fail( "We will fail" ); } @Test public void testAfterFail() { } } public static class DummyAllOk { @Test public void testNotMuchA() { } @Test public void testStub1A() { } @Test public void testStub2A() { } } public static class Dummy3 { @Test public void testNotMuchA() { System.out.println( "tNMA1" ); System.err.println( "tNMA1err" ); } @Test public void testStub2A() { System.out.println( "tS2A" ); System.err.println( "tS2AErr" ); } } public static class Junit3Tc1 extends TestCase { public Junit3Tc1() { super( "testNotMuchJunit3TC1" ); } public void testNotMuchJunit3TC1() { System.out.println( "Junit3TC1" ); } public static junit.framework.Test suite() { TestSuite suite = new TestSuite(); suite.addTest( new Junit3Tc1() ); return suite; } } public static class Junit3Tc2 extends TestCase { public Junit3Tc2( String testMethod ) { super( testMethod ); } public void testNotMuchJunit3TC2() { System.out.println( "Junit3TC2" ); } public void testStubJ3TC2A() { System.out.println( "testStubJ3TC2A" ); } public static junit.framework.Test suite() { TestSuite suite = new TestSuite(); suite.addTest( new Junit3Tc2( "testNotMuchJunit3TC2" ) ); suite.addTest( new Junit3Tc2( "testStubJ3TC2A" ) ); return suite; } } public static class Junit3OddTest1 extends TestCase { public static junit.framework.Test suite() { TestSuite suite = new TestSuite(); suite.addTest( new Junit3OddTest1( "testMe" ) ); suite.addTest( new Junit3OddTest1( "testMe2" ) ); return suite; } public Junit3OddTest1( String name ) { super( name ); } public void testMe() { assertTrue( true ); } } public static class Junit3WithNestedSuite extends TestCase { public static junit.framework.Test suite() { TestSuite suite = new TestSuite(); suite.addTest( new Junit3WithNestedSuite( "testMe" ) ); suite.addTest( new Junit3WithNestedSuite( "testMe2" ) ); suite.addTestSuite( Junit3Tc2.class ); return suite; } public Junit3WithNestedSuite( String name ) { super( name ); } public void testMe2() { assertTrue( true ); } } private DefaultReporterFactory createReporterFactory() { return JUnitCoreTester.defaultNoXml(); } private void assertReporter( RunStatistics result, int success, int ignored, int failure, String message ) { assertEquals( message, success, result.getCompletedCount() ); assertEquals( message, ignored, result.getSkipped() ); } } ConfigurableParallelComputerTest.java000066400000000000000000000244701330756104600462230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutionException; import junit.framework.TestCase; import org.junit.Test; import org.junit.runner.Computer; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.notification.RunListener; /** * Simple test of ConfigurableParallelComputer. * * @author Kristian Rosenvold */ public class ConfigurableParallelComputerTest extends TestCase { private static final int NUMTESTS = 1000; // I'm sorry about all the sout's in this test; but if you deadlock when building you will appreciate it. @Test public void testAnythingYouWantToPlayWith() throws Exception { Result result = new Result(); Class[] realClasses = new Class[]{ Dummy.class, Dummy2.class }; DiagnosticRunListener diagnosticRunListener = new DiagnosticRunListener( false, result.createListener() ); JUnitCore jUnitCore = getJunitCore( diagnosticRunListener ); ConfigurableParallelComputer computer = new ConfigurableParallelComputer( true, false ); jUnitCore.run( computer, realClasses ); computer.close(); assertEquals( "All tests should succeed, right ?", 5, result.getRunCount() ); } @Test public void testOneMethod() throws ExecutionException { JUnitCore jUnitCore = new JUnitCore(); ConfigurableParallelComputer computer = new ConfigurableParallelComputer( false, true ); jUnitCore.run( computer, new Class[]{ Dummy.class, Dummy.class, Dummy.class } ); computer.close(); } @Test public void testSerial() throws Exception { Result result = new Result(); Class[] realClasses = getClassList(); JUnitCore jUnitCore = getJunitCore( result ); Computer computer = new Computer(); timedRun( NUMTESTS, result, realClasses, jUnitCore, computer ); } @Test public void testFullTestRunPC() throws Exception { Result result = new Result(); Class[] realClasses = getClassList(); JUnitCore jUnitCore = getJunitCore( result ); Computer computer = new ConfigurableParallelComputer( true, true ); timedRun( NUMTESTS, result, realClasses, jUnitCore, computer ); } @Test public void testWithFailingAssertionCPC() throws Exception { runWithFailingAssertion( new ConfigurableParallelComputer( false, true, 6, true ) ); runWithFailingAssertion( new ConfigurableParallelComputer( true, false, 12, false ) ); runWithFailingAssertion( new ConfigurableParallelComputer( true, true, 2, false ) ); } @Test public void testWithSlowTestJustAfew() throws Exception { Result result = new Result(); final Computer computer = new ConfigurableParallelComputer( false, true, 3, false ); Class[] realClasses = getClassList( SlowTest.class, 5 ); // 300 ms in methods, 600 in classes JUnitCore jUnitCore = getJunitCore( result ); runIt( realClasses, jUnitCore, computer ); } private void runWithFailingAssertion( Computer computer ) throws ExecutionException { Result result = new Result(); Class[] realClasses = getClassList( FailingAssertions.class ); JUnitCore jUnitCore = getJunitCore( result ); runIt( realClasses, jUnitCore, computer ); assertEquals( "No tests should fail, right ?", NUMTESTS, result.getFailures().size() ); assertEquals( "All tests should succeed, right ?", 0, result.getIgnoreCount() ); assertEquals( "All tests should succeed, right ?", NUMTESTS * 3, result.getRunCount() ); } @Test public void testWithFailure() throws Exception { Computer computer = new ConfigurableParallelComputer( false, true, 4, true ); Result result = new Result(); Class[] realClasses = getClassList( Failure.class ); JUnitCore jUnitCore = getJunitCore( result ); runIt( realClasses, jUnitCore, computer ); assertEquals( "No tests should fail, right ?", NUMTESTS, result.getFailures().size() ); assertEquals( "All tests should succeed, right ?", 0, result.getIgnoreCount() ); assertEquals( "All tests should succeed, right ?", NUMTESTS * 3, result.getRunCount() ); } @Test public void testFixedThreadPool() throws Exception { Result result = new Result(); Class[] realClasses = getClassList(); JUnitCore jUnitCore = getJunitCore( result ); ConfigurableParallelComputer computer = new ConfigurableParallelComputer( false, true, 2, false ); timedRun( NUMTESTS, result, realClasses, jUnitCore, computer ); } @Test public void testClassesUnlimited() throws Exception { Result result = new Result(); Class[] realClasses = getClassList(); JUnitCore jUnitCore = getJunitCore( result ); ConfigurableParallelComputer computer = new ConfigurableParallelComputer( true, false ); timedRun( NUMTESTS, result, realClasses, jUnitCore, computer ); } @Test public void testBothUnlimited() throws Exception { Result result = new Result(); Class[] realClasses = getClassList(); DiagnosticRunListener diagnosticRunListener = new DiagnosticRunListener( false, result.createListener() ); JUnitCore jUnitCore = getJunitCore( diagnosticRunListener ); ConfigurableParallelComputer computer = new ConfigurableParallelComputer( true, true ); timedRun( NUMTESTS, result, realClasses, jUnitCore, computer ); } private JUnitCore getJunitCore( Result result ) { RunListener listener = result.createListener(); JUnitCore jUnitCore = new JUnitCore(); jUnitCore.addListener( listener ); return jUnitCore; } private JUnitCore getJunitCore( RunListener listener ) { JUnitCore jUnitCore = new JUnitCore(); jUnitCore.addListener( listener ); return jUnitCore; } private long runIt( Class[] realClasses, JUnitCore jUnitCore, Computer computer ) throws ExecutionException { long start = System.currentTimeMillis(); jUnitCore.run( computer, realClasses ); if ( computer instanceof ConfigurableParallelComputer ) { ( (ConfigurableParallelComputer) computer ).close(); } return System.currentTimeMillis() - start; } private long timedRun( int NUMTESTS, Result result, Class[] realClasses, JUnitCore jUnitCore, Computer computer ) throws ExecutionException { long time = runIt( realClasses, jUnitCore, computer ); assertEquals( "No tests should fail, right ?", 0, result.getFailures().size() ); assertEquals( "All tests should succeed, right ?", 0, result.getIgnoreCount() ); assertEquals( "All tests should succeed, right ?", NUMTESTS * 3, result.getRunCount() ); return time; } private Class[] getClassList() { return getClassList( Dummy.class, NUMTESTS ); } private Class[] getClassList( Class testClass ) { return getClassList( testClass, NUMTESTS ); } private Class[] getClassList( Class testClass, int numItems ) { List realClasses = new ArrayList(); for ( int i = 0; i < numItems; i++ ) { realClasses.add( testClass ); } return realClasses.toArray( new Class[realClasses.size()] ); } static void sleepReallyEvenOnWindows( long ms ) throws InterruptedException { long endAt = System.currentTimeMillis() + ms; Thread.sleep( ms ); while ( endAt > System.currentTimeMillis() ) { Thread.sleep( ms / 10 ); Thread.yield(); } } public static class Dummy { @Test public void testNotMuch() { } @Test public void testStub1() { // Add your code here } @Test public void testStub2() { // Add your code here } } public static class Dummy2 { @Test public void testNotMuch() { } @Test public void testDummy2() { // Add your code here } } public static class SlowTest { final int scaling = 100; @Test public void testNotMuch() throws InterruptedException { sleepReallyEvenOnWindows( scaling ); } @Test public void testNotMuch2() throws InterruptedException { sleepReallyEvenOnWindows( 3 * scaling ); } @Test public void testNotMuch3() throws InterruptedException { sleepReallyEvenOnWindows( 2 * scaling ); } } public static class FailingAssertions { @Test public void testNotMuch() { } @Test public void testNotMuch2() { } @Test public void testWithFail() { fail( "We excpect this" ); } } public static class Failure { @Test public void testNotMuch() { } @Test public void testNotMuch2() { } @Test public void testWithException() { throw new RuntimeException( "We expect this" ); } } }DiagnosticRunListener.java000066400000000000000000000111151330756104600440360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * Copyright 2002-2009 the original author or authors. * * Licensed 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. * * Also licensed under CPL http://junit.sourceforge.net/cpl-v10.html */ import java.util.concurrent.atomic.AtomicInteger; import org.junit.runner.Description; import org.junit.runner.Result; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunListener; /* * @author Kristian Rosenvold, kristianAzeniorD0Tno */ public class DiagnosticRunListener extends RunListener { private final AtomicInteger numTestStarted = new AtomicInteger(); private final AtomicInteger numTestFailed = new AtomicInteger(); private final AtomicInteger numTestAssumptionsFailed = new AtomicInteger(); private final AtomicInteger numTestFinished = new AtomicInteger(); private final AtomicInteger numTestIgnored = new AtomicInteger(); private final boolean printToConsole; private final RunListener target; private void print( String event, Description description ) { if ( printToConsole ) { System.out.println( Thread.currentThread().toString() + ", event = " + event + ", " + description ); } } private void print( String event, Result description ) { if ( printToConsole ) { System.out.println( Thread.currentThread().toString() + ", event = " + event + ", " + description ); } } private void print( String event, Failure description ) { if ( printToConsole ) { System.out.println( Thread.currentThread().toString() + ", event = " + event + ", " + description ); } } public DiagnosticRunListener( boolean printToConsole, RunListener target ) { this.printToConsole = printToConsole; this.target = target; } @Override public void testRunStarted( Description description ) throws Exception { print( "testRunStarted", description ); if ( target != null ) { target.testRunStarted( description ); } } @Override public void testRunFinished( Result result ) throws Exception { print( "testRunFinished", result ); if ( target != null ) { target.testRunFinished( result ); } } @Override public void testStarted( Description description ) throws Exception { numTestStarted.incrementAndGet(); print( "testStarted", description ); if ( target != null ) { target.testStarted( description ); } } @Override public void testFinished( Description description ) throws Exception { numTestFinished.incrementAndGet(); print( "testFinished", description ); if ( target != null ) { target.testFinished( description ); } } @Override public void testFailure( Failure failure ) throws Exception { numTestFailed.incrementAndGet(); print( "testFailure", failure ); if ( target != null ) { target.testFailure( failure ); } } @Override public void testAssumptionFailure( Failure failure ) { numTestAssumptionsFailed.incrementAndGet(); print( "testAssumptionFailure", failure ); if ( target != null ) { target.testAssumptionFailure( failure ); } } @Override public void testIgnored( Description description ) throws Exception { numTestIgnored.incrementAndGet(); print( "testIgnored", description ); if ( target != null ) { target.testIgnored( description ); } } @Override public String toString() { return "DiagnosticRunListener{" + "numTestIgnored=" + numTestIgnored + ", numTestStarted=" + numTestStarted + ", numTestFailed=" + numTestFailed + ", numTestAssumptionsFailed=" + numTestAssumptionsFailed + ", numTestFinished=" + numTestFinished + '}'; } } JUnit47SuiteTest.java000066400000000000000000000041321330756104600426360ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import junit.framework.JUnit4TestAdapter; import junit.framework.Test; import org.apache.maven.surefire.junitcore.pc.OptimizedParallelComputerTest; import org.apache.maven.surefire.junitcore.pc.ParallelComputerBuilderTest; import org.apache.maven.surefire.junitcore.pc.ParallelComputerUtilTest; import org.apache.maven.surefire.junitcore.pc.SchedulingStrategiesTest; import org.junit.runner.RunWith; import org.junit.runners.Suite; /** * Adapt the JUnit47 tests which use only annotations to the JUnit3 test suite. * * @author Tibor Digana (tibor17) * @since 2.16 */ @Suite.SuiteClasses( { Surefire746Test.class, Surefire813IncorrectResultTest.class, ParallelComputerUtilTest.class, ParallelComputerBuilderTest.class, SchedulingStrategiesTest.class, OptimizedParallelComputerTest.class, ConcurrentRunListenerTest.class, ConfigurableParallelComputerTest.class, JUnit4Reflector481Test.class, JUnitCoreParametersTest.class, JUnitCoreRunListenerTest.class, MavenSurefireJUnit47RunnerTest.class, MavenSurefireJUnit48RunnerTest.class, TestMethodTest.class } ) @RunWith( Suite.class ) public class JUnit47SuiteTest { public static Test suite() { return new JUnit4TestAdapter( JUnit47SuiteTest.class ); } } JUnit4Reflector481Test.java000066400000000000000000000114741330756104600436470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import java.lang.annotation.Annotation; import java.lang.reflect.Method; import org.apache.maven.surefire.common.junit4.JUnit4Reflector; import org.apache.maven.surefire.util.ReflectionUtils; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.Description; import static org.junit.Assert.*; /** * Reflector Test with junit 4.8.1 * * @author Kristian Rosenvold */ public class JUnit4Reflector481Test { private static final Class[] EMPTY_CLASS_ARRAY = new Class[0]; @Test public void testGetAnnotatedIgnore() { final Method testSomething2 = ReflectionUtils.getMethod( IgnoreWithDescription.class, "testSomething2", EMPTY_CLASS_ARRAY ); final Annotation[] annotations = testSomething2.getAnnotations(); Description desc = Description.createTestDescription( IgnoreWithDescription.class, "testSomething2", annotations ); Ignore annotatedIgnore = JUnit4Reflector.getAnnotatedIgnore( desc ); assertNotNull( annotatedIgnore ); assertEquals( "testSomething2" + "(org.apache.maven.surefire.junitcore.JUnit4Reflector481Test$IgnoreWithDescription)", desc.getDisplayName() ); assertEquals( "testSomething2" + "(org.apache.maven.surefire.junitcore.JUnit4Reflector481Test$IgnoreWithDescription)", desc.toString() ); assertEquals( "org.apache.maven.surefire.junitcore.JUnit4Reflector481Test$IgnoreWithDescription", desc.getClassName() ); assertEquals( "testSomething2", desc.getMethodName() ); assertEquals( 0, desc.getChildren().size() ); assertEquals( 2, desc.getAnnotations().size() ); assertSame( annotatedIgnore, desc.getAnnotation( Ignore.class ) ); assertEquals( reason, annotatedIgnore.value() ); } @Test public void testGetAnnotatedIgnoreWithoutClass() { final Method testSomething2 = ReflectionUtils.getMethod( IgnoreWithDescription.class, "testSomething2", EMPTY_CLASS_ARRAY ); final Annotation[] annotations = testSomething2.getAnnotations(); Description desc = Description.createSuiteDescription( "testSomething2", annotations ); Ignore annotatedIgnore = JUnit4Reflector.getAnnotatedIgnore( desc ); assertNotNull( annotatedIgnore ); assertEquals( "testSomething2", desc.getDisplayName() ); assertEquals( "testSomething2", desc.toString() ); assertEquals( "testSomething2", desc.getClassName() ); assertNull( desc.getMethodName() ); assertEquals( 0, desc.getChildren().size() ); assertEquals( 2, desc.getAnnotations().size() ); assertSame( annotatedIgnore, desc.getAnnotation( Ignore.class ) ); assertEquals( reason, annotatedIgnore.value() ); } private static final String reason = "Ignorance is bliss"; public static class IgnoreWithDescription { @Test @Ignore( reason ) public void testSomething2() { } } @Test public void testCreatePureDescription() { Description description = JUnit4Reflector.createDescription( "exception" ); assertEquals( "exception", description.getDisplayName() ); assertEquals( "exception", description.toString() ); assertEquals( 0, description.getChildren().size() ); } @Test public void testCreateDescription() { Ignore ignore = JUnit4Reflector.createIgnored( "error" ); Description description = JUnit4Reflector.createDescription( "exception", ignore ); assertEquals( "exception", description.getDisplayName() ); assertEquals( "exception", description.toString() ); assertEquals( "exception", description.getClassName() ); assertEquals( 0, description.getChildren().size() ); Ignore annotatedIgnore = JUnit4Reflector.getAnnotatedIgnore( description ); assertNotNull( annotatedIgnore ); assertEquals( "error", annotatedIgnore.value() ); } } JUnitCoreParametersTest.java000066400000000000000000000165561330756104600443230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import java.util.HashMap; import java.util.Map; import org.junit.Test; import static org.junit.Assert.*; import static org.hamcrest.core.Is.is; /* * @author Kristian Rosenvold, kristian.rosenvold@gmail com */ public class JUnitCoreParametersTest { @Test public void defaultParameters() { assertFalse( newTestSetDefault().isParallelismSelected() ); assertTrue( newTestSetDefault().isPerCoreThreadCount() ); assertThat( newTestSetDefault().getThreadCount(), is( 0 ) ); assertThat( newTestSetDefault().getThreadCountMethods(), is( 0 ) ); assertThat( newTestSetDefault().getThreadCountClasses(), is( 0 ) ); assertThat( newTestSetDefault().getThreadCountSuites(), is( 0 ) ); assertFalse( newTestSetDefault().isUseUnlimitedThreads() ); assertThat( newTestSetDefault().getParallelTestsTimeoutInSeconds(), is( 0d ) ); assertThat( newTestSetDefault().getParallelTestsTimeoutForcedInSeconds(), is( 0d ) ); assertTrue( newTestSetDefault().isParallelOptimization() ); } @Test public void optimizationParameter() { assertFalse( newTestSetOptimization( false ).isParallelOptimization() ); } @Test public void timeoutParameters() { JUnitCoreParameters parameters = newTestSetTimeouts( 5.5d, 11.1d ); assertThat( parameters.getParallelTestsTimeoutInSeconds(), is( 5.5d ) ); assertThat( parameters.getParallelTestsTimeoutForcedInSeconds(), is( 11.1d ) ); } @Test public void isParallelMethod() { assertFalse( newTestSetClasses().isParallelMethods() ); assertTrue( newTestSetMethods().isParallelMethods() ); assertTrue( newTestSetBoth().isParallelMethods() ); } @Test public void isParallelClasses() { assertTrue( newTestSetClasses().isParallelClasses() ); assertFalse( newTestSetMethods().isParallelClasses() ); assertTrue( newTestSetBoth().isParallelClasses() ); } @Test public void isParallelBoth() { assertFalse( isParallelMethodsAndClasses( newTestSetClasses() ) ); assertFalse( isParallelMethodsAndClasses( newTestSetMethods() ) ); assertTrue( isParallelMethodsAndClasses( newTestSetBoth() ) ); } @Test public void isPerCoreThreadCount() { assertFalse( newTestSetClasses().isPerCoreThreadCount() ); assertFalse( newTestSetMethods().isPerCoreThreadCount() ); assertTrue( newTestSetBoth().isPerCoreThreadCount() ); } @Test public void getThreadCount() { assertFalse( newTestSetClasses().isPerCoreThreadCount() ); assertFalse( newTestSetMethods().isPerCoreThreadCount() ); assertTrue( newTestSetBoth().isPerCoreThreadCount() ); } @Test public void isUseUnlimitedThreads() { assertFalse( newTestSetClasses().isUseUnlimitedThreads() ); assertTrue( newTestSetMethods().isUseUnlimitedThreads() ); assertFalse( newTestSetBoth().isUseUnlimitedThreads() ); } @Test public void isNoThreading() { assertFalse( newTestSetClasses().isNoThreading() ); assertFalse( newTestSetMethods().isNoThreading() ); assertFalse( newTestSetBoth().isNoThreading() ); } @Test public void isAnyParallelismSelected() { assertTrue( newTestSetClasses().isParallelismSelected() ); assertTrue( newTestSetMethods().isParallelismSelected() ); assertTrue( newTestSetBoth().isParallelismSelected() ); } private Map newDefaultProperties() { return new HashMap(); } private Map newPropertiesClasses() { Map props = new HashMap(); props.put(JUnitCoreParameters.PARALLEL_KEY, "classes"); props.put(JUnitCoreParameters.PERCORETHREADCOUNT_KEY, "false"); props.put(JUnitCoreParameters.THREADCOUNT_KEY, "2"); props.put(JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY, "false"); return props; } private Map newPropertiesMethods() { Map props = new HashMap(); props.put(JUnitCoreParameters.PARALLEL_KEY, "methods"); props.put(JUnitCoreParameters.PERCORETHREADCOUNT_KEY, "false"); props.put(JUnitCoreParameters.THREADCOUNT_KEY, "2"); props.put(JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY, "true"); return props; } private Map newPropertiesBoth() { Map props = new HashMap(); props.put(JUnitCoreParameters.PARALLEL_KEY, "both"); props.put(JUnitCoreParameters.PERCORETHREADCOUNT_KEY, "true"); props.put(JUnitCoreParameters.THREADCOUNT_KEY, "7"); props.put(JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY, "false"); return props; } private Map newPropertiesTimeouts( double timeout, double forcedTimeout ) { Map props = new HashMap(); props.put(JUnitCoreParameters.PARALLEL_TIMEOUT_KEY, Double.toString(timeout)); props.put(JUnitCoreParameters.PARALLEL_TIMEOUTFORCED_KEY, Double.toString(forcedTimeout)); return props; } private Map newPropertiesOptimization( boolean optimize ) { Map props = new HashMap(); props.put( JUnitCoreParameters.PARALLEL_OPTIMIZE_KEY, Boolean.toString( optimize ) ); return props; } private JUnitCoreParameters newTestSetDefault() { return new JUnitCoreParameters( newDefaultProperties() ); } private JUnitCoreParameters newTestSetBoth() { return new JUnitCoreParameters( newPropertiesBoth() ); } private JUnitCoreParameters newTestSetClasses() { return new JUnitCoreParameters( newPropertiesClasses() ); } private JUnitCoreParameters newTestSetMethods() { return new JUnitCoreParameters( newPropertiesMethods() ); } private JUnitCoreParameters newTestSetOptimization( boolean optimize ) { return new JUnitCoreParameters( newPropertiesOptimization( optimize ) ); } private JUnitCoreParameters newTestSetTimeouts( double timeout, double forcedTimeout ) { return new JUnitCoreParameters( newPropertiesTimeouts( timeout, forcedTimeout ) ); } private boolean isParallelMethodsAndClasses( JUnitCoreParameters jUnitCoreParameters ) { return jUnitCoreParameters.isParallelMethods() && jUnitCoreParameters.isParallelClasses(); } } JUnitCoreRunListenerTest.java000066400000000000000000000161071330756104600444620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.apache.maven.surefire.junit4.MockReporter; import junit.framework.TestCase; import org.junit.Assume; import org.junit.Test; import org.junit.runner.Computer; import org.junit.runner.Description; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.notification.RunListener; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.*; /** * @author Kristian Rosenvold */ public class JUnitCoreRunListenerTest extends TestCase { public void testTestRunStarted() throws Exception { RunListener jUnit4TestSetReporter = new JUnitCoreRunListener( new MockReporter(), new HashMap() ); JUnitCore core = new JUnitCore(); core.addListener( jUnit4TestSetReporter ); Result result = core.run( new Computer(), STest1.class, STest2.class ); core.removeListener( jUnit4TestSetReporter ); assertEquals( 2, result.getRunCount() ); } public void testFailedAssumption() throws Exception { RunListener jUnit4TestSetReporter = new JUnitCoreRunListener( new MockReporter(), new HashMap() ); JUnitCore core = new JUnitCore(); core.addListener( jUnit4TestSetReporter ); Result result = core.run( new Computer(), TestWithAssumptionFailure.class ); core.removeListener( jUnit4TestSetReporter ); assertEquals( 1, result.getRunCount() ); } public void testStateForClassesWithNoChildren() throws Exception { Description testDescription = Description.createSuiteDescription( "testMethod(cannot.be.loaded.by.junit.Test)" ); Description st1 = Description.createSuiteDescription( STest1.class); // st1.addChild( Description.createSuiteDescription( STest1.class ) ); testDescription.addChild( st1 ); Description st2 = Description.createSuiteDescription( STest2.class); // st2.addChild( Description.createSuiteDescription( STest2.class ) ); testDescription.addChild( st2 ); Map classMethodCounts = new HashMap(); JUnitCoreRunListener listener = new JUnitCoreRunListener( new MockReporter(), classMethodCounts ); listener.testRunStarted( testDescription ); assertEquals( 2, classMethodCounts.size() ); Iterator iterator = classMethodCounts.values().iterator(); assertFalse(iterator.next().equals( iterator.next() )); } public void testTestClassNotLoadableFromJUnitClassLoader() throws Exception { // can't use Description.createTestDescription() methods as these require a loaded Class Description testDescription = Description.createSuiteDescription( "testMethod(cannot.be.loaded.by.junit.Test)" ); assertEquals( "testMethod", testDescription.getMethodName() ); assertEquals( "cannot.be.loaded.by.junit.Test", testDescription.getClassName() ); // assert that the test class is not visible by the JUnit classloader assertNull( testDescription.getTestClass() ); Description suiteDescription = Description.createSuiteDescription( "testSuite" ); suiteDescription.addChild( testDescription ); Map classMethodCounts = new HashMap(); JUnitCoreRunListener listener = new JUnitCoreRunListener( new MockReporter(), classMethodCounts ); listener.testRunStarted( suiteDescription ); assertEquals( 1, classMethodCounts.size() ); TestSet testSet = classMethodCounts.get( "cannot.be.loaded.by.junit.Test" ); assertNotNull( testSet ); } public void testNonEmptyTestRunStarted() throws Exception { Description aggregator = Description.createSuiteDescription( "null" ); Description suite = Description.createSuiteDescription( "some.junit.Test" ); suite.addChild( Description.createSuiteDescription( "testMethodA(some.junit.Test)" ) ); suite.addChild( Description.createSuiteDescription( "testMethodB(some.junit.Test)" ) ); suite.addChild( Description.createSuiteDescription( "testMethod(another.junit.Test)" ) ); aggregator.addChild( suite ); Map classMethodCounts = new HashMap(); JUnitCoreRunListener listener = new JUnitCoreRunListener( new MockReporter(), classMethodCounts ); listener.testRunStarted( aggregator ); assertThat( classMethodCounts.keySet(), hasSize( 2 ) ); assertThat( classMethodCounts.keySet(), containsInAnyOrder( "some.junit.Test", "another.junit.Test" ) ); TestSet testSet = classMethodCounts.get( "some.junit.Test" ); MockReporter reporter = new MockReporter(); testSet.replay( reporter ); assertTrue( reporter.containsNotification( MockReporter.SET_STARTED ) ); assertTrue( reporter.containsNotification( MockReporter.SET_COMPLETED ) ); listener.testRunFinished( null ); assertThat( classMethodCounts.keySet(), empty() ); } public void testEmptySuiteTestRunStarted() throws Exception { Description aggregator = Description.createSuiteDescription( "null" ); Description suite = Description.createSuiteDescription( "some.junit.TestSuite" ); aggregator.addChild( suite ); Map classMethodCounts = new HashMap(); JUnitCoreRunListener listener = new JUnitCoreRunListener( new MockReporter(), classMethodCounts ); listener.testRunStarted( aggregator ); assertThat( classMethodCounts.keySet(), hasSize( 1 ) ); assertThat( classMethodCounts.keySet(), contains( "some.junit.TestSuite" ) ); listener.testRunFinished( null ); assertThat( classMethodCounts.keySet(), empty() ); } public static class STest1 { @Test public void testSomething() { } } public static class STest2 { @Test public void testSomething2() { } } public static class TestWithAssumptionFailure { @Test public void testSomething2() { Assume.assumeTrue( false ); } } } JUnitCoreTester.java000066400000000000000000000076521330756104600426230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import org.apache.maven.plugin.surefire.StartupReportConfiguration; import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger; import org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.DefaultDirectConsoleReporter; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.testset.TestSetFailedException; import org.junit.runner.Computer; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import java.io.File; import java.util.HashMap; import java.util.concurrent.ExecutionException; import static org.apache.maven.surefire.junitcore.ConcurrentRunListener.createInstance; import static org.apache.maven.surefire.report.ConsoleOutputCapture.startCapture; /** * @author Kristian Rosenvold */ public class JUnitCoreTester { private final Computer computer; public JUnitCoreTester() { this( new Computer() ); } public JUnitCoreTester( Computer computer ) { this.computer = computer; } public Result run( boolean parallelClasses, Class... classes ) throws TestSetFailedException, ExecutionException { ReporterFactory reporterManagerFactory = defaultNoXml(); try { final HashMap classMethodCounts = new HashMap(); RunListener reporter = createInstance( classMethodCounts, reporterManagerFactory, parallelClasses, false, new DefaultDirectConsoleReporter( System.out ) ); startCapture( (ConsoleOutputReceiver) reporter ); JUnitCoreRunListener runListener = new JUnitCoreRunListener( reporter, classMethodCounts ); JUnitCore junitCore = new JUnitCore(); junitCore.addListener( runListener ); final Result run = junitCore.run( computer, classes ); junitCore.removeListener( runListener ); return run; } finally { reporterManagerFactory.close(); if ( computer instanceof ConfigurableParallelComputer ) { ( (ConfigurableParallelComputer) computer ).close(); } } } /** * For testing purposes only. * * @return DefaultReporterFactory for testing purposes */ public static DefaultReporterFactory defaultNoXml() { return new DefaultReporterFactory( defaultStartupReportConfiguration(), new NullConsoleLogger() ); } /** * For testing purposes only. * * @return StartupReportConfiguration fo testing purposes */ private static StartupReportConfiguration defaultStartupReportConfiguration() { File target = new File( "./target" ); File statisticsFile = new File( target, "TESTHASHxXML" ); return new StartupReportConfiguration( true, true, "PLAIN", false, true, target, false, null, statisticsFile, false, 0, null, null ); } } MavenSurefireJUnit47RunnerTest.java000066400000000000000000000131541330756104600455160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/* * JBoss, Home of Professional Open Source * Copyright 2009, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * Licensed 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. */ package org.apache.maven.surefire.junitcore; import junit.framework.Assert; import junit.framework.TestCase; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.Result; import org.junit.runner.notification.Failure; /** * {@code * TestCase that expose "No tests were executed!" on Test failure using Maven Surefire 2.6-SNAPSHOT * and the JUnit 4.7 Runner. *
* ------------------------------------------------------- * T E S T S * ------------------------------------------------------- *
* Results: *
* Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 *
* [INFO] ------------------------------------------------------------------------ * [INFO] BUILD FAILURE * [INFO] ------------------------------------------------------------------------ * [INFO] Total time: 11.011s * [INFO] Finished at: Thu Jul 15 13:59:14 CEST 2010 * [INFO] Final Memory: 24M/355M * [INFO] ------------------------------------------------------------------------ * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test * (default-test) on project xxxxxx: No tests were executed! (Set -DfailIfNoTests=false to * ignore this error.) -> [Help 1] *
*
* * junit * junit * 4.8.1 * test * *
* * org.apache.maven.surefire * surefire-booter * 2.6-SNAPSHOT * test * * * org.apache.maven.plugins * maven-surefire-plugin * 2.6-SNAPSHOT * test * * * org.apache.maven.surefire * surefire-junit47 * 2.6-SNAPSHOT * test * * } * * @author Aslak Knutsen * @version $Revision: $ */ public class MavenSurefireJUnit47RunnerTest extends TestCase { /* * Assumption: * The ConcurrentReportingRunListener assumes a Test will be Started before it Fails or Finishes. * * Reality: * JUnits ParentRunner is responsible for adding the BeforeClass/AfterClass statements to the * statement execution chain. After BeforeClass is executed, a Statement that delegates to the * abstract method: runChild(T child, RunNotifier notifier) is called. As the JavaDoc explains: * "Subclasses are responsible for making sure that relevant test events are reported through notifier". * When a @BeforeClass fail, the child that should handle the relevant test events(Started, Failed, Finished) * is never executed. * * Result: * When Test Failed event is received in ConcurrentReportingRunListener without a Started event received first, * it causes a NullPointException because there is no ClassReporter setup for that class yet. When this Exception * is thrown from the ConcurrentReportingRunListener, JUnit catches the exception and reports is as a Failed test. * But to avoid a wild loop, it removes the failing Listener before calling Failed test again. Since the * ConcurrentReportingRunListener now is removed from the chain it will never receive the RunFinished event * and the recorded state will never be replayed on the ReportManager. * * The End result: ReporterManager falsely believe no Test were run. * */ @SuppressWarnings( { "unchecked", "ThrowableResultOfMethodCallIgnored" } ) public void testSurefireShouldBeAbleToReportRunStatusEvenWithFailingTests() throws Exception { Result result = new JUnitCoreTester().run( false, FailingTestClassTestNot.class ); Assert.assertEquals( "JUnit should report correctly number of test ran(Finished)", 0, result.getRunCount() ); for ( Failure failure : result.getFailures() ) { System.out.println( failure.getException().getMessage() ); } Assert.assertEquals( "There should only be one Exception reported, the one from the failing TestCase", 1, result.getFailureCount() ); Assert.assertEquals( "The exception thrown by the failing TestCase", RuntimeException.class, result.getFailures().get( 0 ).getException().getClass() ); } /** * Simple TestCase to force a Exception in @BeforeClass. */ public static class FailingTestClassTestNot { @BeforeClass public static void failingBeforeClass() throws Exception { throw new RuntimeException( "Opps, we failed in @BeforeClass" ); } @Test public void shouldNeverBeCalled() throws Exception { Assert.assertTrue( true ); } } } MavenSurefireJUnit48RunnerTest.java000066400000000000000000000131561330756104600455210ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/* * JBoss, Home of Professional Open Source * Copyright 2009, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * Licensed 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. */ package org.apache.maven.surefire.junitcore; import junit.framework.Assert; import junit.framework.TestCase; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.Result; import org.junit.runner.notification.Failure; /** * TestCase that expose "No tests were executed!" on Test failure using Maven Surefire 2.6-SNAPSHOT * and the JUnit 4.8 Runner. * {@code * *
* ------------------------------------------------------- * T E S T S * ------------------------------------------------------- *
* Results: *
* Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 *
* [INFO] ------------------------------------------------------------------------ * [INFO] BUILD FAILURE * [INFO] ------------------------------------------------------------------------ * [INFO] Total time: 11.011s * [INFO] Finished at: Thu Jul 15 13:59:14 CEST 2010 * [INFO] Final Memory: 24M/355M * [INFO] ------------------------------------------------------------------------ * [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test * (default-test) on project xxxxxx: No tests were executed! (Set -DfailIfNoTests=false to * ignore this error.) -> [Help 1] *
*
* * junit * junit * 4.8.1 * test * *
* * org.apache.maven.surefire * surefire-booter * 2.6-SNAPSHOT * test * * * org.apache.maven.plugins * maven-surefire-plugin * 2.6-SNAPSHOT * test * * * org.apache.maven.surefire * surefire-junit48 * 2.6-SNAPSHOT * test * * } * * @author Aslak Knutsen * @version $Revision: $ */ public class MavenSurefireJUnit48RunnerTest extends TestCase { /* * Assumption: * The ConcurrentReportingRunListener assumes a Test will be Started before it Fails or Finishes. * * Reality: * JUnits ParentRunner is responsible for adding the BeforeClass/AfterClass statements to the * statement execution chain. After BeforeClass is executed, a Statement that delegates to the * abstract method: runChild(T child, RunNotifier notifier) is called. As the JavaDoc explains: * "Subclasses are responsible for making sure that relevant test events are reported through notifier". * When a @BeforeClass fail, the child that should handle the relevant test events(Started, Failed, Finished) * is never executed. * * Result: * When Test Failed event is received in ConcurrentReportingRunListener without a Started event received first, * it causes a NullPointException because there is no ClassReporter setup for that class yet. When this Exception * is thrown from the ConcurrentReportingRunListener, JUnit catches the exception and reports is as a Failed test. * But to avoid a wild loop, it removes the failing Listener before calling Failed test again. Since the * ConcurrentReportingRunListener now is removed from the chain it will never receive the RunFinished event * and the recorded state will never be replayed on the ReportManager. * * The End result: ReporterManager falsely believe no Test were run. * */ @SuppressWarnings( { "unchecked", "ThrowableResultOfMethodCallIgnored" } ) public void testSurefireShouldBeAbleToReportRunStatusEvenWithFailingTests() throws Exception { Result result = new JUnitCoreTester().run( false, FailingTestClassTestNot.class ); Assert.assertEquals( "JUnit should report correctly number of test ran(Finished)", 0, result.getRunCount() ); for ( Failure failure : result.getFailures() ) { System.out.println( failure.getException().getMessage() ); } Assert.assertEquals( "There should only be one Exception reported, the one from the failing TestCase", 1, result.getFailureCount() ); Assert.assertEquals( "The exception thrown by the failing TestCase", RuntimeException.class, result.getFailures().get( 0 ).getException().getClass() ); } /** * Simple TestCase to force a Exception in @BeforeClass. */ public static class FailingTestClassTestNot { @BeforeClass public static void failingBeforeClass() throws Exception { throw new RuntimeException( "Opps, we failed in @BeforeClass" ); } @Test public void shouldNeverBeCalled() throws Exception { Assert.assertTrue( true ); } } } Surefire746Test.java000066400000000000000000000137011330756104600424470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * JBoss, Home of Professional Open Source * Copyright 2009, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * Licensed 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. */ import java.io.File; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import org.apache.maven.surefire.booter.BaseProviderFactory; import org.apache.maven.surefire.booter.ProviderParameterNames; import org.apache.maven.surefire.common.junit4.JUnit4RunListener; import org.apache.maven.surefire.common.junit4.Notifier; import org.apache.maven.surefire.junit4.MockReporter; import org.apache.maven.surefire.report.DefaultDirectConsoleReporter; import org.apache.maven.surefire.report.ReporterConfiguration; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.TestsToRun; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.Description; import org.junit.runner.RunWith; import org.junit.runner.notification.RunNotifier; import org.junit.runners.BlockJUnit4ClassRunner; import org.junit.runners.model.InitializationError; import static junit.framework.Assert.assertEquals; /** * {@code * * junit * junit * 4.8.1 * test * *
* * org.apache.maven.surefire * surefire-booter * 2.8.1 * test * * * org.apache.maven.plugins * maven-surefire-plugin * 2.8.1 * test * * * org.apache.maven.surefire * surefire-junit47 * 2.8.1 * test * * } * * @author Aslak Knutsen * @version $Revision: $ */ public class Surefire746Test { @Rule public final ExpectedException exception = ExpectedException.none(); @Test public void surefireIsConfused_ByMultipleIgnore_OnClassLevel() throws Exception { ReporterFactory reporterFactory = JUnitCoreTester.defaultNoXml(); BaseProviderFactory providerParameters = new BaseProviderFactory( reporterFactory, true ); providerParameters.setReporterConfiguration( new ReporterConfiguration( new File( "" ), false ) ); Map junitProps = new HashMap(); junitProps.put( ProviderParameterNames.PARALLEL_PROP, "none" ); JUnitCoreParameters jUnitCoreParameters = new JUnitCoreParameters( junitProps ); final Map testSetMap = new ConcurrentHashMap(); RunListener listener = ConcurrentRunListener.createInstance( testSetMap, reporterFactory, false, false, new DefaultDirectConsoleReporter( System.out ) ); TestsToRun testsToRun = new TestsToRun( Collections.>singleton( TestClassTest.class ) ); org.junit.runner.notification.RunListener jUnit4RunListener = new JUnitCoreRunListener( listener, testSetMap ); List customRunListeners = new ArrayList(); customRunListeners.add( 0, jUnit4RunListener ); try { // JUnitCoreWrapper#execute() is calling JUnit4RunListener#rethrowAnyTestMechanismFailures() // and rethrows a failure which happened in listener exception.expect( TestSetFailedException.class ); JUnit4RunListener dummy = new JUnit4RunListener( new MockReporter() ); new JUnitCoreWrapper( new Notifier( dummy, 0 ), jUnitCoreParameters, new DefaultDirectConsoleReporter( System.out ) ) .execute( testsToRun, customRunListeners, null ); } finally { RunResult result = reporterFactory.close(); assertEquals( "JUnit should report correctly number of test ran(Finished)", 1, result.getCompletedCount() ); } } @RunWith( TestCaseRunner.class ) public static class TestClassTest { @Test public void shouldNeverBeCalled() throws Exception { } } public static class TestCaseRunner extends BlockJUnit4ClassRunner { public TestCaseRunner( Class klass ) throws InitializationError { super( klass ); } @Override public void run( RunNotifier notifier ) { notifier.addListener( new TestRunListener() ); super.run( notifier ); } } private static class TestRunListener extends org.junit.runner.notification.RunListener { @Override public void testFinished( Description description ) throws Exception { throw new RuntimeException( "This Exception will cause Surefire to receive an internal JUnit Description and fail." ); } } }Surefire813IncorrectResultTest.java000066400000000000000000000047161330756104600455200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import org.apache.maven.surefire.testset.TestSetFailedException; import org.junit.After; import org.junit.Test; import org.junit.runner.Result; import static junit.framework.Assert.assertEquals; /** * @author Kristian Rosenvold * @author nkeyval */ public class Surefire813IncorrectResultTest { @Test public void dcount() throws TestSetFailedException, ExecutionException { JUnitCoreTester jUnitCoreTester = new JUnitCoreTester(); final Result run = jUnitCoreTester.run( true, Test6.class ); assertEquals( 0, run.getFailureCount() ); } public static class Test6 { private final CountDownLatch latch = new CountDownLatch( 1 ); @Test public void test61() throws Exception { System.out.println( "Hey" ); } @After public void tearDown() throws Exception { new MyThread().start(); latch.await(); } private static final String s = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; public void synchPrint() { for ( int i = 0; i < 1000; ++i ) // Increase this number if it does no fail { System.out.println( i + ":" + s ); } } private class MyThread extends Thread { @Override public void run() { System.out.println( s ); latch.countDown(); synchPrint(); } } } } TestMethodTest.java000066400000000000000000000027301330756104600425020ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcorepackage org.apache.maven.surefire.junitcore; /* * 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. */ import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.SimpleReportEntry; import junit.framework.TestCase; /** * @author Kristian Rosenvold */ public class TestMethodTest extends TestCase { public void testTestFailure() { ReportEntry reportEntry = new SimpleReportEntry( "a", "b" ); TestMethod testMethod = new TestMethod( reportEntry, new TestSet( TestMethodTest.class.getName() ) ); testMethod.testFailure( reportEntry ); final int elapsed = testMethod.getElapsed(); assertTrue( elapsed >= 0 ); assertTrue( elapsed < 100000 ); } } pc/000077500000000000000000000000001330756104600373175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcoreOptimizedParallelComputerTest.java000066400000000000000000000337311330756104600461710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.apache.maven.surefire.junitcore.JUnitCoreParameters; import org.apache.maven.surefire.testset.TestSetFailedException; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.experimental.theories.DataPoint; import org.junit.experimental.theories.Theories; import org.junit.experimental.theories.Theory; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import java.util.HashMap; import java.util.Map; import static org.apache.maven.surefire.junitcore.JUnitCoreParameters.*; import static org.apache.maven.surefire.junitcore.pc.ParallelComputerUtil.*; import static org.hamcrest.core.Is.is; import static org.junit.Assert.*; /** * Testing an algorithm in {@link ParallelComputerUtil} which configures * optimized thread resources in ParallelComputer by given {@link org.apache.maven.surefire.junitcore.JUnitCoreParameters}. * * @author Tibor Digana (tibor17) * @see ParallelComputerUtil * @since 2.17 */ @RunWith( Theories.class ) public final class OptimizedParallelComputerTest { @DataPoint public static final int CPU_1 = 1; @DataPoint public static final int CPU_4 = 4; @Rule public final ExpectedException exception = ExpectedException.none(); @BeforeClass public static void beforeClass() { overrideAvailableProcessors( 1 ); } @AfterClass public static void afterClass() { setDefaultAvailableProcessors(); } @Theory public void threadCountSuites( int cpu ) throws TestSetFailedException { overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suites"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); RunnerCounter counter = new RunnerCounter( 5, 10, 20 ); Concurrency concurrency = resolveConcurrency( params, counter ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 0 ) ); assertThat( concurrency.suites, is( (int) Math.min( 3 * cpu, counter.suites ) ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void threadCountClasses( int cpu ) throws TestSetFailedException { overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "classes"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); RunnerCounter counter = new RunnerCounter( 1, 5, 10 ); Concurrency concurrency = resolveConcurrency( params, counter ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 0 ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( (int) Math.min( 3 * cpu, counter.classes ) ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void threadCountMethods( int cpu ) throws TestSetFailedException { overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "methods"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); RunnerCounter counter = new RunnerCounter( 1, 2, 5 ); Concurrency concurrency = resolveConcurrency( params, counter ); assertFalse( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 0 ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( (int) Math.min( 3 * cpu, counter.methods ) ) ); } @Theory public void threadCountBoth( int cpu ) throws TestSetFailedException { overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "both"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); RunnerCounter counter = new RunnerCounter( 1, 2, 5 ); Concurrency concurrency = resolveConcurrency( params, counter ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 3 * cpu ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( (int) Math.min( ( 3d / 2 ) * cpu, 2 ) ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void threadCountClassesAndMethods( int cpu ) throws TestSetFailedException { overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "classesAndMethods"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); RunnerCounter counter = new RunnerCounter( 1, 2, 5 ); Concurrency concurrency = resolveConcurrency( params, counter ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 3 * cpu ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( (int) Math.min( ( 3d / 2 ) * cpu, 2 ) ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void threadCountSuitesAndMethods( int cpu ) throws TestSetFailedException { overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndMethods"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); RunnerCounter counter = new RunnerCounter( 2, 3, 5 ); Concurrency concurrency = resolveConcurrency( params, counter ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 3 * cpu ) ); assertThat( concurrency.suites, is( (int) Math.min( ( 3d / 2 ) * cpu, 2 ) ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void threadCountSuitesAndClasses( int cpu ) throws TestSetFailedException { overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndClasses"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); RunnerCounter counter = new RunnerCounter( 2, 5, 20 ); Concurrency concurrency = resolveConcurrency( params, counter ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 3 * cpu ) ); assertThat( concurrency.suites, is( (int) Math.min( ( 2d * 3 / 7 ) * cpu, 2 ) ) ); assertThat( concurrency.classes, is( Integer.MAX_VALUE ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void threadCountAll( int cpu ) throws TestSetFailedException { overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "all"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); RunnerCounter counter = new RunnerCounter( 2, 5, 20 ); Concurrency concurrency = resolveConcurrency( params, counter ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 3 * cpu ) ); assertThat( concurrency.suites, is( (int) Math.min( ( 2d * 3 / 11 ) * cpu, 2 ) ) ); assertThat( concurrency.classes, is( (int) Math.min( ( 5d * 3 / 11 ) * cpu, 5 ) ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void reusableThreadCountSuitesAndClasses( int cpu ) throws TestSetFailedException { // 4 * cpu to 5 * cpu threads to run test classes overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndClasses"); properties.put(THREADCOUNT_KEY, "6"); properties.put(THREADCOUNTSUITES_KEY, "2"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); RunnerCounter counter = new RunnerCounter( 3, 5, 20 ); Concurrency concurrency = resolveConcurrency( params, counter ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 6 * cpu ) ); assertThat( concurrency.suites, is( Math.min( 2 * cpu, 3 ) ) ); assertThat( concurrency.classes, is( Integer.MAX_VALUE ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void reusableThreadCountSuitesAndMethods( int cpu ) throws TestSetFailedException { // 4 * cpu to 5 * cpu threads to run test methods overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndMethods"); properties.put(THREADCOUNT_KEY, "6"); properties.put(THREADCOUNTSUITES_KEY, "2"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); RunnerCounter counter = new RunnerCounter( 3, 5, 20 ); Concurrency concurrency = resolveConcurrency( params, counter ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 6 * cpu ) ); assertThat( concurrency.suites, is( Math.min( 2 * cpu, 3 ) ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void reusableThreadCountClassesAndMethods( int cpu ) throws TestSetFailedException { // 4 * cpu to 5 * cpu threads to run test methods overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "classesAndMethods"); properties.put(THREADCOUNT_KEY, "6"); properties.put(THREADCOUNTCLASSES_KEY, "2"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); RunnerCounter counter = new RunnerCounter( 3, 5, 20 ); Concurrency concurrency = resolveConcurrency( params, counter ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 6 * cpu ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( Math.min( 2 * cpu, 5 ) ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void reusableThreadCountAll( int cpu ) throws TestSetFailedException { // 8 * cpu to 13 * cpu threads to run test methods overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put( PARALLEL_KEY, "all" ); properties.put( THREADCOUNT_KEY, "14" ); properties.put( THREADCOUNTSUITES_KEY, "2" ); properties.put( THREADCOUNTCLASSES_KEY, "4" ); JUnitCoreParameters params = new JUnitCoreParameters( properties ); RunnerCounter counter = new RunnerCounter( 3, 5, 20 ); Concurrency concurrency = resolveConcurrency( params, counter ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 14 * cpu ) ); assertThat( concurrency.suites, is( Math.min( 2 * cpu, 3 ) ) ); assertThat( concurrency.classes, is( Math.min( 4 * cpu, 5 ) ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } }ParallelComputerBuilderTest.java000077500000000000000000001112761330756104600456170ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import net.jcip.annotations.NotThreadSafe; import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.report.DefaultDirectConsoleReporter; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.Description; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.RunWith; import org.junit.runner.notification.RunNotifier; import org.junit.runners.ParentRunner; import org.junit.runners.Suite; import org.junit.runners.model.InitializationError; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.Iterator; import java.util.List; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.TimeUnit; import static org.hamcrest.core.AnyOf.anyOf; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNot.not; import static org.apache.maven.surefire.junitcore.pc.RangeMatcher.between; import static org.junit.Assert.*; /** * @author Tibor Digana (tibor17) * @since 2.16 */ public class ParallelComputerBuilderTest { private static final int DELAY_MULTIPLIER = 7; private static final Object class1Lock = new Object(); private static volatile boolean beforeShutdown; private static volatile Runnable shutdownTask; private static final ConsoleStream logger = new DefaultDirectConsoleReporter( System.out ); private static void testKeepBeforeAfter( ParallelComputerBuilder builder, Class... classes ) { JUnitCore core = new JUnitCore(); for ( int round = 0; round < 5; round++ ) { NothingDoingTest1.methods.clear(); Result result = core.run( builder.buildComputer(), classes ); assertTrue( result.wasSuccessful() ); Iterator methods = NothingDoingTest1.methods.iterator(); for ( Class clazz : classes ) { String a = clazz.getName() + "#a()"; String b = clazz.getName() + "#b()"; assertThat( methods.next(), is( "init" ) ); assertThat( methods.next(), anyOf( is( a ), is( b ) ) ); assertThat( methods.next(), anyOf( is( a ), is( b ) ) ); assertThat( methods.next(), is( "deinit" ) ); } } } @BeforeClass public static void cleanup() throws InterruptedException { System.gc(); Thread.sleep( 500L ); } @Before public void beforeTest() { Class1.maxConcurrentMethods = 0; Class1.concurrentMethods = 0; shutdownTask = null; NotThreadSafeTest1.t = null; NotThreadSafeTest2.t = null; NotThreadSafeTest3.t = null; NormalTest1.t = null; NormalTest2.t = null; } @Test public void testsWithoutChildrenShouldAlsoBeRun() { ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger ); ParallelComputerBuilder.PC computer = ( ParallelComputerBuilder.PC ) parallelComputerBuilder.buildComputer(); Result result = new JUnitCore().run( computer, TestWithoutPrecalculatedChildren.class ); assertThat( result.getRunCount(), is( 1 ) ); } @Test public void parallelMethodsReuseOneOrTwoThreads() { ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger ); parallelComputerBuilder.useOnePool( 4 ); // One thread because one suite: TestSuite, however the capacity is 5. parallelComputerBuilder.parallelSuites( 5 ); // Two threads because TestSuite has two classes, however the capacity is 5. parallelComputerBuilder.parallelClasses( 5 ); // One or two threads because one threads comes from '#useOnePool(4)' // and next thread may be reused from finished class, however the capacity is 3. parallelComputerBuilder.parallelMethods( 3 ); assertFalse( parallelComputerBuilder.isOptimized() ); ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) parallelComputerBuilder.buildComputer(); final JUnitCore core = new JUnitCore(); final long t1 = systemMillis(); final Result result = core.run( computer, TestSuite.class ); final long t2 = systemMillis(); final long timeSpent = t2 - t1; assertThat( computer.getSuites().size(), is( 1 ) ); assertThat( computer.getClasses().size(), is( 0 ) ); assertThat( computer.getNestedClasses().size(), is( 2 ) ); assertThat( computer.getNestedSuites().size(), is( 0 ) ); assertFalse( computer.isSplitPool() ); assertThat( computer.getPoolCapacity(), is( 4 ) ); assertTrue( result.wasSuccessful() ); if ( Class1.maxConcurrentMethods == 1 ) { assertThat( timeSpent, between( 2000 * DELAY_MULTIPLIER - 50, 2250 * DELAY_MULTIPLIER ) ); } else if ( Class1.maxConcurrentMethods == 2 ) { assertThat( timeSpent, between( 1500 * DELAY_MULTIPLIER - 50, 1750 * DELAY_MULTIPLIER ) ); } else { fail(); } } @Test public void suiteAndClassInOnePool() { ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger ); parallelComputerBuilder.useOnePool( 5 ); parallelComputerBuilder.parallelSuites( 5 ); parallelComputerBuilder.parallelClasses( 5 ); parallelComputerBuilder.parallelMethods( 3 ); assertFalse( parallelComputerBuilder.isOptimized() ); ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) parallelComputerBuilder.buildComputer(); final JUnitCore core = new JUnitCore(); final long t1 = systemMillis(); final Result result = core.run( computer, TestSuite.class, Class1.class ); final long t2 = systemMillis(); final long timeSpent = t2 - t1; assertThat( computer.getSuites().size(), is( 1 ) ); assertThat( computer.getClasses().size(), is( 1 ) ); assertThat( computer.getNestedClasses().size(), is( 2 ) ); assertThat( computer.getNestedSuites().size(), is( 0 ) ); assertFalse( computer.isSplitPool() ); assertThat( computer.getPoolCapacity(), is( 5 ) ); assertTrue( result.wasSuccessful() ); assertThat( Class1.maxConcurrentMethods, is( 2 ) ); assertThat( timeSpent, anyOf( between( 1500 * DELAY_MULTIPLIER - 50, 1750 * DELAY_MULTIPLIER ), between( 2000 * DELAY_MULTIPLIER - 50, 2250 * DELAY_MULTIPLIER ), between( 2500 * DELAY_MULTIPLIER - 50, 2750 * DELAY_MULTIPLIER ) ) ); } @Test public void onePoolWithUnlimitedParallelMethods() { // see ParallelComputerBuilder Javadoc ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger ); parallelComputerBuilder.useOnePool( 8 ); parallelComputerBuilder.parallelSuites( 2 ); parallelComputerBuilder.parallelClasses( 4 ); parallelComputerBuilder.parallelMethods(); assertFalse( parallelComputerBuilder.isOptimized() ); ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) parallelComputerBuilder.buildComputer(); final JUnitCore core = new JUnitCore(); final long t1 = systemMillis(); final Result result = core.run( computer, TestSuite.class, Class1.class ); final long t2 = systemMillis(); final long timeSpent = t2 - t1; assertThat( computer.getSuites().size(), is( 1 ) ); assertThat( computer.getClasses().size(), is( 1 ) ); assertThat( computer.getNestedClasses().size(), is( 2 ) ); assertThat( computer.getNestedSuites().size(), is( 0 ) ); assertFalse( computer.isSplitPool() ); assertThat( computer.getPoolCapacity(), is( 8 ) ); assertTrue( result.wasSuccessful() ); assertThat( Class1.maxConcurrentMethods, is( 4 ) ); assertThat( timeSpent, between( 1000 * DELAY_MULTIPLIER - 50, 1250 * DELAY_MULTIPLIER ) ); } @Test public void underflowParallelism() { ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger ); parallelComputerBuilder.useOnePool( 3 ); // One thread because one suite: TestSuite. parallelComputerBuilder.parallelSuites( 5 ); // One thread because of the limitation which is bottleneck. parallelComputerBuilder.parallelClasses( 1 ); // One thread remains from '#useOnePool(3)'. parallelComputerBuilder.parallelMethods( 3 ); assertFalse( parallelComputerBuilder.isOptimized() ); ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) parallelComputerBuilder.buildComputer(); final JUnitCore core = new JUnitCore(); final long t1 = systemMillis(); final Result result = core.run( computer, TestSuite.class ); final long t2 = systemMillis(); final long timeSpent = t2 - t1; assertThat( computer.getSuites().size(), is( 1 ) ); assertThat( computer.getClasses().size(), is( 0 ) ); assertThat( computer.getNestedClasses().size(), is( 2 ) ); assertThat( computer.getNestedSuites().size(), is( 0 ) ); assertFalse( computer.isSplitPool() ); assertThat( computer.getPoolCapacity(), is( 3 ) ); assertTrue( result.wasSuccessful() ); assertThat( Class1.maxConcurrentMethods, is( 1 ) ); assertThat( timeSpent, between( 2000 * DELAY_MULTIPLIER - 50, 2250 * DELAY_MULTIPLIER ) ); } @Test public void separatePoolsWithSuite() { ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger ); parallelComputerBuilder.parallelSuites( 5 ); parallelComputerBuilder.parallelClasses( 5 ); parallelComputerBuilder.parallelMethods( 3 ); assertFalse( parallelComputerBuilder.isOptimized() ); ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) parallelComputerBuilder.buildComputer(); final JUnitCore core = new JUnitCore(); final long t1 = systemMillis(); final Result result = core.run( computer, TestSuite.class ); final long t2 = systemMillis(); final long timeSpent = t2 - t1; assertThat( computer.getSuites().size(), is( 1 ) ); assertThat( computer.getClasses().size(), is( 0 ) ); assertThat( computer.getNestedClasses().size(), is( 2 ) ); assertThat( computer.getNestedSuites().size(), is( 0 ) ); assertTrue( computer.isSplitPool() ); assertThat( computer.getPoolCapacity(), is( ParallelComputerBuilder.TOTAL_POOL_SIZE_UNDEFINED ) ); assertTrue( result.wasSuccessful() ); assertThat( Class1.maxConcurrentMethods, is( 3 ) ); assertThat( timeSpent, between( 1000 * DELAY_MULTIPLIER - 50, 1250 * DELAY_MULTIPLIER ) ); } @Test public void separatePoolsWithSuiteAndClass() { ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger ); parallelComputerBuilder.parallelSuites( 5 ); parallelComputerBuilder.parallelClasses( 5 ); parallelComputerBuilder.parallelMethods( 3 ); assertFalse( parallelComputerBuilder.isOptimized() ); // 6 methods altogether. // 2 groups with 3 threads. // Each group takes 0.5s. ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) parallelComputerBuilder.buildComputer(); final JUnitCore core = new JUnitCore(); final long t1 = systemMillis(); final Result result = core.run( computer, TestSuite.class, Class1.class ); final long t2 = systemMillis(); final long timeSpent = t2 - t1; assertThat( computer.getSuites().size(), is( 1 ) ); assertThat( computer.getClasses().size(), is( 1 ) ); assertThat( computer.getNestedClasses().size(), is( 2 ) ); assertThat( computer.getNestedSuites().size(), is( 0 ) ); assertTrue( computer.isSplitPool() ); assertThat( computer.getPoolCapacity(), is( ParallelComputerBuilder.TOTAL_POOL_SIZE_UNDEFINED ) ); assertTrue( result.wasSuccessful() ); assertThat( Class1.maxConcurrentMethods, is( 3 ) ); assertThat( timeSpent, between( 1000 * DELAY_MULTIPLIER - 50, 1250 * DELAY_MULTIPLIER ) ); } @Test public void separatePoolsWithSuiteAndSequentialClasses() { ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger ); parallelComputerBuilder.parallelSuites( 5 ); parallelComputerBuilder.parallelClasses( 1 ); parallelComputerBuilder.parallelMethods( 3 ); assertFalse( parallelComputerBuilder.isOptimized() ); ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) parallelComputerBuilder.buildComputer(); final JUnitCore core = new JUnitCore(); final long t1 = systemMillis(); final Result result = core.run( computer, TestSuite.class, Class1.class ); final long t2 = systemMillis(); final long timeSpent = t2 - t1; assertThat( computer.getSuites().size(), is( 1 ) ); assertThat( computer.getClasses().size(), is( 1 ) ); assertThat( computer.getNestedClasses().size(), is( 2 ) ); assertThat( computer.getNestedSuites().size(), is( 0 ) ); assertTrue( computer.isSplitPool() ); assertThat( computer.getPoolCapacity(), is( ParallelComputerBuilder.TOTAL_POOL_SIZE_UNDEFINED ) ); assertTrue( result.wasSuccessful() ); assertThat( Class1.maxConcurrentMethods, is( 2 ) ); assertThat( timeSpent, between( 1500 * DELAY_MULTIPLIER - 50, 1750 * DELAY_MULTIPLIER ) ); } @Test( timeout = 2000 * DELAY_MULTIPLIER ) public void shutdown() { final long t1 = systemMillis(); final Result result = new ShutdownTest().run( false ); final long t2 = systemMillis(); final long timeSpent = t2 - t1; assertTrue( result.wasSuccessful() ); assertTrue( beforeShutdown ); assertThat( timeSpent, between( 500 * DELAY_MULTIPLIER - 50, 1250 * DELAY_MULTIPLIER ) ); } @Test( timeout = 2000 * DELAY_MULTIPLIER ) public void shutdownWithInterrupt() { final long t1 = systemMillis(); new ShutdownTest().run( true ); final long t2 = systemMillis(); final long timeSpent = t2 - t1; assertTrue( beforeShutdown ); assertThat( timeSpent, between( 500 * DELAY_MULTIPLIER - 50, 1250 * DELAY_MULTIPLIER ) ); } @Test public void nothingParallel() { JUnitCore core = new JUnitCore(); ParallelComputerBuilder builder = new ParallelComputerBuilder( logger ); assertFalse( builder.isOptimized() ); Result result = core.run( builder.buildComputer(), NothingDoingTest1.class, NothingDoingTest2.class ); assertTrue( result.wasSuccessful() ); result = core.run( builder.buildComputer(), NothingDoingTest1.class, NothingDoingSuite.class ); assertTrue( result.wasSuccessful() ); builder.useOnePool( 1 ); assertFalse( builder.isOptimized() ); result = core.run( builder.buildComputer(), NothingDoingTest1.class, NothingDoingTest2.class ); assertTrue( result.wasSuccessful() ); builder.useOnePool( 1 ); assertFalse( builder.isOptimized() ); result = core.run( builder.buildComputer(), NothingDoingTest1.class, NothingDoingSuite.class ); assertTrue( result.wasSuccessful() ); builder.useOnePool( 2 ); assertFalse( builder.isOptimized() ); result = core.run( builder.buildComputer(), NothingDoingTest1.class, NothingDoingSuite.class ); assertTrue( result.wasSuccessful() ); Class[] classes = { NothingDoingTest1.class, NothingDoingSuite.class }; builder.useOnePool( 2 ).parallelSuites( 1 ).parallelClasses( 1 ); assertFalse( builder.isOptimized() ); result = core.run( builder.buildComputer(), classes ); assertTrue( result.wasSuccessful() ); builder.useOnePool( 2 ).parallelSuites( 1 ).parallelClasses(); assertFalse( builder.isOptimized() ); result = core.run( builder.buildComputer(), classes ); assertTrue( result.wasSuccessful() ); classes = new Class[]{ NothingDoingSuite.class, NothingDoingSuite.class, NothingDoingTest1.class, NothingDoingTest2.class, NothingDoingTest3.class }; builder.useOnePool( 2 ).parallelSuites( 1 ).parallelClasses( 1 ); assertFalse( builder.isOptimized() ); result = core.run( builder.buildComputer(), classes ); assertTrue( result.wasSuccessful() ); builder.useOnePool( 2 ).parallelSuites( 1 ).parallelClasses(); assertFalse( builder.isOptimized() ); result = core.run( builder.buildComputer(), classes ); assertTrue( result.wasSuccessful() ); } @Test public void keepBeforeAfterOneClass() { ParallelComputerBuilder builder = new ParallelComputerBuilder( logger ); builder.parallelMethods(); assertFalse( builder.isOptimized() ); testKeepBeforeAfter( builder, NothingDoingTest1.class ); } @Test public void keepBeforeAfterTwoClasses() { ParallelComputerBuilder builder = new ParallelComputerBuilder( logger ); builder.useOnePool( 5 ).parallelClasses( 1 ).parallelMethods( 2 ); assertFalse( builder.isOptimized() ); testKeepBeforeAfter( builder, NothingDoingTest1.class, NothingDoingTest2.class ); } @Test public void keepBeforeAfterTwoParallelClasses() { ParallelComputerBuilder builder = new ParallelComputerBuilder( logger ); builder.useOnePool( 8 ).parallelClasses( 2 ).parallelMethods( 2 ); assertFalse( builder.isOptimized() ); JUnitCore core = new JUnitCore(); NothingDoingTest1.methods.clear(); Class[] classes = { NothingDoingTest1.class, NothingDoingTest2.class, NothingDoingTest3.class }; Result result = core.run( builder.buildComputer(), classes ); assertTrue( result.wasSuccessful() ); ArrayList methods = new ArrayList( NothingDoingTest1.methods ); assertThat( methods.size(), is( 12 ) ); assertThat( methods.subList( 9, 12 ), is( not( Arrays.asList( "deinit", "deinit", "deinit" ) ) ) ); } @Test public void notThreadSafeTest() { ParallelComputerBuilder builder = new ParallelComputerBuilder( logger ) .useOnePool( 6 ).optimize( true ).parallelClasses( 3 ).parallelMethods( 3 ); ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) builder.buildComputer(); Result result = new JUnitCore().run( computer, NotThreadSafeTest1.class, NotThreadSafeTest2.class ); assertTrue( result.wasSuccessful() ); assertThat( result.getRunCount(), is( 2 ) ); assertNotNull( NotThreadSafeTest1.t ); assertNotNull( NotThreadSafeTest2.t ); assertSame( NotThreadSafeTest1.t, NotThreadSafeTest2.t ); assertThat( computer.getNotParallelRunners().size(), is( 2 ) ); assertTrue( computer.getSuites().isEmpty() ); assertTrue( computer.getClasses().isEmpty() ); assertTrue( computer.getNestedClasses().isEmpty() ); assertTrue( computer.getNestedSuites().isEmpty() ); assertFalse( computer.isSplitPool() ); assertThat( computer.getPoolCapacity(), is( 6 ) ); } @Test public void mixedThreadSafety() { ParallelComputerBuilder builder = new ParallelComputerBuilder( logger ) .useOnePool( 6 ).optimize( true ).parallelClasses( 3 ).parallelMethods( 3 ); ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) builder.buildComputer(); Result result = new JUnitCore().run( computer, NotThreadSafeTest1.class, NormalTest1.class ); assertTrue( result.wasSuccessful() ); assertThat( result.getRunCount(), is( 2 ) ); assertNotNull( NotThreadSafeTest1.t ); assertNotNull( NormalTest1.t ); assertThat( NormalTest1.t.getName(), is( not( "maven-surefire-plugin@NotThreadSafe" ) ) ); assertNotSame( NotThreadSafeTest1.t, NormalTest1.t ); assertThat( computer.getNotParallelRunners().size(), is( 1 ) ); assertTrue( computer.getSuites().isEmpty() ); assertThat( computer.getClasses().size(), is( 1 ) ); assertTrue( computer.getNestedClasses().isEmpty() ); assertTrue( computer.getNestedSuites().isEmpty() ); assertFalse( computer.isSplitPool() ); assertThat( computer.getPoolCapacity(), is( 6 ) ); } @Test public void notThreadSafeTestsInSuite() { ParallelComputerBuilder builder = new ParallelComputerBuilder( logger ) .useOnePool( 5 ).parallelMethods( 3 ); assertFalse( builder.isOptimized() ); ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) builder.buildComputer(); Result result = new JUnitCore().run( computer, NotThreadSafeTestSuite.class ); assertTrue( result.wasSuccessful() ); assertNotNull( NormalTest1.t ); assertNotNull( NormalTest2.t ); assertSame( NormalTest1.t, NormalTest2.t ); assertThat( NormalTest1.t.getName(), is( "maven-surefire-plugin@NotThreadSafe" ) ); assertThat( NormalTest2.t.getName(), is( "maven-surefire-plugin@NotThreadSafe" ) ); assertThat( computer.getNotParallelRunners().size(), is( 1 ) ); assertTrue( computer.getSuites().isEmpty() ); assertTrue( computer.getClasses().isEmpty() ); assertTrue( computer.getNestedClasses().isEmpty() ); assertTrue( computer.getNestedSuites().isEmpty() ); assertFalse( computer.isSplitPool() ); assertThat( computer.getPoolCapacity(), is( 5 ) ); } @Test public void mixedThreadSafetyInSuite() { ParallelComputerBuilder builder = new ParallelComputerBuilder( logger ) .useOnePool( 10 ).optimize( true ).parallelSuites( 2 ).parallelClasses( 3 ).parallelMethods( 3 ); ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) builder.buildComputer(); Result result = new JUnitCore().run( computer, MixedSuite.class ); assertTrue( result.wasSuccessful() ); assertThat( result.getRunCount(), is( 2 ) ); assertNotNull( NotThreadSafeTest1.t ); assertNotNull( NormalTest1.t ); assertThat( NormalTest1.t.getName(), is( not( "maven-surefire-plugin@NotThreadSafe" ) ) ); assertNotSame( NotThreadSafeTest1.t, NormalTest1.t ); assertTrue( computer.getNotParallelRunners().isEmpty() ); assertThat( computer.getSuites().size(), is( 1 ) ); assertTrue( computer.getClasses().isEmpty() ); assertThat( computer.getNestedClasses().size(), is( 1 ) ); assertTrue( computer.getNestedSuites().isEmpty() ); assertFalse( computer.isSplitPool() ); assertThat( computer.getPoolCapacity(), is( 10 ) ); } @Test public void inheritanceWithNotThreadSafe() { ParallelComputerBuilder builder = new ParallelComputerBuilder( logger ) .useOnePool( 10 ).optimize( true ).parallelSuites( 2 ).parallelClasses( 3 ).parallelMethods( 3 ); ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) builder.buildComputer(); Result result = new JUnitCore().run( computer, OverMixedSuite.class ); assertTrue( result.wasSuccessful() ); assertThat( result.getRunCount(), is( 2 ) ); assertNotNull( NotThreadSafeTest3.t ); assertNotNull( NormalTest1.t ); assertThat( NormalTest1.t.getName(), is( "maven-surefire-plugin@NotThreadSafe" ) ); assertSame( NotThreadSafeTest3.t, NormalTest1.t ); assertThat( computer.getNotParallelRunners().size(), is( 1 ) ); assertTrue( computer.getSuites().isEmpty() ); assertTrue( computer.getClasses().isEmpty() ); assertTrue( computer.getNestedClasses().isEmpty() ); assertTrue( computer.getNestedSuites().isEmpty() ); assertFalse( computer.isSplitPool() ); assertThat( computer.getPoolCapacity(), is( 10 ) ); } @Test public void beforeAfterThreadChanges() throws InterruptedException { // try to GC dead Thread objects from previous tests for ( int i = 0; i < 5; i++ ) { System.gc(); TimeUnit.MILLISECONDS.sleep( 500L ); } Collection expectedThreads = jvmThreads(); ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger ); parallelComputerBuilder.parallelMethods( 3 ); ParallelComputer computer = parallelComputerBuilder.buildComputer(); Result result = new JUnitCore().run( computer, TestWithBeforeAfter.class ); assertTrue( result.wasSuccessful() ); // try to GC dead Thread objects for ( int i = 0; i < 5 && expectedThreads.size() != jvmThreads().size(); i++ ) { System.gc(); TimeUnit.MILLISECONDS.sleep( 500L ); } assertThat( jvmThreads(), is( expectedThreads ) ); } private static Collection jvmThreads() { Thread[] t = new Thread[1000]; Thread.enumerate( t ); ArrayList appThreads = new ArrayList( t.length ); Collections.addAll( appThreads, t ); appThreads.removeAll( Collections.singleton( (Thread) null ) ); Collections.sort( appThreads, new Comparator() { @Override public int compare( Thread t1, Thread t2 ) { return (int) Math.signum( t1.getId() - t2.getId() ); } } ); return appThreads; } private static class ShutdownTest { Result run( final boolean useInterrupt ) { ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger ) .useOnePool( 8 ) .parallelSuites( 2 ) .parallelClasses( 3 ) .parallelMethods( 3 ); assertFalse( parallelComputerBuilder.isOptimized() ); final ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) parallelComputerBuilder.buildComputer(); shutdownTask = new Runnable() { @Override public void run() { Collection startedTests = computer.describeStopped( useInterrupt ).getTriggeredTests(); assertThat( startedTests.size(), is( not( 0 ) ) ); } }; return new JUnitCore().run( computer, TestSuite.class, Class2.class, Class3.class ); } } public static class Class1 { static volatile int concurrentMethods = 0; static volatile int maxConcurrentMethods = 0; @Test public void test1() throws InterruptedException { synchronized ( class1Lock ) { ++concurrentMethods; class1Lock.wait( DELAY_MULTIPLIER * 500L ); maxConcurrentMethods = Math.max( maxConcurrentMethods, concurrentMethods-- ); } } @Test public void test2() throws InterruptedException { test1(); Runnable shutdownTask = ParallelComputerBuilderTest.shutdownTask; if ( shutdownTask != null ) { beforeShutdown = true; shutdownTask.run(); } } } public static class Class2 extends Class1 { } public static class Class3 extends Class1 { } public static class NothingDoingTest1 { static final Collection methods = new ConcurrentLinkedQueue(); @BeforeClass public static void init() { methods.add( "init" ); } @AfterClass public static void deinit() { methods.add( "deinit" ); } @Test public void a() throws InterruptedException { Thread.sleep( 5 ); methods.add( getClass().getName() + "#a()" ); } @Test public void b() throws InterruptedException { Thread.sleep( 5 ); methods.add( getClass().getName() + "#b()" ); } } public static class NothingDoingTest2 extends NothingDoingTest1 { } public static class NothingDoingTest3 extends NothingDoingTest1 { } @RunWith( Suite.class ) @Suite.SuiteClasses( { NothingDoingTest1.class, NothingDoingTest2.class } ) public static class NothingDoingSuite { } @RunWith( Suite.class ) @Suite.SuiteClasses( { Class2.class, Class1.class } ) public static class TestSuite { } public static class Test2 { @Test public void test() { } } @RunWith( ReportOneTestAtRuntimeRunner.class ) public static class TestWithoutPrecalculatedChildren {} public static class ReportOneTestAtRuntimeRunner extends ParentRunner { private final Class testClass; private final Description suiteDescription; private final Description myTestMethodDescr; @SuppressWarnings( "unchecked" ) public ReportOneTestAtRuntimeRunner( Class testClass ) throws InitializationError { super( Object.class ); this.testClass = testClass; suiteDescription = Description.createSuiteDescription( testClass ); myTestMethodDescr = Description.createTestDescription( testClass, "my_test" ); // suiteDescription.addChild(myTestMethodDescr); // let it be not known at start time } protected List getChildren() { throw new UnsupportedOperationException( "workflow from ParentRunner not supported" ); } protected Description describeChild( Object child ) { throw new UnsupportedOperationException( "workflow from ParentRunner not supported" ); } protected void runChild( Object child, RunNotifier notifier ) { throw new UnsupportedOperationException( "workflow from ParentRunner not supported" ); } public Description getDescription() { return suiteDescription; } public void run( RunNotifier notifier ) { notifier.fireTestStarted( myTestMethodDescr ); notifier.fireTestFinished( Description.createTestDescription( testClass, "my_test" ) ); } } @NotThreadSafe public static class NotThreadSafeTest1 { static volatile Thread t; @BeforeClass public static void beforeSuite() { assertThat( Thread.currentThread().getName(), is( not( "maven-surefire-plugin@NotThreadSafe" ) ) ); } @AfterClass public static void afterSuite() { assertThat( Thread.currentThread().getName(), is( not( "maven-surefire-plugin@NotThreadSafe" ) ) ); } @Test public void test() { t = Thread.currentThread(); assertThat( t.getName(), is( "maven-surefire-plugin@NotThreadSafe" ) ); } } @NotThreadSafe public static class NotThreadSafeTest2 { static volatile Thread t; @BeforeClass public static void beforeSuite() { assertThat( Thread.currentThread().getName(), is( not( "maven-surefire-plugin@NotThreadSafe" ) ) ); } @AfterClass public static void afterSuite() { assertThat( Thread.currentThread().getName(), is( not( "maven-surefire-plugin@NotThreadSafe" ) ) ); } @Test public void test() { t = Thread.currentThread(); assertThat( t.getName(), is( "maven-surefire-plugin@NotThreadSafe" ) ); } } @NotThreadSafe public static class NotThreadSafeTest3 { static volatile Thread t; @Test public void test() { t = Thread.currentThread(); assertThat( t.getName(), is( "maven-surefire-plugin@NotThreadSafe" ) ); } } @RunWith( Suite.class ) @Suite.SuiteClasses( { NormalTest1.class, NormalTest2.class } ) @NotThreadSafe public static class NotThreadSafeTestSuite { @BeforeClass public static void beforeSuite() { assertThat( Thread.currentThread().getName(), is( not( "maven-surefire-plugin@NotThreadSafe" ) ) ); } @AfterClass public static void afterSuite() { assertThat( Thread.currentThread().getName(), is( not( "maven-surefire-plugin@NotThreadSafe" ) ) ); } } public static class NormalTest1 { static volatile Thread t; @Test public void test() { t = Thread.currentThread(); } } public static class NormalTest2 { static volatile Thread t; @Test public void test() { t = Thread.currentThread(); } } @RunWith( Suite.class ) @Suite.SuiteClasses( { NotThreadSafeTest1.class, NormalTest1.class } ) public static class MixedSuite { @BeforeClass public static void beforeSuite() { assertThat( Thread.currentThread().getName(), is( not( "maven-surefire-plugin@NotThreadSafe" ) ) ); } @AfterClass public static void afterSuite() { assertThat( Thread.currentThread().getName(), is( not( "maven-surefire-plugin@NotThreadSafe" ) ) ); } } @RunWith( Suite.class ) @Suite.SuiteClasses( { NotThreadSafeTest3.class, NormalTest1.class } ) @NotThreadSafe public static class OverMixedSuite { @BeforeClass public static void beforeSuite() { assertThat( Thread.currentThread().getName(), is( not( "maven-surefire-plugin@NotThreadSafe" ) ) ); } @AfterClass public static void afterSuite() { assertThat( Thread.currentThread().getName(), is( not( "maven-surefire-plugin@NotThreadSafe" ) ) ); } } public static class TestWithBeforeAfter { @BeforeClass public static void beforeClass() throws InterruptedException { System.out.println( new Date() + " BEG: beforeClass" ); sleepSeconds( 1 ); System.out.println( new Date() + " END: beforeClass" ); } @Before public void before() throws InterruptedException { System.out.println( new Date() + " BEG: before" ); sleepSeconds( 1 ); System.out.println( new Date() + " END: before" ); } @Test public void test() throws InterruptedException { System.out.println( new Date() + " BEG: test" ); sleepSeconds( 1 ); System.out.println( new Date() + " END: test" ); } @After public void after() throws InterruptedException { System.out.println( new Date() + " BEG: after" ); sleepSeconds( 1 ); System.out.println( new Date() + " END: after" ); } @AfterClass public static void afterClass() throws InterruptedException { System.out.println( new Date() + " BEG: afterClass" ); sleepSeconds( 1 ); System.out.println( new Date() + " END: afterClass" ); } } private static long systemMillis() { return TimeUnit.NANOSECONDS.toMillis( System.nanoTime() ); } private static void sleepSeconds( int seconds ) throws InterruptedException { TimeUnit.SECONDS.sleep( seconds ); } } ParallelComputerUtilTest.java000066400000000000000000001445641330756104600451510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.apache.maven.surefire.junitcore.JUnitCoreParameters; import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.report.DefaultDirectConsoleReporter; import org.apache.maven.surefire.testset.TestSetFailedException; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.theories.DataPoint; import org.junit.experimental.theories.Theories; import org.junit.experimental.theories.Theory; import org.junit.rules.ExpectedException; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.RunWith; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeUnit; import static org.apache.maven.surefire.junitcore.pc.ParallelComputerUtil.*; import static org.apache.maven.surefire.junitcore.JUnitCoreParameters.*; import static org.hamcrest.core.Is.is; import static org.junit.Assert.*; /** * Testing an algorithm in {@link ParallelComputerUtil} which configures * allocated thread resources in ParallelComputer by given {@link org.apache.maven.surefire.junitcore.JUnitCoreParameters}. * * @author Tibor Digana (tibor17) * @see ParallelComputerUtil * @since 2.16 */ @RunWith( Theories.class ) public final class ParallelComputerUtilTest { private final ConsoleStream logger = new DefaultDirectConsoleReporter( System.out ); @DataPoint public static final int CPU_1 = 1; @DataPoint public static final int CPU_4 = 4; @Rule public final ExpectedException exception = ExpectedException.none(); @BeforeClass public static void beforeClass() { ParallelComputerUtil.overrideAvailableProcessors( 1 ); } @AfterClass public static void afterClass() { ParallelComputerUtil.setDefaultAvailableProcessors(); } @Before public void beforeTest() throws InterruptedException { System.gc(); Thread.sleep( 50L ); assertFalse( Thread.currentThread().isInterrupted() ); } private static Map parallel( String parallel ) { return Collections.singletonMap( PARALLEL_KEY, parallel ); } @Test public void unknownParallel() throws TestSetFailedException { Map properties = new HashMap(); exception.expect( TestSetFailedException.class ); resolveConcurrency( new JUnitCoreParameters( properties ), null ); } @Test public void unknownThreadCountSuites() throws TestSetFailedException { JUnitCoreParameters params = new JUnitCoreParameters( parallel( "suites" ) ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); exception.expect( TestSetFailedException.class ); resolveConcurrency( params, null ); } @Test public void unknownThreadCountClasses() throws TestSetFailedException { JUnitCoreParameters params = new JUnitCoreParameters( parallel( "classes" ) ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); exception.expect( TestSetFailedException.class ); resolveConcurrency( params, null ); } @Test public void unknownThreadCountMethods() throws TestSetFailedException { JUnitCoreParameters params = new JUnitCoreParameters( parallel( "methods" ) ); assertFalse( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); exception.expect( TestSetFailedException.class ); resolveConcurrency( params, null ); } @Test public void unknownThreadCountBoth() throws TestSetFailedException { JUnitCoreParameters params = new JUnitCoreParameters( parallel( "both" ) ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); exception.expect( TestSetFailedException.class ); resolveConcurrency( params, null ); } @Test public void unknownThreadCountAll() throws TestSetFailedException { JUnitCoreParameters params = new JUnitCoreParameters( parallel( "all" ) ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); exception.expect( TestSetFailedException.class ); resolveConcurrency( params, null ); } @Test public void unknownThreadCountSuitesAndClasses() throws TestSetFailedException { JUnitCoreParameters params = new JUnitCoreParameters( parallel( "suitesAndClasses" ) ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); exception.expect( TestSetFailedException.class ); resolveConcurrency( params, null ); } @Test public void unknownThreadCountSuitesAndMethods() throws TestSetFailedException { JUnitCoreParameters params = new JUnitCoreParameters( parallel( "suitesAndMethods" ) ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); exception.expect( TestSetFailedException.class ); resolveConcurrency( params, null ); } @Test public void unknownThreadCountClassesAndMethods() throws TestSetFailedException { JUnitCoreParameters params = new JUnitCoreParameters( parallel( "classesAndMethods" ) ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); exception.expect( TestSetFailedException.class ); resolveConcurrency( params, null ); } @Theory public void useUnlimitedThreadsSuites( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suites"); properties.put(USEUNLIMITEDTHREADS_KEY, "true"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( Integer.MAX_VALUE ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( 0 ) ); properties.put(THREADCOUNTSUITES_KEY, "5"); params = new JUnitCoreParameters( properties ); concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( 5 * cpu ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void useUnlimitedThreadsClasses( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "classes"); properties.put(USEUNLIMITEDTHREADS_KEY, "true"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( Integer.MAX_VALUE ) ); assertThat( concurrency.methods, is( 0 ) ); properties.put(THREADCOUNTCLASSES_KEY, "5"); params = new JUnitCoreParameters( properties ); concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( 5 * cpu ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void unlimitedThreadsMethods( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "methods"); properties.put(USEUNLIMITEDTHREADS_KEY, "true"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); properties.put(THREADCOUNTMETHODS_KEY, "5"); params = new JUnitCoreParameters( properties ); concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( 5 * cpu ) ); } @Theory public void unlimitedThreadsSuitesAndClasses( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndClasses"); properties.put(USEUNLIMITEDTHREADS_KEY, "true"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( Integer.MAX_VALUE ) ); assertThat( concurrency.classes, is( Integer.MAX_VALUE ) ); assertThat( concurrency.methods, is( 0 ) ); properties.put(THREADCOUNTSUITES_KEY, "5"); properties.put(THREADCOUNTCLASSES_KEY, "15"); params = new JUnitCoreParameters( properties ); concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( 5 * cpu ) ); assertThat( concurrency.classes, is( 15 * cpu ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void unlimitedThreadsSuitesAndMethods( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndMethods"); properties.put(USEUNLIMITEDTHREADS_KEY, "true"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( Integer.MAX_VALUE ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); properties.put(THREADCOUNTSUITES_KEY, "5"); properties.put(THREADCOUNTMETHODS_KEY, "15"); params = new JUnitCoreParameters( properties ); concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( 5 * cpu ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( 15 * cpu ) ); } @Theory public void unlimitedThreadsClassesAndMethods( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "classesAndMethods"); properties.put(USEUNLIMITEDTHREADS_KEY, "true"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( Integer.MAX_VALUE ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); properties.put(THREADCOUNTCLASSES_KEY, "5"); properties.put(THREADCOUNTMETHODS_KEY, "15"); params = new JUnitCoreParameters( properties ); concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( 5 * cpu ) ); assertThat( concurrency.methods, is( 15 * cpu ) ); } @Theory public void unlimitedThreadsAll( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "all"); properties.put(USEUNLIMITEDTHREADS_KEY, "true"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( Integer.MAX_VALUE ) ); assertThat( concurrency.classes, is( Integer.MAX_VALUE ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); properties.put(THREADCOUNTSUITES_KEY, "5"); properties.put(THREADCOUNTCLASSES_KEY, "15"); properties.put(THREADCOUNTMETHODS_KEY, "30"); params = new JUnitCoreParameters( properties ); concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( 5 * cpu ) ); assertThat( concurrency.classes, is( 15 * cpu ) ); assertThat( concurrency.methods, is( 30 * cpu ) ); } @Theory public void threadCountSuites( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suites"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 0 ) ); assertThat( concurrency.suites, is( 3 * cpu ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void threadCountClasses( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "classes"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 0 ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( 3 * cpu ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void threadCountMethods( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "methods"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 0 ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( 3 * cpu ) ); } @Theory public void threadCountBoth( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "both"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 3 * cpu ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( (int) ( ( 3d / 2 ) * cpu ) ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void threadCountClassesAndMethods( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "classesAndMethods"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 3 * cpu ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( (int) ( ( 3d / 2 ) * cpu ) ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void threadCountSuitesAndMethods( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndMethods"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 3 * cpu ) ); assertThat( concurrency.suites, is( (int) ( ( 3d / 2 ) * cpu ) ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void threadCountSuitesAndClasses( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndClasses"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 3 * cpu ) ); assertThat( concurrency.suites, is( (int) ( ( 3d / 2 ) * cpu ) ) ); assertThat( concurrency.classes, is( Integer.MAX_VALUE ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void threadCountAll( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "all"); properties.put(THREADCOUNT_KEY, "3"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 3 * cpu ) ); assertThat( concurrency.suites, is( cpu ) ); assertThat( concurrency.classes, is( cpu ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void everyThreadCountSuitesAndClasses( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndClasses"); properties.put(THREADCOUNT_KEY, "3"); // % percentage ratio properties.put(THREADCOUNTSUITES_KEY, "34"); properties.put(THREADCOUNTCLASSES_KEY, "66"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 3 * cpu ) ); int concurrentSuites = (int) ( 0.34d * concurrency.capacity ); assertThat( concurrency.suites, is( concurrentSuites ) ); assertThat( concurrency.classes, is( concurrency.capacity - concurrentSuites ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void everyThreadCountSuitesAndMethods( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndMethods"); properties.put(THREADCOUNT_KEY, "3"); // % percentage ratio properties.put(THREADCOUNTSUITES_KEY, "34"); properties.put(THREADCOUNTMETHODS_KEY, "66"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 3 * cpu ) ); int concurrentSuites = (int) ( 0.34d * concurrency.capacity ); assertThat( concurrency.suites, is( concurrentSuites ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( concurrency.capacity - concurrentSuites ) ); } @Theory public void everyThreadCountClassesAndMethods( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "classesAndMethods"); properties.put(THREADCOUNT_KEY, "3"); // % percentage ratio properties.put(THREADCOUNTCLASSES_KEY, "34"); properties.put(THREADCOUNTMETHODS_KEY, "66"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 3 * cpu ) ); assertThat( concurrency.suites, is( 0 ) ); int concurrentClasses = (int) ( 0.34d * concurrency.capacity ); assertThat( concurrency.classes, is( concurrentClasses ) ); assertThat( concurrency.methods, is( concurrency.capacity - concurrentClasses ) ); } @Theory public void everyThreadCountAll( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "all"); properties.put(THREADCOUNT_KEY, "3"); // % percentage ratio properties.put(THREADCOUNTSUITES_KEY, "17"); properties.put(THREADCOUNTCLASSES_KEY, "34"); properties.put(THREADCOUNTMETHODS_KEY, "49"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 3 * cpu ) ); int concurrentSuites = (int) ( 0.17d * concurrency.capacity ); int concurrentClasses = (int) ( 0.34d * concurrency.capacity ); assertThat( concurrency.suites, is( concurrentSuites ) ); assertThat( concurrency.classes, is( concurrentClasses ) ); assertThat( concurrency.methods, is( concurrency.capacity - concurrentSuites - concurrentClasses ) ); } @Theory public void reusableThreadCountSuitesAndClasses( int cpu ) throws TestSetFailedException { // 4 * cpu to 5 * cpu threads to run test classes ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndClasses"); properties.put(THREADCOUNT_KEY, "6"); properties.put(THREADCOUNTSUITES_KEY, "2"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 6 * cpu ) ); assertThat( concurrency.suites, is( 2 * cpu ) ); assertThat( concurrency.classes, is( Integer.MAX_VALUE ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void reusableThreadCountSuitesAndMethods( int cpu ) throws TestSetFailedException { // 4 * cpu to 5 * cpu threads to run test methods ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndMethods"); properties.put(THREADCOUNT_KEY, "6"); properties.put(THREADCOUNTSUITES_KEY, "2"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 6 * cpu ) ); assertThat( concurrency.suites, is( 2 * cpu ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void reusableThreadCountClassesAndMethods( int cpu ) throws TestSetFailedException { // 4 * cpu to 5 * cpu threads to run test methods ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "classesAndMethods"); properties.put(THREADCOUNT_KEY, "6"); properties.put(THREADCOUNTCLASSES_KEY, "2"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 6 * cpu ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( 2 * cpu ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void reusableThreadCountAll( int cpu ) throws TestSetFailedException { // 8 * cpu to 13 * cpu threads to run test methods ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "all"); properties.put(THREADCOUNT_KEY, "14"); properties.put(THREADCOUNTSUITES_KEY, "2"); properties.put(THREADCOUNTCLASSES_KEY, "4"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 14 * cpu ) ); assertThat( concurrency.suites, is( 2 * cpu ) ); assertThat( concurrency.classes, is( 4 * cpu ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void suites( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suites"); properties.put(THREADCOUNTSUITES_KEY, "5"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 5 * cpu ) ); assertThat( concurrency.suites, is( 5 * cpu ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void classes( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "classes"); properties.put(THREADCOUNTCLASSES_KEY, "5"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 5 * cpu ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( 5 * cpu ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void methods( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "methods"); properties.put(THREADCOUNTMETHODS_KEY, "5"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 5 * cpu ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( 5 * cpu ) ); } @Theory public void suitesAndClasses( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndClasses"); properties.put(THREADCOUNTSUITES_KEY, "5"); properties.put(THREADCOUNTCLASSES_KEY, "15"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 20 * cpu ) ); assertThat( concurrency.suites, is( 5 * cpu ) ); assertThat( concurrency.classes, is( 15 * cpu ) ); assertThat( concurrency.methods, is( 0 ) ); // Warning: this case works but is not enabled in AbstractSurefireMojo // Instead use the 'useUnlimitedThreads' parameter. properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndClasses"); properties.put(THREADCOUNTSUITES_KEY, "5"); params = new JUnitCoreParameters( properties ); concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertFalse( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( 5 * cpu ) ); assertThat( concurrency.classes, is( Integer.MAX_VALUE ) ); assertThat( concurrency.methods, is( 0 ) ); } @Theory public void suitesAndMethods( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndMethods"); properties.put(THREADCOUNTSUITES_KEY, "5"); properties.put(THREADCOUNTMETHODS_KEY, "15"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 20 * cpu ) ); assertThat( concurrency.suites, is( 5 * cpu ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( 15 * cpu ) ); // Warning: this case works but is not enabled in AbstractSurefireMojo // Instead use the 'useUnlimitedThreads' parameter. properties = new HashMap(); properties.put(PARALLEL_KEY, "suitesAndMethods"); properties.put(THREADCOUNTSUITES_KEY, "5"); params = new JUnitCoreParameters( properties ); concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertFalse( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( 5 * cpu ) ); assertThat( concurrency.classes, is( 0 ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void classesAndMethods( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "classesAndMethods"); properties.put(THREADCOUNTCLASSES_KEY, "5"); properties.put(THREADCOUNTMETHODS_KEY, "15"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 20 * cpu ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( 5 * cpu ) ); assertThat( concurrency.methods, is( 15 * cpu ) ); // Warning: this case works but is not enabled in AbstractSurefireMojo // Instead use the 'useUnlimitedThreads' parameter. properties = new HashMap(); properties.put(PARALLEL_KEY, "classesAndMethods"); properties.put(THREADCOUNTCLASSES_KEY, "5"); params = new JUnitCoreParameters( properties ); concurrency = resolveConcurrency( params, null ); assertFalse( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( 0 ) ); assertThat( concurrency.classes, is( 5 * cpu ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Theory public void all( int cpu ) throws TestSetFailedException { ParallelComputerUtil.overrideAvailableProcessors( cpu ); Map properties = new HashMap(); properties.put(PARALLEL_KEY, "all"); properties.put(THREADCOUNTSUITES_KEY, "5"); properties.put(THREADCOUNTCLASSES_KEY, "15"); properties.put(THREADCOUNTMETHODS_KEY, "30"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); Concurrency concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( 50 * cpu ) ); assertThat( concurrency.suites, is( 5 * cpu ) ); assertThat( concurrency.classes, is( 15 * cpu ) ); assertThat( concurrency.methods, is( 30 * cpu ) ); // Warning: these cases work but they are not enabled in AbstractSurefireMojo // Instead use the 'useUnlimitedThreads' parameter. properties = new HashMap(); properties.put(PARALLEL_KEY, "all"); properties.put(THREADCOUNTSUITES_KEY, "5"); properties.put(THREADCOUNTCLASSES_KEY, "15"); params = new JUnitCoreParameters( properties ); concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( 5 * cpu ) ); assertThat( concurrency.classes, is( 15 * cpu ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); properties = new HashMap(); properties.put(PARALLEL_KEY, "all"); properties.put(THREADCOUNTCLASSES_KEY, "15"); params = new JUnitCoreParameters( properties ); concurrency = resolveConcurrency( params, null ); assertTrue( params.isParallelSuites() ); assertTrue( params.isParallelClasses() ); assertTrue( params.isParallelMethods() ); assertThat( concurrency.capacity, is( Integer.MAX_VALUE ) ); assertThat( concurrency.suites, is( Integer.MAX_VALUE ) ); assertThat( concurrency.classes, is( 15 * cpu ) ); assertThat( concurrency.methods, is( Integer.MAX_VALUE ) ); } @Test public void withoutShutdown() { Map properties = new HashMap(); properties.put(PARALLEL_KEY, "methods"); properties.put(THREADCOUNTMETHODS_KEY, "2"); JUnitCoreParameters params = new JUnitCoreParameters( properties ); ParallelComputerBuilder pcBuilder = new ParallelComputerBuilder( logger, params ); ParallelComputer pc = pcBuilder.buildComputer(); final JUnitCore core = new JUnitCore(); final long t1 = systemMillis(); final Result result = core.run( pc, TestClass.class ); final long t2 = systemMillis(); long timeSpent = t2 - t1; final long deltaTime = 500L; assertTrue( result.wasSuccessful() ); assertThat( result.getRunCount(), is( 3 ) ); assertThat( result.getFailureCount(), is( 0 ) ); assertThat( result.getIgnoreCount(), is( 0 ) ); //assertThat( timeSpent, between (timeSpent - deltaTime, timeSpent + deltaTime + 2000L ) ); assertEquals( 10000L, timeSpent, deltaTime ); } @Test public void shutdown() throws TestSetFailedException { // The JUnitCore returns after 2.5s. // The test-methods in TestClass are NOT interrupted, and return normally after 5s. Map properties = new HashMap(); properties.put(PARALLEL_KEY, "methods"); properties.put(THREADCOUNTMETHODS_KEY, "2"); properties.put(PARALLEL_TIMEOUT_KEY, Double.toString( 2.5d )); JUnitCoreParameters params = new JUnitCoreParameters( properties ); ParallelComputerBuilder pcBuilder = new ParallelComputerBuilder( logger, params ); ParallelComputer pc = pcBuilder.buildComputer(); final JUnitCore core = new JUnitCore(); final long t1 = systemMillis(); core.run( pc, TestClass.class ); final long t2 = systemMillis(); final long timeSpent = t2 - t1; final long deltaTime = 500L; assertEquals( 5000L, timeSpent, deltaTime ); String description = pc.describeElapsedTimeout(); assertTrue( description.contains( "The test run has finished abruptly after timeout of 2.5 seconds.") ); assertTrue( description.contains( "These tests were executed in prior to the shutdown operation:\n" + TestClass.class.getName() ) ); } @Test public void forcedShutdown() throws TestSetFailedException { // The JUnitCore returns after 2.5s, and the test-methods in TestClass are interrupted. Map properties = new HashMap(); properties.put(PARALLEL_KEY, "methods"); properties.put(THREADCOUNTMETHODS_KEY, "2"); properties.put(PARALLEL_TIMEOUTFORCED_KEY, Double.toString( 2.5d )); JUnitCoreParameters params = new JUnitCoreParameters( properties ); ParallelComputerBuilder pcBuilder = new ParallelComputerBuilder( logger, params ); ParallelComputer pc = pcBuilder.buildComputer(); final JUnitCore core = new JUnitCore(); final long t1 = systemMillis(); core.run( pc, TestClass.class ); final long t2 = systemMillis(); final long timeSpent = t2 - t1; final long deltaTime = 500L; assertEquals( 2500L, timeSpent, deltaTime ); String description = pc.describeElapsedTimeout(); assertTrue( description.contains( "The test run has finished abruptly after timeout of 2.5 seconds.") ); assertTrue( description.contains( "These tests were executed in prior to the shutdown operation:\n" + TestClass.class.getName() ) ); } @Test public void timeoutAndForcedShutdown() throws TestSetFailedException { // The JUnitCore returns after 3.5s and the test-methods in TestClass are timed out after 2.5s. // No new test methods are scheduled for execution after 2.5s. // Interruption of test methods after 3.5s. Map properties = new HashMap(); properties.put(PARALLEL_KEY, "methods"); properties.put(THREADCOUNTMETHODS_KEY, "2"); properties.put(PARALLEL_TIMEOUT_KEY, Double.toString( 2.5d )); properties.put(PARALLEL_TIMEOUTFORCED_KEY, Double.toString( 3.5d )); JUnitCoreParameters params = new JUnitCoreParameters( properties ); ParallelComputerBuilder pcBuilder = new ParallelComputerBuilder( logger, params ); ParallelComputer pc = pcBuilder.buildComputer(); final JUnitCore core = new JUnitCore(); final long t1 = systemMillis(); core.run( pc, TestClass.class ); final long t2 = systemMillis(); final long timeSpent = t2 - t1; final long deltaTime = 500L; assertEquals( 3500L, timeSpent, deltaTime ); String description = pc.describeElapsedTimeout(); assertTrue( description.contains( "The test run has finished abruptly after timeout of 2.5 seconds.") ); assertTrue( description.contains( "These tests were executed in prior to the shutdown operation:\n" + TestClass.class.getName() ) ); } @Test public void forcedTimeoutAndShutdown() throws Exception { // The JUnitCore returns after 3.5s and the test-methods in TestClass are interrupted after 3.5s. Map properties = new HashMap(); properties.put(PARALLEL_KEY, "methods"); properties.put(THREADCOUNTMETHODS_KEY, "2"); properties.put(PARALLEL_TIMEOUTFORCED_KEY, Double.toString( 3.5d ) ); properties.put(PARALLEL_TIMEOUT_KEY, Double.toString( 4.0d ) ); JUnitCoreParameters params = new JUnitCoreParameters( properties ); ParallelComputerBuilder pcBuilder = new ParallelComputerBuilder( logger, params ); ParallelComputer pc = pcBuilder.buildComputer(); final JUnitCore core = new JUnitCore(); final long t1 = systemMillis(); core.run( pc, TestClass.class ); final long t2 = systemMillis(); final long timeSpent = t2 - t1; final long deltaTime = 500L; assertEquals( 3500L, timeSpent, deltaTime ); String description = pc.describeElapsedTimeout(); assertTrue( description.contains( "The test run has finished abruptly after timeout of 3.5 seconds.") ); assertTrue( description.contains( "These tests were executed in prior to the shutdown operation:\n" + TestClass.class.getName() ) ); } public static class TestClass { @Test public void a() throws InterruptedException { long t1 = systemMillis(); try { Thread.sleep( 5000L ); } finally { System.out.println( getClass().getSimpleName() + "#a() spent " + ( systemMillis() - t1 ) ); } } @Test public void b() throws InterruptedException { long t1 = systemMillis(); try { Thread.sleep( 5000L ); } finally { System.out.println( getClass().getSimpleName() + "#b() spent " + ( systemMillis() - t1 ) ); } } @Test public void c() throws InterruptedException { long t1 = systemMillis(); try { Thread.sleep( 5000L ); } finally { System.out.println( getClass().getSimpleName() + "#c() spent " + ( systemMillis() - t1 ) ); } } } private static long systemMillis() { return TimeUnit.NANOSECONDS.toMillis( System.nanoTime() ); } } RangeMatcher.java000066400000000000000000000031701330756104600425230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.hamcrest.BaseMatcher; import org.hamcrest.Description; import org.hamcrest.Matcher; /** * @author Tibor Digana (tibor17) * @since 2.16 */ final class RangeMatcher extends BaseMatcher { private final long from; private final long to; private RangeMatcher( long from, long to ) { this.from = from; this.to = to; } public static Matcher between( long from, long to ) { return new RangeMatcher( from, to ); } @Override public void describeTo( Description description ) { description.appendValueList( "between ", " and ", "", from, to ); } @Override public boolean matches( Object o ) { long actual = (Long) o; return actual >= from && actual <= to; } }SchedulingStrategiesTest.java000066400000000000000000000126401330756104600451450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pcpackage org.apache.maven.surefire.junitcore.pc; /* * 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. */ import org.apache.maven.surefire.report.ConsoleStream; import org.apache.maven.surefire.report.DefaultDirectConsoleReporter; import org.junit.Test; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import static org.apache.maven.surefire.util.internal.DaemonThreadFactory.newDaemonThreadFactory; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** * Tests the factories in SchedulingStrategy. *
* Th point of these tests is to check {@link Task#result} if changed * from {@code false} to {@code true} after all scheduled tasks * have finished. * The call {@link SchedulingStrategy#finished()} is waiting until the * strategy has finished. * Then {@link Task#result} should be asserted that is {@code true}. * * @author Tibor Digana (tibor17) * @see SchedulingStrategy * @since 2.16 */ public class SchedulingStrategiesTest { private static final ThreadFactory DAEMON_THREAD_FACTORY = newDaemonThreadFactory(); private final ConsoleStream logger = new DefaultDirectConsoleReporter( System.out ); @Test public void invokerStrategy() throws InterruptedException { SchedulingStrategy strategy = SchedulingStrategies.createInvokerStrategy( logger ); assertFalse( strategy.hasSharedThreadPool() ); assertTrue( strategy.canSchedule() ); Task task = new Task(); strategy.schedule( task ); assertTrue( strategy.canSchedule() ); assertTrue( task.result ); assertTrue( strategy.finished() ); assertFalse( strategy.canSchedule() ); } @Test public void nonSharedPoolStrategy() throws InterruptedException { SchedulingStrategy strategy = SchedulingStrategies.createParallelStrategy( logger, 2 ); assertFalse( strategy.hasSharedThreadPool() ); assertTrue( strategy.canSchedule() ); Task task1 = new Task(); Task task2 = new Task(); strategy.schedule( task1 ); strategy.schedule( task2 ); assertTrue( strategy.canSchedule() ); assertTrue( strategy.finished() ); assertFalse( strategy.canSchedule() ); assertTrue( task1.result ); assertTrue( task2.result ); } @Test(expected = NullPointerException.class) public void sharedPoolStrategyNullPool() { SchedulingStrategies.createParallelSharedStrategy( logger, null ); } @Test public void sharedPoolStrategy() throws InterruptedException { ExecutorService sharedPool = Executors.newCachedThreadPool( DAEMON_THREAD_FACTORY ); SchedulingStrategy strategy1 = SchedulingStrategies.createParallelSharedStrategy( logger, sharedPool ); assertTrue( strategy1.hasSharedThreadPool() ); assertTrue( strategy1.canSchedule() ); SchedulingStrategy strategy2 = SchedulingStrategies.createParallelSharedStrategy( logger, sharedPool ); assertTrue( strategy2.hasSharedThreadPool() ); assertTrue( strategy2.canSchedule() ); Task task1 = new Task(); Task task2 = new Task(); Task task3 = new Task(); Task task4 = new Task(); strategy1.schedule( task1 ); strategy2.schedule( task2 ); strategy1.schedule( task3 ); strategy2.schedule( task4 ); assertTrue( strategy1.canSchedule() ); assertTrue( strategy2.canSchedule() ); assertTrue( strategy1.finished() ); assertFalse( strategy1.canSchedule() ); assertTrue( strategy2.finished() ); assertFalse( strategy2.canSchedule() ); assertTrue( task1.result ); assertTrue( task2.result ); assertTrue( task3.result ); assertTrue( task4.result ); } @Test public void infinitePoolStrategy() throws InterruptedException { SchedulingStrategy strategy = SchedulingStrategies.createParallelStrategyUnbounded( logger ); assertFalse( strategy.hasSharedThreadPool() ); assertTrue( strategy.canSchedule() ); Task task1 = new Task(); Task task2 = new Task(); strategy.schedule( task1 ); strategy.schedule( task2 ); assertTrue( strategy.canSchedule() ); assertTrue( strategy.finished() ); assertFalse( strategy.canSchedule() ); assertTrue( task1.result ); assertTrue( task2.result ); } static class Task implements Runnable { volatile boolean result = false; @Override public void run() { result = true; } } } maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/000077500000000000000000000000001330756104600264775ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/pom.xml000066400000000000000000000065751330756104600300310ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire-providers 2.22.0 surefire-testng-utils SureFire TestNG Utils TestNG Utilities junit junit 3.8.2 provided org.apache.maven.shared maven-shared-utils org.apache.maven.surefire surefire-grouper org.testng testng 5.10 jdk15 provided org.apache.maven.plugins maven-shade-plugin package shade true org.apache.maven.shared:maven-shared-utils org.apache.maven.shared org.apache.maven.surefire.shade.org.apache.maven.shared maven-surefire-plugin org.apache.maven.surefire surefire-shadefire 2.12.4 maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/000077500000000000000000000000001330756104600272665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/main/000077500000000000000000000000001330756104600302125ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/main/java/000077500000000000000000000000001330756104600311335ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/main/java/org/000077500000000000000000000000001330756104600317225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/main/java/org/apache/000077500000000000000000000000001330756104600331435ustar00rootroot00000000000000maven/000077500000000000000000000000001330756104600341725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/main/java/org/apachesurefire/000077500000000000000000000000001330756104600360165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maventestng/000077500000000000000000000000001330756104600373225ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefireutils/000077500000000000000000000000001330756104600404625ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testngFailFastEventsSingleton.java000066400000000000000000000030331330756104600460650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utilspackage org.apache.maven.surefire.testng.utils; /* * 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. */ /** * Stores and retrieves atomic events * used by {@link FailFastNotifier} and TestNG provider. * * @author Tibor Digana (tibor17) * @since 2.19 */ public final class FailFastEventsSingleton { private static final FailFastEventsSingleton INSTANCE = new FailFastEventsSingleton(); private volatile boolean skipAfterFailure; private FailFastEventsSingleton() { } public static FailFastEventsSingleton getInstance() { return INSTANCE; } public boolean isSkipAfterFailure() { return skipAfterFailure; } public void setSkipOnNextTest() { this.skipAfterFailure = true; } } FailFastListener.java000066400000000000000000000036401330756104600445270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utilspackage org.apache.maven.surefire.testng.utils; /* * 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. */ import org.testng.ITestContext; import org.testng.ITestListener; import org.testng.ITestResult; /** * Sends an even in {@link FailFastEventsSingleton} that failure has appeared. * * @author Tibor Digana (tibor17) * @since 2.19 */ public class FailFastListener implements ITestListener { private final Stoppable stoppable; public FailFastListener( Stoppable stoppable ) { this.stoppable = stoppable; } @Override public void onTestStart( ITestResult result ) { } @Override public void onTestSuccess( ITestResult result ) { } @Override public void onTestFailure( ITestResult result ) { stoppable.fireStopEvent(); } @Override public void onTestSkipped( ITestResult result ) { } @Override public void onTestFailedButWithinSuccessPercentage( ITestResult result ) { } @Override public void onStart( ITestContext context ) { } @Override public void onFinish( ITestContext context ) { } } FailFastNotifier.java000066400000000000000000000033531330756104600445220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utilspackage org.apache.maven.surefire.testng.utils; /* * 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. */ import org.testng.IInvokedMethod; import org.testng.IInvokedMethodListener; import org.testng.ITestResult; import org.testng.SkipException; /** * Notifies TestNG core skipping remaining tests after first failure has appeared. * * @author Tibor Digana (tibor17) * @since 2.19 */ public class FailFastNotifier implements IInvokedMethodListener { @Override public void beforeInvocation( IInvokedMethod iInvokedMethod, ITestResult iTestResult ) { if ( FailFastEventsSingleton.getInstance().isSkipAfterFailure() ) { throw new SkipException( "Skipped after failure. See parameter [skipAfterFailureCount] " + "in surefire or failsafe plugin." ); } } @Override public void afterInvocation( IInvokedMethod iInvokedMethod, ITestResult iTestResult ) { } } GroupMatcherMethodSelector.java000066400000000000000000000073641330756104600466010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utilspackage org.apache.maven.surefire.testng.utils; /* * 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. */ import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.maven.surefire.group.match.AndGroupMatcher; import org.apache.maven.surefire.group.match.GroupMatcher; import org.apache.maven.surefire.group.match.InverseGroupMatcher; import org.apache.maven.surefire.group.parse.GroupMatcherParser; import org.apache.maven.surefire.group.parse.ParseException; import org.testng.IMethodSelector; import org.testng.IMethodSelectorContext; import org.testng.ITestNGMethod; /** * Method selector delegating to {@link GroupMatcher} to decide if a method is included or not. * */ public class GroupMatcherMethodSelector implements IMethodSelector { private static final long serialVersionUID = 1L; private static GroupMatcher matcher; private Map answers = new HashMap(); @Override public boolean includeMethod( IMethodSelectorContext context, ITestNGMethod method, boolean isTestMethod ) { Boolean result = answers.get( method ); if ( result != null ) { return result; } if ( matcher == null ) { return true; } String[] groups = method.getGroups(); result = matcher.enabled( groups ); answers.put( method, result ); return result; } @Override public void setTestMethods( List testMethods ) { } public static void setGroups( String groups, String excludedGroups ) { // System.out.println( "Processing group includes: '" + groups + "'\nExcludes: '" + excludedGroups + "'" ); try { AndGroupMatcher matcher = new AndGroupMatcher(); GroupMatcher in = null; if ( groups != null && !groups.trim().isEmpty() ) { in = new GroupMatcherParser( groups ).parse(); } if ( in != null ) { matcher.addMatcher( in ); } GroupMatcher ex = null; if ( excludedGroups != null && !excludedGroups.trim().isEmpty() ) { ex = new GroupMatcherParser( excludedGroups ).parse(); } if ( ex != null ) { matcher.addMatcher( new InverseGroupMatcher( ex ) ); } if ( in != null || ex != null ) { // System.out.println( "Group matcher: " + matcher ); GroupMatcherMethodSelector.matcher = matcher; } } catch ( ParseException e ) { throw new IllegalArgumentException( "Cannot parse group includes/excludes expression(s):\nIncludes: " + groups + "\nExcludes: " + excludedGroups, e ); } } public static void setGroupMatcher( GroupMatcher matcher ) { GroupMatcherMethodSelector.matcher = matcher; } } MethodSelector.java000066400000000000000000000053031330756104600442470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utilspackage org.apache.maven.surefire.testng.utils; /* * 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. */ import java.util.List; import org.apache.maven.surefire.testset.TestListResolver; import org.testng.IMethodSelector; import org.testng.IMethodSelectorContext; import org.testng.ITestNGMethod; /** * For internal use only * * @author Olivier Lamy * @since 2.7.3 */ public class MethodSelector implements IMethodSelector { private static volatile TestListResolver testListResolver = null; @Override public void setTestMethods( List arg0 ) { } @Override public boolean includeMethod( IMethodSelectorContext context, ITestNGMethod testngMethod, boolean isTestMethod ) { return testngMethod.isBeforeClassConfiguration() || testngMethod.isBeforeGroupsConfiguration() || testngMethod.isBeforeMethodConfiguration() || testngMethod.isBeforeSuiteConfiguration() || testngMethod.isBeforeTestConfiguration() || testngMethod.isAfterClassConfiguration() || testngMethod.isAfterGroupsConfiguration() || testngMethod.isAfterMethodConfiguration() || testngMethod.isAfterSuiteConfiguration() || testngMethod.isAfterTestConfiguration() || shouldRun( testngMethod ); } public static void setTestListResolver( TestListResolver testListResolver ) { MethodSelector.testListResolver = testListResolver; } private static boolean shouldRun( ITestNGMethod test ) { TestListResolver resolver = testListResolver; boolean hasTestResolver = resolver != null && !resolver.isEmpty(); if ( hasTestResolver ) { boolean run = false; for ( Class clazz = test.getRealClass(); !run && clazz != Object.class; clazz = clazz.getSuperclass() ) { run = resolver.shouldRun( clazz, test.getMethodName() ); } return run; } return false; } } Stoppable.java000066400000000000000000000022771330756104600432660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/main/java/org/apache/maven/surefire/testng/utilspackage org.apache.maven.surefire.testng.utils; /* * 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. */ /** * Covers configuration parameter {@code skipAfterFailureCount}. * * @author Tibor Digana (tibor17) * @since 2.19 */ public interface Stoppable { /** * Delegates this call to {@link org.apache.maven.surefire.report.RunListener#testExecutionSkippedByUser()}. */ void fireStopEvent(); } maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/test/000077500000000000000000000000001330756104600302455ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/test/java/000077500000000000000000000000001330756104600311665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/test/java/testng/000077500000000000000000000000001330756104600324725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/test/java/testng/utils/000077500000000000000000000000001330756104600336325ustar00rootroot00000000000000BaseClassSample.java000066400000000000000000000016471330756104600374300ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/test/java/testng/utilspackage testng.utils; /* * 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. */ public abstract class BaseClassSample { public void baseClassMethodToBeIncluded() { } } ChildClassSample.java000066400000000000000000000016621330756104600375760ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/test/java/testng/utilspackage testng.utils; /* * 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. */ public class ChildClassSample extends BaseClassSample { public void subClassMethod() { } } MethodSelectorTest.java000066400000000000000000000215771330756104600402130ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng-utils/src/test/java/testng/utilspackage testng.utils; /* * 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. */ import junit.framework.TestCase; import org.apache.maven.surefire.testng.utils.MethodSelector; import org.apache.maven.surefire.testset.TestListResolver; import org.testng.IClass; import org.testng.IRetryAnalyzer; import org.testng.ITestClass; import org.testng.ITestNGMethod; import org.testng.internal.DefaultMethodSelectorContext; import java.lang.reflect.Method; public class MethodSelectorTest extends TestCase { public void testInclusionOfMethodFromBaseClass() { MethodSelector selector = new MethodSelector(); DefaultMethodSelectorContext context = new DefaultMethodSelectorContext(); ITestNGMethod testngMethod = new FakeTestNGMethod( ChildClassSample.class, "baseClassMethodToBeIncluded" ); TestListResolver resolver = new TestListResolver( BaseClassSample.class.getName() + "#baseClassMethodToBeIncluded" ); MethodSelector.setTestListResolver( resolver ); boolean include = selector.includeMethod( context, testngMethod, true ); assertTrue( include ); } public void testNoInclusionOfMethodFromBaseClass() { MethodSelector selector = new MethodSelector(); DefaultMethodSelectorContext context = new DefaultMethodSelectorContext(); ITestNGMethod testngMethod = new FakeTestNGMethod( ChildClassSample.class, "baseClassMethodToBeIncluded" ); TestListResolver resolver = new TestListResolver( BaseClassSample.class.getName() + "#nonExistedMethod" ); MethodSelector.setTestListResolver( resolver ); boolean include = selector.includeMethod( context, testngMethod, true ); assertFalse( include ); } public void testInclusionOfMethodFromSubClass() { MethodSelector selector = new MethodSelector(); DefaultMethodSelectorContext context = new DefaultMethodSelectorContext(); ITestNGMethod testngMethod = new FakeTestNGMethod( ChildClassSample.class, "subClassMethod" ); TestListResolver resolver = new TestListResolver( ChildClassSample.class.getName() + "#sub*" ); MethodSelector.setTestListResolver( resolver ); boolean include = selector.includeMethod( context, testngMethod, true ); assertTrue( include ); } private static class FakeTestNGMethod implements ITestNGMethod { private final Class clazz; private final String methodName; FakeTestNGMethod( Class clazz, String methodName ) { this.clazz = clazz; this.methodName = methodName; } @Override public Class getRealClass() { return clazz; } @Override public ITestClass getTestClass() { return null; } @Override public void setTestClass( ITestClass iTestClass ) { } @Override public Method getMethod() { return null; } @Override public String getMethodName() { return methodName; } @Override public Object[] getInstances() { return new Object[0]; } @Override public long[] getInstanceHashCodes() { return new long[0]; } @Override public String[] getGroups() { return new String[0]; } @Override public String[] getGroupsDependedUpon() { return new String[0]; } @Override public String getMissingGroup() { return null; } @Override public void setMissingGroup( String s ) { } @Override public String[] getBeforeGroups() { return new String[0]; } @Override public String[] getAfterGroups() { return new String[0]; } @Override public String[] getMethodsDependedUpon() { return new String[0]; } @Override public void addMethodDependedUpon( String s ) { } @Override public boolean isTest() { return false; } @Override public boolean isBeforeMethodConfiguration() { return false; } @Override public boolean isAfterMethodConfiguration() { return false; } @Override public boolean isBeforeClassConfiguration() { return false; } @Override public boolean isAfterClassConfiguration() { return false; } @Override public boolean isBeforeSuiteConfiguration() { return false; } @Override public boolean isAfterSuiteConfiguration() { return false; } @Override public boolean isBeforeTestConfiguration() { return false; } @Override public boolean isAfterTestConfiguration() { return false; } @Override public boolean isBeforeGroupsConfiguration() { return false; } @Override public boolean isAfterGroupsConfiguration() { return false; } @Override public long getTimeOut() { return 0; } @Override public int getInvocationCount() { return 0; } @Override public void setInvocationCount( int i ) { } @Override public int getSuccessPercentage() { return 0; } @Override public String getId() { return null; } @Override public void setId( String s ) { } @Override public long getDate() { return 0; } @Override public void setDate( long l ) { } @Override public boolean canRunFromClass( IClass iClass ) { return false; } @Override public boolean isAlwaysRun() { return false; } @Override public int getThreadPoolSize() { return 0; } @Override public void setThreadPoolSize( int i ) { } @Override public String getDescription() { return null; } @Override public void incrementCurrentInvocationCount() { } @Override public int getCurrentInvocationCount() { return 0; } @Override public void setParameterInvocationCount( int i ) { } @Override public int getParameterInvocationCount() { return 0; } @Override public ITestNGMethod clone() { try { return ( ITestNGMethod ) super.clone(); } catch ( CloneNotSupportedException e ) { throw new RuntimeException( e ); } } @Override public IRetryAnalyzer getRetryAnalyzer() { return null; } @Override public void setRetryAnalyzer( IRetryAnalyzer iRetryAnalyzer ) { } @Override public boolean skipFailedInvocations() { return false; } @Override public void setSkipFailedInvocations( boolean b ) { } @Override public long getInvocationTimeOut() { return 0; } @Override public boolean ignoreMissingDependencies() { return false; } @Override public void setIgnoreMissingDependencies( boolean b ) { } @Override public int compareTo( Object o ) { return 0; } } } maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/000077500000000000000000000000001330756104600253415ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/pom.xml000066400000000000000000000053361330756104600266650ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire-providers 2.22.0 surefire-testng SureFire TestNG Runner SureFire TestNG Runner junit junit 3.8.2 provided org.apache.maven.surefire common-java5 ${project.version} org.apache.maven.surefire surefire-testng-utils ${project.version} org.testng testng 5.10 jdk15 provided src/main/resources/META-INF META-INF maven-surefire-plugin org.apache.maven.surefire surefire-shadefire 2.12.4 maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/000077500000000000000000000000001330756104600261305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/000077500000000000000000000000001330756104600270545ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/000077500000000000000000000000001330756104600277755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/000077500000000000000000000000001330756104600305645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/000077500000000000000000000000001330756104600320055ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600331135ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600346605ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maventestng/000077500000000000000000000000001330756104600361645ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefireConfigurationAwareTestNGReporter.java000066400000000000000000000024541330756104600454330ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testngpackage org.apache.maven.surefire.testng; /* * 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. */ import org.apache.maven.surefire.report.RunListener; import org.testng.internal.IResultListener; /** * Just like TestNGReporter, but explicitly implements IResultListener; this interface is new in TestNG 5.5 * * @author Dan Fabulich */ public class ConfigurationAwareTestNGReporter extends TestNGReporter implements IResultListener { public ConfigurationAwareTestNGReporter( RunListener reportManager ) { super( reportManager ); } } TestNGDirectoryTestSuite.java000066400000000000000000000202001330756104600437240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testngpackage org.apache.maven.surefire.testng; /* * 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. */ import java.io.File; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.maven.surefire.cli.CommandLineOption; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.TestsToRun; import static org.apache.maven.surefire.testng.TestNGExecutor.run; import static org.apache.maven.surefire.util.internal.StringUtils.isBlank; /** * Test suite for TestNG based on a directory of Java test classes. Can also execute JUnit tests. * * @author Brett Porter * @author Alex Popescu */ final class TestNGDirectoryTestSuite extends TestSuite { private final Map options; private final Map junitOptions; private final String testSourceDirectory; private final File reportsDirectory; private final TestListResolver methodFilter; private final Class junitTestClass; private final Class junitRunWithAnnotation; private final Class junitTestAnnotation; private final List mainCliOptions; private final int skipAfterFailureCount; TestNGDirectoryTestSuite( String testSourceDirectory, Map confOptions, File reportsDirectory, TestListResolver methodFilter, List mainCliOptions, int skipAfterFailureCount ) { this.options = confOptions; this.testSourceDirectory = testSourceDirectory; this.reportsDirectory = reportsDirectory; this.methodFilter = methodFilter; this.junitTestClass = findJUnitTestClass(); this.junitRunWithAnnotation = findJUnitRunWithAnnotation(); this.junitTestAnnotation = findJUnitTestAnnotation(); this.junitOptions = createJUnitOptions(); this.mainCliOptions = mainCliOptions; this.skipAfterFailureCount = skipAfterFailureCount; } void execute( TestsToRun testsToRun, RunListener reporterManager ) throws TestSetFailedException { if ( !testsToRun.allowEagerReading() ) { executeLazy( testsToRun, reporterManager ); } else if ( testsToRun.containsAtLeast( 2 ) ) { executeMulti( testsToRun, reporterManager ); } else if ( testsToRun.containsAtLeast( 1 ) ) { Class testClass = testsToRun.iterator().next(); executeSingleClass( reporterManager, testClass ); } } private void executeSingleClass( RunListener reporter, Class testClass ) throws TestSetFailedException { options.put( "suitename", testClass.getName() ); startTestSuite( reporter ); Map optionsToUse = isJUnitTest( testClass ) ? junitOptions : options; run( Collections.>singleton( testClass ), testSourceDirectory, optionsToUse, reporter, reportsDirectory, methodFilter, mainCliOptions, skipAfterFailureCount ); finishTestSuite( reporter ); } private void executeLazy( TestsToRun testsToRun, RunListener reporterManager ) throws TestSetFailedException { for ( Class testToRun : testsToRun ) { executeSingleClass( reporterManager, testToRun ); } } private static Class findJUnitTestClass() { return lookupClass( "junit.framework.Test" ); } private static Class findJUnitRunWithAnnotation() { return lookupAnnotation( "org.junit.runner.RunWith" ); } private static Class findJUnitTestAnnotation() { return lookupAnnotation( "org.junit.Test" ); } @SuppressWarnings( "unchecked" ) private static Class lookupAnnotation( String className ) { try { return (Class) Class.forName( className ); } catch ( ClassNotFoundException e ) { return null; } } private static Class lookupClass( String className ) { try { return Class.forName( className ); } catch ( ClassNotFoundException e ) { return null; } } private void executeMulti( TestsToRun testsToRun, RunListener reporterManager ) throws TestSetFailedException { List> testNgTestClasses = new ArrayList>(); List> junitTestClasses = new ArrayList>(); for ( Class testToRun : testsToRun ) { if ( isJUnitTest( testToRun ) ) { junitTestClasses.add( testToRun ); } else { testNgTestClasses.add( testToRun ); } } File testNgReportsDirectory = reportsDirectory, junitReportsDirectory = reportsDirectory; if ( !junitTestClasses.isEmpty() && !testNgTestClasses.isEmpty() ) { testNgReportsDirectory = new File( reportsDirectory, "testng-native-results" ); junitReportsDirectory = new File( reportsDirectory, "testng-junit-results" ); } startTestSuite( reporterManager ); run( testNgTestClasses, testSourceDirectory, options, reporterManager, testNgReportsDirectory, methodFilter, mainCliOptions, skipAfterFailureCount ); if ( !junitTestClasses.isEmpty() ) { run( junitTestClasses, testSourceDirectory, junitOptions, reporterManager, junitReportsDirectory, methodFilter, mainCliOptions, skipAfterFailureCount ); } finishTestSuite( reporterManager ); } private boolean isJUnitTest( Class c ) { return isJunit3Test( c ) || isJunit4Test( c ); } private boolean isJunit4Test( Class c ) { return hasJunit4RunWithAnnotation( c ) || hasJunit4TestAnnotation( c ); } private boolean hasJunit4RunWithAnnotation( Class c ) { return junitRunWithAnnotation != null && c.getAnnotation( junitRunWithAnnotation ) != null; } private boolean hasJunit4TestAnnotation( Class c ) { if ( junitTestAnnotation != null ) { for ( Method m : c.getMethods() ) { if ( m.getAnnotation( junitTestAnnotation ) != null ) { return true; } } } return false; } private boolean isJunit3Test( Class c ) { return junitTestClass != null && junitTestClass.isAssignableFrom( c ); } private Map createJUnitOptions() { Map junitOptions = new HashMap( options ); String onlyJUnit = options.get( "junit" ); if ( isBlank( onlyJUnit ) ) { onlyJUnit = "true"; } junitOptions.put( "junit", onlyJUnit ); return junitOptions; } @Override Map getOptions() { return options; } } TestNGExecutor.java000066400000000000000000000352621330756104600417220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testngpackage org.apache.maven.surefire.testng; /* * 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. */ import org.apache.maven.surefire.booter.ProviderParameterNames; import org.apache.maven.surefire.cli.CommandLineOption; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.testng.conf.Configurator; import org.apache.maven.surefire.testng.utils.FailFastEventsSingleton; import org.apache.maven.surefire.testng.utils.FailFastListener; import org.apache.maven.surefire.testng.utils.Stoppable; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.internal.StringUtils; import org.testng.TestNG; import org.testng.annotations.Test; import org.testng.xml.XmlClass; import org.testng.xml.XmlMethodSelector; import org.testng.xml.XmlSuite; import org.testng.xml.XmlTest; import java.io.File; import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import static org.apache.maven.surefire.cli.CommandLineOption.LOGGING_LEVEL_DEBUG; import static org.apache.maven.surefire.cli.CommandLineOption.SHOW_ERRORS; import static org.apache.maven.surefire.util.ReflectionUtils.instantiate; import static org.apache.maven.surefire.util.ReflectionUtils.tryLoadClass; import static org.apache.maven.surefire.util.internal.ConcurrencyUtils.countDownToZero; /** * Contains utility methods for executing TestNG. * * @author Brett Porter * @author Alex Popescu */ final class TestNGExecutor { /** The default name for a suite launched from the maven surefire plugin */ private static final String DEFAULT_SUREFIRE_SUITE_NAME = "Surefire suite"; /** The default name for a test launched from the maven surefire plugin */ private static final String DEFAULT_SUREFIRE_TEST_NAME = "Surefire test"; private static final boolean HAS_TEST_ANNOTATION_ON_CLASSPATH = tryLoadClass( TestNGExecutor.class.getClassLoader(), "org.testng.annotations.Test" ) != null; private TestNGExecutor() { throw new IllegalStateException( "not instantiable constructor" ); } @SuppressWarnings( "checkstyle:parameternumbercheck" ) static void run( Iterable> testClasses, String testSourceDirectory, Map options, // string,string because TestNGMapConfigurator#configure() RunListener reportManager, File reportsDirectory, TestListResolver methodFilter, List mainCliOptions, int skipAfterFailureCount ) throws TestSetFailedException { TestNG testng = new TestNG( true ); Configurator configurator = getConfigurator( options.get( "testng.configurator" ) ); if ( isCliDebugOrShowErrors( mainCliOptions ) ) { System.out.println( "Configuring TestNG with: " + configurator.getClass().getSimpleName() ); } XmlMethodSelector groupMatchingSelector = createGroupMatchingSelector( options ); XmlMethodSelector methodNameFilteringSelector = createMethodNameFilteringSelector( methodFilter ); Map suitesNames = new HashMap(); List xmlSuites = new ArrayList(); for ( Class testClass : testClasses ) { TestMetadata metadata = findTestMetadata( testClass ); SuiteAndNamedTests suiteAndNamedTests = suitesNames.get( metadata.suiteName ); if ( suiteAndNamedTests == null ) { suiteAndNamedTests = new SuiteAndNamedTests(); suiteAndNamedTests.xmlSuite.setName( metadata.suiteName ); configurator.configure( suiteAndNamedTests.xmlSuite, options ); xmlSuites.add( suiteAndNamedTests.xmlSuite ); suitesNames.put( metadata.suiteName, suiteAndNamedTests ); } XmlTest xmlTest = suiteAndNamedTests.testNameToTest.get( metadata.testName ); if ( xmlTest == null ) { xmlTest = new XmlTest( suiteAndNamedTests.xmlSuite ); xmlTest.setName( metadata.testName ); addSelector( xmlTest, groupMatchingSelector ); addSelector( xmlTest, methodNameFilteringSelector ); xmlTest.setXmlClasses( new ArrayList() ); suiteAndNamedTests.testNameToTest.put( metadata.testName, xmlTest ); } xmlTest.getXmlClasses().add( new XmlClass( testClass.getName() ) ); } testng.setXmlSuites( xmlSuites ); configurator.configure( testng, options ); postConfigure( testng, testSourceDirectory, reportManager, reportsDirectory, skipAfterFailureCount, extractVerboseLevel( options ) ); testng.run(); } private static boolean isCliDebugOrShowErrors( List mainCliOptions ) { return mainCliOptions.contains( LOGGING_LEVEL_DEBUG ) || mainCliOptions.contains( SHOW_ERRORS ); } private static TestMetadata findTestMetadata( Class testClass ) { TestMetadata result = new TestMetadata(); if ( HAS_TEST_ANNOTATION_ON_CLASSPATH ) { Test testAnnotation = findAnnotation( testClass, Test.class ); if ( null != testAnnotation ) { if ( !StringUtils.isBlank( testAnnotation.suiteName() ) ) { result.suiteName = testAnnotation.suiteName(); } if ( !StringUtils.isBlank( testAnnotation.testName() ) ) { result.testName = testAnnotation.testName(); } } } return result; } private static T findAnnotation( Class clazz, Class annotationType ) { if ( clazz == null ) { return null; } T result = clazz.getAnnotation( annotationType ); if ( result != null ) { return result; } return findAnnotation( clazz.getSuperclass(), annotationType ); } private static class TestMetadata { private String testName = DEFAULT_SUREFIRE_TEST_NAME; private String suiteName = DEFAULT_SUREFIRE_SUITE_NAME; } private static class SuiteAndNamedTests { private XmlSuite xmlSuite = new XmlSuite(); private Map testNameToTest = new HashMap(); } private static void addSelector( XmlTest xmlTest, XmlMethodSelector selector ) { if ( selector != null ) { xmlTest.getMethodSelectors().add( selector ); } } @SuppressWarnings( "checkstyle:magicnumber" ) private static XmlMethodSelector createMethodNameFilteringSelector( TestListResolver methodFilter ) throws TestSetFailedException { if ( methodFilter != null && !methodFilter.isEmpty() ) { // the class is available in the testClassPath String clazzName = "org.apache.maven.surefire.testng.utils.MethodSelector"; try { Class clazz = Class.forName( clazzName ); Method method = clazz.getMethod( "setTestListResolver", TestListResolver.class ); method.invoke( null, methodFilter ); } catch ( Exception e ) { throw new TestSetFailedException( e.getMessage(), e ); } XmlMethodSelector xms = new XmlMethodSelector(); xms.setName( clazzName ); // looks to need a high value xms.setPriority( 10000 ); return xms; } else { return null; } } @SuppressWarnings( "checkstyle:magicnumber" ) private static XmlMethodSelector createGroupMatchingSelector( Map options ) throws TestSetFailedException { final String groups = options.get( ProviderParameterNames.TESTNG_GROUPS_PROP ); final String excludedGroups = options.get( ProviderParameterNames.TESTNG_EXCLUDEDGROUPS_PROP ); if ( groups == null && excludedGroups == null ) { return null; } // the class is available in the testClassPath final String clazzName = "org.apache.maven.surefire.testng.utils.GroupMatcherMethodSelector"; try { Class clazz = Class.forName( clazzName ); // HORRIBLE hack, but TNG doesn't allow us to setup a method selector instance directly. Method method = clazz.getMethod( "setGroups", String.class, String.class ); method.invoke( null, groups, excludedGroups ); } catch ( Exception e ) { throw new TestSetFailedException( e.getMessage(), e ); } XmlMethodSelector xms = new XmlMethodSelector(); xms.setName( clazzName ); // looks to need a high value xms.setPriority( 9999 ); return xms; } static void run( List suiteFiles, String testSourceDirectory, Map options, // string,string because TestNGMapConfigurator#configure() RunListener reportManager, File reportsDirectory, int skipAfterFailureCount ) throws TestSetFailedException { TestNG testng = new TestNG( true ); Configurator configurator = getConfigurator( options.get( "testng.configurator" ) ); configurator.configure( testng, options ); postConfigure( testng, testSourceDirectory, reportManager, reportsDirectory, skipAfterFailureCount, extractVerboseLevel( options ) ); testng.setTestSuites( suiteFiles ); testng.run(); } private static Configurator getConfigurator( String className ) { try { return (Configurator) Class.forName( className ).newInstance(); } catch ( InstantiationException e ) { throw new RuntimeException( e ); } catch ( IllegalAccessException e ) { throw new RuntimeException( e ); } catch ( ClassNotFoundException e ) { throw new RuntimeException( e ); } } private static void postConfigure( TestNG testNG, String sourcePath, final RunListener reportManager, File reportsDirectory, int skipAfterFailureCount, int verboseLevel ) { // 0 (default): turn off all TestNG output testNG.setVerbose( verboseLevel ); TestNGReporter reporter = createTestNGReporter( reportManager ); testNG.addListener( (Object) reporter ); if ( skipAfterFailureCount > 0 ) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); testNG.addListener( instantiate( cl, "org.apache.maven.surefire.testng.utils.FailFastNotifier", Object.class ) ); testNG.addListener( new FailFastListener( createStoppable( reportManager, skipAfterFailureCount ) ) ); } // FIXME: use classifier to decide if we need to pass along the source dir (only for JDK14) if ( sourcePath != null ) { testNG.setSourcePath( sourcePath ); } testNG.setOutputDirectory( reportsDirectory.getAbsolutePath() ); } private static Stoppable createStoppable( final RunListener reportManager, int skipAfterFailureCount ) { final AtomicInteger currentFaultCount = new AtomicInteger( skipAfterFailureCount ); return new Stoppable() { @Override public void fireStopEvent() { if ( countDownToZero( currentFaultCount ) ) { FailFastEventsSingleton.getInstance().setSkipOnNextTest(); } reportManager.testExecutionSkippedByUser(); } }; } // If we have access to IResultListener, return a ConfigurationAwareTestNGReporter // But don't cause NoClassDefFoundErrors if it isn't available; just return a regular TestNGReporter instead private static TestNGReporter createTestNGReporter( RunListener reportManager ) { try { Class.forName( "org.testng.internal.IResultListener" ); Class c = Class.forName( "org.apache.maven.surefire.testng.ConfigurationAwareTestNGReporter" ); @SuppressWarnings( "unchecked" ) Constructor ctor = c.getConstructor( RunListener.class ); return (TestNGReporter) ctor.newInstance( reportManager ); } catch ( InvocationTargetException e ) { throw new RuntimeException( "Bug in ConfigurationAwareTestNGReporter", e.getCause() ); } catch ( ClassNotFoundException e ) { return new TestNGReporter( reportManager ); } catch ( Exception e ) { throw new RuntimeException( "Bug in ConfigurationAwareTestNGReporter", e ); } } private static int extractVerboseLevel( Map options ) throws TestSetFailedException { try { String verbose = options.get( "surefire.testng.verbose" ); return verbose == null ? 0 : Integer.parseInt( verbose ); } catch ( NumberFormatException e ) { throw new TestSetFailedException( "Provider property 'surefire.testng.verbose' should refer to " + "number -1 (debug mode), 0, 1 .. 10 (most detailed).", e ); } } } TestNGProvider.java000066400000000000000000000213351330756104600417120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testngpackage org.apache.maven.surefire.testng; /* * 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. */ import org.apache.maven.surefire.booter.Command; import org.apache.maven.surefire.booter.CommandListener; import org.apache.maven.surefire.booter.CommandReader; import org.apache.maven.surefire.cli.CommandLineOption; import org.apache.maven.surefire.providerapi.AbstractProvider; import org.apache.maven.surefire.providerapi.ProviderParameters; import org.apache.maven.surefire.report.ConsoleOutputReceiver; import org.apache.maven.surefire.report.ReporterConfiguration; import org.apache.maven.surefire.report.ReporterFactory; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.suite.RunResult; import org.apache.maven.surefire.testng.utils.FailFastEventsSingleton; import org.apache.maven.surefire.testset.TestListResolver; import org.apache.maven.surefire.testset.TestRequest; import org.apache.maven.surefire.testset.TestSetFailedException; import org.apache.maven.surefire.util.RunOrderCalculator; import org.apache.maven.surefire.util.ScanResult; import org.apache.maven.surefire.util.TestsToRun; import java.io.File; import java.util.Collection; import java.util.List; import java.util.Map; import static org.apache.maven.surefire.booter.CommandReader.getReader; import static org.apache.maven.surefire.report.ConsoleOutputCapture.startCapture; import static org.apache.maven.surefire.testset.TestListResolver.getEmptyTestListResolver; import static org.apache.maven.surefire.testset.TestListResolver.optionallyWildcardFilter; import static org.apache.maven.surefire.util.TestsToRun.fromClass; /** * @author Kristian Rosenvold */ public class TestNGProvider extends AbstractProvider { private final Map providerProperties; private final ReporterConfiguration reporterConfiguration; private final ClassLoader testClassLoader; private final ScanResult scanResult; private final TestRequest testRequest; private final ProviderParameters providerParameters; private final RunOrderCalculator runOrderCalculator; private final List mainCliOptions; private final CommandReader commandsReader; private TestsToRun testsToRun; public TestNGProvider( ProviderParameters bootParams ) { // don't start a thread in CommandReader while we are in in-plugin process commandsReader = bootParams.isInsideFork() ? getReader().setShutdown( bootParams.getShutdown() ) : null; providerParameters = bootParams; testClassLoader = bootParams.getTestClassLoader(); runOrderCalculator = bootParams.getRunOrderCalculator(); providerProperties = bootParams.getProviderProperties(); testRequest = bootParams.getTestRequest(); reporterConfiguration = bootParams.getReporterConfiguration(); scanResult = bootParams.getScanResult(); mainCliOptions = bootParams.getMainCliOptions(); } @Override public RunResult invoke( Object forkTestSet ) throws TestSetFailedException { if ( isFailFast() && commandsReader != null ) { registerPleaseStopListener(); } final ReporterFactory reporterFactory = providerParameters.getReporterFactory(); final RunListener reporter = reporterFactory.createReporter(); /** * {@link org.apache.maven.surefire.report.ConsoleOutputCapture#startCapture(ConsoleOutputReceiver)} * called in prior to initializing variable {@link #testsToRun} */ startCapture( (ConsoleOutputReceiver) reporter ); RunResult runResult; try { if ( isTestNGXmlTestSuite( testRequest ) ) { if ( commandsReader != null ) { commandsReader.awaitStarted(); } TestNGXmlTestSuite testNGXmlTestSuite = newXmlSuite(); testNGXmlTestSuite.locateTestSets(); testNGXmlTestSuite.execute( reporter ); } else { if ( testsToRun == null ) { if ( forkTestSet instanceof TestsToRun ) { testsToRun = (TestsToRun) forkTestSet; } else if ( forkTestSet instanceof Class ) { testsToRun = fromClass( (Class) forkTestSet ); } else { testsToRun = scanClassPath(); } } if ( commandsReader != null ) { registerShutdownListener( testsToRun ); commandsReader.awaitStarted(); } TestNGDirectoryTestSuite suite = newDirectorySuite(); suite.execute( testsToRun, reporter ); } } finally { runResult = reporterFactory.close(); } return runResult; } boolean isTestNGXmlTestSuite( TestRequest testSuiteDefinition ) { Collection suiteXmlFiles = testSuiteDefinition.getSuiteXmlFiles(); return !suiteXmlFiles.isEmpty() && !hasSpecificTests(); } private boolean isFailFast() { return providerParameters.getSkipAfterFailureCount() > 0; } private int getSkipAfterFailureCount() { return isFailFast() ? providerParameters.getSkipAfterFailureCount() : 0; } private void registerShutdownListener( final TestsToRun testsToRun ) { commandsReader.addShutdownListener( new CommandListener() { @Override public void update( Command command ) { testsToRun.markTestSetFinished(); } } ); } private void registerPleaseStopListener() { commandsReader.addSkipNextTestsListener( new CommandListener() { @Override public void update( Command command ) { FailFastEventsSingleton.getInstance().setSkipOnNextTest(); } } ); } private TestNGDirectoryTestSuite newDirectorySuite() { return new TestNGDirectoryTestSuite( testRequest.getTestSourceDirectory().toString(), providerProperties, reporterConfiguration.getReportsDirectory(), getTestFilter(), mainCliOptions, getSkipAfterFailureCount() ); } private TestNGXmlTestSuite newXmlSuite() { return new TestNGXmlTestSuite( testRequest.getSuiteXmlFiles(), testRequest.getTestSourceDirectory().toString(), providerProperties, reporterConfiguration.getReportsDirectory(), getSkipAfterFailureCount() ); } @Override @SuppressWarnings( "unchecked" ) public Iterable> getSuites() { if ( isTestNGXmlTestSuite( testRequest ) ) { try { return newXmlSuite().locateTestSets(); } catch ( TestSetFailedException e ) { throw new RuntimeException( e ); } } else { testsToRun = scanClassPath(); return testsToRun; } } private TestsToRun scanClassPath() { final TestsToRun scanned = scanResult.applyFilter( null, testClassLoader ); return runOrderCalculator.orderTestClasses( scanned ); } private boolean hasSpecificTests() { TestListResolver specificTestPatterns = testRequest.getTestListResolver(); return !specificTestPatterns.isEmpty() && !specificTestPatterns.isWildcard(); } private TestListResolver getTestFilter() { TestListResolver filter = optionallyWildcardFilter( testRequest.getTestListResolver() ); return filter.isWildcard() ? getEmptyTestListResolver() : filter; } } TestNGReporter.java000066400000000000000000000135621330756104600417250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testngpackage org.apache.maven.surefire.testng; /* * 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. */ import org.apache.maven.surefire.report.CategorizedReportEntry; import org.apache.maven.surefire.report.PojoStackTraceWriter; import org.apache.maven.surefire.report.ReportEntry; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.SimpleReportEntry; import org.testng.ISuite; import org.testng.ISuiteListener; import org.testng.ITestContext; import org.testng.ITestListener; import org.testng.ITestResult; import static org.apache.maven.surefire.report.SimpleReportEntry.ignored; import static org.apache.maven.surefire.report.SimpleReportEntry.withException; /** * Listens for and provides and adaptor layer so that * TestNG tests can report their status to the current * {@link org.apache.maven.surefire.report.RunListener}. * * @author jkuhnert */ public class TestNGReporter implements ITestListener, ISuiteListener { private final RunListener reporter; /** * Constructs a new instance that will listen to * test updates from a {@link org.testng.TestNG} class instance. *
*
It is assumed that the requisite {@link org.testng.TestNG#addListener(ITestListener)} * method call has already associated with this instance before the test * suite is run. * * @param reportManager Instance to report suite status to */ public TestNGReporter( RunListener reportManager ) { this.reporter = reportManager; } @Override public void onTestStart( ITestResult result ) { String group = groupString( result.getMethod().getGroups(), result.getTestClass().getName() ); String userFriendlyTestName = getUserFriendlyTestName( result ); reporter.testStarting( new CategorizedReportEntry( getSource( result ), userFriendlyTestName, group ) ); } private String getSource( ITestResult result ) { return result.getTestClass().getName(); } @Override public void onTestSuccess( ITestResult result ) { ReportEntry report = new SimpleReportEntry( getSource( result ), getUserFriendlyTestName( result ) ); reporter.testSucceeded( report ); } @Override public void onTestFailure( ITestResult result ) { ReportEntry report = withException( getSource( result ), getUserFriendlyTestName( result ), new PojoStackTraceWriter( result.getTestClass().getRealClass().getName(), result.getMethod().getMethodName(), result.getThrowable() ) ); reporter.testFailed( report ); } private static String getUserFriendlyTestName( ITestResult result ) { // This is consistent with the JUnit output return result.getName() + "(" + result.getTestClass().getName() + ")"; } @Override public void onTestSkipped( ITestResult result ) { Throwable t = result.getThrowable(); String reason = t == null ? null : t.getMessage(); ReportEntry report = ignored( getSource( result ), getUserFriendlyTestName( result ), reason ); reporter.testSkipped( report ); } @Override public void onTestFailedButWithinSuccessPercentage( ITestResult result ) { ReportEntry report = withException( getSource( result ), getUserFriendlyTestName( result ), new PojoStackTraceWriter( result.getTestClass().getRealClass().getName(), result.getMethod().getMethodName(), result.getThrowable() ) ); reporter.testSucceeded( report ); } @Override public void onStart( ITestContext context ) { } @Override public void onFinish( ITestContext context ) { } @Override public void onStart( ISuite suite ) { } @Override public void onFinish( ISuite suite ) { } /** * Creates a string out of the list of testng groups in the * form of
"group1,group2,group3"
. * * @param groups The groups being run * @param defaultValue The default to use if no groups * @return a string describing the groups */ private static String groupString( String[] groups, String defaultValue ) { String retVal; if ( groups != null && groups.length > 0 ) { StringBuilder str = new StringBuilder(); for ( int i = 0; i < groups.length; i++ ) { str.append( groups[i] ); if ( i + 1 < groups.length ) { str.append( "," ); } } retVal = str.toString(); } else { retVal = defaultValue; } return retVal; } public void onConfigurationFailure( ITestResult result ) { onTestFailure( result ); } public void onConfigurationSkip( ITestResult result ) { onTestSkipped( result ); } public void onConfigurationSuccess( ITestResult result ) { // DGF Don't record configuration successes as separate tests //onTestSuccess( result ); } } TestNGXmlTestSuite.java000066400000000000000000000070521330756104600425320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testngpackage org.apache.maven.surefire.testng; /* * 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. */ import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.testset.TestSetFailedException; import static org.apache.maven.surefire.testng.TestNGExecutor.run; /** * Handles suite xml file definitions for TestNG. * * @author jkuhnert * @author Alex Popescu */ final class TestNGXmlTestSuite extends TestSuite { private final List suiteFiles; private List suiteFilePaths; private final String testSourceDirectory; private final Map options; private final File reportsDirectory; private final int skipAfterFailureCount; /** * Creates a testng testset to be configured by the specified * xml file(s). The XML files are suite definitions files according to TestNG DTD. */ TestNGXmlTestSuite( List suiteFiles, String testSourceDirectory, Map confOptions, File reportsDirectory, int skipAfterFailureCount ) { this.suiteFiles = suiteFiles; this.options = confOptions; this.testSourceDirectory = testSourceDirectory; this.reportsDirectory = reportsDirectory; this.skipAfterFailureCount = skipAfterFailureCount; } void execute( RunListener reporter ) throws TestSetFailedException { if ( suiteFilePaths == null ) { throw new IllegalStateException( "You must call locateTestSets before calling execute" ); } startTestSuite( reporter ); run( suiteFilePaths, testSourceDirectory, options, reporter, reportsDirectory, skipAfterFailureCount ); finishTestSuite( reporter ); } Iterable locateTestSets() throws TestSetFailedException { if ( suiteFilePaths != null ) { throw new IllegalStateException( "You can't call locateTestSets twice" ); } if ( suiteFiles.isEmpty() ) { throw new IllegalStateException( "No suite files were specified" ); } suiteFilePaths = new ArrayList( suiteFiles.size() ); ArrayList testSets = new ArrayList( suiteFiles.size() ); for ( File suiteFile : suiteFiles ) { if ( !suiteFile.isFile() ) { throw new TestSetFailedException( "Suite file " + suiteFile + " is not a valid file" ); } testSets.add( suiteFile ); suiteFilePaths.add( suiteFile.getAbsolutePath() ); } return testSets; } @Override Map getOptions() { return options; } } TestSuite.java000066400000000000000000000041131330756104600407570ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testngpackage org.apache.maven.surefire.testng; /* * 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. */ import org.apache.maven.surefire.report.ReporterException; import org.apache.maven.surefire.report.RunListener; import org.apache.maven.surefire.report.SimpleReportEntry; import org.apache.maven.surefire.report.TestSetReportEntry; import java.util.Map; import static org.apache.maven.surefire.util.internal.ObjectUtils.systemProps; /** * Abstract class which implements common functions. */ abstract class TestSuite { abstract Map getOptions(); final String getSuiteName() { String result = getOptions().get( "suitename" ); return result == null ? "TestSuite" : result; } final void startTestSuite( RunListener reporterManager ) { TestSetReportEntry report = new SimpleReportEntry( getClass().getName(), getSuiteName(), systemProps() ); try { reporterManager.testSetStarting( report ); } catch ( ReporterException e ) { // TODO: remove this exception from the report manager } } final void finishTestSuite( RunListener reporterManager ) { SimpleReportEntry report = new SimpleReportEntry( getClass().getName(), getSuiteName(), systemProps() ); reporterManager.testSetCompleted( report ); } } conf/000077500000000000000000000000001330756104600371115ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testngAbstractDirectConfigurator.java000066400000000000000000000146361330756104600452470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.maven.surefire.booter.ProviderParameterNames; import org.apache.maven.surefire.testset.TestSetFailedException; import org.testng.TestNG; import org.testng.xml.XmlSuite; /** * Configurator that relies on reflection to set parameters in TestNG * */ public abstract class AbstractDirectConfigurator implements Configurator { final Map setters; AbstractDirectConfigurator() { Map options = new HashMap(); // options.put( ProviderParameterNames.TESTNG_GROUPS_PROP, new Setter( "setGroups", String.class ) ); // options.put( ProviderParameterNames.TESTNG_EXCLUDEDGROUPS_PROP, new Setter( "setExcludedGroups", String.class // ) ); options.put( "junit", new Setter( "setJUnit", Boolean.class ) ); options.put( ProviderParameterNames.THREADCOUNT_PROP, new Setter( "setThreadCount", int.class ) ); options.put( "usedefaultlisteners", new Setter( "setUseDefaultListeners", boolean.class ) ); this.setters = options; } @Override public void configure( TestNG testng, Map options ) throws TestSetFailedException { System.out.println( "\n\n\n\nCONFIGURING TESTNG\n\n\n\n" ); // kind of ugly, but listeners are configured differently final String listeners = options.remove( "listener" ); // DGF In 4.7, default listeners dump XML files in the surefire-reports directory, // confusing the report plugin. This was fixed in later versions. testng.setUseDefaultListeners( false ); configureInstance( testng, options ); // TODO: we should have the Profile so that we can decide if this is needed or not testng.setListenerClasses( loadListenerClasses( listeners ) ); } @Override public void configure( XmlSuite suite, Map options ) throws TestSetFailedException { Map filtered = filterForSuite( options ); configureInstance( suite, filtered ); } protected Map filterForSuite( Map options ) { Map result = new HashMap(); addPropIfNotNull( options, result, ProviderParameterNames.PARALLEL_PROP ); addPropIfNotNull( options, result, ProviderParameterNames.THREADCOUNT_PROP ); return result; } private void addPropIfNotNull( Map options, Map result, String prop ) { if ( options.containsKey( prop ) ) { result.put( prop, options.get( prop ) ); } } private void configureInstance( Object testngInstance, Map options ) { for ( Map.Entry entry : options.entrySet() ) { String key = entry.getKey(); String val = entry.getValue(); Setter setter = setters.get( key ); if ( setter != null ) { try { setter.invoke( testngInstance, val ); } catch ( Exception e ) { throw new RuntimeException( "Cannot set option " + key + " with value " + val, e ); } } } } static List loadListenerClasses( String listenerClasses ) throws TestSetFailedException { if ( listenerClasses == null || listenerClasses.trim().isEmpty() ) { return new ArrayList(); } List classes = new ArrayList(); String[] classNames = listenerClasses.split( "\\s*,\\s*(\\r?\\n)?\\s*" ); for ( String className : classNames ) { Class clazz = loadClass( className ); classes.add( clazz ); } return classes; } static Class loadClass( String className ) throws TestSetFailedException { try { return Class.forName( className ); } catch ( Exception ex ) { throw new TestSetFailedException( "Cannot find listener class " + className, ex ); } } /** * Describes a property setter by method name and parameter class * */ public static final class Setter { private final String setterName; private final Class paramClass; public Setter( String name, Class clazz ) { setterName = name; paramClass = clazz; } public void invoke( Object target, String value ) throws Exception { Method setter = target.getClass().getMethod( setterName, paramClass ); if ( setter != null ) { setter.invoke( target, convertValue( value ) ); } } private Object convertValue( String value ) { if ( value == null ) { return null; } if ( paramClass.isAssignableFrom( value.getClass() ) ) { return value; } if ( Boolean.class.equals( paramClass ) || boolean.class.equals( paramClass ) ) { return Boolean.valueOf( value ); } if ( Integer.class.equals( paramClass ) || int.class.equals( paramClass ) ) { return Integer.valueOf( value ); } return value; } } } Configurator.java000066400000000000000000000024541330756104600424230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import java.util.Map; import org.apache.maven.surefire.testset.TestSetFailedException; import org.testng.TestNG; import org.testng.xml.XmlSuite; /** * Configurator for passing configuration properties to TestNG * */ public interface Configurator { void configure( TestNG testng, Map options ) throws TestSetFailedException; void configure ( XmlSuite suite, Map options ) throws TestSetFailedException; }TestNG4751Configurator.java000066400000000000000000000026051330756104600440270ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import org.apache.maven.surefire.booter.ProviderParameterNames; /** * TestNG 4.7 and 5.1 configurator. *
* Allowed options: * -groups * -excludedgroups * -junit (boolean) * -threadcount (int) * -parallel (boolean) *
* * @author Alex Popescu */ public class TestNG4751Configurator extends AbstractDirectConfigurator { public TestNG4751Configurator() { setters.put( ProviderParameterNames.PARALLEL_PROP, new Setter( "setParallel", boolean.class ) ); } }TestNG510Configurator.java000066400000000000000000000030471330756104600437350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import org.apache.maven.surefire.testset.TestSetFailedException; import org.testng.xml.XmlSuite; import java.util.Map; /** * TestNG 5.10 configurator. Added support of dataproviderthreadcount. * * @since 2.19 */ public class TestNG510Configurator extends TestNGMapConfigurator { @Override public void configure( XmlSuite suite, Map options ) throws TestSetFailedException { super.configure( suite, options ); String dataProviderThreadCount = options.get( "dataproviderthreadcount" ); if ( dataProviderThreadCount != null ) { suite.setDataProviderThreadCount( Integer.parseInt( dataProviderThreadCount ) ); } } } TestNG513Configurator.java000066400000000000000000000037561330756104600437470ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import org.apache.maven.surefire.testset.TestSetFailedException; /** * TestNG 5.13 configurator. Changed: "reporterslist" need String instead of List<ReporterConfig>. */ public class TestNG513Configurator extends TestNG510Configurator { @Override protected Object convertReporterConfig( Object val ) { return val; } @Override protected Object convertListeners( String listenerClasses ) throws TestSetFailedException { return convertListenersString( listenerClasses ); } static String convertListenersString( String listenerClasses ) { if ( listenerClasses == null || listenerClasses.trim().isEmpty() ) { return listenerClasses; } StringBuilder sb = new StringBuilder(); String[] classNames = listenerClasses.split( "\\s*,\\s*(\\r?\\n)?\\s*" ); for ( int i = 0; i < classNames.length; i++ ) { String className = classNames[i]; sb.append( className ); if ( i < classNames.length - 1 ) { sb.append( ',' ); } } return sb.toString(); } } TestNG5141Configurator.java000066400000000000000000000027511330756104600440230ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import org.apache.maven.surefire.testset.TestSetFailedException; /** * TestNG 5.14.1 configurator. Changed: "listener" use List instead of String. */ public class TestNG5141Configurator extends TestNG513Configurator { @Override protected Object convertListeners( String listenerClasses ) throws TestSetFailedException { // TODO "configure(CommandLineArgs)", which should replace "configure(Map)", doesn't have the issue throw new TestSetFailedException( "Due to an internal TestNG issue, " + "the listener feature of TestNG is not supported with 5.14.1 and 5.14.2" ); } } TestNG5143Configurator.java000066400000000000000000000040171330756104600440220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import java.util.Map; import org.apache.maven.surefire.testset.TestSetFailedException; /** * TestNG 5.14.3 configurator. Changed: "reporterslist" replaced by "reporter", * and "listener" can use String instead of List<Class>. */ public class TestNG5143Configurator extends TestNG5141Configurator { @Override Map getConvertedOptions( Map options ) throws TestSetFailedException { Map convertedOptions = super.getConvertedOptions( options ); for ( Map.Entry entry : convertedOptions.entrySet() ) { String key = entry.getKey(); if ( "-reporterslist".equals( key ) ) { convertedOptions.remove( "-reporterslist" ); Object value = entry.getValue(); convertedOptions.put( "-reporter", value ); break; } } return convertedOptions; } @Override protected Object convertListeners( String listenerClasses ) throws TestSetFailedException { return convertListenersString( listenerClasses ); } } TestNG52Configurator.java000066400000000000000000000025671330756104600436640ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import org.apache.maven.surefire.booter.ProviderParameterNames; /** * TestNG 5.2 configurator. *
* Allowed options: * -groups * -excludedgroups * -junit (boolean) * -threadcount (int) * -parallel (String) *
* * @author Alex Popescu */ public class TestNG52Configurator extends AbstractDirectConfigurator { public TestNG52Configurator() { setters.put( ProviderParameterNames.PARALLEL_PROP, new Setter( "setParallel", String.class ) ); } }TestNG60Configurator.java000066400000000000000000000035771330756104600436650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import java.util.Map; import java.util.Map.Entry; import org.apache.maven.surefire.testset.TestSetFailedException; /** * TestNG 6.0 configurator. Changed objectFactory type to String. * Configuring -objectfactory and -testrunfactory. * * @author Marvin Froeder * @since 2.13 */ public class TestNG60Configurator extends TestNG5143Configurator { @Override Map getConvertedOptions( Map options ) throws TestSetFailedException { Map convertedOptions = super.getConvertedOptions( options ); for ( Entry entry : convertedOptions.entrySet() ) { String key = entry.getKey(); if ( "-objectfactory".equals( key ) || "-testrunfactory".equals( key ) ) { Class value = (Class) entry.getValue(); convertedOptions.put( key, value.getName() ); break; } } return convertedOptions; } } TestNGMapConfigurator.java000077500000000000000000000162141330756104600441500ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import org.apache.maven.surefire.testset.TestSetFailedException; import org.testng.TestNG; import org.testng.xml.XmlSuite; import static java.lang.Integer.parseInt; import static org.apache.maven.surefire.booter.ProviderParameterNames.PARALLEL_PROP; import static org.apache.maven.surefire.booter.ProviderParameterNames.THREADCOUNT_PROP; import static org.apache.maven.surefire.testng.conf.AbstractDirectConfigurator.loadListenerClasses; /** * TestNG configurator for 5.3+ versions. TestNG exposes a {@link org.testng.TestNG#configure(java.util.Map)} method. * All supported TestNG options are passed in String format, except * {@link org.testng.TestNGCommandLineArgs#LISTENER_COMMAND_OPT} which is {@link java.util.List List>Class<}, * {@link org.testng.TestNGCommandLineArgs#JUNIT_DEF_OPT} which is a {@link Boolean}, * {@link org.testng.TestNGCommandLineArgs#SKIP_FAILED_INVOCATION_COUNT_OPT} which is a {@link Boolean}, * {@link org.testng.TestNGCommandLineArgs#OBJECT_FACTORY_COMMAND_OPT} which is a {@link Class}, * {@link org.testng.TestNGCommandLineArgs#REPORTERS_LIST} which is a {@link java.util.List List>ReporterConfig<}. *
* Test classes and/or suite files are not passed along as options parameters, but configured separately. * * @author Alex Popescu */ public class TestNGMapConfigurator implements Configurator { @Override public void configure( TestNG testng, Map options ) throws TestSetFailedException { Map convertedOptions = getConvertedOptions( options ); testng.configure( convertedOptions ); } @Override public void configure( XmlSuite suite, Map options ) throws TestSetFailedException { String threadCountAsString = options.get( THREADCOUNT_PROP ); int threadCount = threadCountAsString == null ? 1 : parseInt( threadCountAsString ); suite.setThreadCount( threadCount ); String parallel = options.get( PARALLEL_PROP ); if ( parallel != null ) { suite.setParallel( parallel ); } } Map getConvertedOptions( Map options ) throws TestSetFailedException { Map convertedOptions = new HashMap(); convertedOptions.put( "-mixed", false ); for ( Map.Entry entry : options.entrySet() ) { String key = entry.getKey(); Object val = entry.getValue(); // todo: use switch-case of jdk7 if ( "listener".equals( key ) ) { val = convertListeners( entry.getValue() ); } else if ( "objectfactory".equals( key ) ) { val = AbstractDirectConfigurator.loadClass( entry.getValue() ); } else if ( "testrunfactory".equals( key ) ) { val = AbstractDirectConfigurator.loadClass( entry.getValue() ); } else if ( "reporter".equals( key ) ) { // for TestNG 5.6 or higher // TODO support multiple reporters? val = convertReporterConfig( val ); key = "reporterslist"; } else if ( "junit".equals( key ) ) { val = convert( val, Boolean.class ); } else if ( "skipfailedinvocationcounts".equals( key ) ) { val = convert( val, Boolean.class ); } else if ( "mixed".equals( key ) ) { val = convert( val, Boolean.class ); } else if ( "configfailurepolicy".equals( key ) ) { val = convert( val, String.class ); } else if ( "group-by-instances".equals( key ) ) { val = convert( val, Boolean.class ); } else if ( THREADCOUNT_PROP.equals( key ) ) { val = convert ( val, String.class ); } else if ( "suitethreadpoolsize".equals( key ) ) { // for TestNG 6.9.7 or higher val = convert( val, Integer.class ); } else if ( "dataproviderthreadcount".equals( key ) ) { // for TestNG 5.10 or higher val = convert( val, Integer.class ); } if ( key.startsWith( "-" ) ) { convertedOptions.put( key, val ); } else { convertedOptions.put( "-" + key, val ); } } return convertedOptions; } // ReporterConfig only became available in later versions of TestNG protected Object convertReporterConfig( Object val ) { try { Class reporterConfig = Class.forName( "org.testng.ReporterConfig" ); Method deserialize = reporterConfig.getMethod( "deserialize", String.class ); Object rc = deserialize.invoke( null, val ); ArrayList reportersList = new ArrayList(); reportersList.add( rc ); return reportersList; } catch ( Exception e ) { return val; } } protected Object convertListeners( String listenerClasses ) throws TestSetFailedException { return loadListenerClasses( listenerClasses ); } protected Object convert( Object val, Class type ) { if ( val == null ) { return null; } else if ( type.isAssignableFrom( val.getClass() ) ) { return val; } else if ( ( type == Boolean.class || type == boolean.class ) && val.getClass() == String.class ) { return Boolean.valueOf( (String) val ); } else if ( ( type == Integer.class || type == int.class ) && val.getClass() == String.class ) { return Integer.valueOf( (String) val ); } else if ( type == String.class ) { return val.toString(); } else { return val; } } }maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/resources/000077500000000000000000000000001330756104600310665ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/resources/META-INF/000077500000000000000000000000001330756104600322265ustar00rootroot00000000000000services/000077500000000000000000000000001330756104600337725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/resources/META-INForg.apache.maven.surefire.providerapi.SurefireProvider000066400000000000000000000000601330756104600464710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/main/resources/META-INF/servicesorg.apache.maven.surefire.testng.TestNGProvider maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/test/000077500000000000000000000000001330756104600271075ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/test/java/000077500000000000000000000000001330756104600300305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/test/java/org/000077500000000000000000000000001330756104600306175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/test/java/org/apache/000077500000000000000000000000001330756104600320405ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600331465ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600347135ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/test/java/org/apache/maventestng/000077500000000000000000000000001330756104600362175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefireconf/000077500000000000000000000000001330756104600371445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testngTestNG513ConfiguratorTest.java000066400000000000000000000056161330756104600446370ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import junit.framework.TestCase; import org.apache.maven.surefire.testset.TestSetFailedException; import java.util.HashMap; import java.util.Map; import static org.apache.maven.surefire.testng.conf.TestNGMapConfiguratorTest.FIRST_LISTENER; import static org.apache.maven.surefire.testng.conf.TestNGMapConfiguratorTest.LISTENER_PROP; import static org.apache.maven.surefire.testng.conf.TestNGMapConfiguratorTest.SECOND_LISTENER; public class TestNG513ConfiguratorTest extends TestCase { public void testListenersOnSeparateLines() throws Exception { String listenersOnSeveralLines = String.format( "%s , %n %s", FIRST_LISTENER, SECOND_LISTENER ); Map convertedOptions = getConvertedOptions( LISTENER_PROP, listenersOnSeveralLines ); String listeners = (String) convertedOptions.get( String.format( "-%s", LISTENER_PROP ) ); assertEquals( FIRST_LISTENER + "," + SECOND_LISTENER, listeners ); } public void testListenersOnTheSameLine() throws Exception { String listenersOnSeveralLines = String.format( "%s,%s", FIRST_LISTENER, SECOND_LISTENER ); Map convertedOptions = getConvertedOptions( LISTENER_PROP, listenersOnSeveralLines ); String listeners = (String) convertedOptions.get( String.format( "-%s", LISTENER_PROP ) ); assertEquals( FIRST_LISTENER + "," + SECOND_LISTENER, listeners ); } public void testReporter() throws Exception { Map convertedOptions = getConvertedOptions( "reporter", "classname" ); String reporter = (String) convertedOptions.get( "-reporterslist" ); assertEquals( "classname", reporter ); } private Map getConvertedOptions( String key, String value ) throws TestSetFailedException { TestNGMapConfigurator testNGMapConfigurator = new TestNG513Configurator(); Map raw = new HashMap(); raw.put( key, value ); return testNGMapConfigurator.getConvertedOptions( raw ); } } TestNG5141ConfiguratorTest.java000066400000000000000000000055321330756104600447160ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import junit.framework.TestCase; import org.apache.maven.surefire.testset.TestSetFailedException; import java.util.HashMap; import java.util.List; import java.util.Map; import static org.apache.maven.surefire.testng.conf.TestNGMapConfiguratorTest.*; public class TestNG5141ConfiguratorTest extends TestCase { public void testListenersOnSeparateLines() throws Exception { try { String listenersOnSeveralLines = String.format("%s , %n %s", FIRST_LISTENER, SECOND_LISTENER); Map convertedOptions = getConvertedOptions(LISTENER_PROP, listenersOnSeveralLines); List listeners = (List) convertedOptions.get(String.format("-%s", LISTENER_PROP)); assertEquals(2, listeners.size()); fail(); } catch ( TestSetFailedException e ) { // TODO remove it when surefire will use "configure(CommandLineArgs)" } } public void testListenersOnTheSameLine() throws Exception { try { String listenersOnSeveralLines = String.format("%s,%s", FIRST_LISTENER, SECOND_LISTENER); Map convertedOptions = getConvertedOptions(LISTENER_PROP, listenersOnSeveralLines); List listeners = (List) convertedOptions.get(String.format("-%s", LISTENER_PROP)); assertEquals(2, listeners.size()); fail(); } catch ( TestSetFailedException e ) { // TODO remove it when surefire will use "configure(CommandLineArgs)" } } private Map getConvertedOptions( String key, String value ) throws TestSetFailedException { TestNGMapConfigurator testNGMapConfigurator = new TestNG5141Configurator(); Map raw = new HashMap(); raw.put( key, value ); return testNGMapConfigurator.getConvertedOptions( raw ); } } TestNG5143ConfiguratorTest.java000066400000000000000000000057071330756104600447240ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import java.util.HashMap; import java.util.Map; import junit.framework.TestCase; import org.apache.maven.surefire.testset.TestSetFailedException; import static org.apache.maven.surefire.testng.conf.TestNGMapConfiguratorTest.FIRST_LISTENER; import static org.apache.maven.surefire.testng.conf.TestNGMapConfiguratorTest.LISTENER_PROP; import static org.apache.maven.surefire.testng.conf.TestNGMapConfiguratorTest.SECOND_LISTENER; public class TestNG5143ConfiguratorTest extends TestCase { public void testListenersOnSeparateLines() throws Exception { String listenersOnSeveralLines = String.format( "%s , %n %s", FIRST_LISTENER, SECOND_LISTENER); Map convertedOptions = getConvertedOptions(LISTENER_PROP, listenersOnSeveralLines); String listeners = (String) convertedOptions.get( String.format("-%s", LISTENER_PROP)); assertEquals(FIRST_LISTENER + "," + SECOND_LISTENER, listeners); } public void testListenersOnTheSameLine() throws Exception { String listenersOnSeveralLines = String.format( "%s,%s", FIRST_LISTENER, SECOND_LISTENER); Map convertedOptions = getConvertedOptions( LISTENER_PROP, listenersOnSeveralLines); String listeners = (String) convertedOptions.get( String.format("-%s", LISTENER_PROP)); assertEquals(FIRST_LISTENER + "," + SECOND_LISTENER, listeners); } public void testReporter() throws Exception { Map convertedOptions = getConvertedOptions( "reporter", "classname" ); assertNull( "classname", convertedOptions.get( "-reporterslist" ) ); String reporter = (String) convertedOptions.get("-reporter" ); assertEquals( "classname", reporter ); } private Map getConvertedOptions( String key, String value ) throws TestSetFailedException { TestNGMapConfigurator testNGMapConfigurator = new TestNG5143Configurator(); Map raw = new HashMap(); raw.put( key, value ); return testNGMapConfigurator.getConvertedOptions( raw ); } } TestNG60ConfiguratorTest.java000066400000000000000000000030141330756104600445420ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import java.util.HashMap; import java.util.Map; import junit.framework.TestCase; /** * @author Marvin Froeder */ public class TestNG60ConfiguratorTest extends TestCase { public void testGetConvertedOptions() throws Exception { TestNGMapConfigurator testNGMapConfigurator = new TestNG60Configurator(); Map raw = new HashMap(); raw.put( "objectfactory", "java.lang.String" ); Map convertedOptions = testNGMapConfigurator.getConvertedOptions( raw ); String objectfactory = (String) convertedOptions.get( "-objectfactory" ); assertNotNull( objectfactory ); } } TestNGMapConfiguratorTest.java000077500000000000000000000066661330756104600450550ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/confpackage org.apache.maven.surefire.testng.conf; /* * 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. */ import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.maven.surefire.testset.TestSetFailedException; import junit.framework.TestCase; import org.testng.ReporterConfig; /** * @author Kristian Rosenvold */ public class TestNGMapConfiguratorTest extends TestCase { public static final String FIRST_LISTENER = "org.testng.TestListenerAdapter"; public static final String SECOND_LISTENER = "org.testng.reporters.ExitCodeListener"; public static final String LISTENER_PROP = "listener"; public void testGetConvertedOptions() throws Exception { Map convertedOptions = getConvertedOptions( "mixed", "true" ); boolean bool = (Boolean) convertedOptions.get( "-mixed" ); assertTrue( bool ); } public void testListenersOnSeparateLines() throws Exception { String listenersOnSeveralLines = String.format( "%s , %n %s", FIRST_LISTENER, SECOND_LISTENER); Map convertedOptions = getConvertedOptions(LISTENER_PROP, listenersOnSeveralLines); List listeners = (List) convertedOptions.get( String.format("-%s", LISTENER_PROP)); assertEquals(2, listeners.size()); } public void testListenersOnTheSameLine() throws Exception { String listenersOnSeveralLines = String.format( "%s,%s", FIRST_LISTENER, SECOND_LISTENER); Map convertedOptions = getConvertedOptions( LISTENER_PROP, listenersOnSeveralLines); List listeners = (List) convertedOptions.get( String.format("-%s", LISTENER_PROP)); assertEquals(2, listeners.size()); } public void testGroupByInstances() throws Exception { Map convertedOptions = getConvertedOptions( "group-by-instances", "true" ); boolean bool = (Boolean) convertedOptions.get( "-group-by-instances" ); assertTrue( bool ); } public void testReporter() throws Exception { Map convertedOptions = getConvertedOptions( "reporter", "classname" ); List reporter = (List) convertedOptions.get( "-reporterslist" ); ReporterConfig reporterConfig = reporter.get( 0 ); assertEquals( "classname", reporterConfig.getClassName() ); } private Map getConvertedOptions( String key, String value ) throws TestSetFailedException { TestNGMapConfigurator testNGMapConfigurator = new TestNGMapConfigurator(); Map raw = new HashMap(); raw.put( key, value ); return testNGMapConfigurator.getConvertedOptions( raw ); } } maven-surefire-surefire-2.22.0/surefire-report-parser/000077500000000000000000000000001330756104600230035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/pom.xml000066400000000000000000000066701330756104600243310ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire 2.22.0 surefire-report-parser Surefire Report Parser Parses report output files from surefire. 2.2.1 org.apache.maven.surefire surefire-logger-api org.apache.maven.shared maven-shared-utils org.apache.maven.reporting maven-reporting-api maven-surefire-plugin org.apache.maven.surefire surefire-shadefire 2.12.4 **/JUnit4SuiteTest.java org.apache.maven.plugins maven-shade-plugin package shade true org.apache.maven.shared:maven-shared-utils org.apache.maven.shared org.apache.maven.surefire.shade.org.apache.maven.shared maven-surefire-surefire-2.22.0/surefire-report-parser/src/000077500000000000000000000000001330756104600235725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/main/000077500000000000000000000000001330756104600245165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/main/java/000077500000000000000000000000001330756104600254375ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/main/java/org/000077500000000000000000000000001330756104600262265ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/main/java/org/apache/000077500000000000000000000000001330756104600274475ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/main/java/org/apache/maven/000077500000000000000000000000001330756104600305555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/main/java/org/apache/maven/plugins/000077500000000000000000000000001330756104600322365ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600340035ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/main/java/org/apache/maven/pluginsreport/000077500000000000000000000000001330756104600353165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefireReportTestCase.java000066400000000000000000000104161330756104600410720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import static org.apache.maven.shared.utils.StringUtils.isNotBlank; /** * */ public final class ReportTestCase { private String fullClassName; private String className; private String fullName; private String name; private float time; private String failureMessage; private String failureType; private String failureErrorLine; private String failureDetail; private boolean hasFailure; private boolean hasError; private boolean hasSkipped; public String getName() { return name; } public ReportTestCase setName( String name ) { this.name = name; return this; } public String getFullClassName() { return fullClassName; } public ReportTestCase setFullClassName( String name ) { fullClassName = name; return this; } public String getClassName() { return className; } public ReportTestCase setClassName( String name ) { className = name; return this; } public float getTime() { return time; } public ReportTestCase setTime( float time ) { this.time = time; return this; } public String getFullName() { return fullName; } public ReportTestCase setFullName( String fullName ) { this.fullName = fullName; return this; } public String getFailureMessage() { return failureMessage; } private ReportTestCase setFailureMessage( String failureMessage ) { this.failureMessage = failureMessage; return this; } public String getFailureType() { return failureType; } public String getFailureErrorLine() { return failureErrorLine; } public ReportTestCase setFailureErrorLine( String failureErrorLine ) { this.failureErrorLine = failureErrorLine; return this; } public String getFailureDetail() { return failureDetail; } public ReportTestCase setFailureDetail( String failureDetail ) { this.failureDetail = failureDetail; return this; } public ReportTestCase setFailure( String message, String type ) { hasFailure = isNotBlank( type ); hasError = false; hasSkipped = false; return setFailureMessage( message ).setFailureType( type ); } public ReportTestCase setError( String message, String type ) { hasFailure = false; hasError = isNotBlank( type ); hasSkipped = false; return setFailureMessage( message ).setFailureType( type ); } public ReportTestCase setSkipped( String message ) { hasFailure = false; hasError = false; hasSkipped = isNotBlank( message ); return setFailureMessage( message ).setFailureType( "skipped" ); } public boolean isSuccessful() { return !hasFailure() && !hasError() && !hasSkipped(); } public boolean hasFailure() { return hasFailure; } public boolean hasError() { return hasError; } public boolean hasSkipped() { return hasSkipped; } /** * {@inheritDoc} */ @Override public String toString() { return fullName; } private ReportTestCase setFailureType( String failureType ) { this.failureType = failureType; return this; } } ReportTestSuite.java000066400000000000000000000107511330756104600413120ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import java.util.ArrayList; import java.util.List; /** * */ public final class ReportTestSuite { private final List testCases = new ArrayList(); private int numberOfErrors; private int numberOfFailures; private int numberOfSkipped; private int numberOfFlakes; private Integer numberOfTests; private String name; private String fullClassName; private String packageName; private float timeElapsed; public List getTestCases() { return testCases; } public int getNumberOfErrors() { return numberOfErrors; } public ReportTestSuite setNumberOfErrors( int numberOfErrors ) { this.numberOfErrors = numberOfErrors; return this; } public ReportTestSuite incrementNumberOfErrors() { ++numberOfErrors; return this; } public int getNumberOfFailures() { return numberOfFailures; } public ReportTestSuite setNumberOfFailures( int numberOfFailures ) { this.numberOfFailures = numberOfFailures; return this; } public ReportTestSuite incrementNumberOfFailures() { ++numberOfFailures; return this; } public int getNumberOfSkipped() { return numberOfSkipped; } public ReportTestSuite setNumberOfSkipped( int numberOfSkipped ) { this.numberOfSkipped = numberOfSkipped; return this; } public ReportTestSuite incrementNumberOfSkipped() { ++numberOfSkipped; return this; } public int getNumberOfFlakes() { return numberOfFlakes; } public ReportTestSuite setNumberOfFlakes( int numberOfFlakes ) { this.numberOfFlakes = numberOfFlakes; return this; } public ReportTestSuite incrementNumberOfFlakes() { ++numberOfFlakes; return this; } public int getNumberOfTests() { return numberOfTests == null ? testCases.size() : numberOfTests; } public ReportTestSuite setNumberOfTests( int numberOfTests ) { this.numberOfTests = numberOfTests; return this; } public String getName() { return name; } public ReportTestSuite setName( String name ) { this.name = name; return this; } public String getFullClassName() { return fullClassName; } public ReportTestSuite setFullClassName( String fullClassName ) { this.fullClassName = fullClassName; int lastDotPosition = fullClassName.lastIndexOf( "." ); name = fullClassName.substring( lastDotPosition + 1, fullClassName.length() ); packageName = lastDotPosition == -1 ? "" : fullClassName.substring( 0, lastDotPosition ); return this; } public String getPackageName() { return packageName; } public ReportTestSuite setPackageName( String packageName ) { this.packageName = packageName; return this; } public float getTimeElapsed() { return this.timeElapsed; } public ReportTestSuite setTimeElapsed( float timeElapsed ) { this.timeElapsed = timeElapsed; return this; } ReportTestSuite setTestCases( List testCases ) { this.testCases.clear(); this.testCases.addAll( testCases ); return this; } /** * {@inheritDoc} */ @Override public String toString() { return fullClassName + " [" + getNumberOfTests() + "/" + getNumberOfFailures() + "/" + getNumberOfErrors() + "/" + getNumberOfSkipped() + "]"; } } SurefireReportParser.java000066400000000000000000000177361330756104600423340ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import java.io.File; import java.io.IOException; import java.text.NumberFormat; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import javax.xml.parsers.ParserConfigurationException; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.reporting.MavenReportException; import org.apache.maven.shared.utils.StringUtils; import org.apache.maven.shared.utils.io.DirectoryScanner; import org.xml.sax.SAXException; import static java.util.Collections.singletonList; /** * */ public final class SurefireReportParser { private static final String INCLUDES = "*.xml"; private static final String EXCLUDES = "*.txt, testng-failed.xml, testng-failures.xml, testng-results.xml, failsafe-summary*.xml"; private static final int PCENT = 100; private final List testSuites = new ArrayList(); private final NumberFormat numberFormat; private final ConsoleLogger consoleLogger; private List reportsDirectories; public SurefireReportParser( List reportsDirectories, Locale locale, ConsoleLogger consoleLogger ) { this.reportsDirectories = reportsDirectories; numberFormat = NumberFormat.getInstance( locale ); this.consoleLogger = consoleLogger; } public List parseXMLReportFiles() throws MavenReportException { final Collection xmlReportFiles = new ArrayList(); for ( File reportsDirectory : reportsDirectories ) { if ( reportsDirectory.exists() ) { for ( String xmlReportFile : getIncludedFiles( reportsDirectory, INCLUDES, EXCLUDES ) ) { xmlReportFiles.add( new File( reportsDirectory, xmlReportFile ) ); } } } final TestSuiteXmlParser parser = new TestSuiteXmlParser( consoleLogger ); for ( File aXmlReportFileList : xmlReportFiles ) { try { testSuites.addAll( parser.parse( aXmlReportFileList.getAbsolutePath() ) ); } catch ( ParserConfigurationException e ) { throw new MavenReportException( "Error setting up parser for JUnit XML report", e ); } catch ( SAXException e ) { throw new MavenReportException( "Error parsing JUnit XML report " + aXmlReportFileList, e ); } catch ( IOException e ) { throw new MavenReportException( "Error reading JUnit XML report " + aXmlReportFileList, e ); } } return testSuites; } protected String parseTestSuiteName( String lineString ) { return lineString.substring( lineString.lastIndexOf( "." ) + 1, lineString.length() ); } protected String parseTestSuitePackageName( String lineString ) { return lineString.substring( lineString.indexOf( ":" ) + 2, lineString.lastIndexOf( "." ) ); } protected String parseTestCaseName( String lineString ) { return lineString.substring( 0, lineString.indexOf( "(" ) ); } public Map getSummary( List suites ) { Map totalSummary = new HashMap(); int totalNumberOfTests = 0; int totalNumberOfErrors = 0; int totalNumberOfFailures = 0; int totalNumberOfSkipped = 0; float totalElapsedTime = 0.0f; for ( ReportTestSuite suite : suites ) { totalNumberOfTests += suite.getNumberOfTests(); totalNumberOfErrors += suite.getNumberOfErrors(); totalNumberOfFailures += suite.getNumberOfFailures(); totalNumberOfSkipped += suite.getNumberOfSkipped(); totalElapsedTime += suite.getTimeElapsed(); } String totalPercentage = computePercentage( totalNumberOfTests, totalNumberOfErrors, totalNumberOfFailures, totalNumberOfSkipped ); totalSummary.put( "totalTests", Integer.toString( totalNumberOfTests ) ); totalSummary.put( "totalErrors", Integer.toString( totalNumberOfErrors ) ); totalSummary.put( "totalFailures", Integer.toString( totalNumberOfFailures ) ); totalSummary.put( "totalSkipped", Integer.toString( totalNumberOfSkipped ) ); totalSummary.put( "totalElapsedTime", numberFormat.format( totalElapsedTime ) ); totalSummary.put( "totalPercentage", totalPercentage ); return totalSummary; } public void setReportsDirectory( File reportsDirectory ) { reportsDirectories = singletonList( reportsDirectory ); } public NumberFormat getNumberFormat() { return numberFormat; } public Map> getSuitesGroupByPackage( List testSuitesList ) { Map> suitePackage = new HashMap>(); for ( ReportTestSuite suite : testSuitesList ) { List suiteList = new ArrayList(); if ( suitePackage.get( suite.getPackageName() ) != null ) { suiteList = suitePackage.get( suite.getPackageName() ); } suiteList.add( suite ); suitePackage.put( suite.getPackageName(), suiteList ); } return suitePackage; } public String computePercentage( int tests, int errors, int failures, int skipped ) { float percentage = tests == 0 ? 0 : ( (float) ( tests - errors - failures - skipped ) / (float) tests ) * PCENT; return numberFormat.format( percentage ); } public List getFailureDetails( List testSuites ) { List failureDetails = new ArrayList(); for ( ReportTestSuite suite : testSuites ) { for ( ReportTestCase tCase : suite.getTestCases() ) { if ( !tCase.isSuccessful() ) { failureDetails.add( tCase ); } } } return failureDetails; } /** * Returns {@code true} if the specified directory contains at least one report file. * * @param directory the directory * @return {@code true} if the specified directory contains at least one report file. */ public static boolean hasReportFiles( File directory ) { return directory != null && directory.isDirectory() && getIncludedFiles( directory, INCLUDES, EXCLUDES ).length != 0; } private static String[] getIncludedFiles( File directory, String includes, String excludes ) { DirectoryScanner scanner = new DirectoryScanner(); scanner.setBasedir( directory ); scanner.setIncludes( StringUtils.split( includes, "," ) ); scanner.setExcludes( StringUtils.split( excludes, "," ) ); scanner.scan(); return scanner.getIncludedFiles(); } } TestSuiteXmlParser.java000066400000000000000000000270661330756104600417630ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.text.NumberFormat; import java.text.ParseException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.shared.utils.StringUtils; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; import static java.util.Locale.ENGLISH; /** * */ public final class TestSuiteXmlParser extends DefaultHandler { private final NumberFormat numberFormat = NumberFormat.getInstance( ENGLISH ); private final ConsoleLogger consoleLogger; private ReportTestSuite defaultSuite; private ReportTestSuite currentSuite; private Map classesToSuitesIndex; private List suites; private StringBuilder currentElement; private ReportTestCase testCase; private boolean valid; public TestSuiteXmlParser( ConsoleLogger consoleLogger ) { this.consoleLogger = consoleLogger; } public List parse( String xmlPath ) throws ParserConfigurationException, SAXException, IOException { FileInputStream fileInputStream = new FileInputStream( new File( xmlPath ) ); InputStreamReader inputStreamReader = new InputStreamReader( fileInputStream, "UTF-8" ); try { return parse( inputStreamReader ); } finally { inputStreamReader.close(); fileInputStream.close(); } } public List parse( InputStreamReader stream ) throws ParserConfigurationException, SAXException, IOException { SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser saxParser = factory.newSAXParser(); valid = true; classesToSuitesIndex = new HashMap(); suites = new ArrayList(); saxParser.parse( new InputSource( stream ), this ); if ( currentSuite != defaultSuite ) { // omit the defaultSuite if it's empty and there are alternatives if ( defaultSuite.getNumberOfTests() == 0 ) { suites.remove( classesToSuitesIndex.get( defaultSuite.getFullClassName() ).intValue() ); } } return suites; } /** * {@inheritDoc} */ @Override public void startElement( String uri, String localName, String qName, Attributes attributes ) throws SAXException { if ( valid ) { try { // todo: use jdk7 switch-case if ( "testsuite".equals( qName ) ) { defaultSuite = new ReportTestSuite(); currentSuite = defaultSuite; try { Number time = numberFormat.parse( attributes.getValue( "time" ) ); defaultSuite.setTimeElapsed( time.floatValue() ); } catch ( NullPointerException e ) { consoleLogger.error( "WARNING: no time attribute found on testsuite element" ); } final String name = attributes.getValue( "name" ); final String group = attributes.getValue( "group" ); defaultSuite.setFullClassName( StringUtils.isBlank( group ) ? /*name is full class name*/ name : /*group is package name*/ group + "." + name ); suites.add( defaultSuite ); classesToSuitesIndex.put( defaultSuite.getFullClassName(), suites.size() - 1 ); } else if ( "testcase".equals( qName ) ) { currentElement = new StringBuilder(); testCase = new ReportTestCase() .setName( attributes.getValue( "name" ) ); String fullClassName = attributes.getValue( "classname" ); // if the testcase declares its own classname, it may need to belong to its own suite if ( fullClassName != null ) { Integer currentSuiteIndex = classesToSuitesIndex.get( fullClassName ); if ( currentSuiteIndex == null ) { currentSuite = new ReportTestSuite() .setFullClassName( fullClassName ); suites.add( currentSuite ); classesToSuitesIndex.put( fullClassName, suites.size() - 1 ); } else { currentSuite = suites.get( currentSuiteIndex ); } } final String timeAsString = attributes.getValue( "time" ); final Number time = StringUtils.isBlank( timeAsString ) ? 0 : numberFormat.parse( timeAsString ); testCase.setFullClassName( currentSuite.getFullClassName() ) .setClassName( currentSuite.getName() ) .setFullName( currentSuite.getFullClassName() + "." + testCase.getName() ) .setTime( time.floatValue() ); if ( currentSuite != defaultSuite ) { currentSuite.setTimeElapsed( testCase.getTime() + currentSuite.getTimeElapsed() ); } } else if ( "failure".equals( qName ) ) { testCase.setFailure( attributes.getValue( "message" ), attributes.getValue( "type" ) ); currentSuite.incrementNumberOfFailures(); } else if ( "error".equals( qName ) ) { testCase.setError( attributes.getValue( "message" ), attributes.getValue( "type" ) ); currentSuite.incrementNumberOfErrors(); } else if ( "skipped".equals( qName ) ) { String message = attributes.getValue( "message" ); testCase.setSkipped( message != null ? message : "skipped" ); currentSuite.incrementNumberOfSkipped(); } else if ( "flakyFailure".equals( qName ) || "flakyError".equals( qName ) ) { currentSuite.incrementNumberOfFlakes(); } else if ( "failsafe-summary".equals( qName ) ) { valid = false; } } catch ( ParseException e ) { throw new SAXException( e.getMessage(), e ); } } } /** * {@inheritDoc} */ @Override public void endElement( String uri, String localName, String qName ) throws SAXException { // todo: use jdk7 switch-case if ( "testcase".equals( qName ) ) { currentSuite.getTestCases().add( testCase ); } else if ( "failure".equals( qName ) || "error".equals( qName ) ) { testCase.setFailureDetail( currentElement.toString() ) .setFailureErrorLine( parseErrorLine( currentElement, testCase.getFullClassName() ) ); } else if ( "time".equals( qName ) ) { try { defaultSuite.setTimeElapsed( numberFormat.parse( currentElement.toString() ).floatValue() ); } catch ( ParseException e ) { throw new SAXException( e.getMessage(), e ); } } // TODO extract real skipped reasons } /** * {@inheritDoc} */ @Override public void characters( char[] ch, int start, int length ) throws SAXException { assert start >= 0; assert length >= 0; if ( valid && isNotBlank( start, length, ch ) ) { currentElement.append( ch, start, length ); } } public boolean isValid() { return valid; } static boolean isNotBlank( int from, int len, char... s ) { assert from >= 0; assert len >= 0; if ( s != null ) { for ( int i = 0; i < len; i++ ) { char c = s[from++]; if ( c != ' ' && c != '\t' && c != '\n' && c != '\r' && c != '\f' ) { return true; } } } return false; } static boolean isNumeric( StringBuilder s, final int from, final int to ) { assert from >= 0; assert from <= to; for ( int i = from; i != to; ) { if ( !Character.isDigit( s.charAt( i++ ) ) ) { return false; } } return from != to; } static String parseErrorLine( StringBuilder currentElement, String fullClassName ) { final String[] linePatterns = { "at " + fullClassName + '.', "at " + fullClassName + '$' }; int[] indexes = lastIndexOf( currentElement, linePatterns ); int patternStartsAt = indexes[0]; if ( patternStartsAt != -1 ) { int searchFrom = patternStartsAt + ( linePatterns[ indexes[1] ] ).length(); searchFrom = 1 + currentElement.indexOf( ":", searchFrom ); int searchTo = currentElement.indexOf( ")", searchFrom ); return isNumeric( currentElement, searchFrom, searchTo ) ? currentElement.substring( searchFrom, searchTo ) : ""; } return ""; } static int[] lastIndexOf( StringBuilder source, String... linePatterns ) { int end = source.indexOf( "Caused by:" ); if ( end == -1 ) { end = source.length(); } int startsAt = -1; int pattern = -1; for ( int i = 0; i < linePatterns.length; i++ ) { String linePattern = linePatterns[i]; int currentStartsAt = source.lastIndexOf( linePattern, end ); if ( currentStartsAt > startsAt ) { startsAt = currentStartsAt; pattern = i; } } return new int[] { startsAt, pattern }; } } maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/000077500000000000000000000000001330756104600245515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/java/000077500000000000000000000000001330756104600254725ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/java/org/000077500000000000000000000000001330756104600262615ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/java/org/apache/000077500000000000000000000000001330756104600275025ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600306105ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/java/org/apache/maven/plugins/000077500000000000000000000000001330756104600322715ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600340365ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/java/org/apache/maven/pluginsreport/000077500000000000000000000000001330756104600353515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefireJUnit4SuiteTest.java000066400000000000000000000027041330756104600412060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import junit.framework.JUnit4TestAdapter; import junit.framework.Test; import org.junit.runner.RunWith; import org.junit.runners.Suite; /** * Adapt the JUnit4 tests which use only annotations to the JUnit3 test suite. * * @author Tibor Digana (tibor17) * @since 2.21.0 */ @Suite.SuiteClasses( { ReportTestCaseTest.class, ReportTestSuiteTest.class, SurefireReportParserTest.class, TestSuiteXmlParserTest.class } ) @RunWith( Suite.class ) public class JUnit4SuiteTest { public static Test suite() { return new JUnit4TestAdapter( JUnit4SuiteTest.class ); } } ReportTestCaseTest.java000066400000000000000000000035001330756104600417610ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import junit.framework.TestCase; /** * @author Jontri */ public class ReportTestCaseTest extends TestCase { private ReportTestCase tCase; /** * {@inheritDoc} */ @Override protected void setUp() throws Exception { super.setUp(); tCase = new ReportTestCase(); } public void testSetName() { tCase.setName( "Test Case Name" ); assertEquals( "Test Case Name", tCase.getName() ); } public void testSetTime() { tCase.setTime( .06f ); assertEquals( .06f, tCase.getTime(), 0.0 ); } public void testSetFailure() { tCase.setFailure( "messageVal", "typeVal" ); assertEquals( "messageVal", tCase.getFailureMessage() ); assertEquals( "typeVal", tCase.getFailureType() ); } public void testSetFullName() { tCase.setFullName( "Test Case Full Name" ); assertEquals( "Test Case Full Name", tCase.getFullName() ); } } ReportTestSuiteTest.java000066400000000000000000000050731330756104600422060ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import java.util.ArrayList; import java.util.List; import junit.framework.TestCase; /** * */ public class ReportTestSuiteTest extends TestCase { private ReportTestSuite tSuite; /** * {@inheritDoc} */ @Override protected void setUp() throws Exception { super.setUp(); tSuite = new ReportTestSuite(); } public void testSetTestCases() { ReportTestCase tCase = new ReportTestCase(); List tCaseList = new ArrayList(); tCaseList.add( tCase ); tSuite.setTestCases( tCaseList ); assertEquals( tCase, tSuite.getTestCases().get( 0 ) ); } public void testSetNumberedOfErrors() { tSuite.setNumberOfErrors( 9 ); assertEquals( 9, tSuite.getNumberOfErrors() ); } public void testSetNumberOfFailures() { tSuite.setNumberOfFailures( 10 ); assertEquals( 10, tSuite.getNumberOfFailures() ); } public void testSetNumberOfSkipped() { tSuite.setNumberOfSkipped( 5 ); assertEquals( 5, tSuite.getNumberOfSkipped() ); } public void testSetNumberOfTests() { tSuite.setNumberOfTests( 11 ); assertEquals( 11, tSuite.getNumberOfTests() ); } public void testSetName() { tSuite.setName( "Suite Name" ); assertEquals( "Suite Name", tSuite.getName() ); } public void testSetPackageName() { tSuite.setPackageName( "Suite Package Name" ); assertEquals( "Suite Package Name", tSuite.getPackageName() ); } public void testSetTimeElapsed() { tSuite.setTimeElapsed( .06f ); assertEquals( .06f, tSuite.getTimeElapsed(), 0.0 ); } } SurefireReportParserTest.java000066400000000000000000000150251330756104600432140ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import java.io.File; import java.io.UnsupportedEncodingException; import java.net.URL; import java.net.URLDecoder; import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger; import org.apache.maven.reporting.MavenReportException; import junit.framework.TestCase; import static java.util.Locale.ENGLISH; /** * */ public class SurefireReportParserTest extends TestCase { private SurefireReportParser report; /** * {@inheritDoc} */ @Override protected void setUp() throws Exception { super.setUp(); report = new SurefireReportParser( null, ENGLISH, new NullConsoleLogger() ); } public void testParseXMLReportFiles() throws MavenReportException, UnsupportedEncodingException { report.setReportsDirectory( getTestDir() ); List suites = report.parseXMLReportFiles(); assertEquals( 8, suites.size() ); for ( ReportTestSuite suite : suites ) { assertNotNull( suite.getName() + " was not correctly parsed", suite.getTestCases() ); assertNotNull( suite.getName() ); assertNotNull( suite.getPackageName() ); } } private File getTestDir() throws UnsupportedEncodingException { URL resource = getClass().getResource( "/test-reports" ); // URLDecoder.decode necessary for JDK 1.5+, where spaces are escaped to %20 return new File( URLDecoder.decode( resource.getPath(), "UTF-8" ) ).getAbsoluteFile(); } public void testParseTestSuiteName() { assertEquals( "CircleTest", report.parseTestSuiteName( "Battery: com.shape.CircleTest" ) ); } public void testParseTestSuitePackageName() { assertEquals( "com.shape", report.parseTestSuitePackageName( "Battery: com.shape.CircleTest" ) ); } public void testParseTestCaseName() { assertEquals( "testCase", report.parseTestCaseName( "testCase(com.shape.CircleTest)" ) ); } public void testGetSummary() throws Exception { ReportTestSuite tSuite1 = new ReportTestSuite() .setNumberOfErrors( 10 ) .setNumberOfFailures( 20 ) .setNumberOfSkipped( 2 ) .setTimeElapsed( 1.0f ) .setNumberOfTests( 100 ); ReportTestSuite tSuite2 = new ReportTestSuite() .setNumberOfErrors( 10 ) .setNumberOfFailures( 20 ) .setNumberOfSkipped( 2 ) .setTimeElapsed( 1.0f ) .setNumberOfTests( 100 ); List suites = new ArrayList(); suites.add( tSuite1 ); suites.add( tSuite2 ); Map testMap = report.getSummary( suites ); assertEquals( 20, Integer.parseInt( testMap.get( "totalErrors" ) ) ); assertEquals( 40, Integer.parseInt( testMap.get( "totalFailures" ) ) ); assertEquals( 200, Integer.parseInt( testMap.get( "totalTests" ) ) ); assertEquals( 4, Integer.parseInt( testMap.get( "totalSkipped" ) ) ); NumberFormat numberFormat = report.getNumberFormat(); assertEquals( 2.0f, numberFormat.parse( testMap.get( "totalElapsedTime" ) ).floatValue(), 0.0f ); assertEquals( 68.00f, numberFormat.parse( testMap.get( "totalPercentage" ) ).floatValue(), 0 ); } public void testGetSuitesGroupByPackage() { ReportTestSuite tSuite1 = new ReportTestSuite(); ReportTestSuite tSuite2 = new ReportTestSuite(); ReportTestSuite tSuite3 = new ReportTestSuite(); tSuite1.setPackageName( "Package1" ); tSuite2.setPackageName( "Package1" ); tSuite3.setPackageName( "Package2" ); List suites = new ArrayList(); suites.add( tSuite1 ); suites.add( tSuite2 ); suites.add( tSuite3 ); Map> groupMap = report.getSuitesGroupByPackage( suites ); assertEquals( 2, groupMap.size() ); assertEquals( tSuite1, groupMap.get( "Package1" ).get( 0 ) ); assertEquals( tSuite2, groupMap.get( "Package1" ).get( 1 ) ); assertEquals( tSuite3, groupMap.get( "Package2" ).get( 0 ) ); } public void testComputePercentage() throws Exception { NumberFormat numberFormat = report.getNumberFormat(); assertEquals( 70.00f, numberFormat.parse( report.computePercentage( 100, 20, 10, 0 ) ).floatValue(), 0 ); } public void testGetFailureDetails() { ReportTestSuite tSuite1 = new ReportTestSuite(); ReportTestSuite tSuite2 = new ReportTestSuite(); ReportTestCase tCase1 = new ReportTestCase(); ReportTestCase tCase2 = new ReportTestCase(); ReportTestCase tCase3 = new ReportTestCase(); tCase1.setFailure( null, IllegalArgumentException.class.getName() ); tCase3.setFailure( "index: 0, size: 0", IndexOutOfBoundsException.class.getName() ); List tCases = new ArrayList(); List tCases2 = new ArrayList(); tCases.add( tCase1 ); tCases.add( tCase2 ); tCases2.add( tCase3 ); tSuite1.setTestCases( tCases ); tSuite2.setTestCases( tCases2 ); List suites = new ArrayList(); suites.add( tSuite1 ); suites.add( tSuite2 ); List failures = report.getFailureDetails( suites ); assertEquals( 2, failures.size() ); assertEquals( tCase1, failures.get( 0 ) ); assertEquals( tCase3, failures.get( 1 ) ); } } TestSuiteXmlParserTest.java000066400000000000000000001142271330756104600426520ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/java/org/apache/maven/plugins/surefire/reportpackage org.apache.maven.plugins.surefire.report; /* * 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. */ import java.io.ByteArrayInputStream; import java.io.File; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.junit.After; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; import static org.junit.Assume.assumeTrue; import static org.hamcrest.Matchers.*; import static org.hamcrest.MatcherAssert.assertThat; /** * @author Kristian Rosenvold */ public class TestSuiteXmlParserTest { private static final String[] linePatterns = { "at org.apache.Test.", "at org.apache.Test$" }; private final Collection loggedErrors = new ArrayList(); private ConsoleLogger consoleLogger; @Before public void instantiateLogger() { consoleLogger = new ConsoleLogger() { @Override public boolean isDebugEnabled() { return true; } @Override public void debug( String message ) { } @Override public boolean isInfoEnabled() { return true; } @Override public void info( String message ) { } @Override public boolean isWarnEnabled() { return true; } @Override public void warning( String message ) { loggedErrors.add( message ); } @Override public boolean isErrorEnabled() { return true; } @Override public void error( String message ) { loggedErrors.add( message ); } @Override public void error( String message, Throwable t ) { loggedErrors.add( message ); } @Override public void error( Throwable t ) { loggedErrors.add( t.getLocalizedMessage() ); } }; } @After public void verifyErrorFreeLogger() { assertThat( loggedErrors, is( empty() ) ); } @Test public void testParse() throws Exception { TestSuiteXmlParser testSuiteXmlParser = new TestSuiteXmlParser( consoleLogger ); String xml = "\n" + "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " junit.framework.AssertionFailedError: \n" + "\tat junit.framework.Assert.fail(Assert.java:47)\n" + "\tat wellFormedXmlFailures.TestSurefire3.testU0000(TestSurefire3.java:40)\n" + "\n" + " \n" + " \n" + " junit.framework.AssertionFailedError: >\n" + "\tat junit.framework.Assert.fail(Assert.java:47)\n" + "\tat wellFormedXmlFailures.TestSurefire3.testGreater(TestSurefire3.java:35)\n" + "\n" + " \n" + " \n" + " junit.framework.AssertionFailedError: \"\n" + "\tat junit.framework.Assert.fail(Assert.java:47)\n" + "\tat wellFormedXmlFailures.TestSurefire3.testQuote(TestSurefire3.java:25)\n" + "\n" + " \n" + ""; InputStream byteArrayIs = new ByteArrayInputStream( xml.getBytes() ); List parse = testSuiteXmlParser.parse( new InputStreamReader(byteArrayIs, "UTF-8") ); assertThat( parse.size(), is( 1 ) ); ReportTestSuite report = parse.get( 0 ); assertThat( report.getFullClassName(), is( "wellFormedXmlFailures.TestSurefire3" ) ); assertThat( report.getName(), is( "TestSurefire3" ) ); assertThat( report.getPackageName(), is( "wellFormedXmlFailures" ) ); assertThat( report.getNumberOfTests(), is( 4 ) ); assertThat( report.getNumberOfSkipped(), is( 0 ) ); assertThat( report.getNumberOfErrors(), is( 0 ) ); assertThat( report.getNumberOfFailures(), is( 4 ) ); assertThat( report.getNumberOfFlakes(), is( 0 ) ); assertThat( report.getTimeElapsed(), is( 0.005f ) ); assertThat( report.getTestCases().size(), is( 4 ) ); List tests = report.getTestCases(); assertThat( tests.get( 0 ).getFullClassName(), is( "wellFormedXmlFailures.TestSurefire3" ) ); assertThat( tests.get( 0 ).getName(), is( "testLower" ) ); assertThat( tests.get( 0 ).getFailureDetail(), is( "junit.framework.AssertionFailedError: <\n" + "\tat junit.framework.Assert.fail(Assert.java:47)\n" + "\tat wellFormedXmlFailures.TestSurefire3.testLower(TestSurefire3.java:30)\n" ) ); assertThat( tests.get( 0 ).getClassName(), is( "TestSurefire3" ) ); assertThat( tests.get( 0 ).getTime(), is( 0.005f ) ); assertThat( tests.get( 0 ).getFailureErrorLine(), is( "30" ) ); assertThat( tests.get( 0 ).getFailureMessage(), is( "<" ) ); assertThat( tests.get( 0 ).getFullName(), is( "wellFormedXmlFailures.TestSurefire3.testLower" ) ); assertThat( tests.get( 0 ).getFailureType(), is( "junit.framework.AssertionFailedError" ) ); assertThat( tests.get( 0 ).hasError(), is( false ) ); assertThat( tests.get( 1 ).getFullClassName(), is( "wellFormedXmlFailures.TestSurefire3" ) ); assertThat( tests.get( 1 ).getName(), is( "testU0000" ) ); assertThat( tests.get( 1 ).getFailureDetail(), is( "junit.framework.AssertionFailedError: \n" + "\tat junit.framework.Assert.fail(Assert.java:47)\n" + "\tat wellFormedXmlFailures.TestSurefire3.testU0000(TestSurefire3.java:40)\n" ) ); assertThat( tests.get( 1 ).getClassName(), is( "TestSurefire3" ) ); assertThat( tests.get( 1 ).getTime(), is( 0f ) ); assertThat( tests.get( 1 ).getFailureErrorLine(), is( "40" ) ); assertThat( tests.get( 1 ).getFailureMessage(), is( "&0#;" ) ); assertThat( tests.get( 1 ).getFullName(), is( "wellFormedXmlFailures.TestSurefire3.testU0000" ) ); assertThat( tests.get( 1 ).getFailureType(), is( "junit.framework.AssertionFailedError" ) ); assertThat( tests.get( 1 ).hasError(), is( false ) ); assertThat( tests.get( 2 ).getFullClassName(), is( "wellFormedXmlFailures.TestSurefire3" ) ); assertThat( tests.get( 2 ).getName(), is( "testGreater" ) ); assertThat( tests.get( 2 ).getFailureDetail(), is( "junit.framework.AssertionFailedError: >\n" + "\tat junit.framework.Assert.fail(Assert.java:47)\n" + "\tat wellFormedXmlFailures.TestSurefire3.testGreater(TestSurefire3.java:35)\n" ) ); assertThat( tests.get( 2 ).getClassName(), is( "TestSurefire3" ) ); assertThat( tests.get( 2 ).getTime(), is( 0f ) ); assertThat( tests.get( 2 ).getFailureErrorLine(), is( "35" ) ); assertThat( tests.get( 2 ).getFailureMessage(), is( ">" ) ); assertThat( tests.get( 2 ).getFullName(), is( "wellFormedXmlFailures.TestSurefire3.testGreater" ) ); assertThat( tests.get( 2 ).getFailureType(), is( "junit.framework.AssertionFailedError" ) ); assertThat( tests.get( 2 ).hasError(), is( false ) ); assertThat( tests.get( 3 ).getFullClassName(), is( "wellFormedXmlFailures.TestSurefire3" ) ); assertThat( tests.get( 3 ).getName(), is( "testQuote" ) ); assertThat( tests.get( 3 ).getFailureDetail(), is( "junit.framework.AssertionFailedError: \"\n" + "\tat junit.framework.Assert.fail(Assert.java:47)\n" + "\tat wellFormedXmlFailures.TestSurefire3.testQuote(TestSurefire3.java:25)\n" ) ); assertThat( tests.get( 3 ).getClassName(), is( "TestSurefire3" ) ); assertThat( tests.get( 3 ).getTime(), is( 0f ) ); assertThat( tests.get( 3 ).getFailureErrorLine(), is( "25" ) ); assertThat( tests.get( 3 ).getFailureMessage(), is( "\"" ) ); assertThat( tests.get( 3 ).getFullName(), is( "wellFormedXmlFailures.TestSurefire3.testQuote" ) ); assertThat( tests.get( 3 ).getFailureType(), is( "junit.framework.AssertionFailedError" ) ); assertThat( tests.get( 3 ).hasError(), is( false ) ); } @Test public void testParser() throws Exception { TestSuiteXmlParser parser = new TestSuiteXmlParser( consoleLogger ); Collection oldResult = parser.parse( "src/test/resources/fixture/testsuitexmlparser/TEST-org.apache.maven.surefire.test.FailingTest.xml" ); assertNotNull( oldResult ); assertEquals( 1, oldResult.size() ); ReportTestSuite next = oldResult.iterator().next(); assertEquals( 2, next.getNumberOfTests() ); } @Test public void successfulSurefireTestReport() throws Exception { TestSuiteXmlParser parser = new TestSuiteXmlParser( consoleLogger ); File surefireReport = new File( "src/test/resources/junit-pathWithÜmlaut/TEST-umlautTest.BasicTest.xml" ); assumeTrue( surefireReport.isFile() ); Collection suites = parser.parse( surefireReport.getCanonicalPath() ); assertNotNull( suites ); assertEquals( 1, suites.size() ); ReportTestSuite suite = suites.iterator().next(); assertThat( suite.getNumberOfTests(), is( 1 ) ); assertEquals( 1, suite.getNumberOfTests() ); assertEquals( 0, suite.getNumberOfFlakes() ); assertEquals( 0, suite.getNumberOfFailures() ); assertEquals( 0, suite.getNumberOfErrors() ); assertEquals( 0, suite.getNumberOfSkipped() ); assertThat( suite.getTimeElapsed(), is( 0.002f ) ); assertThat( suite.getFullClassName(), is( "umlautTest.BasicTest" ) ); assertThat( suite.getPackageName(), is( "umlautTest" ) ); assertThat( suite.getName(), is( "BasicTest" ) ); ReportTestCase test = suite.getTestCases().iterator().next(); assertTrue( test.isSuccessful() ); assertNull( test.getFailureDetail() ); assertNull( test.getFailureErrorLine() ); assertNull( test.getFailureType() ); assertThat( test.getTime(), is( 0.002f ) ); assertThat( test.getFullClassName(), is( "umlautTest.BasicTest" ) ); assertThat( test.getClassName(), is( "BasicTest" ) ); assertThat( test.getName(), is( "testSetUp" ) ); assertThat( test.getFullName(), is( "umlautTest.BasicTest.testSetUp" ) ); } @Test public void testParserHitsFailsafeSummary() throws Exception { TestSuiteXmlParser parser = new TestSuiteXmlParser( consoleLogger ); parser.parse( "src/test/resources/fixture/testsuitexmlparser/failsafe-summary.xml" ); assertFalse( parser.isValid() ); parser.parse( "src/test/resources/fixture/testsuitexmlparser/TEST-org.apache.maven.surefire.test.FailingTest.xml" ); assertTrue( parser.isValid() ); } @Test public void lastIndexOfPatternOfOrdinalTest() { final StringBuilder stackTrace = new StringBuilder( "\tat org.apache.Test.util(Test.java:60)\n" + "\tat org.apache.Test.test(Test.java:30)\n" + "\tat com.sun.Impl.xyz(Impl.java:258)\n" ); int[] result = TestSuiteXmlParser.lastIndexOf( stackTrace, linePatterns ); assertThat( result[0], is( 40 ) ); assertThat( result[1], is( 0 ) ); String errorLine = TestSuiteXmlParser.parseErrorLine( stackTrace, "org.apache.Test" ); assertThat( errorLine, is( "30" ) ); } @Test public void lastIndexOfPatternOfOrdinalTestWithCause() { final StringBuilder stackTrace = new StringBuilder( "\tat org.apache.Test.util(Test.java:60)\n" + "\tat org.apache.Test.test(Test.java:30)\n" + "\tat com.sun.Impl.xyz(Impl.java:258)\n" + "\tat Caused by: java.lang.IndexOutOfBoundsException\n" + "\tat org.apache.Test.util(Test.java:70)\n" ); int[] result = TestSuiteXmlParser.lastIndexOf( stackTrace, linePatterns ); assertThat( result[0], is( 40 ) ); assertThat( result[1], is( 0 ) ); String errorLine = TestSuiteXmlParser.parseErrorLine( stackTrace, "org.apache.Test" ); assertThat( errorLine, is( "30" ) ); } @Test public void lastIndexOfPatternOfEnclosedTest() { final StringBuilder source = new StringBuilder( "\tat org.apache.Test.util(Test.java:60)\n" + "\tat org.apache.Test$Nested.test(Test.java:30)\n" + "\tat com.sun.Impl.xyz(Impl.java:258)\n" ); int[] result = TestSuiteXmlParser.lastIndexOf( source, linePatterns ); assertThat( result[0], is( 40 ) ); assertThat( result[1], is( 1 ) ); String errorLine = TestSuiteXmlParser.parseErrorLine( source, "org.apache.Test$Nested" ); assertThat( errorLine, is( "30" ) ); } @Test public void lastIndexOfPatternOfEnclosedTestWithCause() { final StringBuilder source = new StringBuilder( "\tat org.apache.Test.util(Test.java:60)\n" + "\tat org.apache.Test$Nested.test(Test.java:30)\n" + "\tat com.sun.Impl.xyz(Impl.java:258)\n" + "\tat Caused by: java.lang.IndexOutOfBoundsException\n" + "\tat org.apache.Test$Nested.util(Test.java:70)\n" ); int[] result = TestSuiteXmlParser.lastIndexOf( source, linePatterns ); assertThat( result[0], is( 40 ) ); assertThat( result[1], is( 1 ) ); String errorLine = TestSuiteXmlParser.parseErrorLine( source, "org.apache.Test$Nested" ); assertThat( errorLine, is( "30" ) ); } @Test public void shouldParserEverythingInOrdinalTest() throws Exception { TestSuiteXmlParser parser = new TestSuiteXmlParser( consoleLogger ); List tests = parser.parse( "src/test/resources/fixture/testsuitexmlparser/TEST-surefire.MyTest.xml" ); assertTrue( parser.isValid() ); assertThat( tests.size(), is( 1 ) ); assertThat( tests.get( 0 ).getFullClassName(), is( "surefire.MyTest" ) ); assertThat( tests.get( 0 ).getNumberOfErrors(), is( 1 ) ); assertThat( tests.get( 0 ).getNumberOfFlakes(), is( 0 ) ); assertThat( tests.get( 0 ).getNumberOfSkipped(), is( 0 ) ); assertThat( tests.get( 0 ).getNumberOfFailures(), is( 0 ) ); assertThat( tests.get( 0 ).getPackageName(), is( "surefire" ) ); assertThat( tests.get( 0 ).getNumberOfTests(), is( 1 ) ); assertThat( tests.get( 0 ).getTestCases().size(), is( 1 ) ); assertFalse( tests.get( 0 ).getTestCases().get( 0 ).isSuccessful() ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureErrorLine(), is( "13" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureType(), is( "java.lang.RuntimeException" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFullClassName(), is( "surefire.MyTest" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getClassName(), is( "MyTest" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getName(), is( "test" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFullName(), is( "surefire.MyTest.test" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getTime(), is( 0.1f ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureMessage(), is( "this is different message" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureDetail(), is( "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n" + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:24)\n" + "\tat surefire.MyTest.newRethrownDelegate(MyTest.java:17)\n" + "\tat surefire.MyTest.test(MyTest.java:13)\n" + "\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + "\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\n" + "\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" + "\tat java.lang.reflect.Method.invoke(Method.java:606)\n" + "\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\n" + "\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\n" + "\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\n" + "\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\n" + "\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n" + "\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n" + "\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n" + "\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n" + "\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n" + "\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n" + "\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n" + "\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n" + "\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n" + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:272)\n" + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:167)\n" + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:147)\n" + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:130)\n" + "\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:211)\n" + "\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:163)\n" + "\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:105)\n" + "\tCaused by: java.lang.IndexOutOfBoundsException\n" + "\tat surefire.MyTest.failure(MyTest.java:33)\n" + "\tat surefire.MyTest.access$100(MyTest.java:9)\n" + "\tat surefire.MyTest$Nested.run(MyTest.java:38)\n" + "\tat surefire.MyTest.delegate(MyTest.java:29)\n" + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:22)" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).hasError(), is( true ) ); } @Test public void shouldParserEverythingInEnclosedTest() throws Exception { TestSuiteXmlParser parser = new TestSuiteXmlParser( consoleLogger ); List tests = parser.parse( "src/test/resources/fixture/testsuitexmlparser/TEST-surefire.MyTest-enclosed.xml" ); assertTrue( parser.isValid() ); assertThat( tests.size(), is( 1 ) ); assertThat( tests.get( 0 ).getFullClassName(), is( "surefire.MyTest$A" ) ); assertThat( tests.get( 0 ).getNumberOfErrors(), is( 1 ) ); assertThat( tests.get( 0 ).getNumberOfFlakes(), is( 0 ) ); assertThat( tests.get( 0 ).getNumberOfSkipped(), is( 0 ) ); assertThat( tests.get( 0 ).getNumberOfFailures(), is( 0 ) ); assertThat( tests.get( 0 ).getPackageName(), is( "surefire" ) ); assertThat( tests.get( 0 ).getNumberOfTests(), is( 1 ) ); assertThat( tests.get( 0 ).getTestCases().size(), is( 1 ) ); assertFalse( tests.get( 0 ).getTestCases().get( 0 ).isSuccessful() ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureErrorLine(), is( "45" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureType(), is( "java.lang.RuntimeException" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFullClassName(), is( "surefire.MyTest$A" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getClassName(), is( "MyTest$A" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getName(), is( "t" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFullName(), is( "surefire.MyTest$A.t" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getTime(), is( 0f ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureMessage(), is( "java.lang.IndexOutOfBoundsException" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureDetail(), is( "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n" + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:24)\n" + "\tat surefire.MyTest.newRethrownDelegate(MyTest.java:17)\n" + "\tat surefire.MyTest.access$200(MyTest.java:9)\n" + "\tat surefire.MyTest$A.t(MyTest.java:45)\n" + "\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + "\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\n" + "\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" + "\tat java.lang.reflect.Method.invoke(Method.java:606)\n" + "\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\n" + "\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\n" + "\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\n" + "\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\n" + "\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n" + "\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n" + "\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n" + "\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n" + "\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n" + "\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n" + "\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n" + "\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n" + "\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n" + "\tat org.junit.runners.Suite.runChild(Suite.java:128)\n" + "\tat org.junit.runners.Suite.runChild(Suite.java:27)\n" + "\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n" + "\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n" + "\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n" + "\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n" + "\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n" + "\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n" + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:272)\n" + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:167)\n" + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:147)\n" + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:130)\n" + "\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:211)\n" + "\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:163)\n" + "\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:105)\n" + "\tCaused by: java.lang.IndexOutOfBoundsException\n" + "\tat surefire.MyTest.failure(MyTest.java:33)\n" + "\tat surefire.MyTest.access$100(MyTest.java:9)\n" + "\tat surefire.MyTest$Nested.run(MyTest.java:38)\n" + "\tat surefire.MyTest.delegate(MyTest.java:29)\n" + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:22)\n" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).hasError(), is( true ) ); } @Test public void shouldParserEverythingInEnclosedTrimStackTraceTest() throws Exception { TestSuiteXmlParser parser = new TestSuiteXmlParser( consoleLogger ); List tests = parser.parse( "src/test/resources/fixture/testsuitexmlparser/" + "TEST-surefire.MyTest-enclosed-trimStackTrace.xml" ); assertTrue( parser.isValid() ); assertThat( tests.size(), is( 1 ) ); assertThat( tests.get( 0 ).getFullClassName(), is( "surefire.MyTest$A" ) ); assertThat( tests.get( 0 ).getNumberOfErrors(), is( 1 ) ); assertThat( tests.get( 0 ).getNumberOfFlakes(), is( 0 ) ); assertThat( tests.get( 0 ).getNumberOfSkipped(), is( 0 ) ); assertThat( tests.get( 0 ).getNumberOfFailures(), is( 0 ) ); assertThat( tests.get( 0 ).getPackageName(), is( "surefire" ) ); assertThat( tests.get( 0 ).getNumberOfTests(), is( 1 ) ); assertThat( tests.get( 0 ).getTestCases().size(), is( 1 ) ); assertFalse( tests.get( 0 ).getTestCases().get( 0 ).isSuccessful() ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureErrorLine(), is( "45" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureType(), is( "java.lang.RuntimeException" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFullClassName(), is( "surefire.MyTest$A" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getClassName(), is( "MyTest$A" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getName(), is( "t" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFullName(), is( "surefire.MyTest$A.t" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getTime(), is( 0f ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureMessage(), is( "java.lang.IndexOutOfBoundsException" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureDetail(), is( "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n" + "\tat surefire.MyTest.failure(MyTest.java:33)\n" + "\tat surefire.MyTest.access$100(MyTest.java:9)\n" + "\tat surefire.MyTest$Nested.run(MyTest.java:38)\n" + "\tat surefire.MyTest.delegate(MyTest.java:29)\n" + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:22)\n" + "\tat surefire.MyTest.newRethrownDelegate(MyTest.java:17)\n" + "\tat surefire.MyTest.access$200(MyTest.java:9)\n" + "\tat surefire.MyTest$A.t(MyTest.java:45)\n" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).hasError(), is( true ) ); } @Test public void shouldParserEverythingInNestedClassTest() throws Exception { TestSuiteXmlParser parser = new TestSuiteXmlParser( consoleLogger ); List tests = parser.parse( "src/test/resources/fixture/testsuitexmlparser/" + "TEST-surefire.MyTest-nestedClass.xml" ); assertTrue( parser.isValid() ); assertThat( tests.size(), is( 1 ) ); assertThat( tests.get( 0 ).getFullClassName(), is( "surefire.MyTest" ) ); assertThat( tests.get( 0 ).getNumberOfErrors(), is( 1 ) ); assertThat( tests.get( 0 ).getNumberOfFlakes(), is( 0 ) ); assertThat( tests.get( 0 ).getNumberOfSkipped(), is( 0 ) ); assertThat( tests.get( 0 ).getNumberOfFailures(), is( 0 ) ); assertThat( tests.get( 0 ).getPackageName(), is( "surefire" ) ); assertThat( tests.get( 0 ).getNumberOfTests(), is( 1 ) ); assertThat( tests.get( 0 ).getTestCases().size(), is( 1 ) ); assertFalse( tests.get( 0 ).getTestCases().get( 0 ).isSuccessful() ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureErrorLine(), is( "13" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureType(), is( "java.lang.RuntimeException" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFullClassName(), is( "surefire.MyTest" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getClassName(), is( "MyTest" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getName(), is( "test" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFullName(), is( "surefire.MyTest.test" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getTime(), is( 0f ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureMessage(), is( "java.lang.IndexOutOfBoundsException" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureDetail(), is( "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n" + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:24)\n" + "\tat surefire.MyTest.newRethrownDelegate(MyTest.java:17)\n" + "\tat surefire.MyTest.test(MyTest.java:13)\n" + "\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + "\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\n" + "\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" + "\tat java.lang.reflect.Method.invoke(Method.java:606)\n" + "\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\n" + "\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\n" + "\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\n" + "\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\n" + "\tat org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n" + "\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n" + "\tat org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n" + "\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n" + "\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n" + "\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n" + "\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n" + "\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n" + "\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n" + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:272)\n" + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:167)\n" + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:147)\n" + "\tat org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:130)\n" + "\tat org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:211)\n" + "\tat org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:163)\n" + "\tat org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:105)\n" + "\tCaused by: java.lang.IndexOutOfBoundsException\n" + "\tat surefire.MyTest.failure(MyTest.java:33)\n" + "\tat surefire.MyTest.access$100(MyTest.java:9)\n" + "\tat surefire.MyTest$Nested.run(MyTest.java:38)\n" + "\tat surefire.MyTest.delegate(MyTest.java:29)\n" + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:22)" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).hasError(), is( true ) ); } @Test public void shouldParserEverythingInNestedClassTrimStackTraceTest() throws Exception { TestSuiteXmlParser parser = new TestSuiteXmlParser( consoleLogger ); List tests = parser.parse( "src/test/resources/fixture/testsuitexmlparser/" + "TEST-surefire.MyTest-nestedClass-trimStackTrace.xml" ); assertTrue( parser.isValid() ); assertThat( tests.size(), is( 1 ) ); assertThat( tests.get( 0 ).getFullClassName(), is( "surefire.MyTest" ) ); assertThat( tests.get( 0 ).getNumberOfErrors(), is( 1 ) ); assertThat( tests.get( 0 ).getNumberOfFlakes(), is( 0 ) ); assertThat( tests.get( 0 ).getNumberOfSkipped(), is( 0 ) ); assertThat( tests.get( 0 ).getNumberOfFailures(), is( 0 ) ); assertThat( tests.get( 0 ).getPackageName(), is( "surefire" ) ); assertThat( tests.get( 0 ).getNumberOfTests(), is( 1 ) ); assertThat( tests.get( 0 ).getTestCases().size(), is( 1 ) ); assertFalse( tests.get( 0 ).getTestCases().get( 0 ).isSuccessful() ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureErrorLine(), is( "13" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureType(), is( "java.lang.RuntimeException" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFullClassName(), is( "surefire.MyTest" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getClassName(), is( "MyTest" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getName(), is( "test" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFullName(), is( "surefire.MyTest.test" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getTime(), is( 0f ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureMessage(), is( "java.lang.IndexOutOfBoundsException" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).getFailureDetail(), is( "java.lang.RuntimeException: java.lang.IndexOutOfBoundsException\n" + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:24)\n" + "\tat surefire.MyTest.newRethrownDelegate(MyTest.java:17)\n" + "\tat surefire.MyTest.test(MyTest.java:13)\n" + "\tCaused by: java.lang.IndexOutOfBoundsException\n" + "\tat surefire.MyTest.failure(MyTest.java:33)\n" + "\tat surefire.MyTest.access$100(MyTest.java:9)\n" + "\tat surefire.MyTest$Nested.run(MyTest.java:38)\n" + "\tat surefire.MyTest.delegate(MyTest.java:29)\n" + "\tat surefire.MyTest.rethrownDelegate(MyTest.java:22)" ) ); assertThat( tests.get( 0 ).getTestCases().get( 0 ).hasError(), is( true ) ); } @Test public void shouldTestNotBlank() { assertFalse( TestSuiteXmlParser.isNotBlank( 1, 2, ' ', ' ', ' ', '\n' ) ); assertFalse( TestSuiteXmlParser.isNotBlank( 1, 2, ' ', '\t', ' ', '\n' ) ); assertFalse( TestSuiteXmlParser.isNotBlank( 1, 2, ' ', ' ', '\r', '\n' ) ); assertFalse( TestSuiteXmlParser.isNotBlank( 1, 2, ' ', ' ', '\f', '\n' ) ); assertTrue( TestSuiteXmlParser.isNotBlank( 1, 2, ' ', 'a', ' ', '\n' ) ); assertTrue( TestSuiteXmlParser.isNotBlank( 1, 2, ' ', ' ', 'a', '\n' ) ); assertTrue( TestSuiteXmlParser.isNotBlank( 1, 2, ' ', 'a', 'b', '\n' ) ); } @Test public void shouldTestIsNumeric() { assertFalse( TestSuiteXmlParser.isNumeric( new StringBuilder( "0?5142" ), 1, 3 ) ); assertTrue( TestSuiteXmlParser.isNumeric( new StringBuilder( "0?51M2" ), 2, 4 ) ); assertFalse( TestSuiteXmlParser.isNumeric( new StringBuilder( "0?51M2" ), 2, 5 ) ); } } maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/000077500000000000000000000000001330756104600265635ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/fixture/000077500000000000000000000000001330756104600302515ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/fixture/testsuitexmlparser/000077500000000000000000000000001330756104600342405ustar00rootroot00000000000000TEST-org.apache.maven.surefire.test.FailingTest.xml000066400000000000000000000257751330756104600456250ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/fixture/testsuitexmlparser java.lang.AssertionError: Expected: "wrong" got: "value" at org.junit.Assert.assertThat(Assert.java:778) at org.junit.Assert.assertThat(Assert.java:736) at org.apache.maven.surefire.test.FailingTest.defaultTestValueIs_Value(FailingTest.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:262) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:151) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:122) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:128) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:88) java.lang.AssertionError: Expected: "bar" got: "foo" at org.junit.Assert.assertThat(Assert.java:778) at org.junit.Assert.assertThat(Assert.java:736) at org.apache.maven.surefire.test.FailingTest.setTestAndRetrieveValue(FailingTest.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48) at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:262) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:151) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:122) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:128) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:88) TEST-surefire.MyTest-enclosed-trimStackTrace.xml000066400000000000000000000015451330756104600452450ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/fixture/testsuitexmlparser java.lang.RuntimeException: java.lang.IndexOutOfBoundsException at surefire.MyTest.failure(MyTest.java:33) at surefire.MyTest.access$100(MyTest.java:9) at surefire.MyTest$Nested.run(MyTest.java:38) at surefire.MyTest.delegate(MyTest.java:29) at surefire.MyTest.rethrownDelegate(MyTest.java:22) at surefire.MyTest.newRethrownDelegate(MyTest.java:17) at surefire.MyTest.access$200(MyTest.java:9) at surefire.MyTest$A.t(MyTest.java:45) TEST-surefire.MyTest-enclosed.xml000066400000000000000000000064701330756104600423310ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/fixture/testsuitexmlparser java.lang.RuntimeException: java.lang.IndexOutOfBoundsException at surefire.MyTest.rethrownDelegate(MyTest.java:24) at surefire.MyTest.newRethrownDelegate(MyTest.java:17) at surefire.MyTest.access$200(MyTest.java:9) at surefire.MyTest$A.t(MyTest.java:45) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:272) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:167) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:147) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:130) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:211) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:163) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:105) Caused by: java.lang.IndexOutOfBoundsException at surefire.MyTest.failure(MyTest.java:33) at surefire.MyTest.access$100(MyTest.java:9) at surefire.MyTest$Nested.run(MyTest.java:38) at surefire.MyTest.delegate(MyTest.java:29) at surefire.MyTest.rethrownDelegate(MyTest.java:22) TEST-surefire.MyTest-nestedClass-trimStackTrace.xml000066400000000000000000000016361330756104600457220ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/fixture/testsuitexmlparser java.lang.RuntimeException: java.lang.IndexOutOfBoundsException at surefire.MyTest.rethrownDelegate(MyTest.java:24) at surefire.MyTest.newRethrownDelegate(MyTest.java:17) at surefire.MyTest.test(MyTest.java:13) Caused by: java.lang.IndexOutOfBoundsException at surefire.MyTest.failure(MyTest.java:33) at surefire.MyTest.access$100(MyTest.java:9) at surefire.MyTest$Nested.run(MyTest.java:38) at surefire.MyTest.delegate(MyTest.java:29) at surefire.MyTest.rethrownDelegate(MyTest.java:22) TEST-surefire.MyTest-nestedClass.xml000066400000000000000000000054221330756104600430010ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/fixture/testsuitexmlparser java.lang.RuntimeException: java.lang.IndexOutOfBoundsException at surefire.MyTest.rethrownDelegate(MyTest.java:24) at surefire.MyTest.newRethrownDelegate(MyTest.java:17) at surefire.MyTest.test(MyTest.java:13) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:272) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:167) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:147) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:130) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:211) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:163) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:105) Caused by: java.lang.IndexOutOfBoundsException at surefire.MyTest.failure(MyTest.java:33) at surefire.MyTest.access$100(MyTest.java:9) at surefire.MyTest$Nested.run(MyTest.java:38) at surefire.MyTest.delegate(MyTest.java:29) at surefire.MyTest.rethrownDelegate(MyTest.java:22) TEST-surefire.MyTest.xml000066400000000000000000000054121330756104600405320ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/fixture/testsuitexmlparser java.lang.RuntimeException: java.lang.IndexOutOfBoundsException at surefire.MyTest.rethrownDelegate(MyTest.java:24) at surefire.MyTest.newRethrownDelegate(MyTest.java:17) at surefire.MyTest.test(MyTest.java:13) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:272) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:167) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:147) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:130) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:211) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:163) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:105) Caused by: java.lang.IndexOutOfBoundsException at surefire.MyTest.failure(MyTest.java:33) at surefire.MyTest.access$100(MyTest.java:9) at surefire.MyTest$Nested.run(MyTest.java:38) at surefire.MyTest.delegate(MyTest.java:29) at surefire.MyTest.rethrownDelegate(MyTest.java:22) failsafe-summary-old.xml000066400000000000000000000003211330756104600407200ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/fixture/testsuitexmlparser 1 0 1 0 failsafe-summary.xml000066400000000000000000000003211330756104600401440ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/fixture/testsuitexmlparser 4 0 2 0 maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/junit-pathWithÜmlaut/000077500000000000000000000000001330756104600333045ustar00rootroot00000000000000TEST-umlautTest.BasicTest.xml000066400000000000000000000005231330756104600405530ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/junit-pathWithÜmlaut maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/test-reports/000077500000000000000000000000001330756104600312365ustar00rootroot00000000000000TEST-AntUnit.xml000066400000000000000000000006011330756104600340350ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/test-reports 1 0 0 TEST-NoPackageTest.xml000066400000000000000000000463571330756104600351650ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/test-reports junit.framework.AssertionFailedError: " at junit.framework.Assert.fail(Assert.java:47) at NoPackageTest.testQuote(NoPackageTest.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242) at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216) at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215) at org.apache.maven.surefire.Surefire.run(Surefire.java:163) at org.apache.maven.surefire.Surefire.run(Surefire.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:300) at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:216) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:369) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:867) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:739) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:510) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:274) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at org.apache.maven.cli.MavenCli.main(MavenCli.java:249) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) junit.framework.AssertionFailedError: < at junit.framework.Assert.fail(Assert.java:47) at NoPackageTest.testLower(NoPackageTest.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242) at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216) at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215) at org.apache.maven.surefire.Surefire.run(Surefire.java:163) at org.apache.maven.surefire.Surefire.run(Surefire.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:300) at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:216) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:369) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:867) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:739) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:510) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:274) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at org.apache.maven.cli.MavenCli.main(MavenCli.java:249) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) junit.framework.AssertionFailedError: > at junit.framework.Assert.fail(Assert.java:47) at NoPackageTest.testGreater(NoPackageTest.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242) at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216) at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215) at org.apache.maven.surefire.Surefire.run(Surefire.java:163) at org.apache.maven.surefire.Surefire.run(Surefire.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:300) at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:216) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:369) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:867) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:739) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:510) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:274) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115) at org.apache.maven.cli.MavenCli.main(MavenCli.java:249) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) TEST-NoTimeTestCaseTest.xml000066400000000000000000000152421330756104600361510ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/test-reports TEST-classWithNoTests.NoMethodsTestCase.xml000066400000000000000000000124201330756104600412710ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/test-reports TEST-com.shape.CircleTest.xml000066400000000000000000000322021330756104600363720ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/test-reports junit.framework.AssertionFailedError: expected:<20> but was:<10> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:282) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:201) at junit.framework.Assert.assertEquals(Assert.java:207) at com.shape.CircleTest.testRadius(CircleTest.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [OUT] : Getting the diameter [ERR] : Getting the Circumference java.lang.ArithmeticException: / by zero at com.shape.CircleTest.testProperties(CircleTest.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [OUT] : Getting the diameter [ERR] : Getting the Circumference TEST-com.shape.PointTest.xml000066400000000000000000000223671330756104600362750ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/test-reports junit.framework.AssertionFailedError: expected:<0> but was:<1> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:282) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:201) at junit.framework.Assert.assertEquals(Assert.java:207) at com.shape.PointTest.testXY(PointTest.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:246) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:220) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:203) at org.codehaus.surefire.Surefire.run(Surefire.java:152) at org.codehaus.surefire.Surefire.run(Surefire.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:241) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:357) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:316) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) TEST-junit.twoTestCaseSuite.WrapperTestSuite.xml000066400000000000000000000125731330756104600423660ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/test-reports com.shape.CircleTest.txt000066400000000000000000000165011330756104600356400ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/test-reports------------------------------------------------------------------------------- Battery: com.shape.CircleTest ------------------------------------------------------------------------------- testX(com.shape.CircleTest) testY(com.shape.CircleTest) testXY(com.shape.CircleTest) testRadius(com.shape.CircleTest) [ stdout ] --------------------------------------------------------------- [ stderr ] --------------------------------------------------------------- [ stacktrace ] ----------------------------------------------------------- junit.framework.AssertionFailedError: expected:<20> but was:<10> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:282) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:201) at junit.framework.Assert.assertEquals(Assert.java:207) at com.shape.CircleTest.testRadius(CircleTest.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:190) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:155) at org.codehaus.surefire.Surefire.run(Surefire.java:105) at org.codehaus.surefire.Surefire.run(Surefire.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:83) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:218) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:361) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:472) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:445) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:431) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:268) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:127) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:292) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) testProperties(com.shape.CircleTest) [ stdout ] --------------------------------------------------------------- [ stderr ] --------------------------------------------------------------- [ stacktrace ] ----------------------------------------------------------- java.lang.ArithmeticException: / by zero at com.shape.CircleTest.testProperties(CircleTest.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:190) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:155) at org.codehaus.surefire.Surefire.run(Surefire.java:105) at org.codehaus.surefire.Surefire.run(Surefire.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:83) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:218) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:361) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:472) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:445) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:431) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:268) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:127) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:292) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) testPI(com.shape.CircleTest) testCircumference(com.shape.CircleTest) testDiameter(com.shape.CircleTest) com.shapeclone.CircleTest.txt000066400000000000000000000165701330756104600366670ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-report-parser/src/test/resources/test-reports------------------------------------------------------------------------------- Battery: com.shapeclone.CircleTest ------------------------------------------------------------------------------- testX(com.shapeclone.CircleTest) testY(com.shapeclone.CircleTest) testXY(com.shapeclone.CircleTest) testRadius(com.shapeclone.CircleTest) [ stdout ] --------------------------------------------------------------- [ stderr ] --------------------------------------------------------------- [ stacktrace ] ----------------------------------------------------------- junit.framework.AssertionFailedError: expected:<20> but was:<10> at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:282) at junit.framework.Assert.assertEquals(Assert.java:64) at junit.framework.Assert.assertEquals(Assert.java:201) at junit.framework.Assert.assertEquals(Assert.java:207) at com.shapeclone.CircleTest.testRadius(CircleTest.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:190) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:155) at org.codehaus.surefire.Surefire.run(Surefire.java:105) at org.codehaus.surefire.Surefire.run(Surefire.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:83) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:218) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:361) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:472) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:445) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:431) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:268) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:127) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:292) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) testProperties(com.shapeclone.CircleTest) [ stdout ] --------------------------------------------------------------- [ stderr ] --------------------------------------------------------------- [ stacktrace ] ----------------------------------------------------------- java.lang.ArithmeticException: / by zero at com.shapeclone.CircleTest.testProperties(CircleTest.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.battery.JUnitBattery.execute(JUnitBattery.java:190) at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:155) at org.codehaus.surefire.Surefire.run(Surefire.java:105) at org.codehaus.surefire.Surefire.run(Surefire.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:83) at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:218) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:361) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:472) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:445) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:431) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:268) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:127) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186) at org.apache.maven.cli.MavenCli.main(MavenCli.java:292) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) testPI(com.shapeclone.CircleTest) testCircumference(com.shapeclone.CircleTest) testDiameter(com.shapeclone.CircleTest) maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/000077500000000000000000000000001330756104600250175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/pom.xml000066400000000000000000000302001330756104600263270ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire 2.22.0 surefire-setup-integration-tests Maven Surefire Integration Test Setup Creates internal M2 local repository in target/it-repo/. The project is not deployed. UTF-8 false 5.7 2 2.8 maven-failsafe-plugin org.apache.maven.plugins ${project.version} maven-plugin maven-surefire-report-plugin org.apache.maven.plugins ${project.version} maven-plugin maven-surefire-plugin org.apache.maven.plugins ${project.version} maven-plugin org.apache.maven.surefire surefire-testng ${project.version} org.testng testng org.apache.maven.surefire surefire-junit3 ${project.version} org.apache.maven.surefire surefire-junit4 ${project.version} org.apache.maven.surefire surefire-junit47 ${project.version} org.apache.maven maven-settings ${mavenVersion} test net.sourceforge.htmlunit htmlunit 2.8 test commons-io commons-io 2.0.1 src/main/resources ${project.build.outputDirectory} toolchains.xml src/main/resources true ${project.build.directory}/private toolchains.xml maven-help-plugin 2.2 settings.xml generate-test-resources effective-settings ${project.build.directory}/private/settings.xml ${it.settings.showPasswords} maven-invoker-plugin ${project.build.directory}/it-repo org.apache.maven.surefire:surefire-testng-utils:${project.version} org.testng:testng:4.7:jar:jdk15 org.testng:testng:5.0.2:jar:jdk15 org.testng:testng:5.1:jar:jdk15 org.testng:testng:5.5:jar:jdk15 org.testng:testng:5.6:jar:jdk15 org.testng:testng:5.7:jar:jdk14 org.testng:testng:5.7:jar:jdk15 org.testng:testng:5.8:jar:jdk15 org.testng:testng:5.9:jar:jdk15 org.testng:testng:5.10:jar:jdk15 org.testng:testng:5.12.1 org.testng:testng:5.13 org.testng:testng:5.13.1 org.testng:testng:5.14 org.testng:testng:5.14.1 org.testng:testng:5.14.2 org.testng:testng:5.14.9 org.testng:testng:6.0 org.testng:testng:6.5.1 com.google.inject:guice:3.0:jar:no_aop log4j:log4j:1.2.16 org.apache.maven.plugins:maven-clean-plugin:2.4.1 org.apache.maven.plugins:maven-compiler-plugin:2.3.2 org.apache.maven.plugins:maven-compiler-plugin:2.5.1 org.apache.maven.plugins:maven-install-plugin:2.3.1 org.apache.maven.plugins:maven-compiler-plugin:2.0.2 org.apache.maven.plugins:maven-resources-plugin:2.5 org.apache.maven.plugins:maven-jar-plugin:2.3.2 org.apache.commons:commons-email:1.2 org.codehaus.mojo:build-helper-maven-plugin:1.2 org.apache.maven.reporting:maven-reporting-api:2.2.1 commons-collections:commons-collections:3.2 commons-logging:commons-logging:1.0.4 xml-apis:xml-apis:1.0.b2 org.apache.httpcomponents:httpclient:4.0.2 junit:junit:4.4 junit:junit:4.5 junit:junit:4.7 junit:junit:4.8.1 junit:junit:4.8.2 junit:junit:4.11 junit:junit:4.12 junit:junit-dep:4.8 junit:junit-dep:4.7 junit:junit-dep:4.4 org.apache.maven.plugins:maven-surefire-plugin:2.10 org.apache.maven.surefire:surefire-junit3:2.10 org.codehaus.plexus:plexus-utils:1.0.4 org.codehaus.plexus:plexus-utils:1.4.1 org.codehaus.plexus:plexus-utils:1.5.1 org.codehaus.plexus:plexus-utils:1.5.8 org.codehaus.plexus:plexus-utils:1.5.15 org.mockito:mockito-core:1.8.5 org.powermock:powermock-mockito-release-full:1.6.4:jar:full org.codehaus.plexus:plexus-interpolation:1.12 org.hamcrest:hamcrest-core:1.3 org.hamcrest:hamcrest-library:1.3 org.easytesting:fest-assert:1.4 install maven-surefire-plugin ${project.version} ${testng.version} ${maven.home} ${project.build.directory}/private/settings.xml ${project.build.directory}/it-repo org.apache.maven.surefire surefire-shadefire 2.12.4 maven-enforcer-plugin require-maven-2.1.0 enforce [2.1.0,) maven-jar-plugin true maven-install-plugin true maven-deploy-plugin true maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/src/000077500000000000000000000000001330756104600256065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/src/main/000077500000000000000000000000001330756104600265325ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/src/main/resources/000077500000000000000000000000001330756104600305445ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/src/main/resources/toolchains.xml000066400000000000000000000026051330756104600334340ustar00rootroot00000000000000 jdk jdk9 9 oracle ${jdk.home} maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/src/test/000077500000000000000000000000001330756104600265655ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/src/test/java/000077500000000000000000000000001330756104600275065ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/src/test/java/org/000077500000000000000000000000001330756104600302755ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/src/test/java/org/apache/000077500000000000000000000000001330756104600315165ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/src/test/java/org/apache/maven/000077500000000000000000000000001330756104600326245ustar00rootroot00000000000000surefire/000077500000000000000000000000001330756104600343715ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/src/test/java/org/apache/mavenits/000077500000000000000000000000001330756104600351705ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/src/test/java/org/apache/maven/surefireSetUpForIntegrationTest.java000066400000000000000000000031171330756104600426100ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import java.io.File; import java.io.IOException; import junit.framework.TestCase; /** * Created by IntelliJ IDEA. * * @author Stephen Connolly * @since 05-Jan-2010 08:17:17 */ public class SetUpForIntegrationTest extends TestCase { public void testSmokes() throws IOException { // if the properties are missing we'll fail the test with an NPE and stop the build. File originalSettings = new File( System.getProperty( "maven.settings.file" ) ); File newRepo = new File( System.getProperty( "maven.staged.local.repo" ) ); File newSettings = new File( originalSettings.getParentFile(), "it-" + originalSettings.getName() ); StagedLocalRepoHelper.createStagedSettingsXml( originalSettings, newRepo, newSettings ); } } StagedLocalRepoHelper.java000066400000000000000000000126301330756104600422050ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-setup-integration-tests/src/test/java/org/apache/maven/surefire/itspackage org.apache.maven.surefire.its; /* * 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. */ import java.io.File; import java.io.IOException; import java.util.List; import java.util.Random; import org.apache.maven.settings.Profile; import org.apache.maven.settings.Repository; import org.apache.maven.settings.RepositoryPolicy; import org.apache.maven.settings.Settings; import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader; import org.apache.maven.settings.io.xpp3.SettingsXpp3Writer; import org.apache.maven.shared.utils.ReaderFactory; import org.apache.maven.shared.utils.WriterFactory; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; /** * Helper class to assist in using verifier with a staged local repository. * * @author Stephen Connolly * @since 05-Jan-2010 07:36:22 */ public final class StagedLocalRepoHelper { private StagedLocalRepoHelper() { throw new IllegalAccessError( "Helper class" ); } private static String toUrl( String filename ) { /* * NOTE: Maven fails to properly handle percent-encoded "file:" URLs (WAGON-111) so don't use File.toURI() here * as-is but use the decoded path component in the URL. */ String url = "file://" + new File( filename ).toURI().getPath(); if ( url.endsWith( "/" ) ) { url = url.substring( 0, url.length() - 1 ); } return url; } public static void createStagedSettingsXml( File originalSettingsXml, File stagedLocalRepo, File stagedSettingsXml ) throws IOException { Random entropy = new Random(); try { System.out.println( Settings.class.getClassLoader() .getResource( "org/apache/maven/settings/Server.class" ) ); Settings settings = new SettingsXpp3Reader().read( ReaderFactory.newXmlReader( originalSettingsXml ) ); String localRepo = System.getProperty( "maven.repo.local" ); if ( localRepo == null ) { localRepo = settings.getLocalRepository(); } if ( localRepo == null ) { localRepo = System.getProperty( "user.home" ) + "/.m2/repository"; } File repoDir = new File( localRepo ); if ( !repoDir.exists() ) { repoDir.mkdirs(); } // normalize path localRepo = repoDir.getAbsolutePath(); Profile profile = new Profile(); do { profile.setId( "stagedLocalRepo" + entropy.nextLong() ); } while ( settings.getProfilesAsMap().containsKey( profile.getId() ) ); Repository repository = new Repository(); repository.setId( profile.getId() + entropy.nextLong() ); RepositoryPolicy policy = new RepositoryPolicy(); policy.setEnabled( true ); policy.setChecksumPolicy( "ignore" ); policy.setUpdatePolicy( "never" ); repository.setReleases( policy ); repository.setSnapshots( policy ); repository.setLayout( "default" ); repository.setName( "Original Local Repository" ); repository.setUrl( toUrl( localRepo ) ); profile.addPluginRepository( repository ); profile.addRepository( repository ); settings.addProfile( profile ); settings.addActiveProfile( profile.getId() ); settings.setLocalRepository( stagedLocalRepo.getAbsolutePath() ); for ( Object o : settings.getProfiles() ) { profile = (Profile) o; disableUpdates( profile.getRepositories() ); disableUpdates( profile.getPluginRepositories() ); } new SettingsXpp3Writer().write( WriterFactory.newXmlWriter( stagedSettingsXml ), settings ); } catch ( XmlPullParserException e ) { IOException ioe = new IOException( e.getMessage() ); ioe.initCause( e ); throw ioe; } } private static void disableUpdates( List repositories ) { if ( repositories != null ) { for (Repository repo : repositories) { repo.setReleases(disableUpdates(repo.getReleases())); repo.setSnapshots(disableUpdates(repo.getSnapshots())); } } } private static RepositoryPolicy disableUpdates( RepositoryPolicy policy ) { if ( policy == null ) { policy = new RepositoryPolicy(); } policy.setUpdatePolicy( "never" ); return policy; } } maven-surefire-surefire-2.22.0/surefire-shadefire/000077500000000000000000000000001330756104600221305ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-shadefire/pom.xml000066400000000000000000000102171330756104600234460ustar00rootroot00000000000000 4.0.0 org.apache.maven.surefire surefire 2.22.0 surefire-shadefire ShadeFire JUnit3 Provider A super-shaded junit3 provider that is used by surefire to build itself, that basically has ALL classes relocated to facilitate no API-conflict whatsoever with ourself. The only remaining point of conflict is around the booter properties file format. The Apache Software License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.txt repo org.apache.maven.surefire surefire-junit3 2.12.4 org.apache.maven.surefire surefire-api 2.12.4 org.apache.maven.surefire surefire-booter 2.12.4 org.apache.maven.plugins maven-shade-plugin 1.4 package shade org.apache.maven.surefire:surefire-api org.apache.maven.surefire:surefire-booter org.apache.maven.surefire:surefire-junit3 org.apache.maven.surefire org.apache.maven.surefire.shadefire maven-surefire-plugin 2.12.4 true maven-deploy-plugin true maven-surefire-surefire-2.22.0/surefire-shadefire/src/000077500000000000000000000000001330756104600227175ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-shadefire/src/main/000077500000000000000000000000001330756104600236435ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-shadefire/src/main/resources/000077500000000000000000000000001330756104600256555ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-shadefire/src/main/resources/META-INF/000077500000000000000000000000001330756104600270155ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-shadefire/src/main/resources/META-INF/services/000077500000000000000000000000001330756104600306405ustar00rootroot00000000000000org.apache.maven.surefire.providerapi.SurefireProvider000066400000000000000000000015201330756104600432620ustar00rootroot00000000000000maven-surefire-surefire-2.22.0/surefire-shadefire/src/main/resources/META-INF/services# # 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. # org.apache.maven.surefire.shadefire.junit.JUnit3Provider